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

RJS-2765: Upgrade BSON #6593

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

RJS-2765: Upgrade BSON #6593

wants to merge 9 commits into from

Conversation

elle-j
Copy link
Contributor

@elle-j elle-j commented Apr 4, 2024

What, How & Why?

Upgrading packages to use BSON v6. There are several breaking changes (v5, v6) in the BSON package, some of which affect us.

Notes on breaking changes:

  • Since we are reexporting the package, we should likely consider this a breaking change to our own packages as well.

Blocking:

  • The BSON package is currently using top-level await which currently prevents us from bundling if don't enable that feature. @kraenhansen has contributed a PR to BSON to alleviate this for us (see Jira ticket).

This closes #6561

☑️ ToDos

  • 📝 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

elle-j and others added 9 commits April 17, 2024 09:22
* Fixed a warning in the realm-web Rollup config

* Moved typescript and commonjs plugin down and stripping comments to lower IIFE bundle size

* Adding an alias for "bson" pointing to the .cjs bundle

* Upgrading ts-loader in the realm-web integration tests

* Updating tsconfigs in the realm web integration tests

* Using ESM when importing realm-web integration test files
@kraenhansen
Copy link
Member

I've rebased on latest main to get b88a065 and force-pushed to your branch 🤞

@kraenhansen
Copy link
Member

kraenhansen commented Apr 18, 2024

Latest React Native specific failure:

ReferenceError: Property 'btoa' doesn't exist
      at webByteUtils.toBase64 (/Users/runner/work/realm-js/realm-js/node_modules/bson/lib/bson.cjs:387:15)
      at Binary#toExtendedJSON (/Users/runner/work/realm-js/realm-js/node_modules/bson/lib/bson.cjs:549:47)
      at serializeDocument (/Users/runner/work/realm-js/realm-js/node_modules/bson/lib/bson.cjs:4088:36)
      at serializeValue (/Users/runner/work/realm-js/realm-js/node_modules/bson/lib/bson.cjs:4021:32)
      at stringify (/Users/runner/work/realm-js/realm-js/node_modules/bson/lib/bson.cjs:4120:30)

Metro seems to pick up "bson/lib/bson.cjs" instead of the RN specific bundle that is included in bson 🤔

@kraenhansen kraenhansen assigned kraenhansen and unassigned elle-j May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to BSON v6
2 participants