Skip to content

v1.0.0

Latest

Choose a tag to compare

@mourner mourner released this 05 Oct 08:18

A full rewrite as a small, pure ESM package with a standalone WebAssembly module. It's designed to be bundled directly into Mapbox GL JS, which will load it on demand instead of through setRTLTextPlugin.

Highlights

  • Much smaller. The wasm is now 42 KB (15 KB gzipped), down from 98 KB, and the JS glue is about 0.7 KB gzipped.
  • Pure ESM, no build step. There's no bundled UMD and no Rollup. The package is plain ES modules plus one .wasm file, with no runtime dependencies.
  • Two ways to load it:
    • import {applyArabicShaping, processBidirectionalText} from '@mapbox/mapbox-gl-rtl-text' loads the wasm automatically with top-level await.
    • createRTL(fetch(url)) from @mapbox/mapbox-gl-rtl-text/rtl.js lets you choose where and when the wasm loads.
  • TypeScript types are included for both entry points.
  • Reproducible builds. The same sources and Emscripten version produce a byte-identical wasm.

Breaking changes

  • The package is ESM-only. The main UMD build (dist/mapbox-gl-rtl-text.js) is gone.
  • It no longer works as a setRTLTextPlugin plugin. Mapbox GL JS v3 should keep using the v0.4.0 build.