5.4.0 (2023-07-03)
The MongoDB Node.js team is pleased to announce version 5.4.0 of the bson
package!
Release Notes
Improved React Native experience
The BSON package now ships a bundle made to work on React Native without additional polyfills preconfigured. The necessary APIs (TextEncoder
/TextDecoder
& atob
/btoa
) are now vendored into the RN bundle directly. Users should still install react-native-get-random-values
themselves to get securely generated UUIDs and ObjectIds. Read more in the React Native section of our readme.
Improved BSON UTF8 Decoding Performance
In the v5 major release of BSON we internally abstracted the different byte manipulation APIs used based on whether the library is running in Node.js or in a browser. This abstraction required us to create a subarray
before invoking the environment's UTF8 decoding API. Creating the subarray before invoking Node.js' Buffer.prototype.toString
API turns out to cause an unnecessary slow down. We have now updated the UTF8 stringification step on Node.js to invoke Buffer.prototype.toString
with the start
and end
offsets. See #585 for our research.
Features
Bug Fixes
Documentation
We invite you to try the bson
library immediately, and report any issues to the NODE project.