Replace unmaintained html2canvas with @zumer/snapdom for mind-map/image export
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Refatoração
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, typescript
- Domínio
- frontend
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 3
- Forks
- 2
- Merge médio
- 11h 49min
- PRs com merge (30d)
- 102
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de d-oit/do-knowledge-studio
-
Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)Abertachore config priority: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
d-oit/do-knowledge-studio#1219 ·
Mantenedores costumam responder em até 1 dia
-
Dependabot only scans the root manifest — add workspace packages/* directories, cooldown, and grouped updatesTalvez já em andamento @d-oit assumiu hoje. Abertaci config deps priority: medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
d-oit/do-knowledge-studio#1212 ·
Mantenedores costumam responder em até 1 dia
-
documentation priority: low
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
d-oit/do-knowledge-studio#1218 ·
Mantenedores costumam responder em até 1 dia
-
chore priority: low skills
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
d-oit/do-knowledge-studio#1217 ·
Mantenedores costumam responder em até 1 dia
-
discussion enhancement performance priority: low search
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
d-oit/do-knowledge-studio#1216 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de d-oit/do-knowledge-studio
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
danielmiessler/LifeOS#3028 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
Koenkk/zigbee2mqtt#33855 ·
Mantenedores costumam responder em até 1 dia