-
Notifications
You must be signed in to change notification settings - Fork 257
fix(NODE-6074): Avoiding top-level awaits in bson
by introducing "node" bundles
#669
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
Conversation
@@ -107,7 +109,7 @@ | |||
"check:granular-bench": "npm run build:bench && node ./test/bench/etc/run_granular_benchmarks.js", | |||
"check:spec-bench": "npm run build:bench && node ./test/bench/lib/spec/bsonBench.js", | |||
"build:bench": "cd test/bench && npx tsc", | |||
"build:ts": "node ./node_modules/typescript/bin/tsc", | |||
"build:ts": "node ./node_modules/typescript/bin/tsc --build --force", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding --build
because the project now relies on TS project references.
Adding --force
because the composite: true
entails incremental: true
and subsequent runs of build:dts
would fail because the clean_definition_files
deletes files produced by tsc
and because of the incremental: true
it TSC doesn't check the existence of cached files. The --force
opts out of incremental builds.
It seems there are some type issues with the tests that I have to sort out, but I'll have to end for today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would alleviate things for us on the Realm JS side 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We plan to meet about this so we can dive into more detail over a call but this change is a reversal of prior design decision to unify the javascript that is run in our supported environments.
It is unfortunate that a language feature like top-level await still causes a hassle with bundling but we and others have dealt with this in the past by enabling the flags needed to import such syntax or forced resolution to use the commonjs module.
Okay. We'll revisit our configurations and try to make it work 👍 |
Description
What is changing?
I suggest introducing two node specific bundles, which performs the import of
node:crypto
.The "realm" SDK uses a similar pattern of platform specific entrypoints declared via separate export conditions and TS project references.
Is there new documentation needed for these changes?
What is the motivation for this change?
See https://jira.mongodb.org/browse/NODE-6074
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript