Skip to content

Conversation

@PavelSafronov
Copy link
Contributor

@PavelSafronov PavelSafronov commented Jan 14, 2026

Description

Summary of Changes

Notes for Reviewers

Steps to run locally:

  1. Pull down fix(NODE-7397): Use type predicate for isUint8Array js-bson#860
  2. In js-bson, run npm link
  3. In driver, run npm link ../js-bson (Note: double-check the path)

What is the motivation for this change?

Release Highlight

Release notes highlight

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

const AWAIT_CAPABLE = 8;

const encodeUTF8Into = BSON.BSON.onDemand.ByteUtils.encodeUTF8Into;
const encodeUTF8Into = BSON.onDemand.ByteUtils.encodeUTF8Into;
Copy link
Member

@tadjik1 tadjik1 Jan 14, 2026

Choose a reason for hiding this comment

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

ByteUtils should be available from the BSON ns (we remove them from onDemand)

Suggested change
const encodeUTF8Into = BSON.onDemand.ByteUtils.encodeUTF8Into;
const encodeUTF8Into = BSON.ByteUtils.encodeUTF8Into;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed onDemand references.

1. using Uint8Array instead of Buffer in all internal code
2. enabling eslint rule to block Buffer use in src
3. using BSON's ByteUtils in places where we depended on Buffer operations
4. using ByteUtils.isUint8Array instead of Buffer.isBuffer
5. introduced writeInt32LE wrapper that uses the same order of variables, to avoid embarassing mistakes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants