@takazudo/zfb-md-wasm 2.8.0 → 2.10.0

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/README.md CHANGED
@@ -31,12 +31,12 @@ migration. `./highlight` is also backward-compatible. New `./render` and
31
31
  `zfb-render` but intentionally retain `zfb-content` and `syntect-fancy`.
32
32
  `./parse` is not syntect-free.
33
33
 
34
- | Entry | Exact runtime values | Exact exported types |
35
- | --- | --- | --- |
36
- | `.` | `init`, `compile`, `renderHtml`, `parseToAst`, `highlightCode`, `version`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests`, `toMdastRoot`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `MdastAdapterError` | Full current compile/render/parse/raw-mdast/highlight surface |
37
- | `./highlight` | `init`, `highlightCode`, `version`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError` | `HighlightRole`, `HighlightCodeOptions`, `HighlightCodeResult`, `HighlightDiagnostic`, `HighlightDiagnosticSource` |
38
- | `./render` | `init`, `renderHtml`, `version`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests` | `RenderHtmlResult`, `Diagnostic`, `DiagnosticSource`, `ZfbMdWasmOptions`, `ParseDialect`, `PipelineOptions`, `GfmOptions`, `CodeHighlightMode`, `CodeHighlightOptions`, `MarkdownFeaturesConfig`, `JsxRuntime`, `HighlightRole` |
39
- | `./parse` | `init`, `parseToAst`, `toMdastRoot`, `MdastAdapterError`, `version`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests` | `ParseToAstResult`, `ParseToAstOptions`, `ParseDialect`, `FrontmatterPolicy`, `ParsePipelineOptions`, `Diagnostic`, `DiagnosticSource`, `AstPoint`, `AstPosition`, `RawMdastData`, `MarkdownRsStop`, `MdastNode`, `MdastRoot`, `UnknownMdastNode`, `Root`, `Paragraph`, `Heading`, `ThematicBreak`, `Blockquote`, `List`, `ListItem`, `Html`, `Code`, `Definition`, `Text`, `DirectiveNodeBase`, `ContainerDirective`, `LeafDirective`, `TextDirective`, `Emphasis`, `Strong`, `InlineCode`, `Break`, `Link`, `Image`, `ReferenceKind`, `LinkReference`, `ImageReference`, `FootnoteDefinition`, `FootnoteReference`, `TableAlign`, `Table`, `TableRow`, `TableCell`, `Delete`, `Yaml`, `MdxFlowExpression`, `MdxTextExpression`, `MdxJsxFlowElement`, `MdxJsxTextElement`, `MdxJsxAttributeContent`, `MdxJsxAttribute`, `MdxJsxAttributeValueExpression`, `MdxJsxExpressionAttribute` |
34
+ | Entry | gzip-9 wasm (2.10.0) | Exact runtime values | Exact exported types |
35
+ | --- | ---: | --- | --- |
36
+ | `.` | 1,458,446 B | `init`, `compile`, `renderHtml`, `parseToAst`, `highlightCode`, `version`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests`, `toMdastRoot`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `MdastAdapterError` | Full current compile/render/parse/raw-mdast/highlight surface |
37
+ | `./highlight` | 758,255 B | `init`, `highlightCode`, `version`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError` | `HighlightRole`, `HighlightCodeOptions`, `HighlightCodeResult`, `HighlightDiagnostic`, `HighlightDiagnosticSource` |
38
+ | `./render` | 1,011,152 B | `init`, `renderHtml`, `version`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests` | `RenderHtmlResult`, `Diagnostic`, `DiagnosticSource`, `ZfbMdWasmOptions`, `ParseDialect`, `PipelineOptions`, `GfmOptions`, `CodeHighlightMode`, `CodeHighlightOptions`, `MarkdownFeaturesConfig`, `JsxRuntime`, `HighlightRole` |
39
+ | `./parse` | 276,432 B | `init`, `parseToAst`, `toMdastRoot`, `MdastAdapterError`, `version`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests` | `ParseToAstResult`, `ParseToAstOptions`, `ParseDialect`, `FrontmatterPolicy`, `ParsePipelineOptions`, `Diagnostic`, `DiagnosticSource`, `AstPoint`, `AstPosition`, `RawMdastData`, `MarkdownRsStop`, `MdastNode`, `MdastRoot`, `UnknownMdastNode`, `Root`, `Paragraph`, `Heading`, `ThematicBreak`, `Blockquote`, `List`, `ListItem`, `Html`, `Code`, `Definition`, `Text`, `DirectiveNodeBase`, `ContainerDirective`, `LeafDirective`, `TextDirective`, `Emphasis`, `Strong`, `InlineCode`, `Break`, `Link`, `Image`, `ReferenceKind`, `LinkReference`, `ImageReference`, `FootnoteDefinition`, `FootnoteReference`, `TableAlign`, `Table`, `TableRow`, `TableCell`, `Delete`, `Yaml`, `MdxFlowExpression`, `MdxTextExpression`, `MdxJsxFlowElement`, `MdxJsxTextElement`, `MdxJsxAttributeContent`, `MdxJsxAttribute`, `MdxJsxAttributeValueExpression`, `MdxJsxExpressionAttribute` |
40
40
 
41
41
  The focused entries own private resource pairs:
42
42
 
@@ -683,10 +683,12 @@ suite gates exact-match). Deliberate limitations of the browser build:
683
683
  - **Choose a focused artifact for non-compile calls.** The root remains the
684
684
  compatibility entry and carries the complete compiler graph. `./highlight`
685
685
  keeps its public API and resources while the post-#2449/#2450 graph is
686
- proven SWC-free. `./render` and `./parse` are also SWC-free and omit `zfb-render`;
687
- parse intentionally retains `zfb-content`/`syntect-fancy`, so it is not
688
- syntect-free. Use `./render` or `./parse` when a consumer does not need
689
- `compile`; root and highlight callers otherwise require no migration.
686
+ proven SWC-free and its payload shows it: 758,255 B gzip-9 versus
687
+ 1,458,446 B for root. `./render` and `./parse` are also SWC-free and omit
688
+ `zfb-render`; parse intentionally retains `zfb-content`/`syntect-fancy`, so
689
+ it is not syntect-free. Use `./render` or `./parse` when a consumer does
690
+ not need `compile`; root and highlight callers otherwise require no
691
+ migration.
690
692
  - **`compile` is the execution boundary.** It returns ES-module source and
691
693
  only the root entry exposes it. Host code must explicitly evaluate that
692
694
  source and provide the JSX runtime/components. Controlled consumer code may
@@ -705,29 +707,53 @@ suite gates exact-match). Deliberate limitations of the browser build:
705
707
 
706
708
  ## Artifact size and locked ceilings
707
709
 
708
- The decision snapshot uses the optimized final wasm after wasm-bindgen and
709
- wasm-opt, Node `gzipSync(..., { level: 9 })`, and glue bytes/gzip. These exact
710
- #2447 rows are measurements, not permanent promises:
710
+ ### Maintainer repair workflow
711
+
712
+ These guarded size numbers use `crates/zfb-md-wasm/shipped-sizes.json` as their
713
+ source of truth. After an intentional artifact change, use this verified
714
+ three-step repair sequence:
715
+
716
+ 1. Re-run the four-artifact build and capture its summary:
717
+ `BUILD_LOG=/tmp/zfb-md-wasm-build.log; node crates/zfb-md-wasm/npm/scripts/build.mjs 2>&1 | tee "$BUILD_LOG"`.
718
+ 2. Run `node scripts/assert-zfb-md-wasm-budgets.mjs --build-log "$BUILD_LOG" --dist crates/zfb-md-wasm/npm/dist --update-manifest`.
719
+ 3. Run `node scripts/assert-md-wasm-size-docs.mjs --fix`, then `pnpm format:mdx`.
720
+
721
+ These are the shipped **2.10.0** artifact rows — optimized final wasm after
722
+ wasm-bindgen and wasm-opt, Node `gzipSync(..., { level: 9 })`, and glue
723
+ bytes/gzip:
711
724
 
712
725
  | Entry/graph | final wasm | gzip-9 | glue | glue gzip-9 |
713
726
  | --- | ---: | ---: | ---: | ---: |
714
- | root (full) | 3,336,933 B | 1,491,970 B | 14,881 B | 4,151 B |
715
- | highlight (historical current SWC-retaining baseline) | 1,484,705 B | 767,009 B | 8,758 B | 2,637 B |
716
- | render (selected SWC-free candidate) | 2,123,309 B | 1,032,557 B | 8,637 B | 2,597 B |
717
- | parse (selected SWC-free candidate) | 650,458 B | 289,523 B | 11,141 B | 3,795 B |
718
-
719
- The measured split package was 3,638,607 B versus 2,314,818 B for the current
720
- root-plus-highlight package. Locked gzip-9 ceilings are root 1,600,000 B,
721
- highlight 820,000 B, render 1,100,000 B, and parse 325,000 B; the complete
722
- packed tarball ceiling is 3,900,000 B. The clean four-step production ceiling
723
- is 210 seconds; the selected #2447 median was 155.015 s [153.496, 165.977].
724
-
725
- The highlight row is explicitly historical: #2447's current
726
- `highlight,compiler-surface` baseline retained `swc_core` because the content
727
- edge was unconditional. The shipped post-#2449 highlight graph is proven
728
- SWC-free by #2450's exact parity and no-`swc_core` assertion, with its public API
729
- and resources unchanged, but its post-gating size was not measured. Do not
730
- invent or project a highlight byte value.
727
+ | root (full) | 3,274,064 B | 1,458,446 B | 14,998 B | 4,199 B |
728
+ | highlight | 1,476,740 B | 758,255 B | 8,758 B | 2,637 B |
729
+ | render | 2,083,465 B | 1,011,152 B | 8,772 B | 2,661 B |
730
+ | parse | 624,976 B | 276,432 B | 11,159 B | 3,797 B |
731
+
732
+ The #2447 decision snapshot measured the split package at 3,638,607 B versus
733
+ 2,314,818 B for the root-plus-highlight package. Locked gzip-9 ceilings are
734
+ root 1,600,000 B, highlight 820,000 B, render 1,100,000 B, and parse
735
+ 325,000 B; the complete packed tarball ceiling is 3,900,000 B. All four ship
736
+ inside their ceilings, with 141,554 B (root), 61,745 B (highlight), 88,848 B
737
+ (render), and 48,568 B (parse) of headroom. These are 2.10.0 measurements, not
738
+ permanent promises re-measure against the version you actually install.
739
+ The clean four-step production ceiling is 210 seconds; the selected #2447
740
+ median was 155.015 s [153.496, 165.977].
741
+
742
+ Gating `swc_core` out of the highlight graph (#2449/#2450) was a
743
+ **provability win, not a size win**. The shipped highlight artifact is only
744
+ 7,965 B smaller than #2447's SWC-retaining baseline (1,484,705 B →
745
+ 1,476,740 B; gzip-9 767,009 B → 758,244 B, −8,765 B) — wasm-opt was already
746
+ dead-stripping the unreachable `swc_core`, and #2450's exact-parity and
747
+ no-`swc_core` assertions turned that emergent property into a guaranteed one.
748
+ The delta that matters to a highlight-only consumer is root versus
749
+ highlight: the highlight artifact is 1,797,324 B smaller raw and 700,191 B
750
+ smaller gzip-9, landing at about 45% of root's raw bytes and 52% of its
751
+ gzipped bytes.
752
+
753
+ Every shipped final wasm came in under its #2447 candidate measurement: root
754
+ −62,869 B, highlight −7,965 B, render −39,844 B, parse −25,482 B. The glue
755
+ rows moved the other way by a negligible amount (root +117 B, render +135 B,
756
+ parse +18 B; highlight unchanged).
731
757
 
732
758
  ## Error / trap / re-init contract
733
759
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zfb-md-wasm",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "zfb's md/mdx -> JS/HTML conversion pipeline compiled to WebAssembly, for browser-side dynamic conversion (CMS live preview with parity to zfb's production output).",