Replace unmaintained html2canvas with @zumer/snapdom for mind-map/image export
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start with src/components/studio/views/html2canvas-loader.ts, which isolates the dependency behind a loader, then inspect src/components/studio/views/mindmap-export.ts for option and return-value usage. Replace the dynamic import with @zumer/snapdom, map the supported options, and update src/components/studio/views/mindmap-export.test.ts to verify the export behavior rather than matching html2canvas output. Also check the standalone HTML reader path for embedded captures and DPR or size handling.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
html2canvas (used for mind-map/PNG export) has had no stable release since January 2022 (1.4.1); its own README still describes the project as experimental and recommends against production use. The 2026 ecosystem consensus replacement is a foreignObject-based capture library — @zumer/snapdom (actively maintained, v2.x, zero-dependency, TypeScript).
Evidence
- Dependency:
html2canvas ^1.4.1inpackage.json. - Usage:
src/components/studio/views/html2canvas-loader.ts(dedicated loader) andsrc/components/studio/views/mindmap-export.ts(consumer). - Tests exist, which keeps the migration safe:
src/components/studio/views/mindmap-export.test.ts.
Impact
- Fidelity: html2canvas hand-paints CSS in JS and ships a long list of unsupported properties (pseudo-elements, some fonts, Shadow DOM). SnapDOM clones the DOM and lets the browser rasterize, so styled mind-map exports (custom themes, web fonts from "Editorial Paper & Saffron") render correctly.
- Performance: serialize-then-rasterize is several times faster on dense mind-map trees; html2canvas cost grows per node in its JS interpreter.
- Supply chain / maintenance: an unmaintained rendering dependency is a standing risk in the dependency-audit posture this repo already enforces (
scripts/verify-deps.sh, Dependabot alerts).
Proposed approach
- Swap the loader (
html2canvas-loader.ts) to dynamically import@zumer/snapdombehind the same interface — the loader abstraction makes this a one-module change. - Map options (scale, backgroundColor, filter) per the official migration guide; mind the return-value change (reusable
CaptureResult). - Re-baseline
mindmap-export.test.tsagainst live rendering, not against html2canvas output (differences are usually features html2canvas was dropping). - Verify export size + DPR handling in the encrypted standalone HTML reader path if it embeds captures.
References
- Maintenance status of html2canvas: https://snapdom.dev/compare/html2canvas/
- Migration guide + option map: https://snapdom.dev/how-to/migrate-from-html2canvas/
- 2026 library comparison: https://html2img.com/articles/html2canvas-vs-html-to-image/
- npm: https://www.npmjs.com/package/@zumer/snapdom
- Ngôn ngữ chính
- TypeScript
- Star
- 3
- Fork
- 2
- Merge trung bình
- 11 giờ 49 phút
- Pull request đã merge (30 ngày)
- 102
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của d-oit/do-knowledge-studio
-
Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)Đang mởchore config priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
d-oit/do-knowledge-studio#1219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dependabot only scans the root manifest — add workspace packages/* directories, cooldown, and grouped updatesCó thể đã có người làm @d-oit đã nhận hôm nay. Đang mởci config deps priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
d-oit/do-knowledge-studio#1212 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority: low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
d-oit/do-knowledge-studio#1218 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore priority: low skills
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
d-oit/do-knowledge-studio#1217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
discussion enhancement performance priority: low search
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
d-oit/do-knowledge-studio#1216 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của d-oit/do-knowledge-studio
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
danielmiessler/LifeOS#3028 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Koenkk/zigbee2mqtt#33855 ·
Maintainer thường phản hồi trong vòng 1 ngày