@takazudo/zfb-md-wasm 2.8.0 → 2.9.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.9.0) | Exact runtime values | Exact exported types |
|
|
35
|
+
| --- | ---: | --- | --- |
|
|
36
|
+
| `.` | 1,458,452 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,246 B | `init`, `highlightCode`, `version`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError` | `HighlightRole`, `HighlightCodeOptions`, `HighlightCodeResult`, `HighlightDiagnostic`, `HighlightDiagnosticSource` |
|
|
38
|
+
| `./render` | 1,011,165 B | `init`, `renderHtml`, `version`, `ZfbMdWasmTrapError`, `ZfbMdWasmTrapRecoveryLimitError`, `__forceTrapForTests`, `__getTrapRecoveryStateForTests` | `RenderHtmlResult`, `Diagnostic`, `DiagnosticSource`, `ZfbMdWasmOptions`, `ParseDialect`, `PipelineOptions`, `GfmOptions`, `CodeHighlightMode`, `CodeHighlightOptions`, `MarkdownFeaturesConfig`, `JsxRuntime`, `HighlightRole` |
|
|
39
|
+
| `./parse` | 276,437 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
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
686
|
+
proven SWC-free — and its payload shows it: 758,246 B gzip-9 versus
|
|
687
|
+
1,458,452 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
|
-
|
|
709
|
-
|
|
710
|
-
|
|
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.9.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,
|
|
715
|
-
| highlight
|
|
716
|
-
| render
|
|
717
|
-
| parse
|
|
718
|
-
|
|
719
|
-
The measured split package
|
|
720
|
-
root-plus-highlight package. Locked gzip-9 ceilings are
|
|
721
|
-
highlight 820,000 B, render 1,100,000 B, and parse
|
|
722
|
-
packed tarball ceiling is 3,900,000 B.
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
727
|
+
| root (full) | 3,274,064 B | 1,458,452 B | 14,998 B | 4,199 B |
|
|
728
|
+
| highlight | 1,476,740 B | 758,246 B | 8,758 B | 2,637 B |
|
|
729
|
+
| render | 2,083,465 B | 1,011,165 B | 8,772 B | 2,661 B |
|
|
730
|
+
| parse | 624,976 B | 276,437 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,548 B (root), 61,754 B (highlight), 88,835 B
|
|
737
|
+
(render), and 48,563 B (parse) of headroom. These are 2.9.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,206 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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zfb-md-wasm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.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).",
|