release: react-native-nitro-markdown 0.12.0 - #69
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ParserOptions.maxInputLengthas a UTF-8 byte limit at JavaScript and native boundaries, with the documented 10 MiB hard cap.invalid_rangeinstead of rounding.freezeAst, isolate cache/plugin boundaries, and restore the deprecatedonParsingInProgresscallback.