Skip to content

Commit 845e67e

Browse files
upgrade to commons 1.7.0; enable non expiring assignment cache by default (#33)
* upgrade to commons 1.7.0; enable non expiring assignment cache by default * customize cache behavior after init * revert interface change * revert markdown
1 parent 3107e25 commit 845e67e

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/js-client-sdk",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "Eppo SDK for client-side JavaScript applications",
55
"main": "dist/index.js",
66
"files": [
@@ -57,7 +57,7 @@
5757
"xhr-mock": "^2.5.1"
5858
},
5959
"dependencies": {
60-
"@eppo/js-client-sdk-common": "^1.6.0",
60+
"@eppo/js-client-sdk-common": "^1.7.0",
6161
"axios": "^0.27.2",
6262
"md5": "^2.3.0"
6363
}

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ export async function init(config: IClientConfig): Promise<IEppoClient> {
143143
sdkVersion,
144144
});
145145
EppoJSClient.instance.setLogger(config.assignmentLogger);
146+
147+
// default behavior is to use a non-expiring cache.
148+
// this can be overridden after initialization.
149+
EppoJSClient.instance.useNonExpiringAssignmentCache();
150+
146151
const configurationRequestor = new ExperimentConfigurationRequestor(localStorage, httpClient);
147152
await configurationRequestor.fetchAndStoreConfigurations();
148153
return EppoJSClient.instance;

yarn.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,13 @@
361361
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
362362
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
363363

364-
"@eppo/js-client-sdk-common@^1.6.0":
365-
version "1.6.0"
366-
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-1.6.0.tgz#f32ecd23296d1ec02532a2f4daa467f29f03a447"
367-
integrity sha512-QzfFIEvgTWpFtTV3O/zoSpJY63y+XuREwlrK0ICUyU812a4tdEo40IfdxsM4s7NH1EGCL7wCMMJCyPCTMYq7UA==
364+
"@eppo/js-client-sdk-common@^1.7.0":
365+
version "1.7.0"
366+
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-1.7.0.tgz#13f563af6ae7d030f5be772bcee7a35ca07127c0"
367+
integrity sha512-2E8Okt2oRv5cPWhLzLAdoZkOFiDOUCy3pJw47XJWmfjw29AggEYH/OFjeC5/EU+XjGUA3CWBIrhBIHtkGKfqXg==
368368
dependencies:
369369
axios "^0.27.2"
370+
lru-cache "^10.0.1"
370371
md5 "^2.3.0"
371372

372373
"@eslint/eslintrc@^1.3.0":
@@ -3432,6 +3433,11 @@ log-update@^4.0.0:
34323433
slice-ansi "^4.0.0"
34333434
wrap-ansi "^6.2.0"
34343435

3436+
lru-cache@^10.0.1:
3437+
version "10.0.1"
3438+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a"
3439+
integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==
3440+
34353441
lru-cache@^6.0.0:
34363442
version "6.0.0"
34373443
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"

0 commit comments

Comments
 (0)