@plasmicapp/data-sources
Advanced tools
Comparing version 0.1.139 to 0.1.140
@@ -209,2 +209,3 @@ "use strict"; | ||
const getKeysToInvalidate = () => { | ||
var _a, _b; | ||
if (!invalidatedKeys) { | ||
@@ -216,3 +217,18 @@ return []; | ||
...Array.from(cache.keys()), | ||
...fallback ? Object.keys(fallback) : [] | ||
...fallback ? Object.keys(fallback) : [], | ||
// If this is running within the Studio, we also take the | ||
// opportunity to invalidate the Studio cache. The keys that | ||
// Studio may have can be a superset of `cache` here, because | ||
// `cache` is updated as swr hooks are mounted and unmounted, | ||
// but Studio's data cache keys don't get removed when hooks | ||
// are unmounted. This makes it possible for Studio to hold | ||
// onto a stale cache entry that doesn't get invalidated. | ||
// For example, Studio may render page1, with key X, then goes | ||
// to page 2, which performs a mutate. At this point, Studio | ||
// has a cache entry for key X, but `cache` does not, because | ||
// page2 does not use that query. But page 2 may perform a | ||
// mutation that invalidates X. So we need to invalidate not | ||
// only keys in `cache`, but also keys that Studio is still | ||
// holding onto. | ||
...(_b = (_a = globalThis.__PLASMIC_GET_ALL_CACHE_KEYS) == null ? void 0 : _a.call(globalThis)) != null ? _b : [] | ||
]) | ||
@@ -219,0 +235,0 @@ ).filter((key) => typeof key === "string"); |
@@ -170,2 +170,3 @@ var __defProp = Object.defineProperty; | ||
const getKeysToInvalidate = () => { | ||
var _a, _b; | ||
if (!invalidatedKeys) { | ||
@@ -177,3 +178,18 @@ return []; | ||
...Array.from(cache.keys()), | ||
...fallback ? Object.keys(fallback) : [] | ||
...fallback ? Object.keys(fallback) : [], | ||
// If this is running within the Studio, we also take the | ||
// opportunity to invalidate the Studio cache. The keys that | ||
// Studio may have can be a superset of `cache` here, because | ||
// `cache` is updated as swr hooks are mounted and unmounted, | ||
// but Studio's data cache keys don't get removed when hooks | ||
// are unmounted. This makes it possible for Studio to hold | ||
// onto a stale cache entry that doesn't get invalidated. | ||
// For example, Studio may render page1, with key X, then goes | ||
// to page 2, which performs a mutate. At this point, Studio | ||
// has a cache entry for key X, but `cache` does not, because | ||
// page2 does not use that query. But page 2 may perform a | ||
// mutation that invalidates X. So we need to invalidate not | ||
// only keys in `cache`, but also keys that Studio is still | ||
// holding onto. | ||
...(_b = (_a = globalThis.__PLASMIC_GET_ALL_CACHE_KEYS) == null ? void 0 : _a.call(globalThis)) != null ? _b : [] | ||
]) | ||
@@ -180,0 +196,0 @@ ).filter((key) => typeof key === "string"); |
@@ -209,2 +209,3 @@ "use strict"; | ||
const getKeysToInvalidate = () => { | ||
var _a, _b; | ||
if (!invalidatedKeys) { | ||
@@ -216,3 +217,18 @@ return []; | ||
...Array.from(cache.keys()), | ||
...fallback ? Object.keys(fallback) : [] | ||
...fallback ? Object.keys(fallback) : [], | ||
// If this is running within the Studio, we also take the | ||
// opportunity to invalidate the Studio cache. The keys that | ||
// Studio may have can be a superset of `cache` here, because | ||
// `cache` is updated as swr hooks are mounted and unmounted, | ||
// but Studio's data cache keys don't get removed when hooks | ||
// are unmounted. This makes it possible for Studio to hold | ||
// onto a stale cache entry that doesn't get invalidated. | ||
// For example, Studio may render page1, with key X, then goes | ||
// to page 2, which performs a mutate. At this point, Studio | ||
// has a cache entry for key X, but `cache` does not, because | ||
// page2 does not use that query. But page 2 may perform a | ||
// mutation that invalidates X. So we need to invalidate not | ||
// only keys in `cache`, but also keys that Studio is still | ||
// holding onto. | ||
...(_b = (_a = globalThis.__PLASMIC_GET_ALL_CACHE_KEYS) == null ? void 0 : _a.call(globalThis)) != null ? _b : [] | ||
]) | ||
@@ -219,0 +235,0 @@ ).filter((key) => typeof key === "string"); |
{ | ||
"version": "0.1.139", | ||
"version": "0.1.140", | ||
"license": "MIT", | ||
@@ -50,3 +50,3 @@ "types": "./dist/index.d.ts", | ||
"@plasmicapp/data-sources-context": "0.1.20", | ||
"@plasmicapp/host": "1.0.181", | ||
"@plasmicapp/host": "1.0.182", | ||
"@plasmicapp/isomorphic-unfetch": "1.0.3", | ||
@@ -59,3 +59,3 @@ "@plasmicapp/query": "0.1.77", | ||
}, | ||
"gitHead": "9216f61b95565cb9ff8639fa7f2d2640a320e731" | ||
"gitHead": "14c20ab68d180b65010b1cce060172af9a6826fd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160555
2042
+ Added@plasmicapp/host@1.0.182(transitive)
- Removed@plasmicapp/host@1.0.181(transitive)
Updated@plasmicapp/host@1.0.182