Skip to content

Commit 23668a9

Browse files
Remove 'full' subpackage, since there is not significant difference with the default 'slim' subpackage
1 parent f0b7dfe commit 23668a9

17 files changed

+21
-182
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- 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.
77
- Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions.
88
- Removed the `LocalhostFromObject` export from the "slim" entrypoint (`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.
9+
- Removed the "full" entrypoint (`import { SplitFactory } from '@splitsoftware/splitio-browserjs/full'`), since with the removal of `LocalhostFromObject` from the "slim" entrypoint, the difference between "slim" and "full" entrypoints is minimal. The "full" entrypoint differs only by including the `unfetch` ponyfill to support older browsers.
910

1011
0.15.0 (September 13, 2024)
1112
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:

full/package.json

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

package-lock.json

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

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"cjs",
1414
"esm",
1515
"src",
16-
"types",
17-
"full"
16+
"types"
1817
],
1918
"scripts": {
2019
"check": "npm run check:lint && npm run check:types && npm run check:version",
@@ -62,8 +61,7 @@
6261
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
6362
"dependencies": {
6463
"@splitsoftware/splitio-commons": "2.0.0-rc.2",
65-
"tslib": "^2.3.1",
66-
"unfetch": "^4.2.0"
64+
"tslib": "^2.3.1"
6765
},
6866
"devDependencies": {
6967
"@rollup/plugin-commonjs": "^24.0.1",

rollup.ci.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default env => {
3535
*
3636
* Only https://www.npmjs.com/package/rollup-plugin-ts compiles from node_modules, and is used for tests.
3737
*/
38-
createRollupConfig('esm/full/umd.js', 'full'), // umd/split-browser-VERSION.full[.min].js
38+
createRollupConfig('esm/umd-full.js', 'full'), // umd/split-browser-VERSION.full[.min].js
3939
createRollupConfig('esm/umd.js') // umd/split-browser-VERSION[.min].js
4040
];
4141
};

src/__tests__/offline/browser.spec.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import tape from 'tape-catch';
22
import sinon from 'sinon';
33
import fetchMock from '../testUtils/fetchMock';
44
import { url } from '../testUtils';
5-
import { SplitFactory, InLocalStorage } from '../../full';
6-
import { SplitFactory as SplitFactorySlim } from '../../';
5+
import { SplitFactory, InLocalStorage } from '../../index';
76
import { settingsFactory } from '../../settings';
87

98
const settings = settingsFactory({ core: { key: 'facundo@split.io' } });
@@ -88,18 +87,15 @@ tape('Browser offline mode', function (assert) {
8887
sharedUpdateCount++;
8988
});
9089

91-
const factoriesReadyFromCache = [
92-
SplitFactory({ ...config, storage: InLocalStorage() }),
93-
SplitFactorySlim({ ...config, storage: InLocalStorage() })
94-
];
90+
const factoryReadyFromCache = SplitFactory({ ...config, storage: InLocalStorage() });
9591
const configs = [
9692
{ ...config, features: { ...config.features }, storage: InLocalStorage /* invalid */ },
9793
{ ...config },
9894
config,
9995
];
10096
const factories = [
10197
...configs.map(config => SplitFactory(config)),
102-
...factoriesReadyFromCache
98+
factoryReadyFromCache
10399
];
104100

105101
let readyCount = 0, updateCount = 0, readyFromCacheCount = 0;
@@ -361,7 +357,7 @@ tape('Browser offline mode', function (assert) {
361357
// SDK events on other factory clients
362358
assert.equal(readyCount, factories.length, 'Each factory client should have emitted SDK_READY event once');
363359
assert.equal(updateCount, factories.length - 1, 'Each factory client except one should have emitted SDK_UPDATE event once');
364-
assert.equal(readyFromCacheCount, factoriesReadyFromCache.length * 2, 'The main and shared client of the factories with LOCALSTORAGE should have emitted SDK_READY_FROM_CACHE event');
360+
assert.equal(readyFromCacheCount, 2, 'The main and shared client of the factory with LOCALSTORAGE should have emitted SDK_READY_FROM_CACHE event');
365361

366362
assert.end();
367363
});

src/full/index.ts

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

src/full/splitFactory.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.
File renamed without changes.

src/platform/getFetchFull.ts

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

src/settings/__tests__/index.spec.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { settingsFactory as slimSettingsFactory } from '../index';
2-
import { settingsFactory as fullSettingsFactory } from '../full';
1+
import { settingsFactory } from '../index';
32

43
test('SETTINGS / Consent is overwritable and "GRANTED" by default', () => {
5-
[slimSettingsFactory, fullSettingsFactory].forEach((settingsFactory) => {
6-
let settings = settingsFactory({});
7-
expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if not provided
4+
let settings = settingsFactory({});
5+
expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if not provided
86

9-
settings = settingsFactory({ userConsent: 'INVALID-VALUE' });
10-
expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if a wrong value is provided
7+
settings = settingsFactory({ userConsent: 'INVALID-VALUE' });
8+
expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if a wrong value is provided
119

12-
settings = settingsFactory({ userConsent: 'UNKNOWN' });
13-
expect(settings.userConsent).toEqual('UNKNOWN'); // userConsent can be overwritten
10+
settings = settingsFactory({ userConsent: 'UNKNOWN' });
11+
expect(settings.userConsent).toEqual('UNKNOWN'); // userConsent can be overwritten
1412

15-
settings = settingsFactory({ userConsent: 'declined' });
16-
expect(settings.userConsent).toEqual('DECLINED'); // userConsent can be overwritten
17-
});
13+
settings = settingsFactory({ userConsent: 'declined' });
14+
expect(settings.userConsent).toEqual('DECLINED'); // userConsent can be overwritten
1815
});

src/settings/full.ts

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

src/splitFactory.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { settingsFactory } from './settings';
22
import { getModules } from './platform/getModules';
33
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
44
import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
5-
import { getFetch } from './platform/getFetchSlim';
5+
import { getFetch } from './platform/getFetch';
66
import { getEventSource } from './platform/getEventSource';
77
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
88
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
@@ -11,8 +11,7 @@ import { IBrowserSettings } from '../types/splitio';
1111
const platform = { getFetch, getEventSource, EventEmitter, now };
1212

1313
/**
14-
* Slim SplitFactory with pluggable modules for Browser.
15-
* Doesn't include fetch ponyfill out-of-the-box.
14+
* SplitFactory with pluggable modules for Browser.
1615
*
1716
* @param config configuration object used to instantiate the SDK
1817
* @param __updateModules optional function that lets redefine internal SDK modules. Use with
File renamed without changes.

ts-tests/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111
* @author Nico Zelaya <nicolas.zelaya@split.io>
1212
*/
1313

14-
import { SplitFactory as SplitFactoryFull, InLocalStorage as InLocalStorageFull, DebugLogger as DebugLoggerFull, InfoLogger as InfoLoggerFull, WarnLogger as WarnLoggerFull, ErrorLogger as ErrorLoggerFull, PluggableStorage as PluggableStorageFull } from '@splitsoftware/splitio-browserjs/full';
1514
import { SplitFactory, InLocalStorage, DebugLogger, InfoLogger, WarnLogger, ErrorLogger, PluggableStorage } from '@splitsoftware/splitio-browserjs';
1615

17-
// Entry points must export the same objects
18-
let splitFactory = SplitFactory; splitFactory = SplitFactoryFull;
19-
let inLocalStorage = InLocalStorage; inLocalStorage = InLocalStorageFull;
20-
let pluggableStorage = PluggableStorage; pluggableStorage = PluggableStorageFull;
2116

2217
let stringPromise: Promise<string>;
2318
let splitNamesPromise: Promise<SplitIO.SplitNames>;
@@ -626,10 +621,6 @@ fullBrowserSettings.debug = DebugLogger();
626621
fullBrowserSettings.debug = InfoLogger();
627622
fullBrowserSettings.debug = WarnLogger();
628623
fullBrowserSettings.debug = ErrorLogger();
629-
fullBrowserSettings.debug = DebugLoggerFull();
630-
fullBrowserSettings.debug = InfoLoggerFull();
631-
fullBrowserSettings.debug = WarnLoggerFull();
632-
fullBrowserSettings.debug = ErrorLoggerFull();
633624

634625
// let fullNodeSettings: SplitIO.INodeSettings = {
635626
// core: {

types/full/index.d.ts

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

types/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export = JsSdk;
77

88
declare module JsSdk {
99
/**
10-
* Slim version of the Split.io SDK factory function.
11-
*
12-
* Recommended to use for bundle size reduction in production, since it doesn't include a 'fetch' polyfill out-of-the-box
10+
* Split.io SDK factory function.
1311
*
1412
* The settings parameter should be an object that complies with the SplitIO.IBrowserSettings.
1513
* For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}

0 commit comments

Comments
 (0)