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

Browser support (take 2) #6821

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Browser support (take 2) #6821

wants to merge 11 commits into from

Conversation

kraenhansen
Copy link
Member

What, How & Why?

The work in #5895 has rotted a bit and we want to ensure this gets merged.
One blocker of that was the need for a top-level await of the WASM native module, which we cannot export as our module is currently CommonJS (uses require statements, which doesn't support top-level await semantics).

As outlined in the original proposal for the top-level await language feature:

In the absence of this feature, it's possible to export a Promise from a module, and wait on that to know when its exports are ready.

And until our SDK exports as ESM, I suggest we export a ready promise which must be awaited until interacting with the SDK on platforms which load the native module asynchronously.

NOTE: This PR currently targets kh/wrapper-refactored (which in turn targets kh/avoid-circular-imports) and need to be re-based once it's merged.
NOTE: This also needs to #6820

☑️ ToDos

  • Update to use the unified "wrapper.ts" instead of implementing a "wasm-wrapper.ts" template which depends on the (now deleted) base-wrapper.ts
  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 💥 Breaking label has been applied or is not necessary
  • 🔔 Mention @realm/devdocs if documentation changes are needed

@kraenhansen kraenhansen force-pushed the kh/wrapper-refactored branch 2 times, most recently from 23ebc3a to 348ab11 Compare August 12, 2024 12:05
@cla-bot cla-bot bot added the cla: yes label Aug 12, 2024
Base automatically changed from kh/wrapper-refactored to main August 14, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant