Skip to content

Commit c676005

Browse files
mohitpubnubMohit Tejanipubnub-release-bot
authored
refactor/node-transport-undici (#500)
* migrate to undici v6.x * pin undici 7.27.2 as v8 dispatcher is incompatible with the runtimes build in fetch and raise engines node to leat LTS 22 version single AbortSignal owns request timeout; disable undici internal headers/body/connect timeouts for parity restore node-fetch error categorisation UND_ERR_ TIMEOUT, AggregateError unwrap log ALPN-negotiated protocol via a custom connector match keepAlive false TCP-keepalive behaviour bump CI matrix to Node 22 and 24 * lib updates * bump code snippet run time node version to 22 * logger changes for printing http protocol details when available with node transport. * making `react-native-url-polyfill` as optional dependency because its required only for React Native target * upgrade undici to v7.28 * PubNub SDK v12.0.0 release. * chores: `README`, `CODEOWNERS` updates --------- Co-authored-by: Mohit Tejani <mohit.tejani@Mohits-MacBook-Pro.local> Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
1 parent 94d7076 commit c676005

19 files changed

Lines changed: 1703 additions & 445 deletions

File tree

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
* @mohitpubnub @parfeon @seba-aln
1+
* @mohitpubnub @parfeon @jguz-pubnub
22
README.md @techwritermat @kazydek @mohitpubnub @parfeon

‎.github/workflows/run-tests.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
strategy:
2626
fail-fast: true
2727
matrix:
28-
node: [18.18.0, 20]
28+
node: [22, 24]
2929
env: ['ci:node']
3030
include:
31-
- node: 18.18.0
31+
- node: 22
3232
env: 'ci:web'
3333
steps:
3434
- name: Checkout repository
@@ -51,7 +51,7 @@ jobs:
5151
npm install
5252
npm run ${{ matrix.env }}
5353
- name: Test docs snippets syntax
54-
if: matrix.node == '18.18.0' && matrix.env == 'ci:node'
54+
if: matrix.node == '22' && matrix.env == 'ci:node'
5555
run: npm run test:snippets
5656
- name: Cancel workflow runs for commit on error
5757
if: failure()

‎.pubnub.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
changelog:
3+
- date: 2026-06-22
4+
version: v12.0.0
5+
changes:
6+
- type: feature
7+
text: "BREAKING CHANGES: Added HTTP/2 support for Node, upgrade minimum node version requirements to v22."
8+
- type: bug
9+
text: "React native specific dependencies is made as peer-dependency for package dependency installation."
310
- date: 2026-06-11
411
version: v11.0.2
512
changes:
@@ -1416,7 +1423,7 @@ supported-platforms:
14161423
- 'Ubuntu 14.04 and up'
14171424
- 'Windows 7 and up'
14181425
version: 'Pubnub Javascript for Node'
1419-
version: '11.0.2'
1426+
version: '12.0.0'
14201427
sdks:
14211428
- full-name: PubNub Javascript SDK
14221429
short-name: Javascript
@@ -1432,7 +1439,7 @@ sdks:
14321439
- distribution-type: source
14331440
distribution-repository: GitHub release
14341441
package-name: pubnub.js
1435-
location: https://github.com/pubnub/javascript/archive/refs/tags/v11.0.2.zip
1442+
location: https://github.com/pubnub/javascript/archive/refs/tags/v12.0.0.zip
14361443
requires:
14371444
- name: 'agentkeepalive'
14381445
min-version: '3.5.2'
@@ -2103,7 +2110,7 @@ sdks:
21032110
- distribution-type: library
21042111
distribution-repository: GitHub release
21052112
package-name: pubnub.js
2106-
location: https://github.com/pubnub/javascript/releases/download/v11.0.2/pubnub.11.0.2.js
2113+
location: https://github.com/pubnub/javascript/releases/download/v12.0.0/pubnub.12.0.0.js
21072114
requires:
21082115
- name: 'agentkeepalive'
21092116
min-version: '3.5.2'

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v12.0.0
2+
June 22 2026
3+
4+
#### Added
5+
- **BREAKING CHANGES**: Added HTTP/2 support for Node, upgrade minimum node version requirements to v22.
6+
7+
#### Fixed
8+
- React native specific dependencies is made as peer-dependency for package dependency installation. Fixed the following issues reported by [@tmcpartlin](https://github.com/tmcpartlin): [#383](https://github.com/pubnub/javascript/issues/383).
9+
110
## v11.0.2
211
June 11 2026
312

‎README.md‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,20 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
2727
npm install pubnub
2828
```
2929
* or download one of our builds from our CDN:
30-
* https://cdn.pubnub.com/sdk/javascript/pubnub.11.0.2.js
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.11.0.2.min.js
30+
* https://cdn.pubnub.com/sdk/javascript/pubnub.12.0.0.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.12.0.0.min.js
32+
33+
> **React Native:** the SDK relies on a global `URL` implementation, which React Native does not
34+
> provide, so it depends on [`react-native-url-polyfill`](https://www.npmjs.com/package/react-native-url-polyfill).
35+
> This is declared as an **optional peer dependency** — only React Native projects need it, while
36+
> Node.js and browser consumers are unaffected. Install it alongside the SDK:
37+
>
38+
> ```
39+
> npm install react-native-url-polyfill
40+
> ```
41+
>
42+
> The SDK loads the polyfill automatically (`import 'react-native-url-polyfill/auto'`), so no extra
43+
> import is required once the package is installed.
3244
3345
2. Configure your keys:
3446

‎dist/web/pubnub.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4621,7 +4621,7 @@
46214621
const formattedBody = this.formattedBody(message);
46224622
const padding = ((formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.formData) ? 'Headers' : 'Status').length;
46234623
const response = message.message;
4624-
return `Received HTTP response:\n ${this.paddedString('URL', padding)}: ${response.url}\n ${this.paddedString('Status', padding)}: ${response.status}${headersList ? `\n ${this.paddedString('Headers', padding)}:\n${headersList}` : ''}${(formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.body) ? `\n ${this.paddedString('Body', padding)}:\n${formattedBody.body}` : ''}`;
4624+
return `Received HTTP response:\n ${this.paddedString('URL', padding)}: ${response.url}\n ${this.paddedString('Status', padding)}: ${response.status}${message.details ? `\n ${this.paddedString('Details', padding)}: ${message.details}` : ''}${headersList ? `\n ${this.paddedString('Headers', padding)}:\n${headersList}` : ''}${(formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.body) ? `\n ${this.paddedString('Body', padding)}:\n${formattedBody.body}` : ''}`;
46254625
}
46264626
else if (message.messageType === 'error') {
46274627
const formattedStatus = this.formattedErrorStatus(message);
@@ -5432,7 +5432,7 @@
54325432
return base.PubNubFile;
54335433
},
54345434
get version() {
5435-
return '11.0.2';
5435+
return '12.0.0';
54365436
},
54375437
getVersion() {
54385438
return this.version;

‎dist/web/pubnub.min.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/core/components/configuration.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
168168
return base.PubNubFile;
169169
},
170170
get version() {
171-
return '11.0.2';
171+
return '12.0.0';
172172
},
173173
getVersion() {
174174
return this.version;

‎lib/loggers/console-logger.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ConsoleLogger {
105105
const formattedBody = this.formattedBody(message);
106106
const padding = ((formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.formData) ? 'Headers' : 'Status').length;
107107
const response = message.message;
108-
return `Received HTTP response:\n ${this.paddedString('URL', padding)}: ${response.url}\n ${this.paddedString('Status', padding)}: ${response.status}${headersList ? `\n ${this.paddedString('Headers', padding)}:\n${headersList}` : ''}${(formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.body) ? `\n ${this.paddedString('Body', padding)}:\n${formattedBody.body}` : ''}`;
108+
return `Received HTTP response:\n ${this.paddedString('URL', padding)}: ${response.url}\n ${this.paddedString('Status', padding)}: ${response.status}${message.details ? `\n ${this.paddedString('Details', padding)}: ${message.details}` : ''}${headersList ? `\n ${this.paddedString('Headers', padding)}:\n${headersList}` : ''}${(formattedBody === null || formattedBody === void 0 ? void 0 : formattedBody.body) ? `\n ${this.paddedString('Body', padding)}:\n${formattedBody.body}` : ''}`;
109109
}
110110
else if (message.messageType === 'error') {
111111
const formattedStatus = this.formattedErrorStatus(message);

0 commit comments

Comments
 (0)