chore(memory): capitalize SVG editor integration

BDR-017 (vanilla JS wrap decision), LRN-023 (DOMParser SVG loading),
journal entry for 2026-05-22 session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastien ChanotandClaude Opus 4.6 committed 2026-05-22 02:14:10 +02:00
1 parent 832666b269
commit ce29457d8b
3 files changed
+23

No files matched your search

+7
View File
@@ -174,6 +174,13 @@ Apply: any data contract sourced from non-engineering authors (clinical, legal,
---
## LRN-023 | 2026-05-22 | DOMParser for safe SVG loading in React-wrapped vanilla editors
When wrapping vanilla JS editor in React, avoid `innerHTML = svgText` for user-uploaded SVG. Use `new DOMParser().parseFromString(svgText, 'image/svg+xml')` + `document.importNode(parsedSvg, true)` to safely parse and import SVG into DOM. Parser rejects malformed XML, returns parseerror element on failure — gives clean error path. importNode deep-clones into current document context so all DOM APIs (createSVGPoint, getScreenCTM) work correctly.
Apply: any user-uploaded SVG injection into a React-hosted vanilla canvas. Also avoids security hook warnings about innerHTML with untrusted content.
---
## LRN-022 | 2026-05-21 | pnpm 11.x requires Node 22.13 — pin pnpm to ≤10.x when staying on Node 20, never use `@latest`
pnpm 11.x imports `node:sqlite` for its store-index module — loaded at pnpm startup for any command that touches the store (install, fetch, add, prune). `node:sqlite` is a Node 22.13+ built-in. Result: `ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite` on every fresh Docker build using `node:20-alpine` + pnpm 11.x. The crash is deterministic for cold installs and invisible for warm dev hosts that already have `node_modules` resolved (pnpm 11 on Node 20 can still spawn child scripts because the store module isn't required for `pnpm run`).