Skip to content

Commit 718013e

Browse files
Merge branch 'development' into dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
2 parents 63852c3 + 89644e5 commit 718013e

File tree

99 files changed

+1585
-4228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1585
-4228
lines changed

.eslintrc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"parser": "@typescript-eslint/parser",
66
"plugins": [
77
"@typescript-eslint",
8+
"eslint-plugin-tsdoc",
89
"import"
910
],
1011

@@ -44,7 +45,7 @@
4445
],
4546
"rules": {
4647
"no-restricted-syntax": ["error", "ForOfStatement", "ForInStatement", "ArrayPattern"],
47-
"compat/compat": ["error", "defaults, ie 10"],
48+
"compat/compat": ["error", "defaults"],
4849
"no-throw-literal": "error",
4950
"import/no-default-export": "error",
5051
"import/no-self-import": "error",
@@ -60,7 +61,14 @@
6061
"files": ["types/**"],
6162
"rules": {
6263
"no-use-before-define": "off",
63-
"no-undef": "off" // turned off to avoid issue with triple-slash path directive
64+
"no-undef": "off" // turned off to avoid issue with SplitIO namespace not defined
65+
}
66+
},
67+
{
68+
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
69+
"files": ["**/*.ts"],
70+
"rules": {
71+
"tsdoc/syntax": "warn"
6472
}
6573
}
6674
],

.github/workflows/ci-cd.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
name: Build
22-
# @TODO rollback to ubuntu-latest eventually. ATM, `npm run test-browser` fails when using ubuntu-latest (ubuntu-22.04) with "ERROR [launcher]: Cannot start ChromeHeadless"
23-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2423
steps:
2524
- name: Checkout code
2625
uses: actions/checkout@v4
@@ -48,15 +47,15 @@ jobs:
4847

4948
- name: Store assets
5049
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
51-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5251
with:
5352
name: assets
5453
path: umd/
5554
retention-days: 1
5655

5756
upload-stage:
5857
name: Upload assets
59-
runs-on: ubuntu-20.04
58+
runs-on: ubuntu-latest
6059
needs: build
6160
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
6261
strategy:
@@ -74,7 +73,7 @@ jobs:
7473

7574
steps:
7675
- name: Download assets
77-
uses: actions/download-artifact@v4.1.7
76+
uses: actions/download-artifact@v4
7877
with:
7978
name: assets
8079
path: umd
@@ -84,7 +83,7 @@ jobs:
8483
working-directory: umd
8584

8685
- name: Configure AWS credentials
87-
uses: aws-actions/configure-aws-credentials@v1-node16
86+
uses: aws-actions/configure-aws-credentials@v4
8887
with:
8988
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
9089
aws-region: us-east-1
@@ -99,7 +98,7 @@ jobs:
9998

10099
upload-prod:
101100
name: Upload assets
102-
runs-on: ubuntu-20.04
101+
runs-on: ubuntu-latest
103102
needs: build
104103
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
105104
strategy:
@@ -117,7 +116,7 @@ jobs:
117116

118117
steps:
119118
- name: Download assets
120-
uses: actions/download-artifact@v4.1.7
119+
uses: actions/download-artifact@v4
121120
with:
122121
name: assets
123122
path: umd
@@ -127,7 +126,7 @@ jobs:
127126
working-directory: umd
128127

129128
- name: Configure AWS credentials
130-
uses: aws-actions/configure-aws-credentials@v1-node16
129+
uses: aws-actions/configure-aws-credentials@v4
131130
with:
132131
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
133132
aws-region: us-east-1

.github/workflows/sonar-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ on:
1212
jobs:
1313
build:
1414
name: Build
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
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/*'

.github/workflows/update-license-year.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4

CHANGES.txt

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
0.14.2 (August XX, 2024)
2-
- Updated some transitive dependencies for vulnerability fixes.
1+
1.1.0 (January 17, 2025)
2+
- Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on `SplitView` type objects. Read more in our docs.
3+
- Bugfixing - Updated @splitsoftware/splitio-commons package to version 2.1.0, which properly handles rejected promises when using targeting rules with segment matchers in consumer modes (e.g., Redis and Pluggable storages).
4+
5+
1.0.1 (November 11, 2024)
6+
- Bugfixing - Revert removal of TypeScript `SplitIO` namespace at `/types/splitio.d.ts` to allow explicit imports of types from the Browser SDK package. E.g., `import type { IClientSideSettings } from '@splitsoftware/splitio-browserjs/types/splitio';`.
7+
8+
1.0.0 (November 1, 2024)
9+
- Added support for targeting rules based on large segments.
10+
- Added `factory.destroy()` method, which invokes the `destroy` method of all clients created by the factory.
11+
- Updated @splitsoftware/splitio-commons package to version 2.0.0 that includes major updates and updated some transitive dependencies for vulnerability fixes.
12+
- BREAKING CHANGES:
13+
- NOTE: Refer to ./MIGRATION-GUIDE.md for instructions on how to migrate your codebase from version 0.x to 1.0.0.
14+
- Dropped support for Split Proxy below version 5.9.0. The SDK now requires Split Proxy 5.9.0 or above.
15+
- Renamed some TypeScript definitions in the `SplitIO` namespace to avoid conflicts with other Split packages: `IBrowserSettings`, `IBrowserAsyncSettings`, `ISDK`, `IAsyncSDK`, `IClient`, and `IAsyncClient` were renamed to `IClientSideSettings`, `IClientSideAsyncSettings`, `IBrowserSDK`, `IBrowserAsyncSDK`, `IBrowserClient` and `IBrowserAsyncClient` respectively.
16+
- Removed TypeScript `SplitIO` namespace from `@splitsoftware/splitio-browserjs/types/splitio`. Reverted in 1.0.1.
17+
- Removed internal ponyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers. The SDK now requires the runtime environment to support these features natively or provide a polyfill.
18+
- Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions.
19+
- Removed the `LocalhostFromObject` export from the default import (`import { LocalhostFromObject } from '@splitsoftware/splitio-browserjs'`). It is no longer necessary to manually import and configure it in the `sync.localhostMode` option to enable localhost mode.
20+
21+
0.15.0 (September 13, 2024)
22+
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:
23+
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
24+
- Updated some transitive dependencies for vulnerability fixes.
325

426
0.14.1 (June 14, 2024)
527
- Updated @splitsoftware/splitio-commons package to version 1.16.0 that includes some vulnerability and bug fixes.
@@ -50,7 +72,7 @@
5072
- Updated some transitive dependencies for vulnerability fixes.
5173
- Updated @splitsoftware/splitio-commons package to version 1.8.3 that includes:
5274
- Updated SDK_READY_TIMED_OUT event to be emitted immediately when a connection error occurs using pluggable storage (i.e., when the wrapper `connect` promise is rejected) in consumer and partial consumer modes.
53-
- Bugfixing - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected behaviours when `getTreatment` and `track` methods are called synchronously after `destroy` method is called.
75+
- Bugfixing - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected behaviors when `getTreatment` and `track` methods are called synchronously after `destroy` method is called.
5476

5577
0.9.5 (May 15, 2023)
5678
- Updated @splitsoftware/splitio-commons package to version 1.8.2 that includes minor improvements.
@@ -60,7 +82,7 @@
6082

6183
0.9.4 (May 4, 2023)
6284
- Updated some transitive dependencies for vulnerability fixes.
63-
- Bugfixing - Updated `unfetch` package as a runtime dependency, required when using the "full" entrypoint (`import { SplitFactory } from '@splitsoftware/splitio-browserjs/full'`).
85+
- Bugfixing - Updated `unfetch` package as a runtime dependency, required when using the "full" import (`import { SplitFactory } from '@splitsoftware/splitio-browserjs/full'`).
6486

6587
0.9.3 (March 20, 2023)
6688
- Updated @splitsoftware/splitio-commons package to version 1.8.1 that includes minor improvements.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2024 Split Software, Inc.
1+
Copyright © 2025 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

MIGRATION-GUIDE.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Migrating to JavaScript Browser SDK v1
2+
3+
JavaScript Browser SDK v1.0.0 has a few breaking changes that you should consider when migrating from version 0.x.x.
4+
5+
## Renamed some TypeScript definitions in the `SplitIO` namespace to avoid conflicts with other Split packages
6+
7+
The renamed types are:
8+
- `SplitIO.IBrowserSettings` -> `SplitIO.IClientSideSettings`
9+
- `SplitIO.IBrowserAsyncSettings` -> `SplitIO.IClientSideAsyncSettings`
10+
- `SplitIO.ISDK` -> `SplitIO.IBrowserSDK`
11+
- `SplitIO.IAsyncSDK` -> `SplitIO.IBrowserAsyncSDK`
12+
- `SplitIO.IClient` -> `SplitIO.IBrowserClient`
13+
- `SplitIO.IAsyncClient` -> `SplitIO.IBrowserAsyncClient`
14+
15+
For example, you should replace:
16+
17+
```ts
18+
import { SplitFactory } from '@splitsoftware/splitio-browserjs';
19+
20+
const config: SplitIO.IBrowserSettings = { ... };
21+
const factory: SplitIO.ISDK = SplitFactory(config);
22+
```
23+
24+
with:
25+
26+
```ts
27+
import { SplitFactory } from '@splitsoftware/splitio-browserjs';
28+
29+
const config: SplitIO.IClientSideSettings = { ... };
30+
const factory: SplitIO.IBrowserSDK = SplitFactory(config);
31+
```
32+
33+
34+
## Removed the `LocalhostFromObject` export from the default import
35+
36+
In order to simplify the SDK API, the `LocalhostFromObject` export was removed from the default import (`import { LocalhostFromObject } from '@splitsoftware/splitio-browserjs'`), and it is no longer necessary to manually pass it to the `sync.localhostMode` configuration option to enable localhost mode.
37+
38+
If you were using the `LocalhostFromObject` export, you should remove it from your code. For example, replace:
39+
40+
```js
41+
import { SplitFactory, LocalhostFromObject } from '@splitsoftware/splitio-browserjs';
42+
43+
const factory = SplitFactory({
44+
core: {
45+
authorizationKey: 'localhost',
46+
key: SOME_KEY
47+
},
48+
features: {
49+
'feature1': 'on'
50+
},
51+
sync: {
52+
localhostMode: LocalhostFromObject()
53+
}
54+
});
55+
```
56+
57+
with:
58+
59+
```js
60+
import { SplitFactory } from '@splitsoftware/splitio-browserjs';
61+
62+
const factory = SplitFactory({
63+
core: {
64+
authorizationKey: 'localhost',
65+
key: SOME_KEY
66+
},
67+
features: {
68+
'feature1': 'on'
69+
}
70+
});
71+
```
72+
73+
## Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions
74+
75+
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.
76+
77+
## Removed internal polyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers
78+
79+
The SDK no longer ships with internal implementations for the `Map` and `Set` global objects, which were used to support old browsers like IE.
80+
81+
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`.
82+
83+
## Dropped support for Split Proxy below version 5.9.0. The SDK now requires Split Proxy 5.9.0 or above
84+
85+
If using the Split Proxy with the SDK, 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, 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This SDK is designed to work with Split, the platform for controlled rollouts, w
1010
## Compatibility
1111
The JS Browser SDK is a library for Web browser environments.
1212

13-
The library was build to support ES5 syntax and all major browsers. *However, there are a few polyfills that would be required when targeting old browsers that don't have native support for Promises and Fetch Web API. You should include a Promise polyfill like [es6-promise](https://github.com/stefanpenner/es6-promise), and a Fetch polyfill such as [whatwg-fetch](https://cdn.jsdelivr.net/npm/whatwg-fetch@3.5.0/dist/fetch.umd.min.js) or the lightweight [unfetch](https://unpkg.com/unfetch/polyfill).*
13+
The library was build to support ES5 syntax and all major browsers. *However, there are a few polyfills that would be required when targeting old browsers that don't have native support for Promises, Maps, Sets and Fetch Web API. You should include a polyfill, like [es6-promise](https://github.com/stefanpenner/es6-promise) for Promises, and [whatwg-fetch](https://cdn.jsdelivr.net/npm/whatwg-fetch@3.5.0/dist/fetch.umd.min.js) or the lightweight [unfetch](https://unpkg.com/unfetch/polyfill) for the Fetch API.*
1414

1515
## Getting started
1616
Below is a simple index.js example that describes the instantiation and most basic usage of our SDK:
@@ -64,13 +64,14 @@ Split has built and maintains SDKs for:
6464
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
6565
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
6666
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
67+
* Elixir thin-client [Github](https://github.com/splitio/elixir-thin-client) [Docs](https://help.split.io/hc/en-us/articles/26988707417869-Elixir-Thin-Client-SDK)
6768
* Flutter [Github](https://github.com/splitio/flutter-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/8096158017165-Flutter-plugin)
6869
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
6970
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
7071
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
7172
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
7273
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
73-
* 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)
7475
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
7576
* 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)
7677
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)

karma/config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ module.exports = {
2424
'tap'
2525
],
2626

27-
// Run on Chrome Headless. Use 'Chrome' instead to run on full browser for debugging
28-
browsers: [
29-
'ChromeHeadless'
30-
],
27+
// Run on Chrome Headless
28+
customLaunchers: {
29+
ChromeHeadlessNoSandbox: {
30+
base: 'ChromeHeadless',
31+
// Flags required to run in ubuntu-22.04 or above (https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md)
32+
flags: ['--no-sandbox', '--disable-setuid-sandbox']
33+
}
34+
},
35+
browsers: ['ChromeHeadlessNoSandbox'],
3136

3237
// Continuous Integration mode
3338
// if true, it capture browsers, run tests and exit. Set false for debugging

karma/e2e.gaIntegration.karma.conf.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)