@matfsw/docusaurus-plantuml-plugin 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +99 -1
- package/README.md +150 -18
- package/assets/stdlib/LICENSES.md +21 -0
- package/assets/stdlib/archimate.min.js +22 -0
- package/assets/stdlib/azure.min.js +305 -0
- package/assets/stdlib/c4.min.js +47 -0
- package/assets/stdlib/cloudinsight.min.js +93 -0
- package/assets/stdlib/eip.min.js +14 -0
- package/assets/stdlib/k8s.min.js +52 -0
- package/assets/stdlib/kubernetes.min.js +17 -0
- package/assets/stdlib/manifest.json +112 -0
- package/assets/stdlib/office.min.js +557 -0
- package/dist/index.cjs +380 -7
- package/dist/index.d.cts +86 -3
- package/dist/index.d.ts +12 -2
- package/dist/index.js +20 -1
- package/dist/options.d.ts +52 -1
- package/dist/options.js +81 -0
- package/dist/runtime/assetLoader.d.ts +13 -1
- package/dist/runtime/assetLoader.js +36 -13
- package/dist/runtime/cache.d.ts +6 -1
- package/dist/runtime/cache.js +2 -2
- package/dist/runtime/errors.d.ts +3 -1
- package/dist/runtime/errors.js +27 -1
- package/dist/runtime/renderer.d.ts +3 -0
- package/dist/runtime/renderer.js +21 -7
- package/dist/runtime/stdlibLoader.d.ts +31 -0
- package/dist/runtime/stdlibLoader.js +99 -0
- package/dist/stdlib.d.ts +35 -0
- package/dist/stdlib.js +163 -0
- package/dist/stdlibBundle.d.ts +60 -0
- package/dist/stdlibBundle.js +218 -0
- package/dist/stdlibShared.d.ts +51 -0
- package/dist/stdlibShared.js +54 -0
- package/dist/theme/PlantUmlDiagram/icons.d.ts +38 -0
- package/dist/theme/PlantUmlDiagram/icons.js +44 -0
- package/dist/theme/PlantUmlDiagram/index.js +5 -3
- package/dist/theme/usePlantUmlConfig.d.ts +8 -0
- package/dist/theme/usePlantUmlConfig.js +14 -8
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,102 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.1]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **The toolbar's controls are drawn rather than typed** ([#21]). `⛶` U+26F6 SQUARE FOUR
|
|
15
|
+
CORNERS, the maximize icon, has no glyph in any font that ships with a stock Linux desktop,
|
|
16
|
+
so that control rendered as an empty box for an entire platform's readers — on the demo site
|
|
17
|
+
included. The other four only worked because DejaVu Sans happens to be installed, which a
|
|
18
|
+
minimal container image or a locked-down desktop does not promise, so all of them are now
|
|
19
|
+
inline SVG and the plugin depends on no font at all.
|
|
20
|
+
|
|
21
|
+
The source toggle's `</>` went the same way. It is ASCII and never had the glyph problem, but
|
|
22
|
+
left as text it would have been the one control still drawn in the page font, at a different
|
|
23
|
+
weight and optical size from its neighbours.
|
|
24
|
+
|
|
25
|
+
Nothing about the accessible surface changes: every button keeps its `aria-label`,
|
|
26
|
+
`aria-pressed`, `aria-expanded` and `aria-controls`, and the icons are `aria-hidden`. The
|
|
27
|
+
icons inherit `currentColor` and `1em`, so both colour modes and reader font scaling behave
|
|
28
|
+
exactly as before, with no CSS change. The `Copy` text button and the `⚠` error glyph are
|
|
29
|
+
unchanged.
|
|
30
|
+
|
|
31
|
+
If you worked around this with a `font-family` override on `[class*='toolbarButton']`, it is
|
|
32
|
+
now a harmless no-op and can be removed.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- The example site records why its `onBrokenMarkdownLinks` stays at the top level rather than
|
|
37
|
+
moving to `markdown.hooks`, where Docusaurus 3.9 put it: 3.5's `markdown` schema rejects the
|
|
38
|
+
key outright, and CI builds that fixture against 3.5.2 — the oldest release this plugin's
|
|
39
|
+
peer range claims.
|
|
40
|
+
|
|
41
|
+
[#21]: https://github.com/matf/docusaurus-plantuml-plugin/issues/21
|
|
42
|
+
|
|
43
|
+
## [1.3.0]
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **The PlantUML standard library.** `!include <C4/C4_Container>` now renders, with no
|
|
48
|
+
configuration and nothing to install. Eight namespaces ship with the plugin — `c4`,
|
|
49
|
+
`archimate`, `eip`, `k8s`, `kubernetes`, `azure`, `office` and `cloudinsight` — and a page
|
|
50
|
+
downloads only the ones its diagrams actually include. A C4 page costs 29 KB gzipped; a page
|
|
51
|
+
with no standard library include costs nothing.
|
|
52
|
+
|
|
53
|
+
Four details are worth knowing:
|
|
54
|
+
- **Bundles are served from your own `baseUrl`**, like every other asset. Left to itself the
|
|
55
|
+
engine resolves a namespace against the *current page* — `/docs/architecture/c4.min.js` —
|
|
56
|
+
which cannot exist, and pre-populating its global does not stop it. The plugin loads the
|
|
57
|
+
bundle from the assets directory and then tells the engine the work is done. See
|
|
58
|
+
[ADR 0005](docs/adr/0005-stdlib-bundles.md).
|
|
59
|
+
- **Includes the library makes of itself are resolved too**, from an index built when the
|
|
60
|
+
bundles are generated. `k8s/Common` needs `<c4/…>`, and the engine would only discover that
|
|
61
|
+
mid-render, with no chance to fetch it.
|
|
62
|
+
- **`!include <C4/C4_Container.puml>` works**, spelled with the extension. Upstream's own
|
|
63
|
+
bundles cannot resolve that spelling, even though C4-PlantUML's documentation uses it.
|
|
64
|
+
- **A missing namespace is explained, not dumped on the reader.** The panel names the
|
|
65
|
+
namespace and the option that adds it, instead of PlantUML's grey "Fatal parsing error".
|
|
66
|
+
|
|
67
|
+
- `stdlib` plugin option: `stdlib: false` switches the feature off entirely; `stdlib.include`
|
|
68
|
+
plus `stdlib.source` add namespaces from a `plantuml-stdlib` checkout — including the icon
|
|
69
|
+
libraries that are far too large to vendor, such as `aws`, `ibm` and `tupadr3` — and
|
|
70
|
+
`stdlib.namespaces` narrows what a build emits.
|
|
71
|
+
- `stdlib` error kind, for an include the site cannot resolve.
|
|
72
|
+
- `npm run stdlib:update`, which regenerates the vendored bundles from a pinned
|
|
73
|
+
plantuml-stdlib commit. It is maintainer-only and never part of `npm run build`, so site
|
|
74
|
+
builds stay offline and hermetic.
|
|
75
|
+
- `assets/stdlib/LICENSES.md`, recording the upstream project, version and licence of every
|
|
76
|
+
vendored namespace. Namespaces whose upstream declares no licence are deliberately not
|
|
77
|
+
vendored; `stdlib.include` remains available for anyone who wants them.
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- **PlantUML's preprocessor failures are now reported as errors** rather than passed through as
|
|
82
|
+
successfully rendered pictures. Calling a macro the included library does not define
|
|
83
|
+
(`Function not found RelIndex`), naming a file that is not in a namespace
|
|
84
|
+
(`cannot include <C4/C4_Nope>`) and an include that could not be resolved at all
|
|
85
|
+
(`Fatal parsing error`) all produce an error card with no `Syntax Error?` marker on it, so
|
|
86
|
+
the existing detection missed all three. They are the likeliest ways a standard library
|
|
87
|
+
diagram goes wrong, which is how this surfaced. The panel shows the failure alone rather
|
|
88
|
+
than the thousands of macro-expanded lines it is buried in.
|
|
89
|
+
- **Library files that are themselves whole `@startuml … @enduml` documents** are unwrapped when
|
|
90
|
+
the bundle is generated, the way PlantUML's file-based `!include` does. The standard library
|
|
91
|
+
lookup passes the markers through verbatim, and a nested `@startuml` fails the diagram — 81 of
|
|
92
|
+
`cloudinsight`'s 83 sprite files are written that way, so the namespace was unusable without
|
|
93
|
+
this. Files with more than one block are left alone.
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
|
|
97
|
+
- A script asset that fails to load is now replaced rather than reused when a later diagram
|
|
98
|
+
retries, so one flaky response no longer disables the engine — or a standard library
|
|
99
|
+
namespace — for the rest of the page.
|
|
100
|
+
- The render cache key includes the standard library revision, so refreshing it cannot serve a
|
|
101
|
+
picture rendered against the old one.
|
|
102
|
+
- The published package grows from 77 KB to ~776 KB packed (245 KB to ~3.2 MB unpacked); the
|
|
103
|
+
difference is the vendored bundles. `verify-package.mjs` budgets them separately from the
|
|
104
|
+
plugin's own code, which keeps its own 400 KB ceiling.
|
|
105
|
+
|
|
10
106
|
## [1.2.0]
|
|
11
107
|
|
|
12
108
|
### Added
|
|
@@ -284,7 +380,9 @@ Initial release.
|
|
|
284
380
|
opt-out.
|
|
285
381
|
- Plugin option validation that rejects unknown keys and out-of-range values at build time.
|
|
286
382
|
|
|
287
|
-
[Unreleased]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.
|
|
383
|
+
[Unreleased]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.3.1...HEAD
|
|
384
|
+
[1.3.1]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.3.0...v1.3.1
|
|
385
|
+
[1.3.0]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.2.0...v1.3.0
|
|
288
386
|
[1.2.0]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.1.2...v1.2.0
|
|
289
387
|
[1.1.2]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.1.1...v1.1.2
|
|
290
388
|
[1.1.1]: https://github.com/matf/docusaurus-plantuml-plugin/compare/v1.1.0...v1.1.1
|
package/README.md
CHANGED
|
@@ -244,9 +244,10 @@ props untouched. Existing code-block behaviour (highlighting, line numbers, titl
|
|
|
244
244
|
| `zoom` | `boolean` | `true` | Let readers zoom and pan diagrams. Adds a control toolbar and a focusable viewport. Override per fence with `zoom=false`. |
|
|
245
245
|
| `showSource` | `boolean` | `true` | Offer a toolbar control that reveals the diagram source and copies it to the clipboard. Override per fence with `showSource=false`. |
|
|
246
246
|
| `graphviz` | `object` | see below | Graphviz/DOT support. See [Graphviz options](#graphviz-options). |
|
|
247
|
+
| `stdlib` | `object \| false` | see below | PlantUML standard library (`!include <C4/…>`). See [Standard library options](#standard-library-options). |
|
|
247
248
|
| `id` | `string` | `'default'` | Docusaurus plugin instance id; only relevant if you register the plugin more than once. |
|
|
248
249
|
|
|
249
|
-
Every option above except `graphviz` applies to **both** engines: `lazy`, `cache`,
|
|
250
|
+
Every option above except `graphviz` and `stdlib` applies to **both** engines: `lazy`, `cache`,
|
|
250
251
|
`sanitizeSvg`, `showSourceOnError`, `renderTimeoutMs`, `cacheMaxEntries` and `zoom` behave
|
|
251
252
|
identically for a `dot` fence and a `plantuml` fence. `theme` is the exception — see
|
|
252
253
|
[Light and dark mode](#light-and-dark-mode).
|
|
@@ -258,16 +259,17 @@ would otherwise silently disable the option you meant to set:
|
|
|
258
259
|
```text
|
|
259
260
|
[docusaurus-plugin-plantuml-client] Unknown option 'sanitiseSvg'. Supported options:
|
|
260
261
|
'languages', 'theme', 'lazy', 'cache', 'sanitizeSvg', 'showSourceOnError',
|
|
261
|
-
'renderTimeoutMs', 'cacheMaxEntries', 'zoom', 'showSource', 'graphviz'.
|
|
262
|
+
'renderTimeoutMs', 'cacheMaxEntries', 'zoom', 'showSource', 'graphviz', 'stdlib'.
|
|
262
263
|
```
|
|
263
264
|
|
|
264
265
|
The same is true one level deeper, so `graphviz: {enigne: 'neato'}` fails the build rather than
|
|
265
266
|
quietly doing nothing.
|
|
266
267
|
|
|
267
268
|
`PlantUmlPluginOptions`, `ResolvedPlantUmlOptions`, `GraphvizOptions`,
|
|
268
|
-
`ResolvedGraphvizOptions`, `GraphvizEngine`, `GRAPHVIZ_ENGINES`, `
|
|
269
|
-
`
|
|
270
|
-
|
|
269
|
+
`ResolvedGraphvizOptions`, `GraphvizEngine`, `GRAPHVIZ_ENGINES`, `StdlibOptions`,
|
|
270
|
+
`ResolvedStdlibOptions`, `CacheMode`, `DiagramTheme`, `DEFAULT_OPTIONS`,
|
|
271
|
+
`DEFAULT_GRAPHVIZ_OPTIONS`, `resolveOptions` and `PlantUmlOptionsError` are exported from the
|
|
272
|
+
package root. The renderer, queue and cache internals are deliberately not
|
|
271
273
|
exported.
|
|
272
274
|
|
|
273
275
|
## Graphviz (DOT) diagrams
|
|
@@ -378,6 +380,115 @@ large, and expect the page to stall while they render.
|
|
|
378
380
|
The check happens **before** the engine is downloaded, so refusing an oversized diagram is
|
|
379
381
|
free.
|
|
380
382
|
|
|
383
|
+
## PlantUML standard library
|
|
384
|
+
|
|
385
|
+
`!include <C4/C4_Container>` works out of the box. Nothing to install, nothing to configure:
|
|
386
|
+
|
|
387
|
+
````markdown
|
|
388
|
+
```plantuml title="C4 container diagram"
|
|
389
|
+
@startuml
|
|
390
|
+
!include <C4/C4_Container>
|
|
391
|
+
|
|
392
|
+
Person(user, "Reader", "Reads the documentation")
|
|
393
|
+
Container(browser, "Browser", "JavaScript", "Renders diagrams locally")
|
|
394
|
+
Rel(user, browser, "Opens a page")
|
|
395
|
+
@enduml
|
|
396
|
+
```
|
|
397
|
+
````
|
|
398
|
+
|
|
399
|
+
Both spellings of the include resolve — `<C4/C4_Container>` and `<C4/C4_Container.puml>` —
|
|
400
|
+
and so do the includes the library makes of _itself_: `C4_Container` pulls in `C4_Context`,
|
|
401
|
+
`k8s/Common` pulls in `<c4/…>`, and none of that has to be written in the fence.
|
|
402
|
+
|
|
403
|
+
### What is included, and what it costs
|
|
404
|
+
|
|
405
|
+
Namespaces are fetched **per page, on demand**. A page with a C4 diagram downloads 29 KB
|
|
406
|
+
gzipped; a page with no standard library include downloads nothing at all. The bundles are
|
|
407
|
+
served from your own `baseUrl` like every other asset — no CDN, no plantuml.com.
|
|
408
|
+
|
|
409
|
+
| Namespace | Library | Transfer | Licence |
|
|
410
|
+
| -------------- | -------------------- | -------- | ---------- |
|
|
411
|
+
| `c4` | C4-PlantUML | 29 KB | MIT |
|
|
412
|
+
| `archimate` | Archimate-PlantUML | 34 KB | MIT |
|
|
413
|
+
| `eip` | EIP-PlantUML | 21 KB | MIT |
|
|
414
|
+
| `k8s` | kubernetes-PlantUML | 23 KB | MIT |
|
|
415
|
+
| `kubernetes` | kubernetes sprites | 221 KB | Apache-2.0 |
|
|
416
|
+
| `azure` | Azure-PlantUML | 160 KB | MIT |
|
|
417
|
+
| `office` | plantuml-office | 160 KB | MIT |
|
|
418
|
+
| `cloudinsight` | cicon sprites | 24 KB | MIT |
|
|
419
|
+
| `domainstory` | DomainStory-PlantUML | 5 KB | MIT |
|
|
420
|
+
|
|
421
|
+
Transfer figures are gzipped, per namespace, once per browsing session.
|
|
422
|
+
[`assets/stdlib/LICENSES.md`](assets/stdlib/LICENSES.md) records the exact upstream version and
|
|
423
|
+
licence of each. The bundles are generated from a pinned
|
|
424
|
+
[plantuml-stdlib](https://github.com/plantuml/plantuml-stdlib) commit by
|
|
425
|
+
`npm run stdlib:update`.
|
|
426
|
+
|
|
427
|
+
### Namespaces that are not included
|
|
428
|
+
|
|
429
|
+
The standard library in full is **265 MB** of source (28 MB gzipped), most of it icon sets:
|
|
430
|
+
`aws` alone is 114 MB, and `ibm`, `tupadr3`, `material7.4.47` and `awslib14`/`awslib20` account
|
|
431
|
+
for most of the rest. Shipping that in an npm package is not reasonable, and several other
|
|
432
|
+
namespaces — `classy`, `classy-c4`, `cloudogu`, `edgy`, `elastic`, `gcp`, `osa2` — declare no
|
|
433
|
+
licence at all upstream, which makes redistributing them your call rather than this package's.
|
|
434
|
+
`domainstory` is left out for a third reason: it is small and MIT licensed, but every element it
|
|
435
|
+
draws resolves an icon out of `material2.1.19`, so it cannot render without 6.8 MB of icons
|
|
436
|
+
beside it — use it with `include: ['domainstory', 'material2.1.19']`.
|
|
437
|
+
|
|
438
|
+
Any of them can be added from your own checkout:
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
git clone --depth 1 https://github.com/plantuml/plantuml-stdlib vendor/plantuml-stdlib
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
{
|
|
446
|
+
stdlib: {
|
|
447
|
+
include: ['aws', 'tupadr3'],
|
|
448
|
+
source: 'vendor/plantuml-stdlib/stdlib',
|
|
449
|
+
},
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Bundles for those namespaces are generated during the build and cached under `.docusaurus`, so
|
|
454
|
+
only the first build pays for it. Naming a namespace that _is_ vendored replaces it with the
|
|
455
|
+
copy from your checkout, which is also how you pin a newer C4 than the one shipped here.
|
|
456
|
+
|
|
457
|
+
### Standard library options
|
|
458
|
+
|
|
459
|
+
| Option | Type | Default | Description |
|
|
460
|
+
| ------------ | -------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
461
|
+
| `enabled` | `boolean` | `true` | Resolve `!include <namespace/…>` at all. `stdlib: false` is shorthand for `{enabled: false}`. |
|
|
462
|
+
| `include` | `string[]` | `[]` | Extra namespaces to make available. Each must be found in `source`, or the build fails naming it. |
|
|
463
|
+
| `source` | `string \| string[]` | `[]` | `stdlib` directories of plantuml-stdlib checkouts, relative to the site directory or absolute. Required whenever `include` is set. |
|
|
464
|
+
| `namespaces` | `string[]` | all | Narrow the vendored namespaces emitted into the build. Dependencies of the named ones are kept regardless. |
|
|
465
|
+
|
|
466
|
+
Namespaces are matched case-insensitively, because the engine lower-cases `<C4/…>` before it
|
|
467
|
+
looks anything up.
|
|
468
|
+
|
|
469
|
+
### When a namespace is missing
|
|
470
|
+
|
|
471
|
+
A diagram that includes a namespace the site does not provide gets the plugin's error panel,
|
|
472
|
+
naming what is missing and how to add it — not PlantUML's grey "Fatal parsing error" picture:
|
|
473
|
+
|
|
474
|
+
```text
|
|
475
|
+
This diagram includes <aws/…>, but the 'aws' standard library namespace is not available on
|
|
476
|
+
this site. Add it to the plugin's `stdlib.include` option and point `stdlib.source` at a
|
|
477
|
+
plantuml-stdlib checkout that contains it.
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Turning it off
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
{
|
|
484
|
+
stdlib: false;
|
|
485
|
+
}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Nothing is emitted into the build, and a diagram with a standard library include says so
|
|
489
|
+
instead of failing inside the engine. See
|
|
490
|
+
[ADR 0005](docs/adr/0005-stdlib-bundles.md) for why the bundles are loaded the way they are.
|
|
491
|
+
|
|
381
492
|
## Light and dark mode
|
|
382
493
|
|
|
383
494
|
The two engines handle this differently, because PlantUML has a real dark theme and Graphviz
|
|
@@ -728,16 +839,17 @@ wrapper carries `data-plantuml-status="error"`.
|
|
|
728
839
|
|
|
729
840
|
Failures are classified internally as one of:
|
|
730
841
|
|
|
731
|
-
| Kind | Cause
|
|
732
|
-
| ----------- |
|
|
733
|
-
| `load` | `viz-global.js` or `plantuml.js` could not be fetched, timed out, or was not the expected module (usually a proxy or service worker returning the wrong file).
|
|
734
|
-
| `engine` | The engine threw, or its output could not be used at all.
|
|
735
|
-
| `diagram` | The source is not valid PlantUML.
|
|
736
|
-
| `syntax` | The source is not valid DOT. Carries Graphviz's own diagnostic, including the line number.
|
|
737
|
-
| `too-large` | A DOT source exceeded `graphviz.maxSourceBytes`.
|
|
738
|
-
| `
|
|
739
|
-
| `
|
|
740
|
-
| `
|
|
842
|
+
| Kind | Cause |
|
|
843
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
844
|
+
| `load` | `viz-global.js` or `plantuml.js` could not be fetched, timed out, or was not the expected module (usually a proxy or service worker returning the wrong file). |
|
|
845
|
+
| `engine` | The engine threw, or its output could not be used at all. |
|
|
846
|
+
| `diagram` | The source is not valid PlantUML. |
|
|
847
|
+
| `syntax` | The source is not valid DOT. Carries Graphviz's own diagnostic, including the line number. |
|
|
848
|
+
| `too-large` | A DOT source exceeded `graphviz.maxSourceBytes`. |
|
|
849
|
+
| `stdlib` | A `!include <namespace/…>` names a standard library namespace this site does not provide, or the standard library is switched off. See [Standard library](#plantuml-standard-library). |
|
|
850
|
+
| `timeout` | One render exceeded `renderTimeoutMs`. |
|
|
851
|
+
| `config` | The plugin's global data is missing, or a fence named a layout engine this Graphviz build does not have. |
|
|
852
|
+
| `aborted` | The component unmounted or re-rendered; not surfaced to the reader. |
|
|
741
853
|
|
|
742
854
|
The two engines report invalid source very differently:
|
|
743
855
|
|
|
@@ -745,6 +857,10 @@ The two engines report invalid source very differently:
|
|
|
745
857
|
an "error picture" and reports success, so the rendered SVG is inspected for error markers
|
|
746
858
|
before it is trusted. See [ADR 0002](docs/adr/0002-render-to-string.md) for the exact
|
|
747
859
|
detection rules.
|
|
860
|
+
- **Preprocessor failures carry no `Syntax Error?` marker at all** — `Function not found X`
|
|
861
|
+
after a macro that the included library version does not define, or `cannot include
|
|
862
|
+
<C4/C4_Nope>` for a file that is not in the namespace. Both are detected by their own
|
|
863
|
+
signature, and the panel shows the failure rather than the expanded source it sits in.
|
|
748
864
|
- **Invalid DOT is reported as structured data**, so the panel shows Graphviz's own message
|
|
749
865
|
verbatim — `syntax error in line 3 near '}'` — with no heuristics involved.
|
|
750
866
|
|
|
@@ -782,6 +898,12 @@ The runtime requires:
|
|
|
782
898
|
- `ResizeObserver` — optional; without it zoom still works, but the view is not re-clamped when
|
|
783
899
|
the column is resized
|
|
784
900
|
|
|
901
|
+
It requires **no particular fonts**. The toolbar's controls are inline SVG rather than symbol
|
|
902
|
+
characters, which they were until 1.3.1: `⛶` U+26F6 (maximize) has no glyph in any font a stock
|
|
903
|
+
Linux desktop ships, so it rendered as an empty box for those readers, and the rest only worked
|
|
904
|
+
where DejaVu Sans happened to be installed. The icons inherit `currentColor` and `1em`, so they
|
|
905
|
+
follow the colour mode and the reader's font size the way the characters did.
|
|
906
|
+
|
|
785
907
|
That is modern evergreen Chrome, Edge, Firefox and Safari. Internet Explorer is not
|
|
786
908
|
supported and will not be.
|
|
787
909
|
|
|
@@ -798,6 +920,10 @@ The runtimes are large:
|
|
|
798
920
|
| `viz-global.js` | ≈ 1.4 MB | DOT fences, and PlantUML's own layout |
|
|
799
921
|
| **Total** | **≈ 8.2 MB** | |
|
|
800
922
|
|
|
923
|
+
Standard library namespaces are separate again, and much smaller: one bundle per namespace, 5
|
|
924
|
+
to 220 KB gzipped, fetched only by the pages whose diagrams include them. A C4 page adds 29 KB
|
|
925
|
+
to the figures above; a page with no standard library include adds nothing.
|
|
926
|
+
|
|
801
927
|
Crucially, **none of that is in your site's initial bundle**. The files are emitted as static
|
|
802
928
|
assets, not imported into the webpack graph (the dynamic import is marked `webpackIgnore`), so:
|
|
803
929
|
|
|
@@ -813,9 +939,12 @@ assets, not imported into the webpack graph (the dynamic import is marked `webpa
|
|
|
813
939
|
**Adding Graphviz support to a site that already renders PlantUML costs nothing**, because
|
|
814
940
|
`viz-global.js` was already being emitted and loaded.
|
|
815
941
|
|
|
816
|
-
The published npm package
|
|
817
|
-
the 8 MB comes from the `@plantuml/core` dependency
|
|
818
|
-
your JavaScript bundle
|
|
942
|
+
The published npm package is the compiled plugin, its theme components, and ~3 MB of vendored
|
|
943
|
+
standard library bundles; the 8 MB engine comes from the `@plantuml/core` dependency. Both land
|
|
944
|
+
in your build output rather than in your JavaScript bundle, so budget for roughly 11 MB of
|
|
945
|
+
extra static assets per deployed site — of which a given reader downloads the 8 MB engine once
|
|
946
|
+
and only the standard library namespaces their pages actually use. `stdlib.namespaces` narrows
|
|
947
|
+
what is emitted if the build output size matters more to you than which diagrams keep working.
|
|
819
948
|
|
|
820
949
|
Serve these assets with compression enabled — they are ordinary JavaScript and compress well.
|
|
821
950
|
|
|
@@ -1189,6 +1318,9 @@ Then rebuild. If it persists, remove `node_modules/.cache` and `.docusaurus/` by
|
|
|
1189
1318
|
why zoom transforms a wrapper rather than the SVG.
|
|
1190
1319
|
- [`docs/adr/0004-graphviz-engine-reuse.md`](docs/adr/0004-graphviz-engine-reuse.md) — why DOT
|
|
1191
1320
|
is rendered with the Graphviz already inside `@plantuml/core`, and what that couples us to.
|
|
1321
|
+
- [`docs/adr/0005-stdlib-bundles.md`](docs/adr/0005-stdlib-bundles.md) — how `!include <C4/…>`
|
|
1322
|
+
is resolved, why the engine's own loader has to be short-circuited, and how the vendored set
|
|
1323
|
+
was chosen.
|
|
1192
1324
|
- [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
|
1193
1325
|
- [`SECURITY.md`](SECURITY.md)
|
|
1194
1326
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Vendored PlantUML standard library namespaces
|
|
2
|
+
|
|
3
|
+
These bundles are generated from
|
|
4
|
+
[plantuml/plantuml-stdlib](https://github.com/plantuml/plantuml-stdlib) at commit
|
|
5
|
+
`bdbb819f76c75e7a23af582b2a63ea7dc43eed7c` by `npm run stdlib:update`. Each namespace keeps the licence of its
|
|
6
|
+
own upstream project, listed below. plantuml-stdlib leaves the `license:` field of most
|
|
7
|
+
namespace READMEs empty, so where that is the case the licence was read from the source
|
|
8
|
+
repository and recorded in `scripts/update-stdlib.mjs`. Namespaces whose upstream declares
|
|
9
|
+
no licence at all are not vendored. The MIT licence of this plugin covers the generator,
|
|
10
|
+
not the library content.
|
|
11
|
+
|
|
12
|
+
| Namespace | Library | Version | Licence | Upstream |
|
|
13
|
+
| --- | --- | --- | --- | --- |
|
|
14
|
+
| `c4` | C4 (C4-PlantUML) | 2.13.0 | MIT | <https://github.com/plantuml-stdlib/C4-PlantUML> |
|
|
15
|
+
| `archimate` | Archimate | 3.2.2 | MIT | <https://github.com/plantuml-stdlib/Archimate-PlantUML> |
|
|
16
|
+
| `azure` | Azure | 2.2.0 | MIT | <https://github.com/plantuml-stdlib/Azure-PlantUML> |
|
|
17
|
+
| `cloudinsight` | Cloudinsight | 1.0.0 | MIT | <https://github.com/plantuml-stdlib/cicon-plantuml-sprites> |
|
|
18
|
+
| `eip` | Eip | 1.0.0 | MIT | <https://github.com/plantuml-stdlib/EIP-PlantUML> |
|
|
19
|
+
| `k8s` | K8s | 1.0.0 | MIT | <https://github.com/dcasati/kubernetes-PlantUML> |
|
|
20
|
+
| `kubernetes` | Kubernetes | 5.3.45 | Apache-2.0 | <https://github.com/plantuml-stdlib/plantuml-kubernetes-sprites> |
|
|
21
|
+
| `office` | Office | 1.0.0 | MIT | <https://github.com/Roemer/plantuml-office> |
|