Skip to content

refactor(web): run the input's import and export in the C++ core - #1179

Draft
jnowakow wants to merge 8 commits into
feat/input-core-1-cppfrom
feat/input-core-2-web
Draft

jnowakow wants to merge 8 commits into
feat/input-core-1-cppfrom
feat/input-core-2-web

Conversation

@jnowakow

Copy link
Copy Markdown
Collaborator

What/Why?

Second of four stacked PRs for the shared C++ input core (#1127). Based on the core PR; review only the commits above it.

The web input now runs its import and export in the C++ core through wasm, and the TypeScript implementations are removed. The output is meant to stay the same as before.

  • _parseInput and _serializeInput are exported from the wasm module, and md4c.js is rebuilt (195,513 to 249,026 bytes).
  • InputParser.ts and MarkdownSerializer.ts keep their exports and call the core through inputCore.ts.
  • The wasm module loads when the input mounts. onChangeMarkdown is held until it is ready and then emitted once. getMarkdown() and copy can't wait, so until the module is ready they return the plain text without markers and log one warning.
  • markdownRoundTrip.test.ts reads the shared fixture files.
  • A differential test compared the TypeScript and the wasm output before the TypeScript was removed; it is deleted in the last commit together with markdownEscape.ts and normalizeImport.ts.

One known difference: a lone surrogate becomes one U+FFFD in the core, where the TypeScript wrote three.

Testing

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

@jnowakow
jnowakow added this pull request to stack #1182 November 13, 2026 11:10
@jnowakow
jnowakow force-pushed the feat/input-core-2-web branch from b4a80fe to 0f8ddb1 Compare November 13, 2026 11:27

This branch has not been deployed

No deployments
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