Skip to content

release: react-native-nitro-markdown 0.12.0 - #69

Merged
JoaoPauloCMarra merged 6 commits into
mainfrom
v0.12.0
Aug 24, 2026
Merged

release: react-native-nitro-markdown 0.12.0#69
JoaoPauloCMarra merged 6 commits into
mainfrom
v0.12.0

Conversation

@JoaoPauloCMarra

@JoaoPauloCMarra JoaoPauloCMarra commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Changes

  • Enforce ParserOptions.maxInputLength as a UTF-8 byte limit at JavaScript and native boundaries, with the documented 10 MiB hard cap.
  • Reject Markdown session ranges that split UTF-16 surrogate pairs with invalid_range instead of rounding.
  • Restore mutable ASTs by default, add opt-in freezeAst, isolate cache/plugin boundaries, and restore the deprecated onParsingInProgress callback.
  • Improve streaming session memory release and bounded native serialization reuse while preserving rendered output.
  • Synchronize the README, API/reference docs, and consumer-facing CHANGELOG; regenerate Nitro bindings and strengthen public type and behavior tests.
  • Breaking changes: the byte-based input limit and split-surrogate range rejection above. Upgrades from 0.11.x also retain the Nitro Modules 0.37 native rebuild requirement.

…ation

Consolidate a markdown correctness and streaming-performance pass across
the native parser, JS bindings, tests, docs, and release tooling.

Native session unification:
- Replace the per-platform Swift and Kotlin MarkdownSession hybrid objects
  with one source-owned C++ HybridObject (cpp/bindings/HybridMarkdownSession)
  wired through nitro.json autolinking for both iOS and Android; regenerate
  nitrogen bindings and drop the stale Swift/ObjC shims and generated
  session specs.
- Session ranges are now JavaScript UTF-16 units; split-surrogate boundaries
  throw invalid_range instead of rounding, and external-memory accounting
  releases retained buffer and listener capacity on dispose.

Parser bindings and tests:
- Rewrite JSON serialization with a BoundedJsonWriter that counts actual
  emitted bytes against the 64 MiB cap instead of rejecting near-limit
  output from estimates.
- Add C++ session corpus and parser-binding tests covering UTF-16 offsets,
  surrogate safety, input caps, and error propagation (2466 assertions).

Frozen AST and JS contract:
- Deep-freeze parsed AST nodes with bounded validation (depth, nodes,
  arrays, strings) and isolated transform inputs so callbacks cannot poison
  a cached tree; readonly public node types.

Block-serialization cache (streaming flush cost):
- Add a bounded LRU cache (512 entries, 4 MiB) in the serialization layer
  that maps a completed top-level block's exact source byte slice, absolute
  UTF-16 start offset, parser flags, and node type to its serialized JSON
  fragment, so unchanged prefix blocks are not re-serialized on streaming
  re-parses. Documents with potential link reference definitions bypass the
  cache, and EOF-terminated blocks are never cached; full parse still runs
  every flush and output stays byte-identical (asserted cold vs warm).
- Flush budget benchmark: cold 27.41 ms vs warm 18.68 ms average per flush,
  ratio 0.681 against the 0.8x gate, with byte-identical outputs.

Incremental parsing design:
- Document the md4c checkpoint/resume fork design (docs/design/
  incremental-parsing.md): why O(tail) parsing requires engine changes
  (reference definitions, open container stack, lazy continuation, setext
  state), checkpoint format sketch, differential corpus/fuzz strategy, and
  effort and risk estimates, with the serialization cache as the shipped
  interim measure.

Repo and release tooling:
- Tag-safe release preflight and publish validation in CI workflows, with
  codegen and generated-snapshot checks, doc lifecycle tests, process
  runner, and release tag validation scripts.
- Align README, CHANGELOG, docs, issue templates, and security notes with
  the unified session, frozen AST, and serialization cache behavior.
Retitle the changelog Unreleased section to 0.12.0 (2026-08-24), sync the
package docs copy, align the Nitro Modules badge with the other packages,
normalize the Quick Start heading casing, and anchor the CODEOWNERS
.github pattern.
Bump the example app's Expo toolchain packages (~57.0.16 / ~57.0.14), the
matching workspace overrides, and the verify-core-versions pins so
expo install --check and the version guard agree.
# Conflicts:
#	.github/workflows/npm-publish.yml
@JoaoPauloCMarra
JoaoPauloCMarra merged commit 5289a1e into main Aug 24, 2026
3 checks passed
@JoaoPauloCMarra
JoaoPauloCMarra deleted the v0.12.0 branch August 24, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant