reactive-md 0.9.1 → 0.9.2
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-ch.md +333 -319
- package/CHANGELOG.md +334 -320
- package/CONTRIBUTING-ch.md +22 -22
- package/CONTRIBUTING.md +22 -22
- package/README-ch.md +431 -431
- package/README-en.md +431 -431
- package/README.md +429 -429
- package/SECURITY-ch.md +83 -83
- package/SECURITY.md +83 -83
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +263 -263
- package/cli/assets.mjs +395 -395
- package/cli/build.mjs +445 -445
- package/cli/check.mjs +444 -444
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +323 -323
- package/cli/init.mjs +1577 -1577
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +65 -65
- package/cli/migrate.mjs +368 -368
- package/cli/package-loader.mjs +41 -41
- package/cli/package.mjs +211 -211
- package/dist-library/{LocalDocumentView-sthUP0ct.js → LocalDocumentView-BuqgJZEY.js} +11 -11
- package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-DXE0I0Qc.js} +210 -209
- package/dist-library/{LocalReactiveDocumentCore-ZjQSGyHE.js → LocalReactiveDocumentCore-CWBe4Mm5.js} +8 -8
- package/dist-library/{authoring-Dsune4Hy.js → authoring-Ci_KzJ0q.js} +53 -53
- package/dist-library/{compile-wUv8KEge.js → compile-Dx6Uw3D9.js} +11 -11
- package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-DDDdvuLy.js} +883 -818
- package/dist-library/compiler-dxLPB9Ym.js +86 -0
- package/dist-library/{component-state-C52ZFJGl.js → component-state-BRwvTV0d.js} +15 -14
- package/dist-library/component-state-CwKX_SN5.js +763 -0
- package/dist-library/{config-BadfhjdP.js → config-DXLvctiZ.js} +68 -66
- package/dist-library/config-validation-D3D7Dy2J.js +586 -0
- package/dist-library/{controls-CcT6n7k_.js → controls-DoZyLCrV.js} +3 -3
- package/dist-library/{coordinate-CWS9p5q_.js → coordinate-B1VFK9fd.js} +2 -2
- package/dist-library/{data-table-Bgccxd7h.js → data-table-8-3F15Jf.js} +3 -3
- package/dist-library/{default-components-BwQf0oP-.js → default-components-s21NevON.js} +29 -28
- package/dist-library/{display-B-VhqVND.js → display-B_uutKkN.js} +1 -1
- package/dist-library/{config-validation-F47AcE6o.js → document-theme-C8J6UyNO.js} +193 -731
- package/dist-library/{export-BqVmTXm8.js → export-CIAIPBov.js} +35 -34
- package/dist-library/{gallery-CY6mTx8i.js → gallery-Dv1rOvL0.js} +1 -1
- package/dist-library/{html-CNT4KD-2.js → html-Cr4CBwAH.js} +42 -41
- package/dist-library/identity-BUx0Q_-d.js +40 -0
- package/dist-library/{incremental-Dv0FSp_U.js → incremental-9nx92u9c.js} +12 -10
- package/dist-library/{layout-C0YlEPGr.js → layout-BBB2VF0S.js} +1 -1
- package/dist-library/{mount-preset-KxvtKgJb.js → mount-preset-DMZ5wd3t.js} +3 -3
- package/dist-library/observability-4KqXhIEU.js +421 -0
- package/dist-library/observability-core-Bcu7vpnl.js +24 -0
- package/dist-library/{options-1aDLK7JY.js → options-BBp9IcHm.js} +4 -4
- package/dist-library/{package-core-WFK1RhAZ.js → package-core-K5xesGqy.js} +30 -29
- package/dist-library/{parser-standard-Yuf3A_VI.js → parser-standard-CBA1-hdG.js} +352 -352
- package/dist-library/{plugin-packs-B1XPWcFs.js → plugin-packs-Bh1HhLym.js} +3 -2
- package/dist-library/preset-core-DeZPA8IE.js +1298 -0
- package/dist-library/react-0DCh-Mar.js +7 -0
- package/dist-library/reactive-md-authoring.js +19 -19
- package/dist-library/reactive-md-build.js +48 -10
- package/dist-library/reactive-md-compiler-standard.js +6 -6
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-default-packs.js +3 -2
- package/dist-library/reactive-md-default-preset.js +3 -2
- package/dist-library/reactive-md-export.js +4 -4
- package/dist-library/reactive-md-minimal-preset.js +2 -2
- package/dist-library/reactive-md-minimal-react-preset.js +3 -3
- package/dist-library/reactive-md-observability.js +4 -0
- package/dist-library/reactive-md-plugin-chart.js +3 -3
- package/dist-library/reactive-md-plugin-data.js +5 -5
- package/dist-library/reactive-md-plugin-diagram.js +4 -4
- package/dist-library/reactive-md-plugin-forms.js +4 -4
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +3 -3
- package/dist-library/reactive-md-plugin-network.js +4 -3
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-print.css +304 -304
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-server.js +6 -6
- package/dist-library/reactive-md-react-unstyled.js +11 -11
- package/dist-library/reactive-md-react.js +11 -11
- package/dist-library/reactive-md-runtime-browser.js +2 -1
- package/dist-library/reactive-md-runtime.js +4 -3
- package/dist-library/reactive-md-sdk.js +8 -7
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +5 -5
- package/dist-library/reactive-md.js +556 -367
- package/dist-library/{registry-B9NGct4d.js → registry-D6OGkOcX.js} +3 -3
- package/dist-library/{registry-core-Bbad9Bm2.js → registry-core-C9xOunaw.js} +1 -1
- package/dist-library/{resources-D2GDQS0p.js → resources-B0x_w3s9.js} +71 -46
- package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
- package/dist-library/{runtime-kcA7bG7G.js → runtime-BpQdZmFI.js} +311 -305
- package/dist-library/{schema-BufhKUSM.js → schema-BryM_VRW.js} +14 -14
- package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-ChslheKs.js} +33 -32
- package/dist-library/{session-core-nmJHuR9c.js → session-core-dxQCJBNa.js} +15 -14
- package/dist-library/{shareable-DpbE-59H.js → shareable-B8xMoGEa.js} +179 -176
- package/dist-library/types/build/diagnostics.d.ts +1 -1
- package/dist-library/types/local/index.d.ts +6 -0
- package/dist-library/types/local/observability-codes.d.ts +2 -0
- package/dist-library/types/local/observability-core.d.ts +25 -0
- package/dist-library/types/local/observability-messages.d.ts +6 -0
- package/dist-library/types/local/observability.d.ts +43 -0
- package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
- package/dist-library/types/local/transport/worker.d.ts +52 -1
- package/dist-library/types/local/types.d.ts +8 -0
- package/dist-library/types/observability.d.ts +7 -0
- package/dist-library/{types-BeNtPqdY.js → types-Ib5kSScP.js} +1 -1
- package/dist-library/types-daDo2c_w.js +3 -0
- package/dist-library/{validation-BEBA_HvS.js → validation-B3RI0xOk.js} +251 -249
- package/dist-library/version-DAxuGOG2.js +147 -0
- package/dist-library/{visual-frame-CyV1FXzs.js → visual-frame-_rcd5HUv.js} +1 -1
- package/dist-library/{visuals-BZbZYA7w.js → visuals-DkDhNdEZ.js} +17 -17
- package/dist-standalone/reactive-md-standalone.js +118 -118
- package/docs/README-ch.md +101 -95
- package/docs/README.md +101 -95
- package/docs/compatibility/api-stability-ch.md +25 -0
- package/docs/compatibility/api-stability-en.md +25 -0
- package/docs/compatibility/compatibility-ch.md +146 -129
- package/docs/compatibility/compatibility-en.md +146 -129
- package/docs/compatibility/compatibility-manifest.schema.json +161 -0
- package/docs/compatibility/deprecation-ch.md +21 -0
- package/docs/compatibility/deprecation-en.md +21 -0
- package/docs/compatibility/source-versioning-ch.md +162 -162
- package/docs/compatibility/source-versioning-en.md +162 -162
- package/docs/compatibility/support-matrix-ch.md +108 -0
- package/docs/compatibility/support-matrix-en.md +108 -0
- package/docs/development/component-development-ch.md +66 -66
- package/docs/development/component-development-en.md +66 -66
- package/docs/development/component-development-reference-ch.md +253 -253
- package/docs/development/component-development-reference-en.md +238 -238
- package/docs/development/component-protocol-ch.md +748 -748
- package/docs/development/component-protocol-en.md +750 -750
- package/docs/development/extension-tutorial-ch.md +308 -308
- package/docs/development/extension-tutorial-en.md +308 -308
- package/docs/development/performance-overview-ch.md +422 -422
- package/docs/development/performance-overview-en.md +422 -422
- package/docs/guides/local-guide-ch.md +532 -532
- package/docs/guides/local-guide-en.md +532 -532
- package/docs/integration/author-tools-ch.md +64 -64
- package/docs/integration/author-tools-en.md +64 -64
- package/docs/integration/compiler-ch.md +49 -49
- package/docs/integration/compiler-en.md +36 -36
- package/docs/integration/directory-discovery-en.md +1 -1
- package/docs/integration/editor-ch.md +295 -295
- package/docs/integration/editor-en.md +303 -303
- package/docs/integration/extension-sdk-ch.md +394 -394
- package/docs/integration/extension-sdk-en.md +379 -379
- package/docs/integration/local-integration-ch.md +646 -646
- package/docs/integration/local-integration-en.md +662 -662
- package/docs/integration/shareable-export-ch.md +307 -307
- package/docs/integration/shareable-export-en.md +309 -309
- package/docs/reference/diagnostics-counting-ch.md +104 -104
- package/docs/reference/diagnostics-counting-en.md +104 -104
- package/docs/reference/html-compatibility-ch.md +93 -93
- package/docs/reference/html-compatibility-en.md +95 -95
- package/docs/reference/local-interaction-syntax-ch.md +724 -724
- package/docs/reference/local-interaction-syntax-en.md +722 -722
- package/docs/reference/public-api-ch.md +33 -4
- package/docs/reference/public-api-en.md +33 -4
- package/docs/reference/theme-protocol-ch.md +198 -198
- package/docs/reference/theme-protocol-en.md +217 -217
- package/docs/releases/release-0.4.0-ch.md +91 -91
- package/docs/releases/release-0.4.0-en.md +91 -91
- package/docs/releases/release-0.4.1-ch.md +25 -25
- package/docs/releases/release-0.4.1-en.md +25 -25
- package/docs/releases/release-0.5.0-ch.md +43 -43
- package/docs/releases/release-0.5.0-en.md +43 -43
- package/docs/releases/release-0.5.1-ch.md +41 -41
- package/docs/releases/release-0.5.1-en.md +41 -41
- package/docs/releases/release-0.5.2-ch.md +37 -37
- package/docs/releases/release-0.5.2-en.md +37 -37
- package/docs/releases/release-0.5.3-ch.md +26 -26
- package/docs/releases/release-0.5.3-en.md +26 -26
- package/docs/releases/release-0.6.0-ch.md +59 -59
- package/docs/releases/release-0.6.0-en.md +59 -59
- package/docs/releases/release-0.6.1-ch.md +29 -29
- package/docs/releases/release-0.6.1-en.md +29 -29
- package/docs/releases/release-0.7.0-ch.md +86 -86
- package/docs/releases/release-0.7.0-en.md +86 -86
- package/docs/releases/release-0.9.2-ch.md +33 -0
- package/docs/releases/release-0.9.2-en.md +33 -0
- package/examples/component-package/README-ch.md +101 -101
- package/examples/component-package/README.md +133 -133
- package/examples/conformance/README-ch.md +55 -55
- package/examples/conformance/README.md +55 -55
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/game-2048-package/LICENSE +21 -21
- package/examples/game-2048-package/NOTICES.md +11 -11
- package/examples/game-2048-package/README-ch.md +91 -91
- package/examples/game-2048-package/README.md +98 -98
- package/examples/game-2048-package/package.json +35 -35
- package/examples/game-2048-package/sample/document.reactive.md +17 -17
- package/examples/game-2048-package/scripts/build-export.mjs +44 -44
- package/examples/game-2048-package/scripts/build.mjs +130 -130
- package/examples/game-2048-package/scripts/verify.mjs +180 -180
- package/examples/game-2048-package/src/component.css +161 -161
- package/examples/game-2048-package/src/components.tsx +326 -326
- package/examples/game-2048-package/src/game-engine.ts +228 -228
- package/examples/game-2048-package/src/harness.tsx +34 -34
- package/examples/game-2048-package/src/manifest.ts +85 -85
- package/examples/game-2048-package/src/node-entry.ts +30 -30
- package/examples/game-2048-package/src/sample.ts +4 -4
- package/examples/game-2048-package/tsconfig.json +15 -15
- package/examples/integration/README-ch.md +82 -82
- package/examples/integration/README.md +82 -82
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/extension-sdk/README-ch.md +24 -24
- package/examples/integration/extension-sdk/README.md +24 -24
- package/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README-ch.md +76 -76
- package/examples/local/README.md +76 -76
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README-ch.md +22 -22
- package/examples/local/showcase/README.md +31 -31
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/examples/minimal-extension/README-ch.md +78 -78
- package/examples/minimal-extension/README.md +78 -78
- package/examples/minimal-extension/index.html +15 -15
- package/examples/minimal-extension/package.json +26 -26
- package/examples/minimal-extension/sample/document.reactive.md +10 -10
- package/examples/minimal-extension/scripts/build.mjs +32 -32
- package/examples/minimal-extension/scripts/export.mjs +72 -72
- package/examples/minimal-extension/scripts/test-node.mjs +75 -75
- package/examples/minimal-extension/src/extension.tsx +90 -90
- package/examples/minimal-extension/src/preview.tsx +12 -12
- package/examples/minimal-extension/src/source.ts +4 -4
- package/examples/minimal-extension/tsconfig.json +14 -14
- package/examples/sci-fi-theme/README-ch.md +133 -133
- package/examples/sci-fi-theme/README.md +148 -148
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
- package/examples/sci-fi-theme/demo/demo.css +638 -638
- package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
- package/examples/sci-fi-theme/demo/index.html +13 -13
- package/examples/sci-fi-theme/demo/main.tsx +215 -215
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
- package/examples/sci-fi-theme/docs/design-system.md +474 -474
- package/examples/sci-fi-theme/package.json +28 -28
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
- package/examples/sci-fi-theme/src/components.css +2370 -2370
- package/examples/sci-fi-theme/src/index.ts +6 -6
- package/examples/sci-fi-theme/src/notch.css +142 -142
- package/examples/sci-fi-theme/src/sci-fi.css +7 -7
- package/examples/sci-fi-theme/src/theme.ts +39 -39
- package/examples/sci-fi-theme/tsconfig.json +20 -20
- package/examples/sci-fi-theme/vite.config.ts +24 -24
- package/examples/tetris-package/LICENSE +21 -21
- package/examples/tetris-package/NOTICES.md +11 -11
- package/examples/tetris-package/README-ch.md +91 -91
- package/examples/tetris-package/README.md +95 -95
- package/examples/tetris-package/package.json +35 -35
- package/examples/tetris-package/sample/document.reactive.md +16 -16
- package/examples/tetris-package/scripts/build-export.mjs +44 -44
- package/examples/tetris-package/scripts/build.mjs +130 -130
- package/examples/tetris-package/scripts/verify.mjs +173 -173
- package/examples/tetris-package/src/component.css +145 -145
- package/examples/tetris-package/src/components.tsx +334 -334
- package/examples/tetris-package/src/harness.tsx +34 -34
- package/examples/tetris-package/src/manifests.ts +93 -93
- package/examples/tetris-package/src/node-entry.ts +16 -16
- package/examples/tetris-package/src/sample.ts +4 -4
- package/examples/tetris-package/src/tetris-engine.ts +325 -325
- package/examples/tetris-package/tsconfig.json +15 -15
- package/package.json +7 -1
- package/dist-library/compiler-eOfcinZs.js +0 -62
- package/dist-library/component-state-BoLCGee4.js +0 -801
- package/dist-library/preset-core-CKc5YXSM.js +0 -1443
- package/dist-library/react-D5iGiUdL.js +0 -7
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
# Source revisions and migration
|
|
2
|
-
|
|
3
|
-
**English** · [中文](source-versioning-ch.md)
|
|
4
|
-
|
|
5
|
-
This page covers explicit source revisions, how the compiler treats them, and the pure core and CLI migration tools in `0.4.0`. Syntax rules are in the [syntax specification](../reference/local-interaction-syntax-en.md); package and API compatibility rules are in [Versions and compatibility](compatibility-en.md); the component upgrade checklist is in [0.4.0 release and migration](../releases/release-0.4.0-en.md).
|
|
6
|
-
|
|
7
|
-
## Declaring a revision
|
|
8
|
-
|
|
9
|
-
A source declares its revision with one HTML comment on its own line:
|
|
10
|
-
|
|
11
|
-
```markdown
|
|
12
|
-
<!-- reactive-md: local-draft-3 -->
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
The directive belongs to the document prologue, before the `<theme>` declaration and before any body content. A BOM, blank lines and ordinary Markdown comments may precede it. Exactly one directive is allowed.
|
|
16
|
-
|
|
17
|
-
Code spans and fences, math regions and inert fallback examples are not directives. Showing the line in documentation does not version the surrounding document.
|
|
18
|
-
|
|
19
|
-
Compilation behavior:
|
|
20
|
-
|
|
21
|
-
| Source | Result |
|
|
22
|
-
| --- | --- |
|
|
23
|
-
| No directive | Parsed as the current revision `local-draft-3`; no new warning |
|
|
24
|
-
| `local-draft-3` | Parsed normally |
|
|
25
|
-
| `local-draft-1` or `local-draft-2` | Rejected with a `local.version.*` diagnostic; migrate first |
|
|
26
|
-
|
|
27
|
-
| Unknown, malformed, duplicate or misplaced directive | Rejected with a `local.version.*` diagnostic |
|
|
28
|
-
|
|
29
|
-
A rejected version declaration constructs no runtime. Declaring an old revision does not select an old parser, and it does not make the document readable under current rules. Migrate the source first.
|
|
30
|
-
|
|
31
|
-
Readers built before this declaration existed, including `0.3.1`, treat the comment as an inert HTML comment. They do not validate it, do not reject old revisions and do not enforce this guard. A declaration protects documents opened in this build and later builds; migrate old documents before relying on the check.
|
|
32
|
-
|
|
33
|
-
## Inspect the declared revision
|
|
34
|
-
|
|
35
|
-
`inspectLocalSourceVersion` is exported from `reactive-md` and does not compile or create a runtime:
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
import { inspectLocalSourceVersion } from 'reactive-md';
|
|
39
|
-
|
|
40
|
-
const info = inspectLocalSourceVersion(source);
|
|
41
|
-
// {
|
|
42
|
-
// declaredVersion: string | null,
|
|
43
|
-
// effectiveVersion: string,
|
|
44
|
-
// supported: boolean,
|
|
45
|
-
// range: SourceRange | null,
|
|
46
|
-
// diagnostics: Diagnostic[]
|
|
47
|
-
// }
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
- `declaredVersion` is the revision named by the directive, or `null` when the source is unversioned.
|
|
51
|
-
- `effectiveVersion` is the revision used for interpretation decisions: the declared revision when present, otherwise the current revision. When `supported` is `false`, no interpretation takes place.
|
|
52
|
-
- `supported` is `true` when this compiler accepts that revision.
|
|
53
|
-
- `range` locates the directive in the original source, or is `null` when there is none.
|
|
54
|
-
- `diagnostics` reports malformed, duplicate, misplaced, old or unknown declarations using the `local.version.*` prefix.
|
|
55
|
-
|
|
56
|
-
An unversioned source reports `declaredVersion: null`, `effectiveVersion: 'local-draft-3'`, `supported: true` and no version diagnostic.
|
|
57
|
-
|
|
58
|
-
## Check an upgrade
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
import { checkLocalUpgrade } from 'reactive-md';
|
|
62
|
-
|
|
63
|
-
const check = checkLocalUpgrade(source);
|
|
64
|
-
// {
|
|
65
|
-
// ok: boolean,
|
|
66
|
-
// fromVersion: string,
|
|
67
|
-
// toVersion: 'local-draft-3',
|
|
68
|
-
// needsMigration: boolean,
|
|
69
|
-
// diagnostics: Diagnostic[]
|
|
70
|
-
// }
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
`fromVersion` defaults to the declared revision, or to the current revision when the source is unversioned. Pass `LocalUpgradeOptions` to override it:
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
type LocalUpgradeOptions = {
|
|
77
|
-
fromVersion?: string;
|
|
78
|
-
allowSemanticChanges?: boolean;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const check = checkLocalUpgrade(oldSource, { fromVersion: 'local-draft-1' });
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
An unversioned historical document requires `fromVersion: 'local-draft-1'` to receive the draft-1 checks. When an explicit `fromVersion` disagrees with the declaration, the check is rejected. `local-draft-1`, `local-draft-2` and the current `local-draft-3` are accepted as migration sources; legacy YAML revisions and unknown names are rejected.
|
|
85
|
-
|
|
86
|
-
`needsMigration` is `true` when the source needs a new or different directive. An unversioned source needs the current directive stamped; a current source is already complete; a draft-1 source needs its directive replaced. `ok` is `false` when a blocker prevents a safe migration even though the version change itself is recognized.
|
|
87
|
-
|
|
88
|
-
## Migrate source
|
|
89
|
-
|
|
90
|
-
```ts
|
|
91
|
-
import { migrateLocalSource } from 'reactive-md';
|
|
92
|
-
|
|
93
|
-
const result = migrateLocalSource(oldSource, { fromVersion: 'local-draft-1' });
|
|
94
|
-
// {
|
|
95
|
-
// ok: boolean,
|
|
96
|
-
// fromVersion: string,
|
|
97
|
-
// toVersion: 'local-draft-3',
|
|
98
|
-
// needsMigration: boolean,
|
|
99
|
-
// diagnostics: Diagnostic[],
|
|
100
|
-
// source: string,
|
|
101
|
-
// changed: boolean,
|
|
102
|
-
// edits: { range: SourceRange; text: string }[]
|
|
103
|
-
// }
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Migration stamps or replaces the metadata comment and preserves the body. It keeps original body bytes, a UTF-8 BOM and CRLF line endings, and is idempotent: migrating an already current source returns `changed: false` and the same text. `edits` locates each replacement. A blocked migration produces no migrated output, and the caller's input remains unchanged.
|
|
107
|
-
|
|
108
|
-
Before moving `local-draft-1` source to `local-draft-3`, migration blocks:
|
|
109
|
-
|
|
110
|
-
- bindings that use one of the 17 newly reserved expression names: `sum`, `average`, `minOf`, `maxOf`, `formatNumber`, `formatPercent`, `formatScientific`, `formatCurrency`, `trim`, `lower`, `upper`, `startsWith`, `endsWith`, `replace`, `slice`, `dateCompare`, `dateDiff`;
|
|
111
|
-
- the newly recognized tag names outside code: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step`, `computed`, `const`, `validation`, `data-table`, `column`, `external`;
|
|
112
|
-
- array syntax or calls to newly introduced built-ins in expressions; text inside string literals does not trigger this check;
|
|
113
|
-
- current compile errors in the source.
|
|
114
|
-
|
|
115
|
-
Diagnostics report precise source positions. Migration does not rename identifiers, rewrite expressions or activate formerly inert tags. Those are source changes for the author.
|
|
116
|
-
|
|
117
|
-
Text controls need one explicit compatibility decision. An `input` or `textarea` with `min-length` greater than zero, or with a `max-length`, changes reader semantics for astral Unicode: draft-2 counts Unicode code points while draft-1 counted UTF-16 code units. Migration blocks these controls unless semantic changes are allowed:
|
|
118
|
-
|
|
119
|
-
```ts
|
|
120
|
-
migrateLocalSource(oldSource, {
|
|
121
|
-
fromVersion: 'local-draft-1',
|
|
122
|
-
allowSemanticChanges: true,
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
With that option, migration proceeds and returns a warning for each affected control. Use it when the new code-point limits are the intended reader behavior.
|
|
127
|
-
|
|
128
|
-
Completed checklist styling is a documented compatibility exception. The visual change alone does not block migration and is not treated as a core runtime-semantic failure.
|
|
129
|
-
|
|
130
|
-
Migration changes the source digest. Existing `reactive-md-state/v1` files then fail digest validation, so export a fresh state file after migrating. Migration never rewrites state files.
|
|
131
|
-
|
|
132
|
-
## CLI
|
|
133
|
-
|
|
134
|
-
```sh
|
|
135
|
-
reactive-md migrate doc.reactive.md
|
|
136
|
-
reactive-md migrate - --from local-draft-1 -o doc.reactive.md
|
|
137
|
-
reactive-md migrate doc.reactive.md --check
|
|
138
|
-
reactive-md migrate doc.reactive.md --check --json
|
|
139
|
-
reactive-md migrate old.reactive.md --from local-draft-1 --accept-semantic-changes -o new.reactive.md
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
| Option | Meaning |
|
|
143
|
-
| --- | --- |
|
|
144
|
-
| `[file\|-]` | Input file, or `-` for standard input |
|
|
145
|
-
| `--from local-draft-1\|local-draft-2\|local-draft-3` | Source revision; defaults to the declaration or the current revision |
|
|
146
|
-
| `--check` | Report whether migration is needed; never writes |
|
|
147
|
-
| `--json` | Structured report on standard output; the only stdout content |
|
|
148
|
-
| `-o, --output <file>` | Create a new file; refuses any existing path, including the input |
|
|
149
|
-
| `--accept-semantic-changes` | Allow the text-control length change and report warnings |
|
|
150
|
-
| `--locale en\|zh` | Language for displayed diagnostics and summaries |
|
|
151
|
-
|
|
152
|
-
By default, migrated source goes to standard output. The input file is never overwritten; `-o` uses exclusive creation, so an existing file is an error. Without `-o`, redirect stdout to keep the result.
|
|
153
|
-
|
|
154
|
-
`--check` never writes. It prints diagnostics and a summary, or a JSON report with `--json`. It exits `1` when changes are needed or migration is blocked, and `0` when the source is already current. A normal migration exits `1` when blocked and `0` on success. Usage and I/O errors exit `2`. Do not mix source text with the JSON report.
|
|
155
|
-
|
|
156
|
-
The command migrates one source at a time. This build has no `--write` mode, no in-place overwrite and no destructive batch operation.
|
|
157
|
-
|
|
158
|
-
## Scope
|
|
159
|
-
|
|
160
|
-
Migration handles the declared metadata change and checks whether the body can cross the revision boundary. It is not a legacy reader: it does not interpret YAML `state`/`data`/`computed`/`actions` blocks, directives or other pre-draft syntax, and it does not rewrite the body. Source that already fails to compile under `local-draft-3` stays blocked until the author fixes the reported positions.
|
|
161
|
-
|
|
162
|
-
`0.8.0` keeps `local-draft-3` as the only accepted revision and adds no new source revision. The directive rules, migration API and CLI options on this page apply unchanged, so a document that compiles under `0.7.0` needs no migration for `0.8.0`. Migrating from `local-draft-1` or `local-draft-2` still targets `local-draft-3`; migration from `local-draft-2` continues to block newly active `<external>` tags and requires the author to preserve them as literal code first. `0.9.
|
|
1
|
+
# Source revisions and migration
|
|
2
|
+
|
|
3
|
+
**English** · [中文](source-versioning-ch.md)
|
|
4
|
+
|
|
5
|
+
This page covers explicit source revisions, how the compiler treats them, and the pure core and CLI migration tools in `0.4.0`. Syntax rules are in the [syntax specification](../reference/local-interaction-syntax-en.md); package and API compatibility rules are in [Versions and compatibility](compatibility-en.md); the component upgrade checklist is in [0.4.0 release and migration](../releases/release-0.4.0-en.md).
|
|
6
|
+
|
|
7
|
+
## Declaring a revision
|
|
8
|
+
|
|
9
|
+
A source declares its revision with one HTML comment on its own line:
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
<!-- reactive-md: local-draft-3 -->
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The directive belongs to the document prologue, before the `<theme>` declaration and before any body content. A BOM, blank lines and ordinary Markdown comments may precede it. Exactly one directive is allowed.
|
|
16
|
+
|
|
17
|
+
Code spans and fences, math regions and inert fallback examples are not directives. Showing the line in documentation does not version the surrounding document.
|
|
18
|
+
|
|
19
|
+
Compilation behavior:
|
|
20
|
+
|
|
21
|
+
| Source | Result |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| No directive | Parsed as the current revision `local-draft-3`; no new warning |
|
|
24
|
+
| `local-draft-3` | Parsed normally |
|
|
25
|
+
| `local-draft-1` or `local-draft-2` | Rejected with a `local.version.*` diagnostic; migrate first |
|
|
26
|
+
|
|
27
|
+
| Unknown, malformed, duplicate or misplaced directive | Rejected with a `local.version.*` diagnostic |
|
|
28
|
+
|
|
29
|
+
A rejected version declaration constructs no runtime. Declaring an old revision does not select an old parser, and it does not make the document readable under current rules. Migrate the source first.
|
|
30
|
+
|
|
31
|
+
Readers built before this declaration existed, including `0.3.1`, treat the comment as an inert HTML comment. They do not validate it, do not reject old revisions and do not enforce this guard. A declaration protects documents opened in this build and later builds; migrate old documents before relying on the check.
|
|
32
|
+
|
|
33
|
+
## Inspect the declared revision
|
|
34
|
+
|
|
35
|
+
`inspectLocalSourceVersion` is exported from `reactive-md` and does not compile or create a runtime:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { inspectLocalSourceVersion } from 'reactive-md';
|
|
39
|
+
|
|
40
|
+
const info = inspectLocalSourceVersion(source);
|
|
41
|
+
// {
|
|
42
|
+
// declaredVersion: string | null,
|
|
43
|
+
// effectiveVersion: string,
|
|
44
|
+
// supported: boolean,
|
|
45
|
+
// range: SourceRange | null,
|
|
46
|
+
// diagnostics: Diagnostic[]
|
|
47
|
+
// }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `declaredVersion` is the revision named by the directive, or `null` when the source is unversioned.
|
|
51
|
+
- `effectiveVersion` is the revision used for interpretation decisions: the declared revision when present, otherwise the current revision. When `supported` is `false`, no interpretation takes place.
|
|
52
|
+
- `supported` is `true` when this compiler accepts that revision.
|
|
53
|
+
- `range` locates the directive in the original source, or is `null` when there is none.
|
|
54
|
+
- `diagnostics` reports malformed, duplicate, misplaced, old or unknown declarations using the `local.version.*` prefix.
|
|
55
|
+
|
|
56
|
+
An unversioned source reports `declaredVersion: null`, `effectiveVersion: 'local-draft-3'`, `supported: true` and no version diagnostic.
|
|
57
|
+
|
|
58
|
+
## Check an upgrade
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { checkLocalUpgrade } from 'reactive-md';
|
|
62
|
+
|
|
63
|
+
const check = checkLocalUpgrade(source);
|
|
64
|
+
// {
|
|
65
|
+
// ok: boolean,
|
|
66
|
+
// fromVersion: string,
|
|
67
|
+
// toVersion: 'local-draft-3',
|
|
68
|
+
// needsMigration: boolean,
|
|
69
|
+
// diagnostics: Diagnostic[]
|
|
70
|
+
// }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`fromVersion` defaults to the declared revision, or to the current revision when the source is unversioned. Pass `LocalUpgradeOptions` to override it:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
type LocalUpgradeOptions = {
|
|
77
|
+
fromVersion?: string;
|
|
78
|
+
allowSemanticChanges?: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const check = checkLocalUpgrade(oldSource, { fromVersion: 'local-draft-1' });
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
An unversioned historical document requires `fromVersion: 'local-draft-1'` to receive the draft-1 checks. When an explicit `fromVersion` disagrees with the declaration, the check is rejected. `local-draft-1`, `local-draft-2` and the current `local-draft-3` are accepted as migration sources; legacy YAML revisions and unknown names are rejected.
|
|
85
|
+
|
|
86
|
+
`needsMigration` is `true` when the source needs a new or different directive. An unversioned source needs the current directive stamped; a current source is already complete; a draft-1 source needs its directive replaced. `ok` is `false` when a blocker prevents a safe migration even though the version change itself is recognized.
|
|
87
|
+
|
|
88
|
+
## Migrate source
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { migrateLocalSource } from 'reactive-md';
|
|
92
|
+
|
|
93
|
+
const result = migrateLocalSource(oldSource, { fromVersion: 'local-draft-1' });
|
|
94
|
+
// {
|
|
95
|
+
// ok: boolean,
|
|
96
|
+
// fromVersion: string,
|
|
97
|
+
// toVersion: 'local-draft-3',
|
|
98
|
+
// needsMigration: boolean,
|
|
99
|
+
// diagnostics: Diagnostic[],
|
|
100
|
+
// source: string,
|
|
101
|
+
// changed: boolean,
|
|
102
|
+
// edits: { range: SourceRange; text: string }[]
|
|
103
|
+
// }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Migration stamps or replaces the metadata comment and preserves the body. It keeps original body bytes, a UTF-8 BOM and CRLF line endings, and is idempotent: migrating an already current source returns `changed: false` and the same text. `edits` locates each replacement. A blocked migration produces no migrated output, and the caller's input remains unchanged.
|
|
107
|
+
|
|
108
|
+
Before moving `local-draft-1` source to `local-draft-3`, migration blocks:
|
|
109
|
+
|
|
110
|
+
- bindings that use one of the 17 newly reserved expression names: `sum`, `average`, `minOf`, `maxOf`, `formatNumber`, `formatPercent`, `formatScientific`, `formatCurrency`, `trim`, `lower`, `upper`, `startsWith`, `endsWith`, `replace`, `slice`, `dateCompare`, `dateDiff`;
|
|
111
|
+
- the newly recognized tag names outside code: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step`, `computed`, `const`, `validation`, `data-table`, `column`, `external`;
|
|
112
|
+
- array syntax or calls to newly introduced built-ins in expressions; text inside string literals does not trigger this check;
|
|
113
|
+
- current compile errors in the source.
|
|
114
|
+
|
|
115
|
+
Diagnostics report precise source positions. Migration does not rename identifiers, rewrite expressions or activate formerly inert tags. Those are source changes for the author.
|
|
116
|
+
|
|
117
|
+
Text controls need one explicit compatibility decision. An `input` or `textarea` with `min-length` greater than zero, or with a `max-length`, changes reader semantics for astral Unicode: draft-2 counts Unicode code points while draft-1 counted UTF-16 code units. Migration blocks these controls unless semantic changes are allowed:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
migrateLocalSource(oldSource, {
|
|
121
|
+
fromVersion: 'local-draft-1',
|
|
122
|
+
allowSemanticChanges: true,
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
With that option, migration proceeds and returns a warning for each affected control. Use it when the new code-point limits are the intended reader behavior.
|
|
127
|
+
|
|
128
|
+
Completed checklist styling is a documented compatibility exception. The visual change alone does not block migration and is not treated as a core runtime-semantic failure.
|
|
129
|
+
|
|
130
|
+
Migration changes the source digest. Existing `reactive-md-state/v1` files then fail digest validation, so export a fresh state file after migrating. Migration never rewrites state files.
|
|
131
|
+
|
|
132
|
+
## CLI
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
reactive-md migrate doc.reactive.md
|
|
136
|
+
reactive-md migrate - --from local-draft-1 -o doc.reactive.md
|
|
137
|
+
reactive-md migrate doc.reactive.md --check
|
|
138
|
+
reactive-md migrate doc.reactive.md --check --json
|
|
139
|
+
reactive-md migrate old.reactive.md --from local-draft-1 --accept-semantic-changes -o new.reactive.md
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
| Option | Meaning |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `[file\|-]` | Input file, or `-` for standard input |
|
|
145
|
+
| `--from local-draft-1\|local-draft-2\|local-draft-3` | Source revision; defaults to the declaration or the current revision |
|
|
146
|
+
| `--check` | Report whether migration is needed; never writes |
|
|
147
|
+
| `--json` | Structured report on standard output; the only stdout content |
|
|
148
|
+
| `-o, --output <file>` | Create a new file; refuses any existing path, including the input |
|
|
149
|
+
| `--accept-semantic-changes` | Allow the text-control length change and report warnings |
|
|
150
|
+
| `--locale en\|zh` | Language for displayed diagnostics and summaries |
|
|
151
|
+
|
|
152
|
+
By default, migrated source goes to standard output. The input file is never overwritten; `-o` uses exclusive creation, so an existing file is an error. Without `-o`, redirect stdout to keep the result.
|
|
153
|
+
|
|
154
|
+
`--check` never writes. It prints diagnostics and a summary, or a JSON report with `--json`. It exits `1` when changes are needed or migration is blocked, and `0` when the source is already current. A normal migration exits `1` when blocked and `0` on success. Usage and I/O errors exit `2`. Do not mix source text with the JSON report.
|
|
155
|
+
|
|
156
|
+
The command migrates one source at a time. This build has no `--write` mode, no in-place overwrite and no destructive batch operation.
|
|
157
|
+
|
|
158
|
+
## Scope
|
|
159
|
+
|
|
160
|
+
Migration handles the declared metadata change and checks whether the body can cross the revision boundary. It is not a legacy reader: it does not interpret YAML `state`/`data`/`computed`/`actions` blocks, directives or other pre-draft syntax, and it does not rewrite the body. Source that already fails to compile under `local-draft-3` stays blocked until the author fixes the reported positions.
|
|
161
|
+
|
|
162
|
+
`0.8.0` keeps `local-draft-3` as the only accepted revision and adds no new source revision. The directive rules, migration API and CLI options on this page apply unchanged, so a document that compiles under `0.7.0` needs no migration for `0.8.0`. Migrating from `local-draft-1` or `local-draft-2` still targets `local-draft-3`; migration from `local-draft-2` continues to block newly active `<external>` tags and requires the author to preserve them as literal code first. `0.9.2` is available on `latest` and continues to use `local-draft-3`.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# 支持矩阵
|
|
2
|
+
|
|
3
|
+
**中文** · [English](support-matrix-en.md)
|
|
4
|
+
|
|
5
|
+
本页定义 `reactive-md@0.9.2`、`reactive-md-editor@0.2.1` 和对应 Demo 候选的公开支持范围。配对版本见[版本与兼容性](compatibility-ch.md)。
|
|
6
|
+
|
|
7
|
+
## 支持等级
|
|
8
|
+
|
|
9
|
+
| 等级 | 定义 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Verified | 本页列出的版本或环境已有当前候选的通过记录。 |
|
|
12
|
+
| Declared | 声明范围与验收入口已确定,具体通过结果见发布证据。 |
|
|
13
|
+
| Unverified | 当前未验证。 |
|
|
14
|
+
| Not supported | 超出当前支持范围。 |
|
|
15
|
+
|
|
16
|
+
包声明的 Node 安装下限为 22.12.0。本发布线验证 Node 22.x 和 24.x 中列出的版本。React 和 Vite 的 peer 范围是安装约束,实测点列在下表。每次完整验收记录三仓来源、兼容清单摘要和单项结果,见 `artifacts/support/latest.json`。
|
|
17
|
+
|
|
18
|
+
## 支持矩阵
|
|
19
|
+
|
|
20
|
+
| 领域 | 范围 | 等级 | 检查 | 验证 |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| `Node.js` | 22.x(最低 22.12.0) | Verified | `node-runtime` | 在 22.17.0 完成引擎全量检查。 |
|
|
23
|
+
| `Node.js` | 24.x | Verified | `node-runtime` | 用 24.22.2 运行发布验收。 |
|
|
24
|
+
| React / react-dom | peer `^19.0.0` | Verified | `react-range` | 实测 `19.3.1`。编辑器要求 React 19。 |
|
|
25
|
+
| Vite | `reactive-md/vite` 的可选 peer `^8.0.0` | Verified | `vite-range` | 实测 `8.3.5`。 |
|
|
26
|
+
| Playwright Chromium | Playwright 内置版本 | Verified | `playwright-chromium-core` | 实测 `156.0.8078.4`。可单独运行。 |
|
|
27
|
+
| Google Chrome | Windows 上的 Chrome 渠道 | Verified | `chrome-core` | 引擎 fixture 实测 `157.0.8103.80`。 |
|
|
28
|
+
| Microsoft Edge | Windows 上的 Edge 渠道 | Verified | `edge-core` | 引擎 fixture 实测 `135.0.3179.66`。 |
|
|
29
|
+
| Playwright Firefox | Playwright 内置版本 | Unverified | `firefox-core` | 可单独运行。 |
|
|
30
|
+
| Playwright WebKit | Playwright 内置版本 | Unverified | `webkit-core` | 可单独运行。Safari 实机另测。 |
|
|
31
|
+
| Safari | Apple 设备 | Unverified | none | 待实机验证。 |
|
|
32
|
+
| 桌面布局 | 桌面浏览器 | Declared | `demo-smoke` | Demo 冒烟在 Edge 下检查 1440 px。 |
|
|
33
|
+
| 窄屏布局 | 窄视口 | Declared | `demo-smoke` | Demo 冒烟在 Edge 下检查 390 px。 |
|
|
34
|
+
| SSR 静态渲染 | `react-dom/server` | Verified | `ssr-static` | 打包消费者验证服务端标记。 |
|
|
35
|
+
| 单文件 HTML 导出 | `reactive-md-html/v1` | Declared | `demo-smoke` | Demo 冒烟生成文件并在 Edge 离线打开。 |
|
|
36
|
+
| 交互式单文件 HTML 启动 | `reactive-md-html/v1` 内联运行时 | Declared | `demo-smoke` | Demo 冒烟离线操作滑块并验证内容更新。 |
|
|
37
|
+
| 通用 SSR 水合 | 宿主管理的 hydration | Not supported | none | 已支持的交互路径见单文件 HTML 启动。 |
|
|
38
|
+
| 引擎 Worker | `LocalCompileScheduler` 与 `LocalCompileWorker` | Verified | `worker-unit` | 通过 Worker 单元测试。 |
|
|
39
|
+
| 编辑器分析 Worker | CodeMirror 分析 Worker | Declared | `editor-pack` | 打包检查覆盖 Worker 资源及其导入。 |
|
|
40
|
+
| PDF | `reactive-md/pdf` | Verified | `pdf-static` | 实测内置 Chromium 与 `pdftotext`。 |
|
|
41
|
+
| 编辑器包 | `reactive-md-editor` 0.2.1 | Declared | `editor-pack` | peer 为 `^0.9.2`。打包验证 SSR、Worker 和 NodeNext 声明。 |
|
|
42
|
+
| 兼容性清单 | 三仓候选集合 | Declared | `compatibility-manifest` | 验收检查版本、建议安装组合、候选包及锁文件完整性。 |
|
|
43
|
+
|
|
44
|
+
## 验证检查
|
|
45
|
+
|
|
46
|
+
| 检查 | 配置 | 负责方 | 命令 |
|
|
47
|
+
| --- | --- | --- | --- |
|
|
48
|
+
| `node-runtime` | fast | engine | `built-in` |
|
|
49
|
+
| `react-range` | fast | engine | `built-in` |
|
|
50
|
+
| `vite-range` | fast | engine | `built-in` |
|
|
51
|
+
| `docs-matrix` | fast | engine | `built-in` |
|
|
52
|
+
| `documented-versions` | fast | engine | `node scripts/check-versions.mjs` |
|
|
53
|
+
| `worker-unit` | fast | engine | `npm run test -- tests/local-compile-worker.test.ts` |
|
|
54
|
+
| `compatibility-manifest` | release | engine | `node scripts/verify-compatibility-manifest.mjs --require-workspace` |
|
|
55
|
+
| `chrome-core` | release | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=chrome node scripts/verify-required-form-browser.mjs` |
|
|
56
|
+
| `edge-core` | release | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=msedge node scripts/verify-required-form-browser.mjs` |
|
|
57
|
+
| `ssr-static` | release | engine | `npm run test:boundary` after `npm run build` |
|
|
58
|
+
| `pdf-static` | release | engine | `node scripts/verify-pdf.mjs` |
|
|
59
|
+
| `demo-smoke` | release | demo | `cd ../ReactiveMD-Demo && PLAYWRIGHT_CHANNEL=msedge npm run test:browser:smoke` |
|
|
60
|
+
| `editor-pack` | release | editor | `cd ../ReactiveMD-Editor && npm run check` |
|
|
61
|
+
| `playwright-chromium-core` | optional | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=chromium node scripts/verify-required-form-browser.mjs` |
|
|
62
|
+
| `firefox-core` | optional | engine | `PLAYWRIGHT_ENGINE=firefox node scripts/verify-required-form-browser.mjs` |
|
|
63
|
+
| `webkit-core` | optional | engine | `PLAYWRIGHT_ENGINE=webkit node scripts/verify-required-form-browser.mjs` |
|
|
64
|
+
|
|
65
|
+
## 运行检查
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm run support:verify
|
|
69
|
+
npm run support:verify -- --profile release
|
|
70
|
+
npm run support:verify -- --profile optional
|
|
71
|
+
npm run compatibility:verify
|
|
72
|
+
npm run support:verify -- --only chrome-core
|
|
73
|
+
npm run support:verify -- --only edge-core
|
|
74
|
+
npm run support:verify -- --only playwright-chromium-core
|
|
75
|
+
npm run support:verify -- --only firefox-core
|
|
76
|
+
npm run support:verify -- --only webkit-core
|
|
77
|
+
npm run support:verify -- --only pdf-static
|
|
78
|
+
npm run support:verify -- --include-external --only demo-smoke
|
|
79
|
+
npm run support:verify -- --only node-runtime --out artifacts/support/node24.json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
默认运行 `fast` 配置:内置检查、文档版本检查和 Worker 单元测试,不需要浏览器、构建产物或同级仓库。`--profile release` 运行全部 fast 检查,再追加 release 检查:兼容性清单、Chrome 与 Edge 引擎 fixture、SSR、PDF,以及 Demo 和编辑器仓库负责的外部检查。`--profile optional` 只运行未声明或需要额外下载的环境:Playwright 内置 Chromium、Firefox 与 WebKit。`--profile all` 运行全部检查。
|
|
83
|
+
|
|
84
|
+
`--only <id>` 只运行指定检查。被 `--only` 点名的检查视为显式请求:缺少外部仓库、缺少 `pdftotext` 或缺少构建产物都会记为失败,不会静默跳过。profile 运行则允许跳过无法运行的可选环境,原因写入证据。`--include-external` 在各自仓库中运行 Demo 和编辑器负责的检查;未传入时这些检查在 profile 运行中跳过,被 `--only` 点名时失败。`--out <path>` 写入指定路径,不更新 `artifacts/support/latest.json`,也不写带时间戳的归档。`--list` 列出全部检查 ID、配置、负责方和命令,不执行检查。Node 24 检查用 Node 24 的 `node` 直接运行同一脚本。
|
|
85
|
+
|
|
86
|
+
`npm run compatibility:verify` 直接检查兼容性清单,需要编辑器与 Demo 仓库存在。
|
|
87
|
+
|
|
88
|
+
## 证据
|
|
89
|
+
|
|
90
|
+
每次运行在 `artifacts/support/` 写入带时间戳的记录,并更新 `artifacts/support/latest.json`;该目录已被 Git 忽略。记录使用 `reactive-md-support-evidence/v2` schema,包含:
|
|
91
|
+
|
|
92
|
+
- 引擎、编辑器和 Demo 的包名、版本、来源 commit 与未提交标记,兼容性清单的路径、schema 与 SHA256,运行时间、配置、包名与版本。
|
|
93
|
+
- `environment`:`node`(完整版本)、`nodeLine`(主版本)、`nodeLineDeclared`(是否为声明的 22.x 或 24.x)、`platform`、`arch`、`playwrightChannel`。
|
|
94
|
+
- 每项检查的 `id`、`label`、`owner`、`profile`、`status`(`pass`、`fail` 或 `skip`)、`durationMs`、`command`、`env`、`cwd` 与跳过或失败原因。
|
|
95
|
+
- `node-runtime` 的 `details`:`required`、`actual`、`line`、`declaredLine`、平台与架构。
|
|
96
|
+
- 浏览器检查的 `details.browser`:`report`(fixture 报告路径)、`requestedChannel`、`browserName`、`browserVersion`、`status`。浏览器 fixture 在 launch 后从驱动读取实际版本,因此证据包含真实浏览器版本和渠道,而不只是请求的渠道。
|
|
97
|
+
|
|
98
|
+
只有当前候选存在通过记录时,对应行才保持 Verified。发布记录引用发布运行生成的证据摘要。
|
|
99
|
+
|
|
100
|
+
## 维护
|
|
101
|
+
|
|
102
|
+
- 支持的运行时、peer 范围或环境变化时更新本矩阵,并在同一次修改中同步中英文版本。
|
|
103
|
+
- 包版本、协议修订、Demo 候选包或推荐安装范围变化时,更新 `compatibility-manifest.json`。
|
|
104
|
+
- `npm run check:versions` 检查兼容性页面的包版本和矩阵发布线与 `package.json` 一致。
|
|
105
|
+
- 发布前运行 `npm run support:verify -- --profile release`;需要覆盖未声明浏览器时另跑 `--profile optional`。
|
|
106
|
+
- 只有当前候选的通过记录才能把行标为 Verified;部分运行、失败或跳过的运行不改变等级。历史记录留在“最近记录”列,不随候选更新覆盖。
|
|
107
|
+
- 外部检查在各自所属仓库运行。
|
|
108
|
+
- 保持检查 ID 稳定。`docs-matrix` 检查两份文档是否都包含全部 ID。
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Support matrix
|
|
2
|
+
|
|
3
|
+
**English** · [中文](support-matrix-ch.md)
|
|
4
|
+
|
|
5
|
+
This matrix defines public support for `reactive-md@0.9.2`, `reactive-md-editor@0.2.1` and the paired Demo candidate. See [Versions and compatibility](compatibility-en.md) for the package pair.
|
|
6
|
+
|
|
7
|
+
## Support levels
|
|
8
|
+
|
|
9
|
+
| Level | Definition |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Verified | A passing candidate check covers the listed version or environment. |
|
|
12
|
+
| Declared | The range and acceptance check are defined. The release evidence records the result for the candidate. |
|
|
13
|
+
| Unverified | The environment awaits verification. |
|
|
14
|
+
| Not supported | Outside the current support scope. |
|
|
15
|
+
|
|
16
|
+
The package requires Node 22.12.0 or newer. This release line verifies the listed Node 22.x and 24.x versions. React and Vite peer ranges are installation constraints. The table gives the tested versions. A complete run records the three source revisions, the compatibility manifest digest and per-check results in `artifacts/support/latest.json`.
|
|
17
|
+
|
|
18
|
+
## Support matrix
|
|
19
|
+
|
|
20
|
+
| Area | Scope | Level | Check | Verification |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| `Node.js` | 22.x (minimum 22.12.0) | Verified | `node-runtime` | The full engine check passed on 22.17.0. |
|
|
23
|
+
| `Node.js` | 24.x | Verified | `node-runtime` | Release validation uses 24.22.2. |
|
|
24
|
+
| React / react-dom | Peer `^19.0.0` | Verified | `react-range` | Tested with `19.3.1`. The editor requires React 19. |
|
|
25
|
+
| Vite | Optional peer `^8.0.0` for `reactive-md/vite` | Verified | `vite-range` | Tested with `8.3.5`. |
|
|
26
|
+
| Playwright Chromium | Bundled browser | Verified | `playwright-chromium-core` | Tested with `156.0.8078.4`. Run the check separately. |
|
|
27
|
+
| Google Chrome | Chrome channel on Windows | Verified | `chrome-core` | Engine fixture tested with `157.0.8103.80`. |
|
|
28
|
+
| Microsoft Edge | Edge channel on Windows | Verified | `edge-core` | Engine fixture tested with `135.0.3179.66`. |
|
|
29
|
+
| Playwright Firefox | Bundled browser | Unverified | `firefox-core` | The optional check can run separately. |
|
|
30
|
+
| Playwright WebKit | Bundled browser | Unverified | `webkit-core` | The optional check can run separately. Safari requires its own device check. |
|
|
31
|
+
| Safari | Apple devices | Unverified | none | Device verification is pending. |
|
|
32
|
+
| Desktop layout | Desktop browser | Declared | `demo-smoke` | The Demo smoke check covers 1440 px in Edge. |
|
|
33
|
+
| Narrow layout | Narrow viewport | Declared | `demo-smoke` | The Demo smoke check covers 390 px in Edge. |
|
|
34
|
+
| Static SSR | `react-dom/server` | Verified | `ssr-static` | The packed consumer verifies server-rendered markup. |
|
|
35
|
+
| Single-file HTML export | `reactive-md-html/v1` | Declared | `demo-smoke` | The Demo smoke check builds the file and opens it offline in Edge. |
|
|
36
|
+
| Interactive single-file HTML | Inline `reactive-md-html/v1` runtime | Declared | `demo-smoke` | The Demo smoke check operates the slider offline and checks the resulting content. |
|
|
37
|
+
| General SSR hydration | Host-managed hydration | Not supported | none | See interactive single-file HTML for the supported boot path. |
|
|
38
|
+
| Engine Worker | `LocalCompileScheduler` and `LocalCompileWorker` | Verified | `worker-unit` | The Worker unit suite passed. |
|
|
39
|
+
| Editor analysis Worker | CodeMirror analysis Worker | Declared | `editor-pack` | The packed consumer checks the Worker asset and its imports. |
|
|
40
|
+
| PDF | `reactive-md/pdf` | Verified | `pdf-static` | Tested with bundled Chromium and `pdftotext`. |
|
|
41
|
+
| Editor package | `reactive-md-editor` 0.2.1 | Declared | `editor-pack` | Peer range `^0.9.2`. Packed-consumer checks cover SSR, the Worker and NodeNext declarations. |
|
|
42
|
+
| Compatibility manifest | Cross-repository release candidates | Declared | `compatibility-manifest` | Checks the versions, recommended install set, tarballs and lockfile integrity. |
|
|
43
|
+
|
|
44
|
+
## Verification checks
|
|
45
|
+
|
|
46
|
+
| Check | Profile | Owner | Command |
|
|
47
|
+
| --- | --- | --- | --- |
|
|
48
|
+
| `node-runtime` | fast | engine | `built-in` |
|
|
49
|
+
| `react-range` | fast | engine | `built-in` |
|
|
50
|
+
| `vite-range` | fast | engine | `built-in` |
|
|
51
|
+
| `docs-matrix` | fast | engine | `built-in` |
|
|
52
|
+
| `documented-versions` | fast | engine | `node scripts/check-versions.mjs` |
|
|
53
|
+
| `worker-unit` | fast | engine | `npm run test -- tests/local-compile-worker.test.ts` |
|
|
54
|
+
| `compatibility-manifest` | release | engine | `node scripts/verify-compatibility-manifest.mjs --require-workspace` |
|
|
55
|
+
| `chrome-core` | release | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=chrome node scripts/verify-required-form-browser.mjs` |
|
|
56
|
+
| `edge-core` | release | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=msedge node scripts/verify-required-form-browser.mjs` |
|
|
57
|
+
| `ssr-static` | release | engine | `npm run test:boundary` after `npm run build` |
|
|
58
|
+
| `pdf-static` | release | engine | `node scripts/verify-pdf.mjs` |
|
|
59
|
+
| `demo-smoke` | release | demo | `cd ../ReactiveMD-Demo && PLAYWRIGHT_CHANNEL=msedge npm run test:browser:smoke` |
|
|
60
|
+
| `editor-pack` | release | editor | `cd ../ReactiveMD-Editor && npm run check` |
|
|
61
|
+
| `playwright-chromium-core` | optional | engine | `PLAYWRIGHT_ENGINE=chromium PLAYWRIGHT_CHANNEL=chromium node scripts/verify-required-form-browser.mjs` |
|
|
62
|
+
| `firefox-core` | optional | engine | `PLAYWRIGHT_ENGINE=firefox node scripts/verify-required-form-browser.mjs` |
|
|
63
|
+
| `webkit-core` | optional | engine | `PLAYWRIGHT_ENGINE=webkit node scripts/verify-required-form-browser.mjs` |
|
|
64
|
+
|
|
65
|
+
## Running checks
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm run support:verify
|
|
69
|
+
npm run support:verify -- --profile release
|
|
70
|
+
npm run support:verify -- --profile optional
|
|
71
|
+
npm run compatibility:verify
|
|
72
|
+
npm run support:verify -- --only chrome-core
|
|
73
|
+
npm run support:verify -- --only edge-core
|
|
74
|
+
npm run support:verify -- --only playwright-chromium-core
|
|
75
|
+
npm run support:verify -- --only firefox-core
|
|
76
|
+
npm run support:verify -- --only webkit-core
|
|
77
|
+
npm run support:verify -- --only pdf-static
|
|
78
|
+
npm run support:verify -- --include-external --only demo-smoke
|
|
79
|
+
npm run support:verify -- --only node-runtime --out artifacts/support/node24.json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The default run uses the `fast` profile: the built-in checks, the documented-version check and the Worker unit suite, with no browser, build output or sibling checkout. `--profile release` runs every fast check and then the release checks: the compatibility manifest, the Chrome and Edge engine fixtures, SSR, PDF, and the external checks owned by the Demo and editor repositories. `--profile optional` runs only the undeclared or extra-download environments: bundled Playwright Chromium, Firefox and WebKit. `--profile all` runs every check.
|
|
83
|
+
|
|
84
|
+
`--only <id>` limits a run to the named checks. A check named by `--only` is an explicit request: a missing sibling checkout, a missing `pdftotext` or missing build output is a failure, not a silent skip. A profile run may skip an optional environment it cannot exercise, and the skip reason is written to the evidence. `--include-external` runs the checks owned by the Demo and editor repositories in their own checkouts; without it those checks skip in profile runs and fail when named by `--only`. `--out <path>` writes the evidence to that path without touching `artifacts/support/latest.json` or the timestamped archive. `--list` prints every check ID with its profile, owner and command and runs nothing. For the Node 24 run, invoke the same script with the Node 24 `node` binary.
|
|
85
|
+
|
|
86
|
+
`npm run compatibility:verify` checks the manifest directly and requires the editor and Demo checkouts.
|
|
87
|
+
|
|
88
|
+
## Evidence
|
|
89
|
+
|
|
90
|
+
Each run writes a timestamped record under `artifacts/support/` and updates `artifacts/support/latest.json`; the directory is gitignored. Records use the `reactive-md-support-evidence/v2` schema and contain:
|
|
91
|
+
|
|
92
|
+
- The package name, version, source commit and dirty flag for the engine, editor and Demo; the compatibility manifest path, schema and SHA256; the run time, profile, package name and version.
|
|
93
|
+
- `environment`: `node` (exact version), `nodeLine` (major), `nodeLineDeclared` (whether the run is on the declared 22.x or 24.x line), `platform`, `arch` and `playwrightChannel`.
|
|
94
|
+
- For each check, `id`, `label`, `owner`, `profile`, `status` (`pass`, `fail` or `skip`), `durationMs`, `command`, `env`, `cwd`, and the skip or failure reason.
|
|
95
|
+
- `node-runtime` `details`: `required`, `actual`, `line`, `declaredLine`, platform and architecture.
|
|
96
|
+
- Browser checks add `details.browser`: `report` (the fixture report path), `requestedChannel`, `browserName`, `browserVersion` and `status`. The fixture reads the actual version from the driver after launch, so the evidence names a real browser version and channel rather than only the requested channel.
|
|
97
|
+
|
|
98
|
+
A row stays Verified only while a passing record exists for the current candidate. Release records reference the evidence summary from the release run.
|
|
99
|
+
|
|
100
|
+
## Maintenance
|
|
101
|
+
|
|
102
|
+
- Update the matrix when supported engines, peer ranges or environments change, and update both language versions in the same change.
|
|
103
|
+
- Update `compatibility-manifest.json` when a package version, protocol revision, Demo candidate or recommended install range changes.
|
|
104
|
+
- `npm run check:versions` checks that the compatibility page package version and the matrix release line match `package.json`.
|
|
105
|
+
- Run `npm run support:verify -- --profile release` before a release; run `--profile optional` separately to cover undeclared browsers.
|
|
106
|
+
- Mark a row Verified only from a passing record for the current candidate; a partial, failed or skipped run leaves the level unchanged. Historical results stay in the "Latest record" column and are not overwritten by a new candidate.
|
|
107
|
+
- Run external checks in their owning repository.
|
|
108
|
+
- Keep check IDs stable. The `docs-matrix` check verifies that both language versions contain every ID.
|