Skip to content

Modernize and simplify tooling and code#38

Merged
mourner merged 15 commits intomainfrom
mourner/upgrade-deps
Mar 20, 2026
Merged

Modernize and simplify tooling and code#38
mourner merged 15 commits intomainfrom
mourner/upgrade-deps

Conversation

@mourner
Copy link
Copy Markdown
Member

@mourner mourner commented Mar 20, 2026

  • Upgraded to Emscripten v5, dropping the Docker-based build in favor of a locally-installed emcc; enabled LTO, and switched to emmalloc (smaller allocator) for a reduced binary size; removed a number of redundant build flags; updated dev dependencies and CI
  • Switched to a plain .wasm binary instead of the Emscripten-generated JS+WASM bundle: deleted src/icu.wasm.js, wrote a small manual glue layer in src/index.js that instantiates the WASM directly, and embedded it in the Rollup bundle via @rollup/plugin-wasm
  • Reduced memory usage by 50x — previously, WASM build used 16MB memory by default. We can get away with ~256kB since we use the plugin on labels, not huge amounts of text.
  • Removed bidi_getLine (the only user of ubidi_writeReordered) and rewrote processBidirectionalText to use the same run-based approach (bidi_setLinebidi_getVisualRunbidi_writeReverse) that processStyledBidirectionalText already used; BiDi control characters in LTR runs are now stripped in JS to match the previous behavior
  • Cleaned up JS internals: replaced ccall with direct function calls; consolidated malloc + paragraph setup into one helper; replaced per-run heap allocations for output pointers with a single allocation before the loop
  • Expanded test coverage: bracket mirroring in RTL context, multiple paragraphs, and pure LTR passthrough

@mourner mourner requested a review from stepankuzmin March 20, 2026 11:11
@mourner mourner added the ai AI coding agents co-authored the code label Mar 20, 2026
stepankuzmin
stepankuzmin previously approved these changes Mar 20, 2026
Copy link
Copy Markdown
Contributor

@stepankuzmin stepankuzmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome 🔥

@mourner mourner merged commit 86ad838 into main Mar 20, 2026
1 check passed
@mourner mourner deleted the mourner/upgrade-deps branch March 20, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai AI coding agents co-authored the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants