clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

remove diagrams.net origin fallback

Dami committed a9c93dd
commit
a9c93ddde6fc5416d1f31f79bb14460ac8dd6806
parent
d3993ef265a3feab55aebb8fc83abf37dcc808e1
author
Dami <dami.etoile@gmail.com>
11 files changed, +64 -13
Mdiagramzip-client-units/diagramsnet/unit/worker.js2+-
Mdiagramzip-render/README.md8++++----
Mdiagramzip-render/scripts/deploy-compatibility-units.mjs2+-
Mdiagramzip-render/scripts/deploy-worker-units.mjs1-
Mdiagramzip-render/scripts/smoke-units.mjs18+++++++++++++++++-
Mdiagramzip-render/src/catalog.ts6++++++
Mdiagramzip-render/test/catalog.test.ts7+++++++
Ddiagramzip-render/wrangler.compatibility/diagramsnet.jsonc1-
Mdiagramzip/src/renderer-units.js3+--
Mdiagramzip/test/preview-routing.test.js24++++++++++++++++++++++++
Mdiagramzip/test/renderer-units.test.js5+++--
M diagramzip-client-units/diagramsnet/unit/worker.js +1 -1
M diagramzip-render/README.md +4 -4
@@ -37,7 +37,7 @@ build, and pipeline with `X-Diagram-Unit`, `X-Renderer-Build`, and
3737 3838 Browser-rendered units expose the same health and capability routes plus one3939 sandboxed frame. The frame accepts only its own engine over the versioned40-postMessage protocol. Mermaid, BPMN, and Excalidraw have separate packages,40+postMessage protocol. Mermaid, BPMN, Excalidraw, and diagrams.net have separate packages,4141 bundles, CSPs, deployments, and subdomains.4242 4343 A unit may expose multiple catalog hostnames when those engines share the same
@@ -61,10 +61,10 @@ catalog engine.
6161 | Worker JavaScript | Bytefield, Nomnoml, Vega family (Vega and Vega-Lite → Vega), WaveDrom |6262 | Worker Python | BlockDiag family (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag); WireViz → DOT → GraphViz |6363 | Worker WebAssembly | PlantUML family (PlantUML and bounded C4 → PlantUML); GraphViz family (GraphViz, DBML → DOT → GraphViz, and ERD → DOT → GraphViz); GoAT; Pikchr; Svgbob |64-| Sandboxed browser unit | Mermaid, BPMN, Excalidraw |65-| Compatibility unit | 7 dependency units covering the remaining 7 engines |64+| Sandboxed browser unit | Mermaid, BPMN, Excalidraw, diagrams.net |65+| Compatibility unit | 6 dependency units covering the remaining 6 engines |6666 67-The current split is 23/30 engines off Fly and 7/30 still dependent on it.67+The current split is 24/30 engines off Fly and 6/30 still dependent on it.6868 Compatibility units are extraction seams, not final runtimes or fallbacks for6969 an engine after cutover. DBML retains the upstream parser/checker/DOT model in7070 an explicitly rebuilt Worker bundle, then shares the GraphViz-Wasm runtime.
M diagramzip-render/scripts/deploy-compatibility-units.mjs +1 -1
M diagramzip-render/scripts/deploy-worker-units.mjs +0 -1
M diagramzip-render/scripts/smoke-units.mjs +17 -1
@@ -57,7 +57,23 @@ const goatEngines = new Set(['goat'])
5757 const wirevizEngines = new Set(['wireviz'])5858 const plantumlEngines = new Set(['plantuml', 'c4plantuml'])5959 60+async function smokeClientUnit(engine) {61+ const base = `https://${engine}.render.diagram.zip`62+ const [capabilitiesResponse, frameResponse] = await Promise.all([63+ fetch(`${base}/v1/capabilities`),64+ fetch(`${base}/index.html`),65+ ])66+ if (!capabilitiesResponse.ok) throw new Error(`${engine}: capabilities HTTP ${capabilitiesResponse.status}`)67+ if (!frameResponse.ok) throw new Error(`${engine}: frame HTTP ${frameResponse.status}`)68+ const capabilities = await capabilitiesResponse.json()69+ if (capabilities.id !== engine || capabilities.runtime !== 'client' || capabilities.format !== 'svg') {70+ throw new Error(`${engine}: unexpected client capabilities ${JSON.stringify(capabilities)}`)71+ }72+ return `${engine.padEnd(10)} client ${capabilities.build}`73+}74+6075 async function smoke([engine, filename]) {76+ if (engine === 'diagramsnet') return smokeClientUnit(engine)6177 const source = await readFile(resolve(fixtureDirectory, filename), 'utf8')6278 const endpoint = `https://${engine}.render.diagram.zip/v1/svg`6379 const response = await fetch(endpoint, {
@@ -154,4 +170,4 @@ for (let index = 0; index < entries.length; index += 4) {
154170 results.push(...await Promise.all(entries.slice(index, index + 4).map(smoke)))155171 }156172 for (const result of results) console.log(result)157-console.log(`${results.length}/${results.length} catalog engines returned SVG through dependency-backed units`)173+console.log(`${results.length}/${results.length} catalog engines passed structural unit smoke`)
M diagramzip-render/src/catalog.ts +6 -0
M diagramzip-render/test/catalog.test.ts +7 -0
D diagramzip-render/wrangler.compatibility/diagramsnet.jsonc +0 -1
M diagramzip/src/renderer-units.js +1 -2
M diagramzip/test/preview-routing.test.js +24 -0
M diagramzip/test/renderer-units.test.js +3 -2