@luvio/environments 0.142.2 → 0.142.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{es/es2018/environments.js → environments.js} +7 -5
- package/dist/{es/es2018/types → types}/makeDurable.d.ts +2 -1
- package/package.json +9 -5
- package/dist/umd/es2018/environments.js +0 -864
- package/dist/umd/es2018/types/DurableStore.d.ts +0 -134
- package/dist/umd/es2018/types/DurableTTLStore.d.ts +0 -25
- package/dist/umd/es2018/types/events.d.ts +0 -18
- package/dist/umd/es2018/types/main.d.ts +0 -5
- package/dist/umd/es2018/types/makeDurable/error.d.ts +0 -11
- package/dist/umd/es2018/types/makeDurable/flush.d.ts +0 -4
- package/dist/umd/es2018/types/makeDurable/revive.d.ts +0 -38
- package/dist/umd/es2018/types/makeDurable/stagingStore.d.ts +0 -6
- package/dist/umd/es2018/types/makeDurable/ttl.d.ts +0 -3
- package/dist/umd/es2018/types/makeDurable/utils.d.ts +0 -2
- package/dist/umd/es2018/types/makeDurable.d.ts +0 -47
- package/dist/umd/es2018/types/utils/language.d.ts +0 -21
- package/dist/umd/es5/environments.js +0 -1013
- package/dist/umd/es5/types/DurableStore.d.ts +0 -134
- package/dist/umd/es5/types/DurableTTLStore.d.ts +0 -25
- package/dist/umd/es5/types/events.d.ts +0 -18
- package/dist/umd/es5/types/main.d.ts +0 -5
- package/dist/umd/es5/types/makeDurable/error.d.ts +0 -11
- package/dist/umd/es5/types/makeDurable/flush.d.ts +0 -4
- package/dist/umd/es5/types/makeDurable/revive.d.ts +0 -38
- package/dist/umd/es5/types/makeDurable/stagingStore.d.ts +0 -6
- package/dist/umd/es5/types/makeDurable/ttl.d.ts +0 -3
- package/dist/umd/es5/types/makeDurable/utils.d.ts +0 -2
- package/dist/umd/es5/types/makeDurable.d.ts +0 -47
- package/dist/umd/es5/types/utils/language.d.ts +0 -21
- /package/dist/{es/es2018/types → types}/DurableStore.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/DurableTTLStore.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/events.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/main.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/error.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/flush.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/revive.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/stagingStore.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/ttl.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/makeDurable/utils.d.ts +0 -0
- /package/dist/{es/es2018/types → types}/utils/language.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StoreKeySet, deepFreeze, serializeStructuredKey, emitAdapterEvent,
|
|
1
|
+
import { StoreKeySet, deepFreeze, serializeStructuredKey, emitAdapterEvent, Reader } from '@luvio/engine';
|
|
2
2
|
|
|
3
3
|
// the last version the metadata shape was altered
|
|
4
4
|
const DURABLE_METADATA_VERSION = '0.111.0';
|
|
@@ -394,7 +394,8 @@ function isUnfulfilledSnapshot(cachedSnapshotResult) {
|
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Configures the environment to persist data into a durable store and attempt to resolve
|
|
397
|
-
* data from the persistent store before hitting the network.
|
|
397
|
+
* data from the persistent store before hitting the network. Sets the default
|
|
398
|
+
* cache policy to stale-while-revalidate with infinite staleDuration.
|
|
398
399
|
*
|
|
399
400
|
* @param environment The base environment
|
|
400
401
|
* @param durableStore A DurableStore implementation
|
|
@@ -819,10 +820,11 @@ function makeDurable(environment, { durableStore, instrumentation }) {
|
|
|
819
820
|
return entries;
|
|
820
821
|
});
|
|
821
822
|
};
|
|
822
|
-
|
|
823
|
+
// set the default cache policy of the base environment
|
|
824
|
+
environment.setDefaultCachePolicy({
|
|
823
825
|
type: 'stale-while-revalidate',
|
|
824
|
-
|
|
825
|
-
};
|
|
826
|
+
staleDurationSeconds: Number.MAX_SAFE_INTEGER,
|
|
827
|
+
});
|
|
826
828
|
return create(environment, {
|
|
827
829
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
828
830
|
storeIngest: { value: storeIngest },
|
|
@@ -37,7 +37,8 @@ interface MakeDurableOptions {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Configures the environment to persist data into a durable store and attempt to resolve
|
|
40
|
-
* data from the persistent store before hitting the network.
|
|
40
|
+
* data from the persistent store before hitting the network. Sets the default
|
|
41
|
+
* cache policy to stale-while-revalidate with infinite staleDuration.
|
|
41
42
|
*
|
|
42
43
|
* @param environment The base environment
|
|
43
44
|
* @param durableStore A DurableStore implementation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/environments",
|
|
3
|
-
"version": "0.142.
|
|
3
|
+
"version": "0.142.3",
|
|
4
4
|
"description": "Luvio Environments",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
"directory": "packages/@luvio/environments"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"exports": {
|
|
12
|
+
"types": "./dist/types/main.d.ts",
|
|
13
|
+
"import": "./dist/environments.js",
|
|
14
|
+
"default": "./dist/environments.js"
|
|
15
|
+
},
|
|
16
|
+
"module": "dist/environments.js",
|
|
17
|
+
"types": "dist/types/main.d.ts",
|
|
14
18
|
"files": [
|
|
15
19
|
"dist/"
|
|
16
20
|
],
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
"watch": "yarn build --watch"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"@luvio/engine": "^0.142.
|
|
30
|
+
"@luvio/engine": "^0.142.3"
|
|
27
31
|
},
|
|
28
32
|
"volta": {
|
|
29
33
|
"extends": "../../../package.json"
|