Skip to content

Conversation

@tadjik1
Copy link
Member

@tadjik1 tadjik1 commented Jan 9, 2026

Description

Summary of Changes

This PR moves the ByteUtils and NumberUtils exports from the onDemand namespace to the BSON namespace of the package. This allows for direct imports of these utilities.

Documentation tags have been updated/maintained to ensure these exports are still explicitly marked as @experimental to indicate that their API is subject to change.

Notes for Reviewers

Previously, these were accessed via BSON.onDemand.NumberUtils.getInt32LE. Now, they can be imported directly via BSON.ByteUtils/NumberUtils mainly for consistency reasons (the onDemand ns is primarily for parsing functionality).

What is the motivation for this change?

The onDemand namespace creates unnecessary friction for accessing these useful utility classes. By lifting them to the BSON namespace, we improve developer experience and discoverability for advanced users who need to manipulate BSON/binary types or specific number formats, while still safeguarding the driver's semantic versioning guarantees by labeling them experimental.

Release Highlight

ByteUtils and NumberUtils removed from onDemand namespace

The experimental ByteUtils and NumberUtils helpers have been moved from the onDemand namespace to the top-level package export.

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@tadjik1 tadjik1 marked this pull request as ready for review January 13, 2026 15:35
@tadjik1 tadjik1 requested a review from a team as a code owner January 13, 2026 15:35
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jan 13, 2026
@baileympearson baileympearson self-assigned this Jan 13, 2026
@baileympearson baileympearson merged commit 92bbc34 into main Jan 15, 2026
9 checks passed
@baileympearson baileympearson deleted the NODE-7334 branch January 15, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants