Skip to content

Commit 94fd376

Browse files
Added MIGRATION-GUIDE.md file
1 parent 48d0f41 commit 94fd376

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

MIGRATION-GUIDE.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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` --> `SplitIOBrowser.IClientSideSettings`
9+
- `SplitIO.IBrowserAsyncSettings` -> `SplitIOBrowser.IClientSideAsyncSettings`
10+
- `SplitIO.ISDK` -> `SplitIOBrowser.IBrowserSDK`
11+
- `SplitIO.IAsyncSDK` -> `SplitIOBrowser.IBrowserAsyncSDK`
12+
- `SplitIO.IClient` -> `SplitIOBrowser.IBrowserClient`
13+
- `SplitIO.IAsyncClient` -> `SplitIOBrowser.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+
...
22+
}
23+
24+
const factory: SplitIO.ISDK = SplitFactory(config);
25+
```
26+
27+
with:
28+
29+
```ts
30+
import { SplitFactory } from '@splitsoftware/splitio-browserjs';
31+
32+
const config: SplitIO.IClientSideSettings = {
33+
...
34+
}
35+
36+
const factory: SplitIO.IBrowserSDK = SplitFactory(config);
37+
```
38+
39+
40+
## Removed the `LocalhostFromObject` export from the default import
41+
42+
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.
43+
44+
If you were using the `LocalhostFromObject` export, simple remove it from your code. For example, replace:
45+
46+
```js
47+
import { SplitFactory, LocalhostFromObject } from '@splitsoftware/splitio-browserjs';
48+
49+
const factory = SplitFactory({
50+
core: {
51+
authorizationKey: 'localhost',
52+
key: SOME_KEY
53+
},
54+
features: {
55+
'feature1': 'on'
56+
},
57+
sync: {
58+
localhostMode: LocalhostFromObject()
59+
}
60+
});
61+
```
62+
63+
with:
64+
65+
```js
66+
import { SplitFactory } from '@splitsoftware/splitio-browserjs';
67+
68+
const factory = SplitFactory({
69+
core: {
70+
authorizationKey: 'localhost',
71+
key: SOME_KEY
72+
},
73+
features: {
74+
'feature1': 'on'
75+
}
76+
});
77+
```
78+
79+
## Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions
80+
81+
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.
82+
83+
## 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
84+
85+
The SDK no longer ships with internal implementations for the `Map` and `Set` global objects, which were used to support old browsers.
86+
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`.
87+
88+
## 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
89+
90+
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.

0 commit comments

Comments
 (0)