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

feat: update approach to generating wasm #84

Merged
merged 1 commit into from
May 22, 2021

Conversation

tplooker
Copy link
Member

@tplooker tplooker commented May 22, 2021

Description

This PR makes several changes to how the WASM module in this library is generated.

  • The WASM outputted by wasm-pack now defaults to a web compatible ES module and esm is used to translate this to Commonjs that is capable of being consumed by NodeJS.

  • The default serving/loading of the WASM in web environments is now a more efficient style of loading that does not involve bas64 encoding the WASM reducing bloat.

  • support for NodeJS 10 which is now EOL has had to be dropped due in compatibility with TextEncoder/TextDecoder that is used in the translated ES module.

  • Support for ASM.js has now been dropped due to:

    1. It being incredibly slow
    2. It significantly bloating the package size
    3. Complicating the module loading logic
    4. Support for WASM in browser is ever-improving and for those wanting to use the package in RN environments should be consuming it via a native module.
  • Tests for the changes have been added (for bug fixes / features)

  • The commit message(s) follow conventional commits

  • Documentation has been added / updated (for bug fixes / features)

  • Changes follow the contributing document.

Motivation and Context

See above

Does this PR introduce a breaking change?

  • Yes
  • No

Which merge strategy will you use?

  • Squash
  • Rebase (REVIEW COMMITS)

@tplooker tplooker force-pushed the tl/update-wasm-generation branch from 94a1e97 to 9e2f127 Compare May 22, 2021 22:40
@tplooker tplooker merged commit f1afe8b into master May 22, 2021
@tplooker tplooker deleted the tl/update-wasm-generation branch May 22, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant