reactive-md 0.6.1 → 0.8.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.
Files changed (471) hide show
  1. package/CHANGELOG-ch.md +66 -0
  2. package/CHANGELOG.md +66 -0
  3. package/CONTRIBUTING-ch.md +6 -62
  4. package/CONTRIBUTING.md +5 -63
  5. package/README-ch.md +232 -67
  6. package/README-en.md +209 -71
  7. package/README.md +209 -71
  8. package/SECURITY-ch.md +3 -1
  9. package/SECURITY.md +3 -1
  10. package/THIRD_PARTY_NOTICES.md +1909 -87
  11. package/cli/args.mjs +33 -1
  12. package/cli/build.mjs +62 -1
  13. package/cli/check.mjs +444 -0
  14. package/cli/help.mjs +181 -3
  15. package/cli/init.mjs +1577 -0
  16. package/cli/main.mjs +11 -1
  17. package/cli/package-loader.mjs +41 -0
  18. package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
  19. package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
  20. package/dist-library/compiler--ea2CKQF.js +61 -0
  21. package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
  22. package/dist-library/component-state-Cq2K5gkS.js +490 -0
  23. package/dist-library/component-state-D_cw_EHe.js +54 -0
  24. package/dist-library/config-validation-DXTynAw7.js +3005 -0
  25. package/dist-library/default-components-Z_YMio5P.js +2346 -0
  26. package/dist-library/identity-MYJXKSkB.js +1443 -0
  27. package/dist-library/math-display-BJz4gbFc.js +24000 -0
  28. package/dist-library/math-sample-BGEW49zY.js +1124 -0
  29. package/dist-library/options-CX5m5n-J.js +115 -0
  30. package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
  31. package/dist-library/props-DGlBk0e5.js +183 -0
  32. package/dist-library/react-ByOHunUW.js +122 -0
  33. package/dist-library/reactive-md-authoring.js +712 -1077
  34. package/dist-library/reactive-md-build.js +7966 -0
  35. package/dist-library/reactive-md-compiler-standard.js +33 -0
  36. package/dist-library/reactive-md-compiler.js +22 -0
  37. package/dist-library/reactive-md-default-packs.js +71 -0
  38. package/dist-library/reactive-md-default-preset.js +10 -0
  39. package/dist-library/reactive-md-export.js +111 -0
  40. package/dist-library/reactive-md-print.css +18 -3
  41. package/dist-library/reactive-md-react-runtime.js +251 -0
  42. package/dist-library/reactive-md-react-server.js +55 -0
  43. package/dist-library/reactive-md-react-unstyled.js +9 -1
  44. package/dist-library/reactive-md-react.js +9 -1
  45. package/dist-library/reactive-md-runtime-browser.js +51 -0
  46. package/dist-library/reactive-md-runtime.js +3 -0
  47. package/dist-library/reactive-md-sdk.js +6 -0
  48. package/dist-library/reactive-md-standalone-host.js +442 -0
  49. package/dist-library/reactive-md-testing-browser.js +523 -0
  50. package/dist-library/reactive-md-testing-react.js +221 -0
  51. package/dist-library/reactive-md-testing.js +638 -0
  52. package/dist-library/reactive-md-vite.js +959 -0
  53. package/dist-library/reactive-md.css +1 -1
  54. package/dist-library/reactive-md.js +1080 -795
  55. package/dist-library/registry-B9Jc3FVe.js +1174 -0
  56. package/dist-library/resources-BGt8mpDA.js +204 -0
  57. package/dist-library/runtime-C-sbfpOX.js +1157 -0
  58. package/dist-library/runtime-Dkq7ldyg.js +172 -0
  59. package/dist-library/schema-ZFufO8V0.js +39 -0
  60. package/dist-library/shareable-DDVL4Fi9.js +844 -0
  61. package/dist-library/types/authoring/catalog.d.ts +168 -0
  62. package/dist-library/types/authoring/conformance.d.ts +24 -0
  63. package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
  64. package/dist-library/types/authoring/extensions.d.ts +13 -0
  65. package/dist-library/types/authoring/index.d.ts +14 -11
  66. package/dist-library/types/authoring/insert.d.ts +16 -0
  67. package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
  68. package/dist-library/types/authoring/templates.d.ts +65 -0
  69. package/dist-library/types/build/diagnostics.d.ts +8 -0
  70. package/dist-library/types/build/digest.d.ts +5 -0
  71. package/dist-library/types/build/entry.d.ts +9 -0
  72. package/dist-library/types/build/host.d.ts +36 -0
  73. package/dist-library/types/build/index.d.ts +99 -0
  74. package/dist-library/types/build/notices.d.ts +29 -0
  75. package/dist-library/types/build/resources.d.ts +60 -0
  76. package/dist-library/types/build/vite.d.ts +15 -0
  77. package/dist-library/types/compiler/index.d.ts +22 -0
  78. package/dist-library/types/compiler/result.d.ts +30 -0
  79. package/dist-library/types/compiler/standard.d.ts +16 -0
  80. package/dist-library/types/compiler/types.d.ts +69 -0
  81. package/dist-library/types/components/chart-motion.d.ts +12 -0
  82. package/dist-library/types/components/controls.d.ts +21 -0
  83. package/dist-library/types/{local → components}/data-table.d.ts +10 -24
  84. package/dist-library/types/components/default-chart-types.d.ts +22 -0
  85. package/dist-library/types/components/default-chart.d.ts +2 -0
  86. package/dist-library/types/components/default-preset.d.ts +10 -0
  87. package/dist-library/types/components/diagram-inspector.d.ts +24 -0
  88. package/dist-library/types/components/gallery.d.ts +6 -0
  89. package/dist-library/types/components/layout.d.ts +23 -0
  90. package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
  91. package/dist-library/types/components/mafs-visuals.d.ts +40 -0
  92. package/dist-library/types/components/numeric-sliders.d.ts +3 -0
  93. package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
  94. package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
  95. package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
  96. package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
  97. package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
  98. package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
  99. package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
  100. package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
  101. package/dist-library/types/components/use-hydrated.d.ts +6 -0
  102. package/dist-library/types/components/visuals.d.ts +13 -0
  103. package/dist-library/types/export/component-state.d.ts +39 -0
  104. package/dist-library/types/export/index.d.ts +47 -0
  105. package/dist-library/types/export/requirements.d.ts +23 -0
  106. package/dist-library/types/export/resources.d.ts +8 -0
  107. package/dist-library/types/export/restoration.d.ts +52 -0
  108. package/dist-library/types/index.d.ts +1 -0
  109. package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
  110. package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
  111. package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
  112. package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
  113. package/dist-library/types/local/compilation/compiler.d.ts +34 -0
  114. package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
  115. package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
  116. package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
  117. package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
  118. package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
  119. package/dist-library/types/local/configuration/options-core.d.ts +120 -0
  120. package/dist-library/types/local/configuration/options.d.ts +17 -0
  121. package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
  122. package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
  123. package/dist-library/types/local/configuration/schema.d.ts +12 -0
  124. package/dist-library/types/local/contracts/types.d.ts +519 -0
  125. package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
  126. package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
  127. package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
  128. package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
  129. package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
  130. package/dist-library/types/local/evaluation/math.d.ts +73 -0
  131. package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
  132. package/dist-library/types/local/html/html-details.d.ts +16 -0
  133. package/dist-library/types/local/html/html-entities.d.ts +7 -0
  134. package/dist-library/types/local/html/html-policy.d.ts +43 -0
  135. package/dist-library/types/local/html/html-recovery.d.ts +16 -0
  136. package/dist-library/types/local/html/html-table-names.d.ts +9 -0
  137. package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
  138. package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
  139. package/dist-library/types/local/index.d.ts +31 -24
  140. package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
  141. package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
  142. package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
  143. package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
  144. package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
  145. package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
  146. package/dist-library/types/local/parsing/lexical.d.ts +21 -0
  147. package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
  148. package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
  149. package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
  150. package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
  151. package/dist-library/types/local/parsing/parser.d.ts +16 -0
  152. package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
  153. package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
  154. package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
  155. package/dist-library/types/local/rendering/render-types.d.ts +57 -0
  156. package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
  157. package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
  158. package/dist-library/types/local/runtime/runtime.d.ts +34 -0
  159. package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
  160. package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
  161. package/dist-library/types/local/session/incremental.d.ts +48 -0
  162. package/dist-library/types/local/session/parse-session.d.ts +62 -0
  163. package/dist-library/types/local/session/row-reuse.d.ts +46 -0
  164. package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
  165. package/dist-library/types/local/source/node-walk.d.ts +3 -0
  166. package/dist-library/types/local/source/source-context.d.ts +63 -0
  167. package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
  168. package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
  169. package/dist-library/types/local/theme/theme-name.d.ts +3 -0
  170. package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
  171. package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
  172. package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
  173. package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
  174. package/dist-library/types/local/transport/shared-data.d.ts +10 -0
  175. package/dist-library/types/local/transport/worker.d.ts +265 -0
  176. package/dist-library/types/local/widgets/visuals.d.ts +25 -0
  177. package/dist-library/types/presets/default-authoring.d.ts +50 -0
  178. package/dist-library/types/presets/default-components.d.ts +4 -0
  179. package/dist-library/types/presets/default-semantics.d.ts +8 -0
  180. package/dist-library/types/presets/default.d.ts +11 -0
  181. package/dist-library/types/presets/identity.d.ts +7 -0
  182. package/dist-library/types/presets/packs.d.ts +4 -0
  183. package/dist-library/types/react/component-api.d.ts +260 -0
  184. package/dist-library/types/react/component-primitives.d.ts +21 -0
  185. package/dist-library/types/react/component-utils.d.ts +125 -0
  186. package/dist-library/types/react/default-theme.d.ts +6 -0
  187. package/dist-library/types/react/field-validation.d.ts +11 -0
  188. package/dist-library/types/react/index.d.ts +17 -5
  189. package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
  190. package/dist-library/types/react/package.d.ts +69 -0
  191. package/dist-library/types/react/runtime/common.d.ts +4 -0
  192. package/dist-library/types/react/runtime/index.d.ts +8 -0
  193. package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
  194. package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
  195. package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
  196. package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
  197. package/dist-library/types/react/sdk.d.ts +110 -0
  198. package/dist-library/types/react/server.d.ts +15 -0
  199. package/dist-library/types/react/tooltip-layer.d.ts +10 -0
  200. package/dist-library/types/react/use-draft-field.d.ts +17 -0
  201. package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
  202. package/dist-library/types/runtime-services/component-state.d.ts +152 -0
  203. package/dist-library/types/runtime-services/identity.d.ts +41 -0
  204. package/dist-library/types/runtime-services/index.d.ts +10 -0
  205. package/dist-library/types/runtime-services/random.d.ts +42 -0
  206. package/dist-library/types/runtime-services/runtime.d.ts +51 -0
  207. package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
  208. package/dist-library/types/sdk/assembly.d.ts +73 -0
  209. package/dist-library/types/sdk/compat-profile.d.ts +57 -0
  210. package/dist-library/types/sdk/compiler-config.d.ts +33 -0
  211. package/dist-library/types/sdk/config-validation.d.ts +33 -0
  212. package/dist-library/types/sdk/config.d.ts +35 -0
  213. package/dist-library/types/sdk/hash.d.ts +9 -0
  214. package/dist-library/types/sdk/index.d.ts +10 -0
  215. package/dist-library/types/sdk/manifest.d.ts +49 -0
  216. package/dist-library/types/sdk/pattern.d.ts +11 -0
  217. package/dist-library/types/sdk/preset-core.d.ts +11 -0
  218. package/dist-library/types/sdk/preset.d.ts +9 -0
  219. package/dist-library/types/sdk/props.d.ts +33 -0
  220. package/dist-library/types/sdk/registry-core.d.ts +16 -0
  221. package/dist-library/types/sdk/registry.d.ts +18 -0
  222. package/dist-library/types/sdk/theme.d.ts +73 -0
  223. package/dist-library/types/sdk/types.d.ts +221 -0
  224. package/dist-library/types/sdk/version.d.ts +49 -0
  225. package/dist-library/types/shareable.d.ts +29 -3
  226. package/dist-library/types/standalone/diagnostics.d.ts +16 -0
  227. package/dist-library/types/standalone/events.d.ts +4 -0
  228. package/dist-library/types/standalone/library.d.ts +6 -0
  229. package/dist-library/types/standalone/payload.d.ts +15 -0
  230. package/dist-library/types/standalone/prepare.d.ts +21 -0
  231. package/dist-library/types/standalone/session.d.ts +68 -0
  232. package/dist-library/types/standalone/version.d.ts +7 -0
  233. package/dist-library/types/testing/behavior.d.ts +19 -0
  234. package/dist-library/types/testing/browser.d.ts +126 -0
  235. package/dist-library/types/testing/cases.d.ts +16 -0
  236. package/dist-library/types/testing/index.d.ts +13 -0
  237. package/dist-library/types/testing/manifest.d.ts +10 -0
  238. package/dist-library/types/testing/react.d.ts +45 -0
  239. package/dist-library/types/testing/report.d.ts +20 -0
  240. package/dist-library/types/testing/types.d.ts +125 -0
  241. package/dist-library/types/testing/values.d.ts +22 -0
  242. package/dist-library/types/vite/client.d.ts +36 -0
  243. package/dist-library/types/vite/discovery.d.ts +51 -0
  244. package/dist-library/types/vite/index.d.ts +31 -0
  245. package/dist-library/types/vite/registration.d.ts +109 -0
  246. package/dist-library/types-BFCrMrg0.js +52 -0
  247. package/dist-library/validation-W-bmny-x.js +2253 -0
  248. package/dist-library/values-CIt8AjiU.js +134 -0
  249. package/dist-standalone/reactive-md-standalone.css +1 -1
  250. package/dist-standalone/reactive-md-standalone.js +591 -95
  251. package/docs/README-ch.md +90 -0
  252. package/docs/README.md +87 -81
  253. package/docs/compatibility/compatibility-ch.md +22 -14
  254. package/docs/compatibility/compatibility-en.md +22 -14
  255. package/docs/compatibility/source-versioning-ch.md +15 -12
  256. package/docs/compatibility/source-versioning-en.md +16 -13
  257. package/docs/development/component-development-ch.md +51 -195
  258. package/docs/development/component-development-en.md +51 -195
  259. package/docs/development/component-development-reference-ch.md +253 -0
  260. package/docs/development/component-development-reference-en.md +238 -0
  261. package/docs/development/component-protocol-ch.md +51 -50
  262. package/docs/development/component-protocol-en.md +52 -49
  263. package/docs/development/local-module-layout-ch.md +59 -0
  264. package/docs/development/local-module-layout-en.md +59 -0
  265. package/docs/development/performance-overview-ch.md +402 -0
  266. package/docs/development/performance-overview-en.md +402 -0
  267. package/docs/development/releasing-ch.md +8 -104
  268. package/docs/development/releasing-en.md +8 -104
  269. package/docs/guides/local-guide-ch.md +28 -9
  270. package/docs/guides/local-guide-en.md +31 -12
  271. package/docs/integration/author-tools-ch.md +4 -2
  272. package/docs/integration/author-tools-en.md +4 -2
  273. package/docs/integration/codemirror-ch.md +52 -0
  274. package/docs/integration/codemirror-en.md +29 -0
  275. package/docs/integration/compiler-ch.md +47 -0
  276. package/docs/integration/compiler-en.md +34 -0
  277. package/docs/integration/directory-discovery-ch.md +53 -0
  278. package/docs/integration/directory-discovery-en.md +31 -0
  279. package/docs/integration/editor-ch.md +48 -21
  280. package/docs/integration/editor-en.md +48 -21
  281. package/docs/integration/extension-sdk-ch.md +392 -0
  282. package/docs/integration/extension-sdk-en.md +377 -0
  283. package/docs/integration/local-integration-ch.md +63 -9
  284. package/docs/integration/local-integration-en.md +89 -13
  285. package/docs/integration/repository-split-ch.md +40 -0
  286. package/docs/integration/repository-split-en.md +23 -0
  287. package/docs/integration/shareable-export-ch.md +46 -2
  288. package/docs/integration/shareable-export-en.md +46 -2
  289. package/docs/reference/computations-formatting-ch.md +4 -2
  290. package/docs/reference/computations-formatting-en.md +4 -2
  291. package/docs/reference/constraints-collections-ch.md +21 -1
  292. package/docs/reference/constraints-collections-en.md +21 -1
  293. package/docs/reference/diagnostics-counting-ch.md +1 -1
  294. package/docs/reference/diagnostics-counting-en.md +1 -1
  295. package/docs/reference/html-compatibility-ch.md +4 -0
  296. package/docs/reference/html-compatibility-en.md +4 -0
  297. package/docs/reference/local-components-v2-ch.md +2 -0
  298. package/docs/reference/local-components-v2-en.md +2 -0
  299. package/docs/reference/local-interaction-syntax-ch.md +51 -15
  300. package/docs/reference/local-interaction-syntax-en.md +58 -14
  301. package/docs/reference/theme-protocol-ch.md +79 -7
  302. package/docs/reference/theme-protocol-en.md +79 -7
  303. package/docs/reference/tolerance-ch.md +64 -0
  304. package/docs/reference/tolerance-en.md +57 -0
  305. package/docs/releases/release-0.4.0-ch.md +2 -0
  306. package/docs/releases/release-0.4.0-en.md +2 -0
  307. package/docs/releases/release-0.4.1-ch.md +2 -0
  308. package/docs/releases/release-0.4.1-en.md +2 -0
  309. package/docs/releases/release-0.5.0-ch.md +2 -0
  310. package/docs/releases/release-0.5.0-en.md +2 -0
  311. package/docs/releases/release-0.5.1-ch.md +2 -0
  312. package/docs/releases/release-0.5.1-en.md +2 -0
  313. package/docs/releases/release-0.5.2-ch.md +2 -0
  314. package/docs/releases/release-0.5.2-en.md +2 -0
  315. package/docs/releases/release-0.5.3-ch.md +2 -0
  316. package/docs/releases/release-0.5.3-en.md +2 -0
  317. package/docs/releases/release-0.6.0-ch.md +2 -0
  318. package/docs/releases/release-0.6.0-en.md +2 -0
  319. package/docs/releases/release-0.6.1-ch.md +2 -0
  320. package/docs/releases/release-0.6.1-en.md +2 -0
  321. package/docs/releases/release-0.7.0-ch.md +86 -0
  322. package/docs/releases/release-0.7.0-en.md +86 -0
  323. package/docs/releases/release-0.8.0-ch.md +126 -0
  324. package/docs/releases/release-0.8.0-en.md +126 -0
  325. package/examples/component-package/LICENSE +21 -0
  326. package/examples/component-package/NOTICES.md +12 -0
  327. package/examples/component-package/README-ch.md +101 -0
  328. package/examples/component-package/README.md +133 -0
  329. package/examples/component-package/package.json +35 -0
  330. package/examples/component-package/sample/document.reactive.md +14 -0
  331. package/examples/component-package/scripts/build-export.mjs +44 -0
  332. package/examples/component-package/scripts/build.mjs +130 -0
  333. package/examples/component-package/scripts/verify.mjs +257 -0
  334. package/examples/component-package/src/assets/notice.svg +4 -0
  335. package/examples/component-package/src/component.css +40 -0
  336. package/examples/component-package/src/components.tsx +105 -0
  337. package/examples/component-package/src/harness.tsx +34 -0
  338. package/examples/component-package/src/manifests.ts +71 -0
  339. package/examples/component-package/src/node-entry.ts +18 -0
  340. package/examples/component-package/src/sample.ts +4 -0
  341. package/examples/component-package/src/theme.css +44 -0
  342. package/examples/component-package/src/theme.ts +22 -0
  343. package/examples/component-package/tsconfig.json +15 -0
  344. package/examples/conformance/README-ch.md +55 -0
  345. package/examples/conformance/README.md +2 -0
  346. package/examples/conformance/local-draft-3.json +296 -0
  347. package/examples/game-2048-package/LICENSE +21 -0
  348. package/examples/game-2048-package/NOTICES.md +11 -0
  349. package/examples/game-2048-package/README-ch.md +97 -0
  350. package/examples/game-2048-package/README.md +102 -0
  351. package/examples/game-2048-package/package.json +35 -0
  352. package/examples/game-2048-package/sample/document.reactive.md +17 -0
  353. package/examples/game-2048-package/scripts/build-export.mjs +44 -0
  354. package/examples/game-2048-package/scripts/build.mjs +130 -0
  355. package/examples/game-2048-package/scripts/verify.mjs +180 -0
  356. package/examples/game-2048-package/src/component.css +161 -0
  357. package/examples/game-2048-package/src/components.tsx +326 -0
  358. package/examples/game-2048-package/src/game-engine.ts +228 -0
  359. package/examples/game-2048-package/src/harness.tsx +34 -0
  360. package/examples/game-2048-package/src/manifest.ts +85 -0
  361. package/examples/game-2048-package/src/node-entry.ts +30 -0
  362. package/examples/game-2048-package/src/sample.ts +4 -0
  363. package/examples/game-2048-package/tsconfig.json +15 -0
  364. package/examples/integration/README-ch.md +63 -0
  365. package/examples/integration/README.md +17 -1
  366. package/examples/integration/extension-sdk/README-ch.md +24 -0
  367. package/examples/integration/extension-sdk/README.md +24 -0
  368. package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
  369. package/examples/integration/extension-sdk/advanced.tsx +101 -0
  370. package/examples/integration/extension-sdk/env.d.ts +2 -0
  371. package/examples/integration/extension-sdk/extensions.tsx +97 -0
  372. package/examples/integration/extension-sdk/index.html +3 -0
  373. package/examples/integration/extension-sdk/main.tsx +10 -0
  374. package/examples/integration/extension-sdk/package.json +6 -0
  375. package/examples/integration/extension-sdk/standalone.ts +7 -0
  376. package/examples/integration/extension-sdk/tsconfig.json +8 -0
  377. package/examples/integration/react-comprehensive/index.html +12 -0
  378. package/examples/integration/react-comprehensive/main.jsx +123 -0
  379. package/examples/integration/react-comprehensive/package.json +18 -0
  380. package/examples/local/README-ch.md +76 -0
  381. package/examples/local/README.md +4 -2
  382. package/examples/local/scenarios/blog-zh.reactive.md +71 -0
  383. package/examples/local/scenarios/blog.reactive.md +71 -0
  384. package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
  385. package/examples/local/scenarios/classroom.reactive.md +97 -0
  386. package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
  387. package/examples/local/scenarios/proposal.reactive.md +79 -0
  388. package/examples/local/scenarios/survey-zh.reactive.md +74 -0
  389. package/examples/local/scenarios/survey.reactive.md +74 -0
  390. package/examples/local/showcase/README-ch.md +22 -0
  391. package/examples/local/showcase/README.md +9 -3
  392. package/examples/local/showcase/features.reactive.md +637 -0
  393. package/examples/local/showcase/zh/features.reactive.md +637 -0
  394. package/examples/sci-fi-theme/README-ch.md +131 -0
  395. package/examples/sci-fi-theme/README.md +146 -0
  396. package/examples/sci-fi-theme/demo/demo.css +532 -0
  397. package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
  398. package/examples/sci-fi-theme/demo/index.html +13 -0
  399. package/examples/sci-fi-theme/demo/main.tsx +180 -0
  400. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
  401. package/examples/sci-fi-theme/docs/design-system.md +474 -0
  402. package/examples/sci-fi-theme/package.json +27 -0
  403. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
  404. package/examples/sci-fi-theme/src/components.css +1460 -0
  405. package/examples/sci-fi-theme/src/index.ts +6 -0
  406. package/examples/sci-fi-theme/src/sci-fi.css +5 -0
  407. package/examples/sci-fi-theme/src/theme.ts +37 -0
  408. package/examples/sci-fi-theme/src/tokens.css +408 -0
  409. package/examples/sci-fi-theme/tsconfig.json +20 -0
  410. package/examples/sci-fi-theme/vite.config.ts +24 -0
  411. package/examples/tetris-package/LICENSE +21 -0
  412. package/examples/tetris-package/NOTICES.md +11 -0
  413. package/examples/tetris-package/README-ch.md +91 -0
  414. package/examples/tetris-package/README.md +95 -0
  415. package/examples/tetris-package/package.json +35 -0
  416. package/examples/tetris-package/sample/document.reactive.md +16 -0
  417. package/examples/tetris-package/scripts/build-export.mjs +44 -0
  418. package/examples/tetris-package/scripts/build.mjs +130 -0
  419. package/examples/tetris-package/scripts/verify.mjs +173 -0
  420. package/examples/tetris-package/src/component.css +145 -0
  421. package/examples/tetris-package/src/components.tsx +334 -0
  422. package/examples/tetris-package/src/harness.tsx +34 -0
  423. package/examples/tetris-package/src/manifests.ts +93 -0
  424. package/examples/tetris-package/src/node-entry.ts +16 -0
  425. package/examples/tetris-package/src/sample.ts +4 -0
  426. package/examples/tetris-package/src/tetris-engine.ts +325 -0
  427. package/examples/tetris-package/tsconfig.json +15 -0
  428. package/package.json +98 -44
  429. package/dist-library/compiler-Cm3ppMxG.js +0 -46044
  430. package/dist-library/react-Bh7_oxZp.js +0 -59655
  431. package/dist-library/reactive-md-editor.css +0 -2
  432. package/dist-library/reactive-md-editor.js +0 -3853
  433. package/dist-library/runtime-DlFYQ4s_.js +0 -498
  434. package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
  435. package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
  436. package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
  437. package/dist-library/types/editor/extended-native-components.d.ts +0 -58
  438. package/dist-library/types/editor/index.d.ts +0 -9
  439. package/dist-library/types/editor/locale.d.ts +0 -13
  440. package/dist-library/types/editor/source-authoring.d.ts +0 -59
  441. package/dist-library/types/editor/types.d.ts +0 -48
  442. package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
  443. package/dist-library/types/editor/use-source-history.d.ts +0 -16
  444. package/dist-library/types/local/compiler.d.ts +0 -4
  445. package/dist-library/types/local/math.d.ts +0 -48
  446. package/dist-library/types/local/options.d.ts +0 -36
  447. package/dist-library/types/local/parser.d.ts +0 -13
  448. package/dist-library/types/local/render-types.d.ts +0 -27
  449. package/dist-library/types/local/runtime.d.ts +0 -2
  450. package/dist-library/types/local/schema.d.ts +0 -77
  451. package/dist-library/types/local/types.d.ts +0 -263
  452. package/dist-library/types/local/visuals.d.ts +0 -12
  453. package/dist-library/types/local/worker.d.ts +0 -98
  454. package/docs/development/performance-ch.md +0 -76
  455. package/docs/development/performance-en.md +0 -76
  456. /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
  457. /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
  458. /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
  459. /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
  460. /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
  461. /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
  462. /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
  463. /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
  464. /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
  465. /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
  466. /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
  467. /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
  468. /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
  469. /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
  470. /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
  471. /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
@@ -0,0 +1,402 @@
1
+ # Performance optimization and current measurement overview
2
+
3
+ **English** · [中文](performance-overview-ch.md)
4
+
5
+ Re-tested 2026-10-29. The full matrix records the row reuse, patch cost selection and CM6 single-editor migration of commit `4a8f1ea`; this round continues optimizing dynamic interpolation rows and deep nesting on top of that commit, with the targeted re-measurements listed separately in part two. The measurements were taken on the 0.6.1 codebase before the 0.7.0 release.
6
+
7
+ ## 1. Direction and outcome of each optimization round
8
+
9
+ The records below are as of each optimization. Cold compilation, steady-state editing and input-to-frame opportunity use different bases, so these numbers cannot be chained into a single speedup ratio. The full matrix and this round's targeted re-measurements are in part two.
10
+
11
+
12
+ | Commit | Direction | Optimization outcome at the time and basis |
13
+ | --- | --- | --- |
14
+ | ea80662 | Ordinary paragraphs produce a LocalNode directly; Markdown without replacements reuses the first-pass AST, avoiding duplicate parsing and per-character mapping | Relative to df59896, first compilation of 5000 ordinary paragraphs 517.4 → 87.0 ms; 100k paragraphs rejected under the default budget 16339.7 → 29.9 ms, peak RSS 1003.8 → 69.4 MiB; after raising the budget to 250k nodes, successful compilation 19918.7 → 2297.8 ms. All are first calls in an independent Node process. |
15
+ | 6ac6916 | Added a block-level incremental session that locates changes with Lezer TreeFragment and keeps unmodified blocks; wired into the Worker, fallback compilation and React component | Full and incremental measured as pairs in the same build, 3 warmups and 15 measurements. A 600-section article 1030.09 → 30.65 ms, compiling only 1 block and reusing 1799; 5000 ordinary paragraphs 60.20 → 15.99 ms. Establishing a session for the first time has additional cost. |
16
+ | fb05509 | Deferred block-cache rebuilds during consecutive component-context changes; fast scanning for simple lists and tables; fewer copies of private results | Compared against the production package saved before the change. 100-item list session edit 15.08 → 5.70 ms, 200×4 table 30.78 → 10.82 ms (21 measurements); of 200 consecutive context changes the last 199 build no index, and restoring the body builds one. |
17
+ | 658a3b6 | Contiguous range mapping and shared row index; per-block fast/general dispatch; direct node production and upfront budgets; parse and semantic caches; shared results, bidirectional Worker patches, runtime reuse and cancellable idle preparation | Relative to fb05509, inside a container a 256k-indented long line 9846.93 → 25.09 ms, 80 mixed blocks 82.21 → 39.61 ms. Browser component-context Worker 80 → 60 ms, body 29 → 11 ms. The dynamic list preview regressed once from 394.3 to 503.5 ms; patches for huge lists and tables are still close to full results. |
18
+ | 047b547 | 20 ms Demo debounce; retained preview and runtime, stable highlighting and reference keys; later top-level paragraphs use content-visibility:auto | Relative to the production package and Demo snapshot saved before that round's change, the old full editor's input-to-frame opportunity: 800 dynamic paragraphs 705.5 → 182.5 ms; 2400 paragraphs 2401.9 → 644.6 ms; 1000-row dynamic table 837.1 → 446.3 ms (median, 15 samples). The baseline already includes earlier optimizations and is not the original fb05509. |
19
+ | f7a7ab8 | Introduced CM6 and made it the Demo default; source creates DOM per viewport; shared Worker author analysis; fixed const/computed and HTML syntax highlighting, restored the old color scheme | Two editors on the same prototype package: 800 paragraphs input-to-frame opportunity 93.7 → 15.0 ms, source DOM 4015 → 294; 2400 paragraphs 301.7 → 24.0 ms, DOM 12015 → 294; 1000-row dynamic table 223.8 → 16.5 ms. These are prototype records; this round re-measured through the single CM6 entry point. |
20
+ | 4a8f1ea | The previous-block row plan avoids the 512-entry LRU order scan on eviction; keeps unmodified row IDs and objects, updating ranges on shifts; sends a full success result instead of an unprofitable patch; copies short strings in caches; removed the old textarea source editor | A/B, real preview DOM, cache memory and the CM6 full matrix are below. /editor and /editor/codemirror share components, styles and runtime; the old textareaRef/getTextarea are removed, and the document form textarea remains supported. |
21
+ | This round (based on 4a8f1ea) | Simple dynamic rows reuse the validated placeholder plan, and the first-pass masking scan also skips Markdown inside expressions; deep node traversal, snapshot publishing, dependency summaries, runtime and view indexing use explicit stacks; negotiated flat result transfer; deep single-child container chains use fewer React memo wrappers | Compilation and preview comparisons for dynamic lists and tables are in the targeted re-measurement. Real Edge passed compilation and transfer of 1000-level references, lists and mixed nesting, and deep preview edits preserve parameter 13; 1001-level Markdown is rejected by budget. |
22
+
23
+
24
+ This round also confirmed a cache retention problem: short row strings could indirectly reference the old full text. Before the fix, for the same 1000-item list, the post-GC heap grew from 23.52 to 27.54 MiB between edits 100 and 200; after copying cache keys and inline token text, an independent re-measurement gave 20.26 → 20.34 MiB. A formal 500-edit long-row measurement follows below.
25
+
26
+ The historical implementation basis includes Lezer's incremental fragments, GFM container rules and CM6 viewport management; these approaches fall back conservatively according to current semantics. Reference definitions, footnotes, HTML, BOM, declaration or container context changes and code delimiter changes can still trigger a full compilation. This round brings simple dynamic interpolation rows into the fast path; links, escapes, nesting and complex inline formatting continue to fall back per block.
27
+
28
+ ## 2. Current compilation and rendering performance overview
29
+
30
+ ### Measurement conditions and coverage
31
+
32
+ Node v22.17.0, Intel(R) Core(TM) Ultra 5 125H, Windows x64. Node stress scenarios use independent processes with a 1 GiB old-generation cap; the browser is Edge 135.0.3179.66 in headless mode at a 1440×1000 viewport. Daily development processes remain running on the machine; power policy and CPU frequency were not pinned. Performance scripts run serially.
33
+
34
+ Typically 3 warmups and 15 measurements; the long-line and dedicated over-budget cases use 5/3, and the independent browser Worker uses 2 warmups and 5 measurements; the summary data is authoritative. P95 uses the nearest rank, which equals the maximum sample at 15 samples and is used only to observe the tail. First calls, public snapshot copies, shared Worker results and main-thread rendering are recorded separately.
35
+
36
+ RSS is the process high-water mark and includes Node, modules, input and temporary objects; the post-GC heap is the retained amount, and the two are not interchangeable. JSON UTF-8 message size is an estimate; structured-clone cost is measured separately. Input-to-preview ends at the second requestAnimationFrame frame opportunity after commit; CDP Paint is a paint-phase event, and neither indicates GPU display completion. React phases overlap and cannot be summed.
37
+
38
+ ### This round's targeted re-measurement of dynamic rows and deep nesting
39
+
40
+ The baseline is the `4a8f1ea` production package saved at the start of this round, and post-change data comes from the final build; code hashes and condensed results are in `benchmarks/dynamic-depth-2026-10-29.json`. This round re-measured dynamic lists, dynamic tables, deep containers, protocol recovery and sustained-edit memory. The complete 45-scenario matrix and the other overview tables below retain the `4a8f1ea` measurements.
41
+
42
+ Each browser group uses 3 warmups and 15 measurements. Before-change samples are retained from this round's first paired measurement, and after-change samples were re-measured on the final build. The table shows median/P95 in ms. Input is driven by an independent textarea fixture to compare the Worker-to-React preview path; CM6 and deep preview get separate real-browser functional verification.
43
+
44
+ | Dynamic scenario | Worker compile, before → after | Input to preview frame opportunity, before → after | Median response size, before → after |
45
+ | --- | --- | --- | --- |
46
+ | 1000-item dynamic list | 268/342 → 175/253 | 339.6/408.9 → 280.6/396.7 | 15444 → 15453 B |
47
+ | 500-row dynamic table | 213/310 → 66/89 | 286/373.1 → 134.4/159.1 | 8688 → 8693 B |
48
+
49
+ Node in-process Worker-handler comparisons also use 3 warmups and 15 measurements; the table below lists only the compilation phase and excludes patch encoding, cloning or React.
50
+
51
+ | Scenario | Compile median/P95, before → after ms |
52
+ | --- | --- |
53
+ | 1000-item dynamic list, equal-length edit | 148/212 → 104/129 |
54
+ | 1000-item dynamic list, shift edit | 195/291 → 266/368 |
55
+ | 500-row dynamic table, equal-length edit | 111/202 → 86/106 |
56
+ | 500-row dynamic table, shift edit | 115/230 → 110/185 |
57
+
58
+ This batch's Node shift list regressed; a separate new-process comparison gave 324/508 → 124/255 ms. Both batches show clear jitter, so all raw results are kept and this round computes no unified speedup ratio. The browser table uses final-build measurements.
59
+
60
+ Deep Node comparisons use independent processes, 1 warmup and 3 measurements, through the public `compileLocal()` path. The component limit remains 100 levels and the Markdown limit 1000 levels; over-limit rows record rejection time.
61
+
62
+ | Scenario and result | Compile median, before → after ms | First-call peak RSS, before → after MiB |
63
+ | --- | --- | --- |
64
+ | containers-50, success | 37.38 → 16.87 | 71.28 → 67.26 |
65
+ | containers-100, success | 109.42 → 32.91 | 81.17 → 70.29 |
66
+ | containers-101, local.budget.nesting | 107.89 → 11.14 | 79.43 → 67.12 |
67
+ | containers-1000, local.budget.nesting | 4587.18 → 88.83 | 138.18 → 97.64 |
68
+ | markdown-depth-500, success | 10.25 → 12.37 | 67.17 → 67.19 |
69
+ | markdown-depth-1000, success | 22.29 → 20.08 | 77.91 → 76.86 |
70
+ | markdown-depth-1500, local.budget.markdown-depth | 3.19 → 2.8 | 64.17 → 64.04 |
71
+
72
+ 500-level blockquotes are slightly slower in this batch of Node measurements; the main gain of the deep work is fewer duplicate parses of component bodies, earlier termination of over-limit input, and removal of browser call-stack and result-transfer failures. A 1000-level list still takes hundreds of milliseconds, and general container parsing still has room for improvement.
73
+
74
+ The real Edge module Worker passed 100/500/1000-level blockquotes, 1000-level lists and 500 groups of mixed reference/list nesting, and leaf expressions were correct after deep edits. A corrupted flat frame recovers with exactly one full request, after which a 1001-level budget rejection and an ordinary document return to normal. CM6 and the React preview passed 500/1000-level references, 1000-level unordered/ordered lists and mixed nesting; the original DOM depth is preserved, the expression edited from `n * 2` to `n * 3` displays 39, the parameter stays 13, only one Worker is created, and page and console errors are empty.
75
+
76
+ The implementation includes three constraints: the fast plan validates placeholder positions and types produced by the current parse every time, and the first-pass expression masking plan only supplies Markdown facts and must not generate body nodes; deep results negotiate `flatResults: "flat-v1"` into flat records plus references, while ordinary documents keep the existing patches; single-child Markdown container chains above 32 levels build native wrappers iteratively, reducing React memo component layers while preserving native DOM structure. Copying, sharing, flat encoding/decoding, runtime indexing and view projection of 6000-level data have separate unit verification.
77
+
78
+ A 1000-item dynamic list edited 500 times consecutively: post-GC heap growth over edits 50–500 is 0.463 MiB, retained heap 18.146 MiB, and 13.095 MiB after releasing the session; the parse cache ends at 524 entries, still within the 672-entry cap.
79
+
80
+ The implementation references [Lezer's context and incremental reuse constraints](https://lezer.codemirror.net/docs/guide/) and [V8's iterative traversal approach](https://v8.dev/blog/json-stringify). Flat records reference [the object index table of @ungap/structured-clone](https://github.com/ungap/structured-clone/blob/main/esm/serialize.js); that implementation's visitor is still recursive, whereas this round implements iterative traversal for the compiler's ordinary data with no new dependency.
81
+
82
+ This round's gates: 116 core test files with 1534 tests and 16 Demo files with 254 tests pass; type checking, production/standalone/declaration builds, Demo builds, public package checks and offline packed consumption pass; documentation links and `git diff --check` pass. The deep stress unit tests set a separate 30-second timeout, and performance statistics come from production-package scripts.
83
+
84
+ Reproduce the targeted tests:
85
+
86
+ ```powershell
87
+ npm run build
88
+ node scripts/benchmark-row-reuse.mjs --case=dynamic --out=artifacts/dynamic-depth/rows-after-final.json
89
+ node scripts/verify-deep-worker-browser.mjs --preview
90
+ $env:EDITING_BEFORE="artifacts/dynamic-depth/before-library"
91
+ $env:EDITING_DYNAMIC_ROWS="1"
92
+ $env:EDITING_CASES="list,table"
93
+ node scripts/benchmark-editing-comparison.mjs
94
+ $env:EDITING_MEMORY_CASES="longRows"
95
+ $env:EDITING_MEMORY_REPORT="artifacts/dynamic-depth/dynamic-memory.json"
96
+ node scripts/benchmark-editing-memory.mjs
97
+ ```
98
+
99
+ Per-sample results and failure reproductions are kept in `artifacts/dynamic-depth/`. The old-package snapshot is a local artifact; re-running the comparison requires saving an identical baseline production package first.
100
+
101
+ ### Full compilation and extreme input (4a8f1ea, 45 scenarios)
102
+
103
+ Calls the public compileLocal; timing includes final result construction and excludes input generation, checking and GC. The node budget defaults to 10000; scenarios marked raised use 250000. Character counts are UTF-16 code units. Budget rejections are listed separately as expected outcomes, and all scenarios should exit normally.
104
+
105
+
106
+ | Scenario ID | Characters | Result / nodes | First ms | Steady-state median / P95 ms | First-call peak RSS MiB |
107
+ | --- | --- | --- | --- | --- | --- |
108
+ | plain-10000 | 10000 | success / 2 | 4.32 | 0.10 / 0.72 | 63.94 |
109
+ | plain-100000 | 100000 | success / 2 | 7.64 | 0.52 / 1.10 | 63.98 |
110
+ | plain-500000 | 500000 | success / 2 | 10.21 | 2.43 / 3.12 | 63.95 |
111
+ | plain-1000000 | 1000000 | success / 2 | 12.26 | 5.15 / 8.02 | 64.05 |
112
+ | plain-1000001 | 1000001 | local.budget.document | 1.13 | 0.02 / 0.05 | 63.98 |
113
+ | article-10 | 1598 | success / 161 | 45.67 | 6.94 / 16.27 | 65.85 |
114
+ | article-100 | 15550 | success / 1601 | 139.84 | 37.77 / 62.57 | 82.30 |
115
+ | article-600 | 94050 | success / 9601 | 479.75 | 301.98 / 369.22 | 138.63 |
116
+ | article-2000 | 315852 | local.budget.nodes | 889.29 | 781.91 / 864.21 | 175.77 |
117
+ | article-2000-raised | 315852 | success / 32001 | 1180.89 | 1105.17 / 1300.44 | 194.27 |
118
+ | controls-1000 | 68779 | success / 1000 | 224.98 | 136.66 / 160.26 | 113.53 |
119
+ | controls-5000 | 352779 | success / 5000 | 826.41 | 622.27 / 791.14 | 201.92 |
120
+ | controls-10000 | 707779 | success / 10000 | 1392.64 | 1647.63 / 2294.73 | 330.71 |
121
+ | controls-10001 | 707852 | local.budget.nodes | 170.43 | 120.53 / 131.25 | 108.06 |
122
+ | controls-12000 | 853779 | local.budget.nodes | 190.92 | 141.34 / 155.13 | 112.27 |
123
+ | controls-10000-raised | 707779 | success / 10000 | 1398.86 | 1414.88 / 1677.35 | 330.30 |
124
+ | controls-12000-raised | 853779 | success / 12000 | 1596.10 | 1780.85 / 2404.79 | 373.24 |
125
+ | shared-controls-5000 | 270000 | success / 5000 | 698.38 | 544.15 / 602.56 | 204.18 |
126
+ | conflicting-controls-5000 | 329999 | local.initial.duplicate-peers | 658.93 | 537.97 / 731.30 | 195.88 |
127
+ | expressions-1000 | 21960 | success / 4001 | 309.11 | 155.26 / 180.70 | 120.70 |
128
+ | expressions-5000 | 113960 | local.budget.nodes | 872.52 | 683.96 / 750.02 | 199.67 |
129
+ | expressions-5000-raised | 113960 | success / 20001 | 1026.15 | 864.84 / 979.29 | 213.87 |
130
+ | paragraphs-1000 | 6000 | success / 2000 | 22.82 | 8.46 / 14.96 | 66.13 |
131
+ | paragraphs-5000 | 30000 | success / 10000 | 74.83 | 53.12 / 65.57 | 83.64 |
132
+ | paragraphs-10000 | 60000 | local.budget.nodes | 9.50 | 1.64 / 2.45 | 64.39 |
133
+ | paragraphs-20000 | 120000 | local.budget.nodes | 10.95 | 2.21 / 3.88 | 64.65 |
134
+ | paragraphs-100000 | 600000 | local.budget.nodes | 18.03 | 8.11 / 12.06 | 66.54 |
135
+ | paragraphs-100000-raised | 600000 | success / 200000 | 1889.73 | 1791.24 / 1971.32 | 300.19 |
136
+ | formatted-paragraphs-5000 | 285000 | local.budget.nodes | 614.75 | 510.08 / 655.62 | 172.16 |
137
+ | formatted-paragraphs-5000-raised | 285000 | success / 40000 | 890.59 | 739.60 / 882.25 | 191.44 |
138
+ | containers-50 | 956 | success / 52 | 122.90 | 34.50 / 40.75 | 76.79 |
139
+ | containers-100 | 1906 | success / 102 | 229.97 | 112.17 / 126.17 | 79.36 |
140
+ | containers-101 | 1925 | local.tag.unclosed.pair, local.budget.nesting | 221.91 | 107.99 / 114.28 | 79.77 |
141
+ | containers-1000 | 19006 | local.tag.unclosed.pair, local.budget.nesting | 2316.23 | 2345.12 / 3270.82 | 135.50 |
142
+ | unclosed-1000 | 9004 | local.tag.unclosed.pair, local.budget.nesting | 1170.57 | 1156.87 / 1294.90 | 138.63 |
143
+ | markdown-depth-100 | 204 | success / 102 | 17.64 | 2.62 / 4.26 | 63.98 |
144
+ | markdown-depth-500 | 1004 | success / 502 | 34.16 | 6.71 / 13.08 | 66.80 |
145
+ | markdown-depth-1000 | 2004 | success / 1002 | 60.56 | 16.72 / 27.48 | 77.02 |
146
+ | markdown-depth-1500 | 3004 | local.budget.markdown-depth | 20.03 | 1.84 / 5.85 | 63.91 |
147
+ | markdown-depth-2000 | 4004 | local.budget.markdown-depth | 18.98 | 1.82 / 3.34 | 65.48 |
148
+ | markdown-depth-5000 | 10004 | local.budget.markdown-depth | 37.84 | 3.45 / 6.32 | 71.81 |
149
+ | math-1000 | 16000 | success / 2000 | 349.64 | 181.27 / 291.72 | 112.90 |
150
+ | table-1000 | 28910 | success / 5008 | 445.32 | 267.54 / 341.15 | 136.33 |
151
+ | computed-chain-1000 | 45839 | success / 3 | 226.52 | 120.62 / 148.63 | 115.39 |
152
+ | computed-chain-5000 | 237839 | success / 3 | 803.20 | 663.79 / 871.36 | 201.66 |
153
+
154
+
155
+ ### Long-document editing across block types (24 scenarios)
156
+
157
+ The same target block sits among 1000 ordinary paragraphs; version numbers have fixed width, and the fenced-delimiter scenario actively changes the boundary. Independent process per scenario, alternating full compilation and session compilation order. The table includes the cost of publishing an independent public snapshot; syntax highlighting, plot sampling and DOM layout are outside this table.
158
+
159
+ | Target block | Single-block full ms | Long-document full ms | Session median / P95 ms | Final mode | Reused blocks |
160
+ | --- | --- | --- | --- | --- | --- |
161
+ | Ordinary paragraph, about 512 characters | 0.09 | 7.88 | 13.86 / 20.54 | incremental | 1000 |
162
+ | Ordinary paragraph, about 8 Ki characters | 0.38 | 7.53 | 13.07 / 15.19 | incremental | 1000 |
163
+ | Formatted paragraph, about 512 characters | 2.65 | 29.61 | 14.93 / 18.71 | incremental | 1000 |
164
+ | Level-2 heading, about 80 characters | 0.69 | 27.80 | 12.83 / 17.66 | incremental | 1000 |
165
+ | Unordered list, 20 items | 0.89 | 12.28 | 13.70 / 18.27 | incremental | 1000 |
166
+ | Unordered list, 100 items | 3.15 | 14.58 | 17.37 / 21.99 | incremental | 1000 |
167
+ | Ordered list, 20 items | 0.89 | 11.76 | 13.45 / 15.81 | incremental | 1000 |
168
+ | Markdown table, 20×4 | 1.64 | 11.39 | 14.08 / 17.66 | incremental | 1000 |
169
+ | Markdown table, 100×4 | 4.66 | 15.97 | 22.32 / 27.41 | incremental | 1000 |
170
+ | Markdown table, 200×4 | 8.97 | 20.18 | 30.39 / 44.42 | incremental | 1000 |
171
+ | Blockquote, 10 paragraphs | 1.85 | 29.70 | 13.66 / 17.28 | incremental | 1000 |
172
+ | Fenced code, 60 lines | 0.85 | 30.35 | 14.39 / 18.90 | incremental | 1000 |
173
+ | Fenced code, 300 lines | 2.78 | 29.67 | 13.83 / 18.49 | incremental | 1000 |
174
+ | Indented code, 60 lines | 1.21 | 66.05 | 14.42 / 22.71 | incremental | 1000 |
175
+ | Display formula, 20 items | 3.42 | 51.20 | 15.18 / 22.10 | incremental | 1000 |
176
+ | Display formula, 80 items | 6.65 | 54.16 | 18.03 / 23.94 | incremental | 1000 |
177
+ | Expression paragraph, 20 interpolations | 2.92 | 48.98 | 14.66 / 22.29 | incremental | 1000 |
178
+ | Slider initial value change | 0.90 | 49.82 | 53.89 / 84.76 | full | 0 |
179
+ | Panel interior, 50 paragraphs | 3.22 | 48.92 | 47.80 / 58.14 | full | 0 |
180
+ | ReactiveMD table, 20×4 | 3.05 | 49.69 | 55.93 / 70.05 | full | 0 |
181
+ | Bar chart data, 20 rows | 2.23 | 47.79 | 53.12 / 90.45 | full | 0 |
182
+ | Plot formula, 1 curve | 1.62 | 49.35 | 54.03 / 74.35 | full | 0 |
183
+ | Diagram node body, 20 nodes | 6.24 | 49.13 | 53.47 / 89.76 | full | 0 |
184
+ | Fenced delimiter change, 60 lines of code | 1.27 | 28.70 | 39.01 / 49.05 | full | 0 |
185
+
186
+
187
+ ### Fast/general mixed parsing and long lines
188
+
189
+ Covers simple blocks interleaved with links and escapes, native and component tables, dynamic cells, 5000 controls, very long indented lines inside containers, and large over-budget lists.
190
+
191
+ | Scenario | Median / P95 ms | Process peak RSS MiB |
192
+ | --- | --- | --- |
193
+ | ordinary-1000 | 10.63 / 14.03 | 101.95 |
194
+ | mixed-80 | 32.65 / 42.82 | 164.93 |
195
+ | table-1000 | 45.24 / 56.52 | 174.41 |
196
+ | component-table-500 | 35.50 / 44.30 | 152.65 |
197
+ | component-dynamic-table-500 | 100.19 / 129.04 | 191.91 |
198
+ | controls-5000 | 490.59 / 591.58 | 533.31 |
199
+ | indented-line-16000 | 5.85 / 7.94 | 73.05 |
200
+ | indented-line-64000 | 6.60 / 17.72 | 74.18 |
201
+ | indented-line-256000 | 25.82 / 29.74 | 71.91 |
202
+ | over-budget-list-50000 | 54.54 / 55.79 | 212.41 |
203
+
204
+
205
+ Cache recovery of an independent body after 200 consecutive component-context changes:
206
+
207
+ | Context edit median / P95 ms | Index rebuilds during consecutive changes | Restore body ms | Index builds during restore |
208
+ | --- | --- | --- | --- |
209
+ | 42.15 / 82.14 | 0 | 121.50 | 1 |
210
+
211
+
212
+ Full compilation scale for pure blocks:
213
+
214
+ | Scenario | Median / P95 ms | Peak RSS MiB |
215
+ | --- | --- | --- |
216
+ | bullet-100 | 3.12 / 5.09 | 77.60 |
217
+ | bullet-500 | 16.45 / 21.92 | 115.81 |
218
+ | bullet-1500 | 55.05 / 75.23 | 174.01 |
219
+ | table-100 | 4.33 / 10.23 | 80.65 |
220
+ | table-500 | 21.36 / 28.69 | 118.31 |
221
+ | table-1000 | 54.18 / 71.87 | 185.18 |
222
+ | component-table-100 | 7.05 / 14.13 | 99.87 |
223
+ | component-table-500 | 33.44 / 46.50 | 136.01 |
224
+
225
+
226
+ Full compilation versus session editing in the same build, including full snapshot publishing:
227
+
228
+ | Document | Full median ms | Session median ms | First session ms | Compiled / reused blocks |
229
+ | --- | --- | --- | --- | --- |
230
+ | paragraphs-5000 | 44.59 | 64.33 | 220.07 | 1 / 4999 |
231
+ | formatted-paragraphs-1000 | 119.28 | 51.92 | 296.79 | 1 / 999 |
232
+ | article-600 | 282.14 | 62.05 | 546.19 | 1 / 1799 |
233
+ | article-2000 | 908.57 | 223.06 | 1511.52 | 1 / 5999 |
234
+
235
+
236
+ ### This round's row reuse and patch cost A/B
237
+
238
+ The baseline is the saved f7a7ab8 production package. One session per scenario, 3 warmups and 15 measurements. The production Worker handler runs inside Node; responses are applied only after structuredClone. Worker timing excludes cross-thread transfer; the clone column is local copy time. equal is a fixed-length middle edit, shift alternately adds and removes characters and shifts later ranges, and rewrite changes every row.
239
+
240
+ | Scenario | Worker median ms: before → after | Clone median ms: before → after | Patch apply ms: before → after | Response B: before → after | Shared nodes: before → after |
241
+ | --- | --- | --- | --- | --- | --- |
242
+ | list-equal | 64.51 → 58.51 | 17.78 → 0.12 | 29.29 → 3.73 | 1046617 → 14900 | 4 → 5998 |
243
+ | list-shift | 63.60 → 82.15 | 19.81 → 0.46 | 28.21 → 4.71 | 1046667 → 38000 | 2 → 3002 |
244
+ | table-equal | 38.87 → 31.14 | 13.18 → 0.10 | 16.88 → 2.14 | 591190 → 8565 | 4 → 3504 |
245
+ | table-shift | 40.58 → 48.02 | 11.49 → 0.28 | 18.03 → 2.83 | 591237 → 20156 | 2 → 1759 |
246
+ | dynamic-list-equal | 199.45 → 174.49 | 30.99 → 0.22 | 42.75 → 6.10 | 1396442 → 15432 | 5 → 7997 |
247
+ | dynamic-list-shift | 196.83 → 201.79 | 27.69 → 0.51 | 44.03 → 9.47 | 1396492 → 38532 | 3 → 4003 |
248
+ | dynamic-table-equal | 91.72 → 70.99 | 14.12 → 0.16 | 22.20 → 2.15 | 603521 → 8674 | 5 → 3505 |
249
+ | dynamic-table-shift | 84.61 → 83.23 | 12.44 → 0.30 | 19.61 → 2.43 | 603570 → 20267 | 3 → 1760 |
250
+ | paragraphs-equal | 7.98 → 8.36 | 0.10 → 0.10 | 1.23 → 1.14 | 11145 → 11184 | 1602 → 1602 |
251
+ | list-rewrite | 73.39 → 97.10 | 18.77 → 21.86 | 28.70 → 0.00 | 1090461 → 905965 | 4 → 0 |
252
+
253
+
254
+ Equal-length single-row edits mainly reduce transfer, main-thread patch application and React node replacement. Shift edits must update later ranges and still clone objects; a whole-block rewrite encodes first and then decides to send a full result, so Worker encoding cost may rise. The real-browser measurements below cannot be replaced by Node handler data for end-to-end latency.
255
+
256
+ ### Real Worker and end-to-end preview
257
+
258
+ An independent module Worker per input, 2 warmups and 5 measurements. The table isolates React; round-trip includes source and result copying, scheduling and main-thread receipt.
259
+
260
+ | Scenario | Worker median / P95 ms | Round-trip median / P95 ms | Result |
261
+ | --- | --- | --- | --- |
262
+ | article-100 | 33.20 / 38.60 | 35.90 / 40.80 | success |
263
+ | article-600 | 178.30 / 214.70 | 193.20 / 228.00 | success |
264
+ | controls-1000 | 66.90 / 88.80 | 70.30 / 92.90 | success |
265
+ | controls-5000 | 371.90 / 433.70 | 392.90 / 453.30 | success |
266
+ | controls-10000 | 717.40 / 758.60 | 763.40 / 795.60 | success |
267
+ | paragraphs-5000 | 33.50 / 41.00 | 45.70 / 53.30 | success |
268
+ | plain-1000000 | 4.30 / 7.90 | 7.90 / 11.30 | success |
269
+ | markdown-depth-500 | no successful samples | no successful samples | transfer-error |
270
+ | markdown-depth-1000 | 10.80 / 21.80 | 11.00 / 23.00 | local.parse |
271
+ | markdown-depth-2000 | 2.70 / 3.80 | 3.00 / 4.10 | local.budget |
272
+
273
+
274
+ Deep Markdown still has separate limits in the browser: the compilation result of the 500-level case may not be postMessage-able; 1000 levels returns a parse failure in that browser, and 2000 levels is rejected by the depth budget. A subsequent ordinary request on the same Worker recovers. A successful Node compilation does not mean the result graph can be cloned and rendered in the browser.
275
+
276
+ The following uses the same controlled input fixture, a real module Worker and the production React profiling preview, comparing f7a7ab8 with this round. 3 warmups and 15 measurements per scenario, with version order alternating for regular scenarios; the dynamic table was re-measured after a pause in before/after order, so time-of-day drift exists. The fixture isolates compilation and preview; real CM6 typing is measured separately in the next section.
277
+
278
+ | Scenario | Worker median / P95 ms: before → after | Input-to-frame opportunity ms: before → after | Response median B: before → after |
279
+ | --- | --- | --- | --- |
280
+ | context | 37.00 / 68.00 → 34.00 / 48.00 | 93.80 / 118.40 → 88.60 / 103.00 | 1428 → 1435 |
281
+ | body | 13.00 / 25.00 → 10.00 / 27.00 | 59.70 / 74.70 → 58.40 / 74.40 | 1356 → 1414 |
282
+ | paragraphs | 21.00 / 51.00 → 25.00 / 48.00 | 96.00 / 124.80 → 100.30 / 122.90 | 12929 → 12968 |
283
+ | list | 80.00 / 113.00 → 71.00 / 109.00 | 238.00 / 271.30 → 136.40 / 187.00 | 1057284 → 14913 |
284
+ | table | 46.00 / 65.00 → 31.00 / 52.00 | 134.80 / 173.30 → 89.20 / 115.50 | 599741 → 8584 |
285
+ | Dynamic list | 262.00 / 336.00 → 259.00 / 421.00 | 469.30 / 573.80 → 326.60 / 507.60 | 1404760 → 15445 |
286
+ | Dynamic table | 124.00 / 220.00 → 115.00 / 377.00 | 233.40 / 398.40 → 170.70 / 450.50 | 608116 → 8685 |
287
+
288
+
289
+ ### Current CM6 full editor and rendering phases
290
+
291
+ Uses the current single CM6 editor, the shared author-analysis Worker, the real LocalPreview, a stateful session and native input in the middle. React phases are instrumented only in the benchmark build; the production library does not contain these hooks. Later positions shift as editing grows.
292
+
293
+ | Scenario | Input-to-frame opportunity median / P95 ms | Input-to-dispatch ms | Worker round-trip ms | Receive and apply ms | Editor render ms | Preview render ms |
294
+ | --- | --- | --- | --- | --- | --- | --- |
295
+ | paragraphs800 | 107.60 / 191.50 | 23.00 | 51.80 | 6.00 | 8.60 | 6.40 |
296
+ | paragraphs2400 | 464.50 / 575.90 | 28.40 | 293.50 | 27.80 | 45.70 | 40.70 |
297
+ | table1000 | 429.20 / 510.50 | 23.50 | 331.10 | 4.00 | 17.00 | 14.20 |
298
+ | controls1000 | 118.50 / 290.30 | 23.70 | 48.50 | 1.00 | 6.90 | 4.70 |
299
+ | controls5000 | 760.50 / 962.20 | 52.40 | 418.70 | 7.20 | 60.40 | 50.20 |
300
+
301
+
302
+ | Scenario | commitRoot ms | DOM mutation ms | Layout Effects ms | Styles ms | Layout ms | Paint ms | Preview article replacements |
303
+ | --- | --- | --- | --- | --- | --- | --- | --- |
304
+ | paragraphs800 | 17.80 | 1.30 | 2.30 | 4.08 | 6.84 | 4.10 | 0 |
305
+ | paragraphs2400 | 78.50 | 4.50 | 12.20 | 17.14 | 17.38 | 8.30 | 0 |
306
+ | table1000 | 36.40 | 4.40 | 3.20 | 3.22 | 26.81 | 5.87 | 0 |
307
+ | controls1000 | 34.10 | 2.30 | 4.30 | 3.24 | 20.28 | 9.12 | 0 |
308
+ | controls5000 | 177.70 | 18.50 | 47.40 | 33.13 | 66.03 | 36.71 | 0 |
309
+
310
+
311
+ Each rendering scenario also checks body/control DOM and focus retention, parameter 13 preserved, author initial values reset, the final commit of fast edits and new-session reset. Long paragraphs additionally check that offscreen text is still findable natively and that printing restores the full layout.
312
+
313
+ Real CM6 continuous typing, 3 warmups and 15 measurements; source DOM includes the toolbar and author panel.
314
+
315
+ | Scenario | Characters | Input-to-frame opportunity median / P95 ms | Source DOM | Mounted lines / total lines | Cumulative Layout ms | Long tasks |
316
+ | --- | --- | --- | --- | --- | --- | --- |
317
+ | paragraphs800 | 101529 | 15.30 / 20.10 | 294 | 47 / 1601 | 230.48 | 0 |
318
+ | paragraphs2400 | 306129 | 27.60 / 39.80 | 294 | 47 / 4801 | 423.58 | 16 |
319
+ | table1000 | 17949 | 16.80 / 21.10 | 228 | 71 / 1004 | 366.18 | 0 |
320
+
321
+
322
+ CM6 source row DOM grows with the viewport. The preview keeps the document DOM, and later ordinary paragraphs use content-visibility:auto; this is not whole-area virtualization of the preview. Huge lists, tables and complex visualizations can still bear whole-block DOM, layout and paint costs.
323
+
324
+ ### Runtime, formula and visualization updates
325
+
326
+ This group is a Vite development fixture, 5 warmups and 15 measurements; it separates runtime.set, three-curve sampling, React updates, forced layout and local dependency scope, and cannot be compared directly with the production React profiling numbers above.
327
+
328
+ | Phase | Median ms | P95 ms |
329
+ | --- | --- | --- |
330
+ | compile:interactive-article | 31.1000 | 38.8000 |
331
+ | update:runtime-set | 0.0004 | 0.0016 |
332
+ | plot:3-curves-200-samples | 0.2800 | 0.3750 |
333
+ | render:final | 6.7000 | 29.3000 |
334
+ | interaction:update-plot-render | 8.8000 | 17.4000 |
335
+ | locality:100-sections | 11.8000 | 43.2000 |
336
+ | locality:1-section | 4.1000 | 16.3000 |
337
+ | locality:unreferenced | 10.5000 | 16.2000 |
338
+ | visuals:10-tables | 10.6000 | 29.5000 |
339
+ | visuals:1-table | 4.7000 | 6.6000 |
340
+ | visuals:unreferenced | 2.1000 | 2.7000 |
341
+ | charts:4-charts | 13.4000 | 19.3000 |
342
+ | charts:1-chart | 7.1000 | 8.8000 |
343
+ | charts:unreferenced | 1.9000 | 4.0000 |
344
+
345
+
346
+ ### Sustained-edit memory, budgets and protocol recovery
347
+
348
+ Node uses independent child processes and performs an explicit GC before each snapshot. The previous version's preview stays alive until the replacement result completes; the heap is measured after results and sessions are released.
349
+
350
+ | Scenario | Count / scale | Retained heap after GC MiB | After releasing session MiB | Steady-state heap growth MiB |
351
+ | --- | --- | --- | --- | --- |
352
+ | longEdit | 500 | 22.242 | 15.466 | 0.156 |
353
+ | longRows | 500 | 20.658 | 11.61 | 0.13 |
354
+ | cacheEviction | 260 | 20.75 | 15.235 | not applicable |
355
+ | rapidCancel | 120 | 19.12 | 13.256 | not applicable |
356
+ | longText | 1000000 | 12.182 | 12.17 | not applicable |
357
+ | manyComponents | 5000 controls / 352779 characters | 29.485 | 13.189 | not applicable |
358
+ | deepContainers | 1000/1001 levels | not applicable | 11.338 | not applicable |
359
+
360
+
361
+ CM6 main-thread heap, with the probe array cleared and GC through CDP while host compilation state stays mounted; Worker heap not measured:
362
+
363
+ | Checkpoint | Heap after GC MiB | Source DOM |
364
+ | --- | --- | --- |
365
+ | edit-50 | 13.14 | 74 |
366
+ | edit-2000 | 14.47 | 74 |
367
+ | editor-unmounted-host-retained | 13.31 | 0 |
368
+
369
+
370
+ Protocol recovery re-measurement passed the old Worker, out-of-order responses, a stale baseline, corrupted patches, option switching and cancelled preparation tasks. The stale baseline and corrupted patch each recover with one full request; cost selection returns a full success result directly rather than retrying after a failure. The public LocalReactiveDocument commits the correct document after a pausable, interruptible React transition and preserves input values. Huge static and dynamic lists and tables each received a real-browser single-row edit; the preview DOM of unchanged rows kept the same object and the input value stayed 13.
371
+
372
+ ### Current limits and where to optimize next
373
+
374
+ - In the public snapshot path for 5000 ordinary short paragraphs, a session edit takes 64.33 ms, slower than full compilation at 44.59 ms. Sharing and full snapshot publishing still cost the whole tree; the public snapshot and the Worker's private sharing path should be optimized separately.
375
+ - The previous round's full matrix showed tail regressions for dynamic tables and lists. This round's browser comparison improved median and P95, but Node shift lists still regress in batches; continue tracking how allocation and GC affect the tail.
376
+ - Simple dynamic interpolation rows are on the fast path. Dynamic blocks containing links, escapes or complex inline formatting can still fall back; the next step can study local updates to row-fragment parsing and semantic summaries, continuing to validate with full-result diffs.
377
+ - Shift edits in large lists and tables relocate many ranges; patch encoding and cost estimation for whole-block rewrites can still increase Worker time, so reduce duplicate traversal before encoding first.
378
+ - CM6 still synchronizes with the host through a full source string, and author analysis also produces a whole result; long single lines, very long strings and large dependency graphs still involve linear work.
379
+ - The preview is suited to further row-level and block-level subscriptions and to viewport-deferred visualization. Before truly unmounting offscreen preview, state, anchors, native find, cross-block selection and printing must be preserved.
380
+ - Default depth budgets remain Markdown 1000 levels and components 100 levels. Deep results transfer after negotiating `flat-v1` through the public scheduler; custom Workers that hand deep `compileLocal()` results directly to native `postMessage()` are still limited by the browser call stack. Deep results currently send a complete flat snapshot each time; subtree patches can be studied later. Physical Chinese IME, mobile keyboards and assistive technology need manual acceptance on target devices.
381
+
382
+ ### Reproduce and verify
383
+
384
+ Full serial matrix:
385
+
386
+ ```powershell
387
+ npm run build
388
+ npm run build --workspace=@reactive-md/demo
389
+ node scripts/benchmark-performance-overview.mjs
390
+ # Add a comparison when a saved old production package exists:
391
+ node scripts/benchmark-performance-overview.mjs --baseline=artifacts/next-editing/before-library
392
+ # Re-measure by phase; do not run other performance processes at the same time:
393
+ node scripts/benchmark-performance-overview.mjs --only=render,cm6
394
+ ```
395
+
396
+ The full matrix covers compilation stress, 24 block types, mixed parsing, context recovery, snapshot copying, row reuse, Node and browser memory, Worker transfer, protocol recovery, native CM6 input, React phases, table/chart dependency locality and plot sampling. The default CM6 memory check is 2000 inputs.
397
+
398
+ Functional gates passed by the full `4a8f1ea` matrix: production build, type checking, standalone and declaration generation, public package boundaries and offline packed consumption; 1504 tests in 112 core test files and 254 tests in 16 Demo files; 8 browser checks of the unified editor, plus CM6, real workbench, author tools, images, diagnostics, document save/export and long-document preview regressions.
399
+
400
+ The rendering semantic diff completed 350 steps of state, selection, reset, language and Tab operations with an identical final state; the optimized and baseline normalized markup are both 45806 characters and byte-identical, and page and console errors are empty.
401
+
402
+ The full matrix's per-sample JSON, event records and CDP traces are in `artifacts/performance-overview/`, `artifacts/render-pipeline/` and `artifacts/cm6/`, and this round's targeted results are in `artifacts/dynamic-depth/`; all are locally ignored artifacts. The committable condensed summaries are `benchmarks/performance-overview-2026-10-29.json` and `benchmarks/dynamic-depth-2026-10-29.json`, each retaining its measurement basis and code provenance. The original historical reports can be read from the corresponding Git commits.
@@ -1,108 +1,12 @@
1
- # 发布清单
1
+ # 引擎发布
2
2
 
3
- 本文件是维护者的手动发布流程。本清单覆盖 `0.6.1`,同时更新 `latest` 与 `next`。版本规则见[版本与兼容性](../compatibility/compatibility-ch.md),面向使用者的说明见[0.6.1 发布说明](../releases/release-0.6.1-ch.md)。
3
+ **中文** · [English](releasing-en.md)
4
4
 
5
- ## 发布前确认
5
+ reactive-md 独立维护版本;编辑器从自己的仓库发布 reactive-md-editor,Demo 独立构建站点。候选包更新与导入迁移见[三仓库迁移](../integration/repository-split-ch.md)。
6
6
 
7
- ### 包身份与元数据
7
+ 1. 核对分支、本次 diff、目标版本与 registry 状态。更新 package.json、package-lock.json、变更记录及兼容说明;包版本与语法、协议版本分别管理。
8
+ 2. 运行 npm ci、npm run check、npm run notices,检查 tarball 的 exports、声明路径与 notice。公开包检查在独立目录安装实际 tarball,不需要检出编辑器或 Demo。
9
+ 3. 提交并推送已授权的发布源码。在对应 ref 手动触发 publish.yml,选择 dist_tag 与 update_latest。工作流使用 Node24、npm ^11.21 和 npm trusted publishing(OIDC);保留 npm 已配置的工作流文件名。工作流完成检查和构建后打包,仅发布不存在的版本;已存在的版本只更新请求的标签。本机不执行 npm publish 或 npm dist-tag。
10
+ 4. 确认工作流成功,核对 registry 的版本、渠道和 integrity。授权后给对应源码创建 tag/Release;升级下游 registry 依赖前,在干净消费目录验证公开包。
8
11
 
9
- 非 scope 名称 `reactive-md` 已由已发布的 `0.3.0`、`0.3.1` 建立,`reactive-md/react` 和 `reactive-md/styles.css` 子路径也随这些版本生效。`0.5.0` 新增 `reactive-md/editor` 和 `reactive-md/editor/styles.css`,`0.5.1` 至 `0.6.1` 保持这些入口。不要把改名当作常规发布准备:改名会破坏导入、状态工具和文档。
10
-
11
- 1. 除非维护者明确决定改用 scope,否则保持 `reactive-md`。scope 需要对应的 npm 账号或组织权限。
12
- 2. 如果改名,同时更新 `package.json` 的 `name`、文档中的导入语句、tarball 文件名说明、示例和相关子路径,并在变更记录中按破坏性变更说明。
13
- 3. 核对 `package.json` 的 `repository`、`homepage`、`bugs`、`license`、`engines` 等发布元数据;当前已设置,发布前确认 URL 和最低 Node 版本仍然正确,并确认 `private` 保持移除状态。
14
- 4. 确认 `files` 覆盖发布所需内容。当前包含 `dist-library`、`dist-standalone`、`bin`、`cli`、README(`README.md`、`README-en.md`、`README-ch.md`)、中英文贡献指南、变更记录与安全策略、`THIRD_PARTY_NOTICES.md`、`docs` 和 `examples`;新增文档或 notice 时同步加入 `files`。
15
-
16
- 包名和版本决定 tarball 名称。当前 `0.6.1` 的预期文件名是 `reactive-md-0.6.1.tgz`;改名或改版本后以 `npm pack` 的实际输出为准。
17
-
18
- ### 第三方 notice
19
-
20
- 库产物打包了 `remark-gfm@4.0.1`、`remark-parse@11.0.0`、`unified@11.0.5`、`elkjs@0.12.0`、`katex@0.19.1` 及其依赖。KaTeX 包含数学字体和 mhchem 扩展。独立 HTML 运行时还打包了 React、React DOM 和 scheduler;库的 React 入口使用宿主提供的 peer dependency。`THIRD_PARTY_NOTICES.md` 保留这些打包依赖的版权和许可声明。
21
-
22
- 维护者在发布前:
23
-
24
- 1. 运行 `npm run notices`,从已安装依赖重新生成 `THIRD_PARTY_NOTICES.md`。生成脚本覆盖 `remark-gfm`、`remark-parse`、`unified`、`parse5`、`lowlight`、`elkjs`、`katex`、`react`、`react-dom` 的依赖树和实际许可证文本,包括 scheduler,以及 mhchem 的上游声明和 Apache-2.0 许可。
25
- 2. 确认 `package.json` 的 `files` 包含 `THIRD_PARTY_NOTICES.md`,并随 tarball 分发。
26
- 3. 检查 `npm pack --dry-run` 的输出,确认没有 `node_modules`、`demo/`、`demo/artifacts/`、测试产物或本地缓存。
27
- 4. 核对依赖许可证与打包内容一致;新增或升级 Markdown 依赖后重新生成 notice。
28
-
29
- ## 本地 tarball 安装
30
-
31
- 完整的本地门禁是:
32
-
33
- ```sh
34
- npm ci
35
- npm run verify:release
36
- ```
37
-
38
- `verify:release` 运行 Node 端与浏览器检查,构建包,在仓库外安装真实 tarball,并验证多份能力组合后的文档行为;它自行管理预览服务和浏览器生命周期。门禁同时覆盖编辑器入口、其样式表及同一页面的两个编辑器实例。CI 通过 `verify:release:node` 和 `verify:release:browser` 分片运行同一门禁。本机需已安装浏览器。
39
-
40
- packed 检查会在 `artifacts/release-package/` 保留经过验证的原始安装包,并在同目录的 `package-verification.json` 记录 SHA256 与 npm integrity。完整门禁通过后发布这一安装包;源码、包元数据或随包文档变化后重新验证。
41
-
42
- 需要手工检查包内容时,直接使用 tarball。在仓库根目录:
43
-
44
- ```sh
45
- npm pack
46
- ```
47
-
48
- `npm pack` 会通过 `prepack` 先运行构建和 `npm run notices`,生成 `dist-library/` 与 `THIRD_PARTY_NOTICES.md`。`dist-library/` 是 `package.json` 的 `exports` 指向的目录。随后在一个空目录中验证安装:
49
-
50
- ```sh
51
- mkdir /tmp/reactive-md-consumer
52
- cd /tmp/reactive-md-consumer
53
- npm init -y
54
- npm install /path/to/reactive-md-0.6.1.tgz
55
- ```
56
-
57
- 核心入口可在 Node 中直接检查:
58
-
59
- ```sh
60
- node --input-type=module -e "import { compileLocal, LOCAL_SYNTAX_VERSION } from 'reactive-md'; console.log(LOCAL_SYNTAX_VERSION, compileLocal('# ok').ok)"
61
- ```
62
-
63
- React 入口需要另装 React 19:
64
-
65
- ```sh
66
- npm install react@19 react-dom@19
67
- ```
68
-
69
- ```tsx
70
- import { LocalReactiveDocument } from 'reactive-md/react';
71
- import 'reactive-md/styles.css';
72
- ```
73
-
74
- 编辑器入口使用相同的 React peer 和独立样式表:
75
-
76
- ```tsx
77
- import { ReactiveMarkdownEditor } from 'reactive-md/editor';
78
- import 'reactive-md/editor/styles.css';
79
- ```
80
-
81
- 静态 SSR 渲染由 packed 检查覆盖。编辑器入口在服务端渲染检查中导入,并在浏览器检查中运行。单文件导出的静态首屏水合由 Playwright Chromium 和本地 Edge 浏览器检查覆盖;该路径之外的通用 SSR 水合尚未验证。安装验证还应确认 tarball 中的 `dist-library/types`(包括编辑器入口和样式表)、`dist-standalone`、`bin`、`cli`、`README.md`、`README-en.md`、`README-ch.md`、`CHANGELOG-ch.md`、`SECURITY-ch.md`、`THIRD_PARTY_NOTICES.md`、`docs` 和 `examples` 完整,并检查 `docs` 中没有指向未打包 `demo/`、`src/`、`tests/` 或 `.tasks/` 文件的本地链接。
82
-
83
- ## 发布说明
84
-
85
- 发布说明面向使用者,至少包含:
86
-
87
- - 包版本、`LOCAL_SYNTAX_VERSION`、组块协议修订与主题协议修订;这些不是同一个版本号。
88
- - 安装方式:`npm install reactive-md`、`npm install reactive-md@next`,或使用 `npm install reactive-md@<version>` 固定版本;并提供可下载 tarball 作为离线安装选项。
89
- - 用户可见变化、破坏性变更和迁移步骤;直接链接[变更记录](../../CHANGELOG-ch.md),本轮同时链接[0.5.0 发布说明](../releases/release-0.5.0-ch.md)。
90
- - 已验证的平台,以及未验证的浏览器、通用 SSR 水合等范围。
91
- - 已知限制和安全说明链接 [SECURITY-ch.md](../../SECURITY-ch.md)。
92
-
93
- 不要写尚未执行的检查结果,也不要把 CI 配置存在写成 CI 已通过。
94
-
95
- ## 人工发布清单
96
-
97
- 1. 确认工作区干净,变更已审查;`npm ci` 从锁文件安装成功。
98
- 2. 在 Node 22.12 和受支持的较新 LTS(当前为 24)上运行 `npm run verify:release`。这是维护者和 CI 共用的完整门禁,不要用一组自行挑选的命令代替。
99
- 3. 确认版本号、`CHANGELOG-ch.md` 和发布说明一致。`0.6.1` 将公式展示改为 KaTeX,并内嵌数学字体;语法修订 `local-draft-2`、组块协议 `component-protocol-2` 和主题协议 `reactive-md-theme-1` 均保持不变。仅在某条版本轴自身的契约变化时更新它。
100
- 4. 检查门禁保留的安装包,包括文件列表、大小和许可文件。手动重新运行 `npm pack` 会产生新候选包,需要单独完成安装验证。
101
- 5. 核对安装包的 SHA256 与 `artifacts/release-package/package-verification.json` 一致,并记录到发布说明或内部发布记录。
102
- 6. 合并发布提交,等待 `main` 上的 CI 全部通过。
103
- 7. 手动创建并推送 tag,例如 `v0.6.1`。不要在自动发布工作流中保存 npm token。
104
- 8. 为标签创建草稿 GitHub Release,附上已验证的 tarball、`package-verification.json` 和包含 `version`、源码 `commit`、`sha256`、`integrity` 的 `release-manifest.json`。触发 `publish.yml`,传入 `ref=v0.6.1`、`dist_tag=next`、`update_latest=true`、`use_verified_release=true`。npm trusted publishing 通过 OIDC 发包,无需本机 npm 登录或验证码;工作流先核对源码提交与文件摘要,再发布附件中的原始包。等待成功后确认两个渠道。`latest` 不在授权范围内时,传入 `update_latest=false`。
105
- 9. 在 npm 和 GitHub Releases 上核对包内容、版本、README、许可与发布说明;从公开 registry 重新安装一次。
106
- 10. 从 registry 验证 README 中的安装命令可用,核对 registry 的完整性摘要与发布 tarball 一致。
107
-
108
- README 中的版本与安装命令应在打包前准备好,并在发布后验证。发布过程中不要提交 token、`.npmrc` 凭据或本机路径。
12
+ 编辑器首次发包前需单独配置其仓库与 publish.yml 的 npm trusted publisher。正式发布前,下游通过 vendor tarball 和锁文件固定候选组合。推送代码不自动发布 npm 或部署站点。