Skip to content

Commit e8362c3

Browse files
mohitpubnubMohit Tejanipubnub-release-bot
authored
react-native: use fast-text-encoding and remove outdated text-encoding polyfill (#487)
* use `fast-text-encoding` for react native instead outdated `fast-encoding` * PubNub SDK v10.2.5 release. --------- Co-authored-by: Mohit Tejani <[email protected]> Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 9032b02 commit e8362c3

File tree

11 files changed

+47
-32
lines changed

11 files changed

+47
-32
lines changed

.pubnub.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
changelog:
3+
- date: 2025-12-16
4+
version: v10.2.5
5+
changes:
6+
- type: improvement
7+
text: "Use `fast-text-encoding` for react native instead of outdated `fast-encoding` polyfill."
38
- date: 2025-12-04
49
version: v10.2.4
510
changes:
@@ -1374,7 +1379,7 @@ supported-platforms:
13741379
- 'Ubuntu 14.04 and up'
13751380
- 'Windows 7 and up'
13761381
version: 'Pubnub Javascript for Node'
1377-
version: '10.2.4'
1382+
version: '10.2.5'
13781383
sdks:
13791384
- full-name: PubNub Javascript SDK
13801385
short-name: Javascript
@@ -1390,7 +1395,7 @@ sdks:
13901395
- distribution-type: source
13911396
distribution-repository: GitHub release
13921397
package-name: pubnub.js
1393-
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.4.zip
1398+
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.5.zip
13941399
requires:
13951400
- name: 'agentkeepalive'
13961401
min-version: '3.5.2'
@@ -2061,7 +2066,7 @@ sdks:
20612066
- distribution-type: library
20622067
distribution-repository: GitHub release
20632068
package-name: pubnub.js
2064-
location: https://github.com/pubnub/javascript/releases/download/v10.2.4/pubnub.10.2.4.js
2069+
location: https://github.com/pubnub/javascript/releases/download/v10.2.5/pubnub.10.2.5.js
20652070
requires:
20662071
- name: 'agentkeepalive'
20672072
min-version: '3.5.2'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.2.5
2+
December 16 2025
3+
4+
#### Modified
5+
- Use `fast-text-encoding` for react native instead of outdated `fast-encoding` polyfill.
6+
17
## v10.2.4
28
December 04 2025
39

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ 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.10.2.4.js
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.4.min.js
30+
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.5.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.5.min.js
3232
3333
2. Configure your keys:
3434

dist/web/pubnub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5436,7 +5436,7 @@
54365436
return base.PubNubFile;
54375437
},
54385438
get version() {
5439-
return '10.2.4';
5439+
return '10.2.5';
54405440
},
54415441
getVersion() {
54425442
return this.version;

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
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 '10.2.4';
171+
return '10.2.5';
172172
},
173173
getVersion() {
174174
return this.version;

lib/react_native/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
const text_encoding_1 = require("text-encoding");
76
require("react-native-url-polyfill/auto");
7+
require("fast-text-encoding");
88
const cbor_js_1 = __importDefault(require("cbor-js"));
99
const buffer_1 = require("buffer");
1010
const stringify_buffer_keys_1 = require("../core/components/stringify_buffer_keys");
@@ -19,9 +19,7 @@ const LegacyCryptoModule_1 = __importDefault(require("../crypto/modules/LegacyCr
1919
const pubnub_common_1 = require("../core/pubnub-common");
2020
const configuration_2 = require("./configuration");
2121
const common_1 = __importDefault(require("../cbor/common"));
22-
// Polyfill global environment
23-
global.TextEncoder = global.TextEncoder || text_encoding_1.TextEncoder;
24-
global.TextDecoder = global.TextDecoder || text_encoding_1.TextDecoder;
22+
// Polyfill global Buffer for React Native environment
2523
global.Buffer = global.Buffer || buffer_1.Buffer;
2624
/**
2725
* PubNub client for React Native platform.

package-lock.json

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

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pubnub",
3-
"version": "10.2.4",
3+
"version": "10.2.5",
44
"author": "PubNub <[email protected]>",
55
"description": "Publish & Subscribe Real-time Messaging with PubNub",
66
"scripts": {
@@ -60,13 +60,13 @@
6060
"buffer": "^6.0.3",
6161
"cbor-js": "^0.1.0",
6262
"cbor-sync": "^1.0.4",
63+
"fast-text-encoding": "^1.0.6",
6364
"fflate": "^0.8.2",
6465
"form-data": "^4.0.4",
6566
"lil-uuid": "^0.1.1",
6667
"node-fetch": "^2.7.0",
6768
"proxy-agent": "^6.3.0",
68-
"react-native-url-polyfill": "^2.0.0",
69-
"text-encoding": "^0.7.0"
69+
"react-native-url-polyfill": "^2.0.0"
7070
},
7171
"devDependencies": {
7272
"@rollup/plugin-commonjs": "^25.0.7",
@@ -79,6 +79,7 @@
7979
"@types/chai": "^4.3.14",
8080
"@types/chai-as-promised": "^7.1.8",
8181
"@types/expect": "^24.3.0",
82+
"@types/fast-text-encoding": "^1.0.3",
8283
"@types/lil-uuid": "^0.1.3",
8384
"@types/mocha": "^9.1.0",
8485
"@types/nock": "^9.3.1",
@@ -118,8 +119,8 @@
118119
"sinon": "^7.5.0",
119120
"sinon-chai": "^3.3.0",
120121
"source-map-support": "^0.5.21",
121-
"ts-mocha": "^10.0.0",
122122
"ts-loader": "^9.5.2",
123+
"ts-mocha": "^10.0.0",
123124
"ts-node": "^10.9.2",
124125
"tsx": "^4.7.1",
125126
"typescript": "^5.4.5",

src/core/components/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export const makeConfiguration = (
236236
return base.PubNubFile;
237237
},
238238
get version(): string {
239-
return '10.2.4';
239+
return '10.2.5';
240240
},
241241
getVersion(): string {
242242
return this.version;

0 commit comments

Comments
 (0)