Skip to content

Commit d6d8979

Browse files
authored
Merge branch 'main' into perf-testing-2
2 parents a80e4e2 + 0664840 commit d6d8979

File tree

11 files changed

+586
-514
lines changed

11 files changed

+586
-514
lines changed

.github/scripts/highlights.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ async function pullRequestHighlights(prs) {
7070
if (!highlights.length) return '';
7171

7272
highlights.unshift('## Release Notes\n\n');
73-
return highlights.join('\n\n');
73+
74+
const highlight = highlights.join('\n\n');
75+
console.log(`Total highlight is ${highlight.length} characters long`);
76+
return highlight;
7477
}
7578

7679
console.log('List of PRs to collect highlights from:', prs);

.github/scripts/pr_list.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ const historyFilePath = path.join(__dirname, '..', '..', 'HISTORY.md');
1313
*/
1414
function parsePRList(history) {
1515
const prRegexp = /js-bson\/issues\/(?<prNum>\d+)\)/iu;
16-
return history
17-
.split('\n')
18-
.map(line => prRegexp.exec(line)?.groups?.prNum ?? '')
19-
.filter(prNum => prNum !== '');
16+
return Array.from(
17+
new Set(
18+
history
19+
.split('\n')
20+
.map(line => prRegexp.exec(line)?.groups?.prNum ?? '')
21+
.filter(prNum => prNum !== '')
22+
)
23+
);
2024
}
2125

2226
const historyContents = await fs.readFile(historyFilePath, { encoding: 'utf8' });

HISTORY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [6.0.0-alpha.0](https://github.com/mongodb/js-bson/compare/v5.4.0...v6.0.0-alpha.0) (2023-08-15)
6+
7+
8+
### ⚠ BREAKING CHANGES
9+
10+
* **NODE-5504:** bump bson major version (#605)
11+
* **NODE-4770:** remove 12 length string support from ObjectId constructor (#601)
12+
* **NODE-4769:** remove ISO-8859-1 string support from Binary (#602)
13+
* **NODE-5223:** remove deprecated cacheHexString (#595)
14+
* **NODE-4787:** bump minimum Node.js version to v16.20.1 (#590)
15+
16+
### Features
17+
18+
* **NODE-4769:** remove ISO-8859-1 string support from Binary ([#602](https://github.com/mongodb/js-bson/issues/602)) ([74f7f8a](https://github.com/mongodb/js-bson/commit/74f7f8a447fa0b0b1557cba14e75ff052df54d13))
19+
* **NODE-4770:** remove 12 length string support from ObjectId constructor ([#601](https://github.com/mongodb/js-bson/issues/601)) ([409c592](https://github.com/mongodb/js-bson/commit/409c592524a6eec6a89eb96dee4b51e4f8adf5ae))
20+
* **NODE-4787:** bump minimum Node.js version to v16.20.1 ([#590](https://github.com/mongodb/js-bson/issues/590)) ([1dcca92](https://github.com/mongodb/js-bson/commit/1dcca92b24e609a069ca7f4187e5b9521380b2f5))
21+
* **NODE-5223:** remove deprecated cacheHexString ([#595](https://github.com/mongodb/js-bson/issues/595)) ([76eca2b](https://github.com/mongodb/js-bson/commit/76eca2b44c5fd0a4f4d5037346a29c2f9a5350b5))
22+
* **NODE-5504:** bump bson major version ([#605](https://github.com/mongodb/js-bson/issues/605)) ([9615902](https://github.com/mongodb/js-bson/commit/9615902943927646562c145604fc477cd42e9ce6))
23+
24+
25+
### Bug Fixes
26+
27+
* **NODE-5509:** Allow undefined or null params in ObjectId.equals ([#607](https://github.com/mongodb/js-bson/issues/607)) ([e2674c6](https://github.com/mongodb/js-bson/commit/e2674c6c2940d81e5de5b6c9500391ce5b1a2649))
28+
529
## [5.4.0](https://github.com/mongodb/js-bson/compare/v5.3.0...v5.4.0) (2023-07-03)
630

731

README.md

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ BSON is short for "Binary JSON," and is the binary-encoded serialization of JSON
44
You can learn more about it in [the specification](http://bsonspec.org).
55

66
### Table of Contents
7+
78
- [Usage](#usage)
89
- [Bugs/Feature Requests](#bugs--feature-requests)
910
- [Installation](#installation)
@@ -18,7 +19,7 @@ Think you've found a bug? Want to see a new feature in `bson`? Please open a cas
1819
2. Navigate to the NODE project: [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE)
1920
3. Click **Create Issue** - Please provide as much information as possible about the issue and how to reproduce it.
2021

21-
Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are **public**.
22+
Bug reports in JIRA for the NODE driver project are **public**.
2223

2324
## Usage
2425

@@ -67,41 +68,52 @@ If you are working directly in the browser without a bundler please use the `.mj
6768
npm install bson
6869
```
6970

71+
### MongoDB Node.js Driver Version Compatibility
72+
73+
Only the following version combinations with the [MongoDB Node.js Driver](https://github.com/mongodb/node-mongodb-native) are considered stable.
74+
75+
76+
| ------------- | ---------- | ---------- | ---------- | ---------- |
77+
| `[email protected]` | N/A | N/A | N/A ||
78+
| `[email protected]` | N/A | N/A || N/A |
79+
| `[email protected]` | N/A || N/A | N/A |
80+
| `[email protected]` || N/A | N/A | N/A |
81+
7082
## Documentation
7183

72-
### BSON
84+
### BSON
7385

7486
[API documentation](https://mongodb.github.io/node-mongodb-native/Next/modules/BSON.html)
7587

7688
<a name="EJSON"></a>
7789

7890
### EJSON
7991

80-
* [EJSON](#EJSON)
81-
82-
* [.parse(text, [options])](#EJSON.parse)
92+
- [EJSON](#EJSON)
8393

84-
* [.stringify(value, [replacer], [space], [options])](#EJSON.stringify)
94+
- [.parse(text, [options])](#EJSON.parse)
8595

86-
* [.serialize(bson, [options])](#EJSON.serialize)
96+
- [.stringify(value, [replacer], [space], [options])](#EJSON.stringify)
8797

88-
* [.deserialize(ejson, [options])](#EJSON.deserialize)
98+
- [.serialize(bson, [options])](#EJSON.serialize)
8999

100+
- [.deserialize(ejson, [options])](#EJSON.deserialize)
90101

91102
<a name="EJSON.parse"></a>
92103

93-
#### *EJSON*.parse(text, [options])
104+
#### _EJSON_.parse(text, [options])
94105

95-
| Param | Type | Default | Description |
96-
| --- | --- | --- | --- |
97-
| text | <code>string</code> | | |
98-
| [options] | <code>object</code> | | Optional settings |
106+
| Param | Type | Default | Description |
107+
| ----------------- | -------------------- | ----------------- | ---------------------------------------------------------------------------------- |
108+
| text | <code>string</code> | | |
109+
| [options] | <code>object</code> | | Optional settings |
99110
| [options.relaxed] | <code>boolean</code> | <code>true</code> | Attempt to return native JS types where possible, rather than BSON types (if true) |
100111

101112
Parse an Extended JSON string, constructing the JavaScript value or object described by that
102113
string.
103114

104115
**Example**
116+
105117
```js
106118
const { EJSON } = require('bson');
107119
const text = '{ "int32": { "$numberInt": "10" } }';
@@ -112,24 +124,26 @@ console.log(EJSON.parse(text, { relaxed: false }));
112124
// prints { int32: 10 }
113125
console.log(EJSON.parse(text));
114126
```
127+
115128
<a name="EJSON.stringify"></a>
116129

117-
#### *EJSON*.stringify(value, [replacer], [space], [options])
130+
#### _EJSON_.stringify(value, [replacer], [space], [options])
118131

119-
| Param | Type | Default | Description |
120-
| --- | --- | --- | --- |
121-
| value | <code>object</code> | | The value to convert to extended JSON |
122-
| [replacer] | <code>function</code> \| <code>array</code> | | A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string |
123-
| [space] | <code>string</code> \| <code>number</code> | | A String or Number object that's used to insert white space into the output JSON string for readability purposes. |
124-
| [options] | <code>object</code> | | Optional settings |
125-
| [options.relaxed] | <code>boolean</code> | <code>true</code> | Enabled Extended JSON's `relaxed` mode |
126-
| [options.legacy] | <code>boolean</code> | <code>true</code> | Output in Extended JSON v1 |
132+
| Param | Type | Default | Description |
133+
| ----------------- | ------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
134+
| value | <code>object</code> | | The value to convert to extended JSON |
135+
| [replacer] | <code>function</code> \| <code>array</code> | | A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string |
136+
| [space] | <code>string</code> \| <code>number</code> | | A String or Number object that's used to insert white space into the output JSON string for readability purposes. |
137+
| [options] | <code>object</code> | | Optional settings |
138+
| [options.relaxed] | <code>boolean</code> | <code>true</code> | Enabled Extended JSON's `relaxed` mode |
139+
| [options.legacy] | <code>boolean</code> | <code>true</code> | Output in Extended JSON v1 |
127140

128141
Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer
129142
function is specified or optionally including only the specified properties if a replacer array
130143
is specified.
131144

132145
**Example**
146+
133147
```js
134148
const { EJSON } = require('bson');
135149
const Int32 = require('mongodb').Int32;
@@ -141,24 +155,25 @@ console.log(EJSON.stringify(doc, { relaxed: false }));
141155
// prints '{"int32":10}'
142156
console.log(EJSON.stringify(doc));
143157
```
158+
144159
<a name="EJSON.serialize"></a>
145160

146-
#### *EJSON*.serialize(bson, [options])
161+
#### _EJSON_.serialize(bson, [options])
147162

148-
| Param | Type | Description |
149-
| --- | --- | --- |
150-
| bson | <code>object</code> | The object to serialize |
163+
| Param | Type | Description |
164+
| --------- | ------------------- | ---------------------------------------------------- |
165+
| bson | <code>object</code> | The object to serialize |
151166
| [options] | <code>object</code> | Optional settings passed to the `stringify` function |
152167

153168
Serializes an object to an Extended JSON string, and reparse it as a JavaScript object.
154169

155170
<a name="EJSON.deserialize"></a>
156171

157-
#### *EJSON*.deserialize(ejson, [options])
172+
#### _EJSON_.deserialize(ejson, [options])
158173

159-
| Param | Type | Description |
160-
| --- | --- | --- |
161-
| ejson | <code>object</code> | The Extended JSON object to deserialize |
174+
| Param | Type | Description |
175+
| --------- | ------------------- | -------------------------------------------- |
176+
| ejson | <code>object</code> | The Extended JSON object to deserialize |
162177
| [options] | <code>object</code> | Optional settings passed to the parse method |
163178

164179
Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types
@@ -194,7 +209,7 @@ BSON vendors the required polyfills for `TextEncoder`, `TextDecoder`, `atob`, `b
194209
npm install --save react-native-get-random-values
195210
```
196211

197-
The following snippet should be placed at the top of the entrypoint (by default this is the root `index.js` file) for React Native projects using the BSON library. These lines must be placed for any code that imports `BSON`.
212+
The following snippet should be placed at the top of the entrypoint (by default this is the root `index.js` file) for React Native projects using the BSON library. These lines must be placed for any code that imports `BSON`.
198213

199214
```typescript
200215
// Required Polyfills For ReactNative
@@ -211,7 +226,7 @@ This will cause React Native to import the `node_modules/bson/lib/bson.rn.cjs` b
211226

212227
### Technical Note about React Native module import
213228

214-
The `"exports"` definition in our `package.json` will result in BSON's CommonJS bundle being imported in a React Native project instead of the ES module bundle. Importing the CommonJS bundle is necessary because BSON's ES module bundle of BSON uses top-level await, which is not supported syntax in [React Native's runtime hermes](https://hermesengine.dev/).
229+
The `"exports"` definition in our `package.json` will result in BSON's CommonJS bundle being imported in a React Native project instead of the ES module bundle. Importing the CommonJS bundle is necessary because BSON's ES module bundle of BSON uses top-level await, which is not supported syntax in [React Native's runtime hermes](https://hermesengine.dev/).
215230

216231
## FAQ
217232

etc/eslint/no-bigint-usage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"chai": "^4.3.7",
13-
"eslint": "^8.33.0",
13+
"eslint": "^8.46.0",
1414
"mocha": "^10.2.0"
1515
}
1616
}

0 commit comments

Comments
 (0)