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

fix: Init WASM modules using Base64 #2913

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Nov 28, 2024

This PR changes the WASM loader slightly to package the WASM source code using Base64 and decode it at runtime. This has multiple effects:

  • Fixes an obscure OOM bug in Firefox that would only occur on Mac OS (possibly due to extremely large arrays?)
  • Reduces bundle size for Snaps that leverage WASM
  • Prevents bundler slowdown due to large arrays needing to be parsed by Babel

This adds minor overhead to initializing WASM bundles, but this seems worth it given the effects above.

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.48%. Comparing base (03cd5d6) to head (76ef209).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2913      +/-   ##
==========================================
- Coverage   94.48%   94.48%   -0.01%     
==========================================
  Files         487      487              
  Lines       10429    10428       -1     
  Branches     1598     1598              
==========================================
- Hits         9854     9853       -1     
  Misses        575      575              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrederikBolding FrederikBolding marked this pull request as ready for review November 28, 2024 12:48
@FrederikBolding FrederikBolding requested a review from a team as a code owner November 28, 2024 12:48
@FrederikBolding FrederikBolding merged commit 0fe7eda into main Nov 28, 2024
166 checks passed
@FrederikBolding FrederikBolding deleted the fb/change-wasm-init branch November 28, 2024 14:09
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.

3 participants