Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.0: Switch to WASM, rewrite build pipeline #32

Merged
merged 5 commits into from
Jul 24, 2024
Merged

v0.3.0: Switch to WASM, rewrite build pipeline #32

merged 5 commits into from
Jul 24, 2024

Conversation

stepankuzmin
Copy link
Contributor

@stepankuzmin stepankuzmin commented Jun 14, 2024

  • Switch to WASM, drop JS-only bundle
  • Use the emscripten/emsdk Docker image to build the WASM artifact
  • Use the latest available ICU 75.1 and build it from the sources
  • Keep WASM artifacts in the repo
  • Use Rollup as a bundler
  • Provide one UMD bundle that inlines all WASM subresources as base64 string literals
  • Switch to GitHub Action instead of CircleCI
  • Adds local debug page run by vite

The API for the GL JS interoperability the same:

mapboxgl.setRTLTextPlugin('mapbox-gl-rtl-text.js');

// or
mapboxgl.setRTLTextPlugin(
      'node_modules/@mapbox/mapbox-gl-rtl-text/dist/mapbox-gl-rtl-text.js',
      null,
      false
);

The NPM package now exports UMD with a pending promise as a default export (see src/index.js). The promise is resolved to previously exported functions:

import rtlText from '@mapbox/mapbox-gl-rtl-text';
const {applyArabicShaping, processBidirectionalText} = await rtlText;

const arabicString = "سلام";
const shapedArabicText = applyArabicShaping(arabicString);
const readyForDisplay = processBidirectionalText(shapedArabicText, []);

Before v0.2.3

Screenshot 2024-06-14 at 17 28 14 before

After

There is no visual change compared with the latest stable v0.2.3.

Screenshot 2024-06-14 at 17 28 42 after

Supersedes #30
Closes #30 #26

@stepankuzmin stepankuzmin marked this pull request as ready for review June 14, 2024 13:56
@stepankuzmin stepankuzmin changed the title Rewrite build system Switch to WASM, rewrite build pipeline Jun 14, 2024
@stepankuzmin stepankuzmin force-pushed the v0.2.4 branch 2 times, most recently from eb0afca to 6de555d Compare June 14, 2024 14:06
init

WIP

WIP!

Rewrite from scratch

Inline WASM

add github action

cleanup

Setup vite for debugging

Fix se;f reference in Node environment

Use ICU from EMSDK

cleanup

Build WASM module as sync CommonJS module

Cleanup

Cleanup

Final cleanup

cleanup
@stepankuzmin stepankuzmin changed the title Switch to WASM, rewrite build pipeline v0.3.0: Switch to WASM, rewrite build pipeline Jun 14, 2024
@stepankuzmin stepankuzmin merged commit 62b0889 into main Jul 24, 2024
3 checks passed
@stepankuzmin stepankuzmin deleted the v0.2.4 branch July 24, 2024 10:36
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.

2 participants