-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: BSON
Use Case
As a... frontend js-bson user
I want... js-bson to not dynamically import crypto
So that... using js-bson is a smooth experience
After removing support for Node.js 16 in NODE-6625 - The crypto global should be available in all our supported environments
User Experience
- Determine a path forward to ease user friction when using js-bson with frontend frameworks and bundlers
Dependencies
- upstream and/or downstream requirements and timelines to bear in mind
Risks/Unknowns
- What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
- Is there an opportunity for better cross-driver alignment or testing in this area?
- Is there an opportunity to improve existing documentation on this subject?
Acceptance Criteria
Implementation Requirements
- Update Node byte utils to use the global crypto object's getRandomValues to produce random bytes (i.e., we should probably be doing the exact same things as the web byte utils does)
- remove require_rewriter and usages from the rollup config
Testing Requirements
- All tests pass.
Documentation Requirements
- n/a
Follow Up Requirements
- n/a
- depends on
-
NODE-6625 Update BSON minimum Node version
-
- Closed
-
- is related to
-
NODE-3376 Node.js BSON dist cannot serialize browser BSON dist ObjectId
-
- Closed
-
-
NODE-6301 bson node es6 module import issue inside react app
-
- Closed
-
-
NODE-4211 "bson" package: Browser shouldn't require("crypto")
-
- Closed
-
-
NODE-6623 BSON exports causing confusion
-
- Closed
-
-
NODE-5773 Cant use BSON ObjectId in browser
-
- Closed
-
-
NODE-5816 NextJS 14 await is not defined
-
- Closed
-