Skip to content

Conversation

@nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Nov 22, 2022

Description

What is changing?

Removes deprecated default export, adds a namespace export.

// typescript and es module users:
import * as BSON from 'bson'; // either
import { BSON, ObjectId } from 'bson'; // or

// nodejs commonjs users:
const BSON = require('bson');

The following is no longer supported:

import BSON from 'bson';

What is the motivation for this change?

The default had to be maintained explicitly, did not have access to the type definitions nor constants so it wasn't an equivalent import. default export has a lot of behavioral corner cases that we want to avoid.

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken changed the title refactor!(NODE-4701): remove default export and add named namespace export feat!(NODE-4701): remove default export and add named namespace export Nov 23, 2022
@nbbeeken nbbeeken force-pushed the NODE-4701-rm-default-export branch 3 times, most recently from bfbd803 to 8566d66 Compare December 1, 2022 21:02
@nbbeeken nbbeeken marked this pull request as ready for review December 2, 2022 19:57
@nbbeeken nbbeeken added Blocked Blocked on other work and removed Blocked Blocked on other work labels Dec 2, 2022
@nbbeeken nbbeeken force-pushed the NODE-4701-rm-default-export branch 2 times, most recently from 82b9030 to 6ef65f2 Compare December 8, 2022 20:08
@nbbeeken nbbeeken removed the Blocked Blocked on other work label Dec 8, 2022
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 9, 2022
@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 9, 2022
@durran durran self-requested a review December 9, 2022 11:41
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@durran durran added Primary Review In Review with primary reviewer, not yet ready for team's eyes and removed Team Review Needs review from team labels Dec 9, 2022
@durran durran force-pushed the NODE-4701-rm-default-export branch from 6999d86 to 52e3711 Compare December 9, 2022 11:52
@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 9, 2022
@durran durran merged commit de00063 into main Dec 9, 2022
@durran durran deleted the NODE-4701-rm-default-export branch December 9, 2022 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Review Needs review from team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants