-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
Use Case
BSON should have consistent exports across module types (esm, cjs). The ideal way to offer the same style of export across modules is with using named exports only.
User Impact
- Migration will require code changes
- Users using webpack (which can be node or web users) may be pulling the esm compiled version of the BSON library and they will no longer have a default export to import from.
- It will lead to a runtime (perhaps bundle time) error.
- Any usage of import BSON from 'bson' would need to be changed to import {BSON} from 'bson'.
Dependencies
- BSON library
Unknowns
- None
Acceptance Criteria
Implementation Requirements
- Change export default BSON; to export const BSON in bson.ts
- Remove the deprecation attached to this variable
Testing Requirements
- Add unit tests much like the ones in unit/index.test.ts in the driver
- Should assert that all the current exports are present on require('bson')
- Should assert that all the current exports are also available on require('bson').BSON
- related to
-
NODE-4862 Remove internal constants from BSON public export
- Closed