@makeswift/runtime 0.23.4 → 0.23.5-canary.0
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/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/runtimes/react/hooks/use-cache-data.js +2 -2
- package/dist/cjs/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/runtimes/react/hooks/use-cache-data.js +2 -2
- package/dist/esm/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/types/runtimes/react/hooks/use-cache-data.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -37,7 +37,7 @@ async function handler(...args) {
|
|
|
37
37
|
const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
38
38
|
const supportsWebhook = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
39
39
|
const body = {
|
|
40
|
-
version: "0.23.
|
|
40
|
+
version: "0.23.5-canary.0",
|
|
41
41
|
previewMode: supportsPreviewMode,
|
|
42
42
|
draftMode: supportsDraftMode,
|
|
43
43
|
interactionMode: true,
|
|
@@ -21,12 +21,12 @@ __export(use_cache_data_exports, {
|
|
|
21
21
|
useCacheData: () => useCacheData
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(use_cache_data_exports);
|
|
24
|
+
var import_react = require("react");
|
|
24
25
|
var import_actions = require("../../../state/actions");
|
|
25
26
|
var import_host_api_client = require("../host-api-client");
|
|
26
|
-
var import_use_universal_dispatch = require("./use-universal-dispatch");
|
|
27
27
|
function useCacheData(cacheData) {
|
|
28
28
|
const { makeswiftApiClient: apiStore } = (0, import_host_api_client.useMakeswiftHostApiClient)();
|
|
29
|
-
(0,
|
|
29
|
+
(0, import_react.useMemo)(() => apiStore.dispatch((0, import_actions.updateAPIClientCache)(cacheData)), [cacheData]);
|
|
30
30
|
}
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"sourcesContent":["import { type CacheData } from '../../../api/react'\nimport { updateAPIClientCache } from '../../../state/actions'\n\nimport { useMakeswiftHostApiClient } from '../host-api-client'\
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { type CacheData } from '../../../api/react'\nimport { updateAPIClientCache } from '../../../state/actions'\n\nimport { useMakeswiftHostApiClient } from '../host-api-client'\n\nexport function useCacheData(cacheData: CacheData) {\n const { makeswiftApiClient: apiStore } = useMakeswiftHostApiClient()\n\n // We perform cache hydration immediately on render - this is safe to do per\n // render because updating the API cache is idempotent. For precedence, see:\n //\n // https://github.com/TanStack/query/blob/8f9f183f11df3709a1a38c4efce1452788041f88/packages/react-query/src/HydrationBoundary.tsx#L41\n useMemo(() => apiStore.dispatch(updateAPIClientCache(cacheData)), [cacheData])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwB;AAExB,qBAAqC;AAErC,6BAA0C;AAEnC,SAAS,aAAa,WAAsB;AACjD,QAAM,EAAE,oBAAoB,SAAS,QAAI,kDAA0B;AAMnE,4BAAQ,MAAM,SAAS,aAAS,qCAAqB,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;AAC/E;","names":[]}
|
|
@@ -14,7 +14,7 @@ async function handler(...args) {
|
|
|
14
14
|
const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
15
15
|
const supportsWebhook = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
16
16
|
const body = {
|
|
17
|
-
version: "0.23.
|
|
17
|
+
version: "0.23.5-canary.0",
|
|
18
18
|
previewMode: supportsPreviewMode,
|
|
19
19
|
draftMode: supportsDraftMode,
|
|
20
20
|
interactionMode: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { updateAPIClientCache } from "../../../state/actions";
|
|
2
3
|
import { useMakeswiftHostApiClient } from "../host-api-client";
|
|
3
|
-
import { useUniversalDispatch } from "./use-universal-dispatch";
|
|
4
4
|
function useCacheData(cacheData) {
|
|
5
5
|
const { makeswiftApiClient: apiStore } = useMakeswiftHostApiClient();
|
|
6
|
-
|
|
6
|
+
useMemo(() => apiStore.dispatch(updateAPIClientCache(cacheData)), [cacheData]);
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
9
|
useCacheData
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"sourcesContent":["import { type CacheData } from '../../../api/react'\nimport { updateAPIClientCache } from '../../../state/actions'\n\nimport { useMakeswiftHostApiClient } from '../host-api-client'\
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { type CacheData } from '../../../api/react'\nimport { updateAPIClientCache } from '../../../state/actions'\n\nimport { useMakeswiftHostApiClient } from '../host-api-client'\n\nexport function useCacheData(cacheData: CacheData) {\n const { makeswiftApiClient: apiStore } = useMakeswiftHostApiClient()\n\n // We perform cache hydration immediately on render - this is safe to do per\n // render because updating the API cache is idempotent. For precedence, see:\n //\n // https://github.com/TanStack/query/blob/8f9f183f11df3709a1a38c4efce1452788041f88/packages/react-query/src/HydrationBoundary.tsx#L41\n useMemo(() => apiStore.dispatch(updateAPIClientCache(cacheData)), [cacheData])\n}\n"],"mappings":"AAAA,SAAS,eAAe;AAExB,SAAS,4BAA4B;AAErC,SAAS,iCAAiC;AAEnC,SAAS,aAAa,WAAsB;AACjD,QAAM,EAAE,oBAAoB,SAAS,IAAI,0BAA0B;AAMnE,UAAQ,MAAM,SAAS,SAAS,qBAAqB,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;AAC/E;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cache-data.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-cache-data.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,QAQhD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.5-canary.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"uuid": "^9.0.0",
|
|
158
158
|
"zod": "^3.21.4",
|
|
159
159
|
"@makeswift/controls": "0.1.7",
|
|
160
|
-
"@makeswift/
|
|
161
|
-
"@makeswift/
|
|
160
|
+
"@makeswift/next-plugin": "0.3.1",
|
|
161
|
+
"@makeswift/prop-controllers": "0.4.0"
|
|
162
162
|
},
|
|
163
163
|
"devDependencies": {
|
|
164
164
|
"@emotion/jest": "^11.11.0",
|