Skip to content

Commit 78530b5

Browse files
Merge branch 'development' into type_declarations_update
2 parents df870f4 + a395b47 commit 78530b5

File tree

19 files changed

+69
-67
lines changed

19 files changed

+69
-67
lines changed

.github/workflows/sonar-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: Set up nodejs
22+
- name: Set up Node.js
2323
uses: actions/setup-node@v3
2424
with:
2525
node-version: 'lts/*'

CHANGES.txt

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.

CONTRIBUTORS-GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Split SDK is an open source project and we welcome feedback and contribution. Th
77
### Development process
88

99
1. Fork the repository and create a topic branch from `development` branch. Please use a descriptive name for your branch.
10-
2. Run `nvm use` to ensure that you are using the right npm and node version, and `npm install` to have the dependencies up to date.
10+
2. Run `nvm use` to ensure that you are using the right npm and Node.js version, and `npm install` to have the dependencies up to date.
1111
3. While developing, use descriptive messages in your commits. Avoid short or meaningless sentences like: "fix bug".
1212
4. Make sure to add tests for both positive and negative cases.
1313
5. If your changes have any impact on the public API, make sure you update the TypeScript declarations as well as it's related test file.
@@ -46,7 +46,7 @@ Consider running the linter script (`npm run check:lint`) and fixing any issues
4646

4747
If you want to debug your changes consuming it from a test application, you could:
4848
- For browsers, import the **UMD** bundle from an HTML document. To debug you can use the browser dev tools.
49-
- For Node, you could use symlinks via [npm link command](https://docs.npmjs.com/cli/link.html) and then import the package as usual. To debug you could use the [Node inspector](https://nodejs.org/en/docs/guides/debugging-getting-started/).
49+
- For Node.js, you could use symlinks via [npm link command](https://docs.npmjs.com/cli/link.html) and then import the package as usual. To debug you could use the [Node.js inspector](https://nodejs.org/en/docs/guides/debugging-getting-started/).
5050

5151
# Contact
5252

MIGRATION-GUIDE.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
JavaScript SDK v11.0.0 has a few breaking changes that you should consider when migrating from version 10.x.x.
44

5-
## Changes that affect server-side API (NodeJS)
5+
## Changes that affect server-side API (Node.js)
66

7-
The only change that affects the use of the SDK on NodeJS is the drop of support for NodeJS v6. The SDK now requires NodeJS v14 or above.
7+
While JavaScript SDK previously supported Node.js v6 and above, the SDK now requires Node.js v14 or above.
88

99
## Changes that affect client-side API (Browser)
1010

@@ -53,16 +53,18 @@ accountClient.track('account', 'my_event');
5353

5454
- **Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations. The `integrations` configuration option has been removed from the SDK factory configuration, along with the associated interfaces in the TypeScript definitions.**
5555

56-
The Google Analytics integrations were removed since they integrate with the *Google Universal Analytics* library, which was shut down on July 1, 2024, and [replaced by *Google Analytics 4*](https://support.google.com/analytics/answer/11583528?hl=en). Check [this docs](https://help.split.io/hc/en-us/articles/360040838752-Google-Analytics#google-analytics-4-ga4) for more information on how to integrate Split with Google Analytics 4.
56+
The Google Analytics integrations were removed since they integrate with the *Google Universal Analytics* library, which was shut down on July 1, 2024, and [replaced by *Google Analytics 4*](https://support.google.com/analytics/answer/11583528?hl=en). Go to Split's [Google Analytics integration guide](https://help.split.io/hc/en-us/articles/360040838752-Google-Analytics) for more information on how to integrate Split with Google Analytics 4.
5757

5858
The integrations have stopped being used and maintained, and were removed from the SDK, together with the `integrations` configuration option. If you were using the `integrations` option, you should remove it from your SDK configuration object.
5959

60-
- **Removed internal ponyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers.**
60+
- **Removed internal polyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers.**
6161

6262
The SDK no longer ships with internal implementations for the `Map` and `Set` global objects, which were used to support old browsers like IE.
6363

6464
If you need to target environments that do not support these features natively, you should provide a polyfill for them. For example, [es6-map](https://github.com/medikoo/es6-map) for `Map`, and [es6-set](https://github.com/medikoo/es6-set) for `Set`.
6565

66+
In addition, the Split SDK depends on support for ES6 promises. Since v10.2.0, the SDK does not pollute any global variable to add the ES6 promise polyfill. If your environment does not support ES6 promises, you can [polyfill](https:/github.com/stefanpenner/es6-promise).
67+
6668
- **Dropped support for Split Proxy below version 5.9.0, when using in the browser (client-side API). The SDK now requires Split Proxy 5.9.0 or above.**
6769

6870
If using the Split Proxy with the SDK in the browser, make sure to update it to version 5.9.0 or above. This is required due to the introduction of Large Segments matchers in the SDK on client-side, which uses a new HTTP endpoint to retrieve the segments data and is only supported by Split Proxy 5.9.0.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Split has built and maintains SDKs for:
7171
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
7272
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
7373
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
74-
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
74+
* Node.js [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
7575
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
7676
* PHP thin-client [Github](https://github.com/splitio/php-thin-client) [Docs](https://help.split.io/hc/en-us/articles/18305128673933-PHP-Thin-Client-SDK)
7777
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)

src/__tests__/consumer/node_redis.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const initializeRedisServer = (mock = '') => {
8383
exec(`cat ./src/__tests__/mocks/${mockFileName}.txt | redis-cli -p ${redisPort}`, err => {
8484
if (err) {
8585
reject(server);
86-
// node couldn't execute the command
86+
// Node.js couldn't execute the command
8787
return;
8888
}
8989

@@ -95,7 +95,7 @@ const initializeRedisServer = (mock = '') => {
9595
return promise;
9696
};
9797

98-
tape('NodeJS Redis', function (t) {
98+
tape('Node.js Redis', function (t) {
9999

100100
t.test('Regular usage - DEBUG strategy', assert => {
101101
initializeRedisServer()

src/__tests__/destroy/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fetchMock.get(url(settings, '/splitChanges?s=1.1&since=-1'), { status: 200, body
2121
fetchMock.get(url(settings, '/splitChanges?s=1.1&since=1500492097547'), { status: 200, body: splitChangesMock2 });
2222
fetchMock.postOnce(url(settings, '/v1/metrics/config'), 200);
2323

24-
tape('SDK destroy for NodeJS', async function (assert) {
24+
tape('SDK destroy for Node.js', async function (assert) {
2525
const config = {
2626
core: {
2727
authorizationKey: 'fake-key',

src/__tests__/offline/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const settingsGenerator = mockFileName => {
5555
};
5656

5757

58-
tape('NodeJS Offline Mode', function (t) {
58+
tape('Node.js Offline Mode', function (t) {
5959

6060
t.test('Old format evaluations - .split', DotSplitTests);
6161
t.test('New format evaluations - .yaml extension', DotYAMLTests.bind(null, 'split', 'yaml'));

src/__tests__/online/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fetchMock.post(url(settings, '/testImpressions/count'), 200);
5555
fetchMock.post(url(settings, '/v1/metrics/config'), 200);
5656
fetchMock.post(url(settings, '/v1/metrics/usage'), 200);
5757

58-
tape('## Node JS - E2E CI Tests ##', async function (assert) {
58+
tape('## Node.js - E2E CI Tests ##', async function (assert) {
5959
/* Check client evaluations. */
6060
assert.test('E2E / In Memory', evaluationsSuite.bind(null, config, key));
6161
assert.test('E2E / In Memory - Semver', evaluationsSemverSuite.bind(null, fetchMock));

src/__tests__/push/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fetchMock.config.overwriteRoutes = false;
1313
fetchMock.post('https://telemetry.split.io/api/v1/metrics/config', 200);
1414
fetchMock.post('https://telemetry.split.io/api/v1/metrics/usage', 200);
1515

16-
tape('## Node JS - E2E CI Tests for PUSH ##', async function (assert) {
16+
tape('## Node.js - E2E CI Tests for PUSH ##', async function (assert) {
1717

1818
// Non-recoverable issues on inizialization
1919
assert.test('E2E / PUSH initialization: auth with push disabled', testAuthWithPushDisabled.bind(null, fetchMock));

src/platform/EventEmitter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ EventEmitter.prototype.emit = function emit(type) {
133133
er = args[0];
134134
if (er instanceof Error) {
135135
// Note: The comments on the `throw` lines are intentional, they show
136-
// up in Node's output if this results in an unhandled exception.
136+
// up in Node.js output if this results in an unhandled exception.
137137
throw er; // Unhandled 'error' event
138138
}
139139
// At least give some kind of context to the user

src/platform/getFetch/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function __setFetch(fetch) {
1717
}
1818

1919
/**
20-
* Retrieves 'node-fetch', a Fetch API polyfill for NodeJS, with fallback to global 'fetch' if available.
20+
* Retrieves 'node-fetch', a Fetch API polyfill for Node.js, with fallback to global 'fetch' if available.
2121
*/
2222
export function getFetch() {
2323
return nodeFetch;

src/settings/__tests__/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ tape('SETTINGS / Log error and fallback to InMemory storage if no valid storage
147147
tape('SETTINGS / Consent is not overwritable in server-side', assert => {
148148
const settings = settingsFactory({ userConsent: 'UNKNOWN' });
149149

150-
assert.equal(settings.userConsent, undefined, 'userConsent cannot be overwritten in NodeJS.');
150+
assert.equal(settings.userConsent, undefined, 'userConsent cannot be overwritten in Node.js.');
151151
assert.end();
152152
});

src/settings/storage/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function validateStorage(settings) {
6868
};
6969
}
7070

71-
// For now, we don't have modifiers or settings for MEMORY in NodeJS
71+
// For now, we don't have modifiers or settings for MEMORY in Node.js
7272
case STORAGE_MEMORY:
7373
default: {
7474
// If passing MEMORY storage in consumer mode, throw an error (no way to fallback to REDIS storage)

src/sync/offline/LocalhostFromFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { splitsParserFromFileFactory } from './splitsParserFromFile';
22
import { syncManagerOfflineFactory } from '@splitsoftware/splitio-commons/src/sync/offline/syncManagerOffline';
33

44
// Singleton instance of the factory function for offline SyncManager from YAML file
5-
// It uses NodeJS APIs.
5+
// It uses Node.js APIs.
66
export const localhostFromFileFactory = syncManagerOfflineFactory(splitsParserFromFileFactory);

src/utils/ip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-redeclare */
22
/*
3-
Trimmed version of "ip" package (https://www.npmjs.com/package/ip) that fixes an error when running in Node v18.
3+
Trimmed version of "ip" package (https://www.npmjs.com/package/ip) that fixes an error when running in Node.js v18.
44
55
This software is licensed under the MIT License.
66

ts-node.register.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Run tests and scripts in Node while transpiling typescript files from `@splitsoftware/splitio-commons/src`
2+
* Run tests and scripts in Node.js while transpiling typescript files from `@splitsoftware/splitio-commons/src`
33
* https://www.npmjs.com/package/ts-node
44
*
55
* NOTE: can be used with `npm link @splitsoftware/splitio-commons` or `"@splitsoftware/splitio-commons": "file:../javascript-commons" without extra steps

ts-tests/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ splitKey = splitKeyObj;
148148

149149
/**** Tests for ISDK interface ****/
150150

151-
// For node with sync storage
151+
// For Node.js with sync storage
152152
nodeSettings = {
153153
core: {
154154
authorizationKey: 'key'
155155
}
156156
};
157-
// For node with async storage
157+
// For Node.js with async storage
158158
asyncSettings = {
159159
core: {
160160
authorizationKey: 'key'
@@ -195,14 +195,14 @@ const instantiatedSettingsVersion: string = SDK.settings.version;
195195
let instantiatedSettingsFeatures = SDK.settings.features as SplitIO.MockedFeaturesMap;
196196
// We should be able to write on features prop. The rest are readonly props.
197197
instantiatedSettingsFeatures.something = 'something';
198-
SDK.settings.features = 'new_file_path'; // Node
198+
SDK.settings.features = 'new_file_path'; // Node.js
199199
SDK.settings.features = { 'split_x': 'on' }; // Browser
200200

201201
// Client and Manager
202202
client = SDK.client();
203203
manager = SDK.manager();
204204
manager = BrowserSDK.manager();
205-
// Today async clients are only possible on Node. Shared client creation not available here.
205+
// Today async clients are only possible on Node.js. Shared client creation not available here.
206206
asyncClient = AsyncSDK.client();
207207
asyncManager = AsyncSDK.manager();
208208
// Browser client for attributes binding
@@ -235,7 +235,7 @@ splitEvent = client.Event.SDK_READY_FROM_CACHE;
235235
splitEvent = client.Event.SDK_READY_TIMED_OUT;
236236
splitEvent = client.Event.SDK_UPDATE;
237237

238-
// Client implements methods from NodeJS.Events. Testing a few.
238+
// Client implements methods from Node.js EventEmitter. Testing a few.
239239
client = client.on(splitEvent, () => { });
240240
const a: boolean = client.emit(splitEvent);
241241
client = client.removeAllListeners(splitEvent);
@@ -325,7 +325,7 @@ splitEvent = asyncClient.Event.SDK_READY_FROM_CACHE;
325325
splitEvent = asyncClient.Event.SDK_READY_TIMED_OUT;
326326
splitEvent = asyncClient.Event.SDK_UPDATE;
327327

328-
// Client implements methods from NodeJS.Events. (same as for sync client, just for interface checking)
328+
// Client implements methods from Node.js EventEmitter. (same as for sync client, just for interface checking)
329329
asyncClient = asyncClient.on(splitEvent, () => { });
330330
const a1: boolean = asyncClient.emit(splitEvent);
331331
asyncClient = asyncClient.removeAllListeners(splitEvent);
@@ -396,7 +396,7 @@ splitViews = manager.splits();
396396
// Manager implements ready promise.
397397
promise = manager.ready();
398398

399-
// Manager implements methods from NodeJS.Events. Testing a few.
399+
// Manager implements methods from Node.js EventEmitter. Testing a few.
400400
manager = manager.on(splitEvent, () => { });
401401
const aa: boolean = manager.emit(splitEvent);
402402
manager = manager.removeAllListeners(splitEvent);
@@ -420,7 +420,7 @@ splitViewsAsync = asyncManager.splits();
420420
// asyncManager implements ready promise.
421421
promise = asyncManager.ready();
422422

423-
// asyncManager implements methods from NodeJS.Events. Testing a few.
423+
// asyncManager implements methods from Node.js EventEmitter. Testing a few.
424424
asyncManager = asyncManager.on(splitEvent, () => { });
425425
const aaa: boolean = asyncManager.emit(splitEvent);
426426
asyncManager = asyncManager.removeAllListeners(splitEvent);

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Declaration file for JavaScript and Node Split Software SDK v8.1.0
1+
// Declaration file for JavaScript and Node.js Split Software SDK v8.1.0
22
// Project: http://www.split.io/
33
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
44

0 commit comments

Comments
 (0)