@sanity/core-loader
Advanced tools
Comparing version 0.2.1-pink-lizard to 0.3.0-pink-lizard
# Changelog | ||
## [0.3.0-pink-lizard](https://github.com/sanity-io/visual-editing/compare/core-loader-v0.2.1-pink-lizard...core-loader-v0.3.0-pink-lizard) (2023-10-25) | ||
### Features | ||
* add `query` API for React SSR ([e86ce61](https://github.com/sanity-io/visual-editing/commit/e86ce6151d21ce12a302d62c8346035eb78cdfc3)) | ||
* expose `unstable__cache` API for SSR ([9300036](https://github.com/sanity-io/visual-editing/commit/9300036adcdb6a7de60cfafaab58fed67c558200)) | ||
### Bug Fixes | ||
* **deps:** upgrade `@sanity/pkg-utils` ([9236c86](https://github.com/sanity-io/visual-editing/commit/9236c86fd37a2e4dff4d5a8142846fc2a96bc538)) | ||
* update live queries whenever adding a new query ([fafb057](https://github.com/sanity-io/visual-editing/commit/fafb057c5dcd73fc08b30ae7e80ccf57be26e301)) | ||
## [0.2.1-pink-lizard](https://github.com/sanity-io/visual-editing/compare/core-loader-v0.2.0-pink-lizard...core-loader-v0.2.1-pink-lizard) (2023-10-24) | ||
@@ -4,0 +18,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { Cache as Cache_2 } from 'async-cache-dedupe' | ||
import { ContentSourceMap } from '@sanity/client' | ||
@@ -117,4 +118,12 @@ import type { QueryParams } from '@sanity/client' | ||
params?: QueryParams, | ||
initialData?: Response, | ||
initialSourceMap?: ContentSourceMap, | ||
) => MapStore<QueryStoreState<Response, Error>> | ||
$LiveMode: MapStore<LiveModeState> | ||
unstable__cache: Cache_2 & { | ||
fetch: <Response>(key: string) => Promise<{ | ||
result: Response | ||
resultSourceMap: ContentSourceMap | undefined | ||
}> | ||
} | ||
} | ||
@@ -121,0 +130,0 @@ |
@@ -659,2 +659,3 @@ import { createCache } from 'async-cache-dedupe'; | ||
}); | ||
updateLiveQueries(); | ||
$fetch.setKey("error", void 0); | ||
@@ -704,3 +705,3 @@ if (controller.signal.aborted) return; | ||
}); | ||
const cache2 = createCache().define("fetch", async key => { | ||
const cache = createCache().define("fetch", async key => { | ||
const { | ||
@@ -730,3 +731,3 @@ query, | ||
$fetch.setKey("error", void 0); | ||
const response = await cache2.fetch(JSON.stringify({ | ||
const response = await cache.fetch(JSON.stringify({ | ||
query, | ||
@@ -745,8 +746,8 @@ params | ||
}; | ||
const createFetcherStore = (query, params = {}) => { | ||
const createFetcherStore = (query, params = {}, initialData, initialSourceMap) => { | ||
const $fetch = map({ | ||
loading: true, | ||
error: void 0, | ||
data: void 0, | ||
sourceMap: void 0 | ||
data: initialData, | ||
sourceMap: initialSourceMap | ||
}); | ||
@@ -770,3 +771,4 @@ onMount($fetch, () => { | ||
createFetcherStore, | ||
$LiveMode | ||
$LiveMode, | ||
unstable__cache: cache | ||
}; | ||
@@ -773,0 +775,0 @@ }; |
{ | ||
"name": "@sanity/core-loader", | ||
"version": "0.2.1-pink-lizard", | ||
"version": "0.3.0-pink-lizard", | ||
"license": "MIT", | ||
@@ -88,3 +88,3 @@ "author": "Sanity.io <hello@sanity.io>", | ||
"@sanity/client": "^6.7.0", | ||
"@sanity/pkg-utils": "^3.2.0", | ||
"@sanity/pkg-utils": "^3.2.1", | ||
"@typescript-eslint/eslint-plugin": "^6.9.0", | ||
@@ -98,3 +98,3 @@ "@typescript-eslint/parser": "^6.9.0", | ||
"typescript": "^5.2.2", | ||
"@sanity/groq-store": "0.0.7-pink-lizard", | ||
"@sanity/groq-store": "0.0.8-pink-lizard", | ||
"channels": "0.0.0", | ||
@@ -101,0 +101,0 @@ "visual-editing-helpers": "0.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
221460
2515