gemi 0.164.0 → 0.165.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/{chunk-1kt3p3dg.js → chunk-3q6adj7c.js} +10 -10
- package/dist/{chunk-1kt3p3dg.js.map → chunk-3q6adj7c.js.map} +3 -3
- package/dist/{chunk-dcnz24yt.js → chunk-7d0n00an.js} +1 -1
- package/dist/{chunk-34svz95a.js → chunk-bs0setym.js} +2 -2
- package/dist/{chunk-34svz95a.js.map → chunk-bs0setym.js.map} +1 -1
- package/dist/chunk-sk22zf9e.js +24 -0
- package/dist/{chunk-472qd3v9.js.map → chunk-sk22zf9e.js.map} +4 -4
- package/dist/{chunk-mvj8q5a7.js → chunk-w4227psm.js} +1 -1
- package/dist/chunks/{RealtimeClient-b6NvkUAQ.js → RealtimeClient-BX_HwEBK.js} +2 -2
- package/dist/chunks/{RealtimeClient-b6NvkUAQ.js.map → RealtimeClient-BX_HwEBK.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-CkuoNG4Q.js → ThemeProvider-D4mhhONE.js} +78 -22
- package/dist/chunks/ThemeProvider-D4mhhONE.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-DVWwtyWu.js → fetchFileRequest-C3wMigR3.js} +2 -2
- package/dist/chunks/{fetchFileRequest-DVWwtyWu.js.map → fetchFileRequest-C3wMigR3.js.map} +1 -1
- package/dist/chunks/{live-CpXfJmRN.js → live-CJOuf1Gu.js} +3 -3
- package/dist/chunks/{live-CpXfJmRN.js.map → live-CJOuf1Gu.js.map} +1 -1
- package/dist/chunks/{mutationExtras-BNFui6Pt.js → mutationExtras-DpB8MtNs.js} +2 -2
- package/dist/chunks/{mutationExtras-BNFui6Pt.js.map → mutationExtras-DpB8MtNs.js.map} +1 -1
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/ServerDataProvider.d.ts +6 -0
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/chunkLoadRecovery.d.ts +56 -8
- package/dist/client/chunkLoadRecovery.d.ts.map +1 -1
- package/dist/client/helpers/loadRoutePayload.d.ts +8 -0
- package/dist/client/helpers/loadRoutePayload.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +23 -9
- package/dist/client/index.js.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/index.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/httpProd.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/testing/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-472qd3v9.js +0 -24
- package/dist/chunks/ThemeProvider-CkuoNG4Q.js.map +0 -1
- /package/dist/{chunk-dcnz24yt.js.map → chunk-7d0n00an.js.map} +0 -0
- /package/dist/{chunk-mvj8q5a7.js.map → chunk-w4227psm.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as applyParams, it as parseRetryAfter, st as QueryError } from "./ThemeProvider-D4mhhONE.js";
|
|
2
2
|
//#region client/fetchFileRequest.ts
|
|
3
3
|
/**
|
|
4
4
|
* `fetchBlob` / `fetchText` once loaded: the `GET`, a `QueryError` for a
|
|
@@ -54,4 +54,4 @@ function filenameOf(response) {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { fetchFile, filenameOf };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=fetchFileRequest-
|
|
57
|
+
//# sourceMappingURL=fetchFileRequest-C3wMigR3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchFileRequest-
|
|
1
|
+
{"version":3,"file":"fetchFileRequest-C3wMigR3.js","names":[],"sources":["../../client/fetchFileRequest.ts"],"sourcesContent":["import { applyParams } from \"../utils/applyParams\";\nimport type { FetchedBlob, FetchedText, FetchFileOptions } from \"./fetchFile\";\nimport { QueryError } from \"./QueryError\";\nimport { parseRetryAfter } from \"./retryPolicy\";\n\n// What `fetchBlob` and `fetchText` in `./fetchFile` load on their first call\n// (#915).\n\ntype RequestOptions = Omit<FetchFileOptions<string>, \"params\"> & {\n params?: Record<string, string | number | undefined>;\n};\n\n/**\n * `fetchBlob` / `fetchText` once loaded: the `GET`, a `QueryError` for a\n * non-2xx, and the body read `as` a blob or text.\n */\nexport async function fetchFile(\n path: string,\n // The caller's `FetchFileOptions<P>`, checked against its path there.\n options: object | undefined,\n as: \"blob\" | \"text\",\n): Promise<FetchedBlob | FetchedText> {\n const response = await request(path, options as RequestOptions);\n const body = as === \"blob\" ? { blob: await response.blob() } : { text: await response.text() };\n return { ...body, filename: filenameOf(response), response } as FetchedBlob | FetchedText;\n}\n\nasync function request(path: string, options: RequestOptions = {}) {\n const { params = {}, search, signal, init } = options;\n const url = applyParams(path, params);\n const query = searchString(search);\n const response = await fetch(`/api${url}${query ? `?${query}` : \"\"}`, {\n ...init,\n method: \"GET\",\n signal,\n });\n if (!response.ok) {\n // An error body that is not JSON (a proxy's HTML 502) is still that status.\n const body = await response.json().catch(() => null);\n throw new QueryError(\n url,\n query,\n response.status,\n body,\n parseRetryAfter(response.headers.get(\"retry-after\")),\n );\n }\n return response;\n}\n\nfunction searchString(search: FetchFileOptions<string>[\"search\"]) {\n if (!search) return \"\";\n if (search instanceof URLSearchParams) return search.toString();\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(search)) {\n if (value !== null && value !== undefined) params.append(key, String(value));\n }\n return params.toString();\n}\n\n/**\n * The file name in a `Content-Disposition` header: the RFC 5987\n * `filename*=UTF-8''...` form when present and decodable, else `filename`.\n *\n * @internal Exported for tests.\n */\nexport function filenameOf(response: Response): string | null {\n const header = response.headers.get(\"content-disposition\");\n if (!header) return null;\n const extended = /filename\\*\\s*=\\s*([^']*)'[^']*'([^;]+)/i.exec(header);\n if (extended) {\n try {\n return decodeURIComponent(extended[2].trim());\n } catch {\n // A malformed escape: fall back to the plain form.\n }\n }\n const plain = /filename\\s*=\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|([^;]+))/i.exec(header);\n if (!plain) return null;\n const name = plain[1] !== undefined ? plain[1].replace(/\\\\(.)/g, \"$1\") : plain[2].trim();\n return name || null;\n}\n"],"mappings":";;;;;;AAgBA,eAAsB,UACpB,MAEA,SACA,IACoC;CACpC,MAAM,WAAW,MAAM,QAAQ,MAAM,OAAyB;CAE9D,OAAO;EAAE,GADI,OAAO,SAAS,EAAE,MAAM,MAAM,SAAS,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,SAAS,KAAK,EAAE;EAC3E,UAAU,WAAW,QAAQ;EAAG;CAAS;AAC7D;AAEA,eAAe,QAAQ,MAAc,UAA0B,CAAC,GAAG;CACjE,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,QAAQ,SAAS;CAC9C,MAAM,MAAM,YAAY,MAAM,MAAM;CACpC,MAAM,QAAQ,aAAa,MAAM;CACjC,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,QAAQ,IAAI,UAAU,MAAM;EACpE,GAAG;EACH,QAAQ;EACR;CACF,CAAC;CACD,IAAI,CAAC,SAAS,IAAI;EAEhB,MAAM,OAAO,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,IAAI;EACnD,MAAM,IAAI,WACR,KACA,OACA,SAAS,QACT,MACA,gBAAgB,SAAS,QAAQ,IAAI,aAAa,CAAC,CACrD;CACF;CACA,OAAO;AACT;AAEA,SAAS,aAAa,QAA4C;CAChE,IAAI,CAAC,QAAQ,OAAO;CACpB,IAAI,kBAAkB,iBAAiB,OAAO,OAAO,SAAS;CAC9D,MAAM,SAAS,IAAI,gBAAgB;CACnC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAC9C,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO,OAAO,KAAK,OAAO,KAAK,CAAC;CAE7E,OAAO,OAAO,SAAS;AACzB;;;;;;;AAQA,SAAgB,WAAW,UAAmC;CAC5D,MAAM,SAAS,SAAS,QAAQ,IAAI,qBAAqB;CACzD,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,WAAW,0CAA0C,KAAK,MAAM;CACtE,IAAI,UACF,IAAI;EACF,OAAO,mBAAmB,SAAS,EAAE,CAAC,KAAK,CAAC;CAC9C,QAAQ,CAER;CAEF,MAAM,QAAQ,kDAAkD,KAAK,MAAM;CAC3E,IAAI,CAAC,OAAO,OAAO;CAEnB,QADa,MAAM,OAAO,KAAA,IAAY,MAAM,EAAE,CAAC,QAAQ,UAAU,IAAI,IAAI,MAAM,EAAE,CAAC,KAAK,MACxE;AACjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { W as realtime, q as loadedModule } from "./ThemeProvider-D4mhhONE.js";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -76,7 +76,7 @@ function followLive(provided, live, resource, setOpen) {
|
|
|
76
76
|
};
|
|
77
77
|
const socket = provided ?? realtime.client;
|
|
78
78
|
if (socket) start(socket);
|
|
79
|
-
else import("./RealtimeClient-
|
|
79
|
+
else import("./RealtimeClient-BX_HwEBK.js").then((module) => start(loadedModule(module).tabClient())).catch(() => {});
|
|
80
80
|
return () => {
|
|
81
81
|
stop?.();
|
|
82
82
|
stop = null;
|
|
@@ -85,4 +85,4 @@ function followLive(provided, live, resource, setOpen) {
|
|
|
85
85
|
//#endregion
|
|
86
86
|
export { live_exports as n, followLive as t };
|
|
87
87
|
|
|
88
|
-
//# sourceMappingURL=live-
|
|
88
|
+
//# sourceMappingURL=live-CJOuf1Gu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-
|
|
1
|
+
{"version":3,"file":"live-CJOuf1Gu.js","names":[],"sources":["../../client/realtime/live.ts"],"sourcesContent":["import type { QueryResource } from \"../QueryResource\";\nimport type { ChannelPattern } from \"../useChannel\";\nimport { EVENT_COALESCE_MS } from \"./useChannelSubscription\";\nimport type { ChannelParamValues, RealtimeSocket } from \"./RealtimeClient\";\nimport { loadedModule } from \"../lazyModule\";\nimport { realtime } from \"./loader\";\n\n/**\n * `useQuery`'s `live` option: the channel whose events and resyncs refetch\n * the query. A pattern without params (`\"user\"`), `[pattern, params]`, or\n * `{ channel, params }`.\n */\nexport type LiveChannel =\n | ChannelPattern\n | readonly [ChannelPattern, ChannelParamValues]\n | { channel: ChannelPattern; params?: ChannelParamValues };\n\nexport function resolveLiveChannel(\n live: LiveChannel | null | undefined | false,\n): { pattern: string; params: ChannelParamValues } | null {\n if (!live) return null;\n if (typeof live === \"string\") return { pattern: live, params: {} };\n if (Array.isArray(live)) return { pattern: live[0], params: live[1] ?? {} };\n const object = live as { channel: string; params?: ChannelParamValues };\n return { pattern: object.channel, params: object.params ?? {} };\n}\n\n/**\n * `useQuery`'s `live` subscription, loaded on first use by `followLive` in\n * `./loader` (#891). The channel's events refetch every cached variant of the\n * query (the rendered ones now), a burst of them once per\n * `EVENT_COALESCE_MS`; a resync refetches at once. `setOpen` follows whether\n * the channel is open, which pauses the query's polling.\n */\nexport function subscribeLive(\n socket: RealtimeSocket,\n live: LiveChannel,\n resource: () => QueryResource,\n setOpen: (open: boolean) => void,\n): () => void {\n const channel = resolveLiveChannel(live);\n if (!channel) return () => {};\n const refresh = () => {\n const target = resource();\n for (const key of target.variantKeys()) target.invalidate(key);\n };\n let timer: ReturnType<typeof setTimeout> | null = null;\n const release = socket.subscribe(channel.pattern, channel.params, {\n onEvent: () => {\n if (timer) return;\n timer = setTimeout(() => {\n timer = null;\n refresh();\n }, EVENT_COALESCE_MS);\n },\n onResync: refresh,\n onStatus: (status) => setOpen(status === \"open\"),\n });\n return () => {\n if (timer) clearTimeout(timer);\n release();\n };\n}\n\n/**\n * What `followLive` in `./loader` hands over to once this module is loaded:\n * subscribes on the provided socket, or the tab's client, loading that first\n * when it is not there yet. Returns the function that stops it.\n */\nexport function followLive(\n provided: RealtimeSocket | null,\n live: LiveChannel,\n resource: () => QueryResource,\n setOpen: (open: boolean) => void,\n): () => void {\n // `undefined` until it subscribes, `null` once stopped.\n let stop: (() => void) | null | undefined;\n const start = (socket: RealtimeSocket) => {\n if (stop === undefined) stop = subscribeLive(socket, live, resource, setOpen);\n };\n const socket = provided ?? realtime.client;\n if (socket) start(socket);\n // Its own `import()` of the client rather than `loadRealtimeClient`, which\n // would keep that in the entry chunk of every app with a `useQuery`. A\n // failed load leaves the channel closed, so the query keeps polling.\n else\n import(\"./RealtimeClient.js\")\n .then((module) => start(loadedModule(module).tabClient()))\n .catch(() => {});\n return () => {\n stop?.();\n stop = null;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,SAAgB,mBACd,MACwD;CACxD,IAAI,CAAC,MAAM,OAAO;CAClB,IAAI,OAAO,SAAS,UAAU,OAAO;EAAE,SAAS;EAAM,QAAQ,CAAC;CAAE;CACjE,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO;EAAE,SAAS,KAAK;EAAI,QAAQ,KAAK,MAAM,CAAC;CAAE;CAC1E,MAAM,SAAS;CACf,OAAO;EAAE,SAAS,OAAO;EAAS,QAAQ,OAAO,UAAU,CAAC;CAAE;AAChE;;;;;;;;AASA,SAAgB,cACd,QACA,MACA,UACA,SACY;CACZ,MAAM,UAAU,mBAAmB,IAAI;CACvC,IAAI,CAAC,SAAS,aAAa,CAAC;CAC5B,MAAM,gBAAgB;EACpB,MAAM,SAAS,SAAS;EACxB,KAAK,MAAM,OAAO,OAAO,YAAY,GAAG,OAAO,WAAW,GAAG;CAC/D;CACA,IAAI,QAA8C;CAClD,MAAM,UAAU,OAAO,UAAU,QAAQ,SAAS,QAAQ,QAAQ;EAChE,eAAe;GACb,IAAI,OAAO;GACX,QAAQ,iBAAiB;IACvB,QAAQ;IACR,QAAQ;GACV,GAAA,GAAoB;EACtB;EACA,UAAU;EACV,WAAW,WAAW,QAAQ,WAAW,MAAM;CACjD,CAAC;CACD,aAAa;EACX,IAAI,OAAO,aAAa,KAAK;EAC7B,QAAQ;CACV;AACF;;;;;;AAOA,SAAgB,WACd,UACA,MACA,UACA,SACY;CAEZ,IAAI;CACJ,MAAM,SAAS,WAA2B;EACxC,IAAI,SAAS,KAAA,GAAW,OAAO,cAAc,QAAQ,MAAM,UAAU,OAAO;CAC9E;CACA,MAAM,SAAS,YAAY,SAAS;CACpC,IAAI,QAAQ,MAAM,MAAM;MAKtB,OAAO,+BAAsB,CAC1B,MAAM,WAAW,MAAM,aAAa,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CACzD,YAAY,CAAC,CAAC;CACnB,aAAa;EACX,OAAO;EACP,OAAO;CACT;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as toVariantKey, Y as applyParams } from "./ThemeProvider-D4mhhONE.js";
|
|
2
2
|
import { p as mutationErrorFromBody, s as isObject } from "./MutationError-DuKqBW8o.js";
|
|
3
3
|
//#region client/mutationErrorHelpers.ts
|
|
4
4
|
var FALLBACK_MESSAGE = "Something went wrong. Try again.";
|
|
@@ -112,4 +112,4 @@ function applyQueryUpdates(getResource, routeParams, updates, answer) {
|
|
|
112
112
|
//#endregion
|
|
113
113
|
export { applyQueryUpdates, withMutationErrorHelpers, writeQueryData };
|
|
114
114
|
|
|
115
|
-
//# sourceMappingURL=mutationExtras-
|
|
115
|
+
//# sourceMappingURL=mutationExtras-DpB8MtNs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationExtras-
|
|
1
|
+
{"version":3,"file":"mutationExtras-DpB8MtNs.js","names":[],"sources":["../../client/mutationErrorHelpers.ts","../../client/queryUpdates.ts"],"sourcesContent":["import {\n isObject,\n mutationErrorFromBody,\n type MutationErrorHelpers,\n type MutationValidationError,\n type WithMutationErrorHelpers,\n} from \"./MutationError\";\n\n// `error.list()` and `error.field(name)` on what the mutation hooks hand over.\n// Loaded with the hooks' other extras when one mounts (see\n// `./mutationModules`), so no route's entry chunk carries it (#915).\n//\n// `list` and `field` repeat `mutationErrorList` and `mutationErrorField` from\n// `./MutationError` on purpose. Those are public and synchronous, so they sit\n// in whatever chunk calls them; importing them here would put them, and so\n// this code, back in every entry chunk. `MutationError.helpers.test` runs the\n// same cases through both.\n\nconst FALLBACK_MESSAGE = \"Something went wrong. Try again.\";\n\n// `isValidationError`, which an import would keep in the entry chunk.\nfunction isValidationError(error: unknown): error is MutationValidationError {\n return isObject(error) && error.kind === \"validation_error\";\n}\n\n// A `QueryError`'s refusal, read as the mutation hooks read a body. Read by\n// shape, not `instanceof`, so a copy of the class from another bundle works.\nfunction unwrapQueryError(error: unknown): unknown {\n if (error instanceof Error && error.name === \"QueryError\" && \"body\" in error) {\n const { body, status } = error as Error & { body: unknown; status: number };\n return body == null ? error : mutationErrorFromBody(body, status);\n }\n return error;\n}\n\n// `error.list(fallback)`: see `mutationErrorList`.\nfunction list(\n error: unknown,\n fallback: string = FALLBACK_MESSAGE,\n): string[] {\n const value = unwrapQueryError(error);\n if (isValidationError(value)) {\n const messages = Object.values(value.messages ?? {})\n .flat()\n .filter((message) => typeof message === \"string\" && message !== \"\");\n return messages.length > 0 ? messages : [fallback];\n }\n if (\n isObject(value) &&\n !(value instanceof Error) &&\n value.kind !== \"server_error\" &&\n typeof value.message === \"string\" &&\n value.message !== \"\"\n ) {\n return [value.message];\n }\n return [fallback];\n}\n\n// `error.field(name)`: see `mutationErrorField`.\nfunction field(error: unknown, name: string): string[] {\n const value = unwrapQueryError(error);\n if (!isValidationError(value)) return [];\n const messages = value.messages?.[name];\n return Array.isArray(messages) ? [...messages] : [];\n}\n\n/**\n * Puts `list` and `field` on an error the hooks hand over, as non-enumerable\n * properties, so `toEqual`, a spread and `JSON.stringify` see the same object\n * as before. A key the error already has is left alone; a primitive or a\n * frozen value is returned as it is.\n *\n * @internal\n */\nexport function withMutationErrorHelpers<T>(error: T): WithMutationErrorHelpers<T> {\n if (!isObject(error) || !Object.isExtensible(error)) {\n return error as WithMutationErrorHelpers<T>;\n }\n const helpers: MutationErrorHelpers = {\n list: (fallback) => list(error, fallback),\n field: (name) => field(error, name),\n };\n for (const key of [\"list\", \"field\"] as const) {\n if (key in error) continue;\n Object.defineProperty(error, key, {\n value: helpers[key],\n configurable: true,\n writable: true,\n enumerable: false,\n });\n }\n return error as WithMutationErrorHelpers<T>;\n}\n","import type { QueryResource } from \"./QueryResource\";\nimport type { QueryTarget, QueryUpdate } from \"./useSetQueryData\";\nimport { applyParams } from \"../utils/applyParams\";\nimport { toVariantKey } from \"../utils/variantKey\";\n\n// The cache writes behind a mutation's `updates` and `useSetQueryData()`\n// (#897). Loaded with the hooks' other extras when one mounts (see\n// `./mutationModules`), so no route's entry chunk carries it (#915).\n\ntype Resolve = (key: string) => QueryResource;\n\n/**\n * Write data the server just produced (a mutation's answer) into a variant,\n * with no refetch: unlike `mutate`, the value is not a guess to reconcile.\n * The variant counts as freshly fetched, so its `staleTime` starts again, and\n * a GET already on the wire for it is dropped when it lands, since it may\n * carry the data from before the write. A reader suspended on the variant\n * wakes up with it (#897). Here rather than on `QueryResource`, which every\n * entry chunk carries (#915).\n */\nfunction setVariant(resource: QueryResource, variantKey: string, data: unknown) {\n resource.dropHttpCache(variantKey);\n resource.markApplied(variantKey);\n const store = resource.store.getValue();\n resource.fill(store, variantKey, data, Date.now());\n resource.store.next(store);\n}\n\n/** The value to write, or a function of the cached one. */\nexport type WriteQueryNext = { value: unknown } | { update: (current: any) => unknown };\n\n/**\n * Write into every variant `target` names. `next` is the value to write, or\n * a function of the cached value; a function skips a variant with nothing\n * cached. A value seeds a single variant that is not cached yet; a predicate\n * only ever reaches variants that are.\n */\nexport function writeQueryData(\n getResource: Resolve,\n routeParams: Record<string, any>,\n target: QueryTarget<any>,\n next: WriteQueryNext,\n) {\n const { path, params = {}, search = {} } = target;\n const resource = getResource(applyParams(String(path), { ...routeParams, ...params }));\n const write = (variantKey: string) => {\n if (\"value\" in next) {\n setVariant(resource, variantKey, next.value);\n return;\n }\n const state = resource.peek(variantKey);\n if (!state?.hasData) return;\n setVariant(resource, variantKey, next.update(state.data));\n };\n\n if (typeof search === \"function\") {\n for (const variantKey of resource.variantKeys()) {\n if (!resource.peek(variantKey)?.hasData) continue;\n if (search(new URLSearchParams(variantKey))) write(variantKey);\n }\n return;\n }\n write(toVariantKey(search));\n}\n\n/**\n * Write a mutation's `updates` with its answer.\n */\nexport function applyQueryUpdates(\n getResource: Resolve,\n routeParams: Record<string, any>,\n updates: ReadonlyArray<QueryUpdate<any>> | undefined,\n answer: unknown,\n) {\n for (const update of updates ?? []) {\n const { data } = update as { data?: (answer: any, current: any) => any };\n writeQueryData(\n getResource,\n routeParams,\n update,\n data ? { update: (current) => data(answer, current) } : { value: answer },\n );\n }\n}\n"],"mappings":";;;AAkBA,IAAM,mBAAmB;AAGzB,SAAS,kBAAkB,OAAkD;CAC3E,OAAO,SAAS,KAAK,KAAK,MAAM,SAAS;AAC3C;AAIA,SAAS,iBAAiB,OAAyB;CACjD,IAAI,iBAAiB,SAAS,MAAM,SAAS,gBAAgB,UAAU,OAAO;EAC5E,MAAM,EAAE,MAAM,WAAW;EACzB,OAAO,QAAQ,OAAO,QAAQ,sBAAsB,MAAM,MAAM;CAClE;CACA,OAAO;AACT;AAGA,SAAS,KACP,OACA,WAAmB,kBACT;CACV,MAAM,QAAQ,iBAAiB,KAAK;CACpC,IAAI,kBAAkB,KAAK,GAAG;EAC5B,MAAM,WAAW,OAAO,OAAO,MAAM,YAAY,CAAC,CAAC,CAAC,CACjD,KAAK,CAAC,CACN,QAAQ,YAAY,OAAO,YAAY,YAAY,YAAY,EAAE;EACpE,OAAO,SAAS,SAAS,IAAI,WAAW,CAAC,QAAQ;CACnD;CACA,IACE,SAAS,KAAK,KACd,EAA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B,WAAW,UAAU,YAAY,KAAK,KAAK;GAC3C;EACF;EACA,MAAM,QAAQ,SAAS,KAAK,UAAU;EACtC,IAAI,CAAC,OAAO,SAAS;EACrB,WAAW,UAAU,YAAY,KAAK,OAAO,MAAM,IAAI,CAAC;CAC1D;CAEA,IAAI,OAAO,WAAW,YAAY;EAChC,KAAK,MAAM,cAAc,SAAS,YAAY,GAAG;GAC/C,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,EAAE,SAAS;GACzC,IAAI,OAAO,IAAI,gBAAgB,UAAU,CAAC,GAAG,MAAM,UAAU;EAC/D;EACA;CACF;CACA,MAAM,aAAa,MAAM,CAAC;AAC5B;;;;AAKA,SAAgB,kBACd,aACA,aACA,SACA,QACA;CACA,KAAK,MAAM,UAAU,WAAW,CAAC,GAAG;EAClC,MAAM,EAAE,SAAS;EACjB,eACE,aACA,aACA,QACA,OAAO,EAAE,SAAS,YAAY,KAAK,QAAQ,OAAO,EAAE,IAAI,EAAE,OAAO,OAAO,CAC1E;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAqB,aAAa,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGjC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAqB,aAAa,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,aAAa,EAAE,M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AAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACzC;AAKD,eAAO,MAAM,oBAAoB,GAC/B,OAAO,iBAAiB,CAAC,yBAAyB,CAAC,4CAiWpD,CAAC"}
|
|
@@ -60,6 +60,12 @@ export interface ServerDataContextValue {
|
|
|
60
60
|
assetBase?: string;
|
|
61
61
|
meta: any;
|
|
62
62
|
appId: string;
|
|
63
|
+
/**
|
|
64
|
+
* The client build this document was rendered for. A `.json` navigation
|
|
65
|
+
* answered by another build (`x-gemi-build`) loads the page in full (#1056).
|
|
66
|
+
* Absent in dev and in tests.
|
|
67
|
+
*/
|
|
68
|
+
buildId?: string;
|
|
63
69
|
/** Route patterns declared `.static()`; absent when the app has none. */
|
|
64
70
|
staticRoutes?: string[];
|
|
65
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerDataProvider.d.ts","sourceRoot":"","sources":["../../client/ServerDataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EA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AAC,CAAC;IAClC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,0EAA0E;IAC1E,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,iDAA8C,CAAC;AAE7E,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,GAC7B,OAAO,iBAAiB,CAAC,uBAAuB,CAAC,4CAgBlD,CAAC"}
|
|
@@ -4,17 +4,29 @@
|
|
|
4
4
|
* (#548). The page cannot continue with the module it wanted, and a full load
|
|
5
5
|
* of the URL it was heading to gets it the current release's document.
|
|
6
6
|
*
|
|
7
|
-
* One reload, guarded: a reload that lands on the same failure (a
|
|
8
|
-
* genuinely missing, a proxy that keeps refusing it) must not
|
|
9
|
-
* `sessionStorage` marker
|
|
10
|
-
*
|
|
7
|
+
* One reload per page, guarded: a reload that lands on the same failure (a
|
|
8
|
+
* chunk that is genuinely missing, a proxy that keeps refusing it) must not
|
|
9
|
+
* become a loop. A `sessionStorage` marker records when each URL was reloaded
|
|
10
|
+
* onto and survives the reload it guards, so a second failure for the same URL
|
|
11
|
+
* inside the cooldown is left to the route's error boundary. Per URL rather
|
|
12
|
+
* than per tab (#1056): while two releases serve at once every navigation can
|
|
13
|
+
* miss, and a tab-wide cooldown sent the second one to the error boundary.
|
|
14
|
+
*
|
|
15
|
+
* The same guard covers a navigation whose data came from another build
|
|
16
|
+
* (`recoverFromBuildMismatch`).
|
|
11
17
|
*
|
|
12
18
|
* No DOM or React import at module scope: the server's reload stub
|
|
13
19
|
* (`server/staticAssetMiss.ts`) embeds the same guard as a script.
|
|
14
20
|
*/
|
|
15
21
|
/** The `sessionStorage` key the guard lives under, shared with the reload stub. */
|
|
16
22
|
export declare const CHUNK_RELOAD_MARKER = "gemi:chunk-reload";
|
|
17
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The response header carrying the client build id on a `.json` navigation
|
|
25
|
+
* (#1056). The document carries its own as `buildId`; they differ when the
|
|
26
|
+
* request reached a server running another release.
|
|
27
|
+
*/
|
|
28
|
+
export declare const BUILD_HEADER = "x-gemi-build";
|
|
29
|
+
/** How long after a recovery reload onto a URL another one onto it is refused. */
|
|
18
30
|
export declare const DEFAULT_CHUNK_RELOAD_COOLDOWN_MS = 30000;
|
|
19
31
|
/**
|
|
20
32
|
* Where the failure surfaced: a route's view chunk during a client-side
|
|
@@ -25,7 +37,7 @@ export declare const DEFAULT_CHUNK_RELOAD_COOLDOWN_MS = 30000;
|
|
|
25
37
|
export type ChunkLoadErrorSource = "navigation" | "hydration" | "preload" | "app";
|
|
26
38
|
/**
|
|
27
39
|
* Why gemi will not reload, or `null` when it will:
|
|
28
|
-
* - `cooldown`: it already reloaded
|
|
40
|
+
* - `cooldown`: it already reloaded onto this URL within `cooldownMs`.
|
|
29
41
|
* - `offline`: `navigator.onLine` is false — a reload would only fail harder.
|
|
30
42
|
* - `storage`: `sessionStorage` cannot be read or written, so the guard cannot
|
|
31
43
|
* survive the reload and the loop it prevents could not be ruled out.
|
|
@@ -39,6 +51,16 @@ export interface ChunkLoadErrorContext {
|
|
|
39
51
|
/** Why gemi will not reload, or `null` when it is about to. */
|
|
40
52
|
blocked: ChunkReloadBlock;
|
|
41
53
|
}
|
|
54
|
+
export interface BuildMismatchContext {
|
|
55
|
+
/** The URL the full page load goes to: the page being navigated to. */
|
|
56
|
+
url: string;
|
|
57
|
+
/** The build the page was loaded with. */
|
|
58
|
+
clientBuild: string;
|
|
59
|
+
/** The build that answered the navigation. */
|
|
60
|
+
serverBuild: string;
|
|
61
|
+
/** Why gemi will not reload, or `null` when it is about to. */
|
|
62
|
+
blocked: ChunkReloadBlock;
|
|
63
|
+
}
|
|
42
64
|
export interface ChunkLoadRecoveryOptions {
|
|
43
65
|
/** Default 30 000 ms. */
|
|
44
66
|
cooldownMs?: number;
|
|
@@ -50,6 +72,13 @@ export interface ChunkLoadRecoveryOptions {
|
|
|
50
72
|
* when the reload is blocked too, with `blocked` saying why.
|
|
51
73
|
*/
|
|
52
74
|
onChunkLoadError?: (context: ChunkLoadErrorContext) => boolean | void;
|
|
75
|
+
/**
|
|
76
|
+
* Called when a client-side navigation's data came from another build (a
|
|
77
|
+
* deploy in progress, two releases behind one load balancer), before gemi
|
|
78
|
+
* loads the page in full. Return `false` to skip that and render the data
|
|
79
|
+
* anyway. Called when the load is blocked too, with `blocked` saying why.
|
|
80
|
+
*/
|
|
81
|
+
onBuildMismatch?: (context: BuildMismatchContext) => boolean | void;
|
|
53
82
|
}
|
|
54
83
|
/**
|
|
55
84
|
* Sets how gemi recovers from a failed chunk. `false` turns recovery off: the
|
|
@@ -85,10 +114,29 @@ export declare function recoverFromChunkLoadError(error: unknown, { source, url
|
|
|
85
114
|
source?: ChunkLoadErrorSource;
|
|
86
115
|
url?: string;
|
|
87
116
|
}): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Loads `url` in full because the navigation to it got its data from another
|
|
119
|
+
* build (#1056): the views this page runs were not written for that data, and
|
|
120
|
+
* rendering it anyway is how a deploy turned into "Something went wrong". The
|
|
121
|
+
* full load gets a document and views of one build. Same guard as a chunk
|
|
122
|
+
* failure, once per URL per cooldown; a navigation refused here renders the
|
|
123
|
+
* data as before. Returns whether the page load was started.
|
|
124
|
+
*/
|
|
125
|
+
export declare function recoverFromBuildMismatch({ url, clientBuild, serverBuild, }: {
|
|
126
|
+
url: string;
|
|
127
|
+
clientBuild: string;
|
|
128
|
+
serverBuild: string;
|
|
129
|
+
}): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The build that answered a `.json` navigation, when it is not `clientBuild`;
|
|
132
|
+
* otherwise `null`. Unknown on either side (dev, a test double, a server from
|
|
133
|
+
* before the header) is not a mismatch.
|
|
134
|
+
*/
|
|
135
|
+
export declare function otherBuild(response: Response, clientBuild: string | undefined): string | null;
|
|
88
136
|
/**
|
|
89
137
|
* The same guard as a classic script body, for the module the server sends in
|
|
90
|
-
* place of a chunk it does not have. It reloads once per cooldown;
|
|
91
|
-
* cooldown (or with no storage) it throws an error `isChunkLoadError`
|
|
138
|
+
* place of a chunk it does not have. It reloads once per URL per cooldown;
|
|
139
|
+
* inside the cooldown (or with no storage) it throws an error `isChunkLoadError`
|
|
92
140
|
* recognises, so the importing page's own recovery and error boundary see the
|
|
93
141
|
* failure instead of a module that silently has no exports.
|
|
94
142
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunkLoadRecovery.d.ts","sourceRoot":"","sources":["../../client/chunkLoadRecovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"chunkLoadRecovery.d.ts","sourceRoot":"","sources":["../../client/chunkLoadRecovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,kFAAkF;AAClF,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,CAAC;AAElF;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAEzE,MAAM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,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAYV;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG7F;AA+ED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAyC,GACpD,MAAM,CAUR"}
|
|
@@ -18,6 +18,14 @@ interface LoadRoutePayloadOptions {
|
|
|
18
18
|
* segment suspended on that variant.
|
|
19
19
|
*/
|
|
20
20
|
onQueryPayload?: (payload: RouteQueryPayload) => void;
|
|
21
|
+
/** The build the page was loaded with (`buildId` in the document). */
|
|
22
|
+
buildId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The response came from another build (#1056). Returns whether a full page
|
|
25
|
+
* load is under way, in which case nothing is rendered; otherwise the
|
|
26
|
+
* payload is used as it is.
|
|
27
|
+
*/
|
|
28
|
+
onOtherBuild?: (serverBuild: string) => boolean;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* The page data for a navigation, from whichever source can produce it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadRoutePayload.d.ts","sourceRoot":"","sources":["../../../client/helpers/loadRoutePayload.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadRoutePayload.d.ts","sourceRoot":"","sources":["../../../client/helpers/loadRoutePayload.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG9E,UAAU,uBAAuB;IAC/B,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1D;;;;OAIG;IACH,aAAa,EAAE,MAAM,MAAM,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACtD,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;CACjD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,GAAG,CAAC,CAkDd"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { Redirect } from "./Redirect";
|
|
|
42
42
|
export { init, create } from "./init";
|
|
43
43
|
export type { InitOptions } from "./init";
|
|
44
44
|
export { isChunkLoadError, recoverFromChunkLoadError, CHUNK_RELOAD_MARKER, } from "./chunkLoadRecovery";
|
|
45
|
-
export type { ChunkLoadErrorContext, ChunkLoadErrorSource, ChunkLoadRecoveryOptions, ChunkReloadBlock, } from "./chunkLoadRecovery";
|
|
45
|
+
export type { ChunkLoadErrorContext, ChunkLoadErrorSource, ChunkLoadRecoveryOptions, BuildMismatchContext, ChunkReloadBlock, } from "./chunkLoadRecovery";
|
|
46
46
|
export { createRoot } from "./createRoot";
|
|
47
47
|
export type { RPC, FileRPC, ViewRPC, I18nDictionary, BroadcastRPC, Features, FeatureKey, ClientFeatureKey, } from "./rpc";
|
|
48
48
|
export type { ViewProps, LayoutProps, ViewPaths, ApiPaths } from "./types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAA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C as registerDictionary, D as useRoute, E as routeDataUrl, F as domainUrl, G as reconnectRealtime, H as followLive, I as isAbsoluteUrl, J as toVariantKey, K as loadLazy, M as ServerDataContext, N as ServerDataProvider, O as useSearchParams, P as useLocation, Q as QueryManagerProvider, R as Action, S as loadDictionaryForRender, T as readRoutePayload, V as configureRealtime, W as realtime, X as QueryConfigContext, Y as applyParams$1, Z as QueryManagerContext, _ as isChunkLoadError, a as useRouteTransition, at as retryDelayFor, b as recoverFromChunkLoadError, c as ClientRouterContext, ct as Subject, d as ComponentsProvider, et as pickDefined, f as initialViewModulesReady, g as configureChunkLoadRecovery, h as CHUNK_RELOAD_MARKER, i as RouteTransitionProvider, j as I18nProvider, k as useNavigate, l as ClientRouterProvider, m as subscribeViewModules, n as useTheme, nt as readResponseBody, o as useChannelSubscription, ot as shouldRetryQuery, p as loadViewModule, q as loadedModule, r as m, rt as isRetryableQueryError, s as useCoalesced, st as QueryError, t as ThemeProvider, tt as DEFAULT_STALE_TIME, u as ComponentsContext, v as otherBuild, w as setActiveLocale, x as loadDictionary, y as recoverFromBuildMismatch } from "../chunks/ThemeProvider-D4mhhONE.js";
|
|
2
2
|
import { n as RouteStateContext, r as RouteStateProvider, t as useParams } from "../chunks/useParams-BN3XXfmG.js";
|
|
3
3
|
import { a as isNetworkError, c as isPermissionError, d as isValidationError, f as mutationErrorField, h as mutationErrorList, i as isHttpError, l as isRateLimitError, m as mutationErrorKind, n as isCsrfError, o as isNotFoundError, p as mutationErrorFromBody, r as isFormError, s as isObject, t as isAuthenticationError, u as isServerError } from "../chunks/MutationError-DuKqBW8o.js";
|
|
4
4
|
import { Fragment, StrictMode, Suspense, createContext, createElement, isValidElement, lazy, memo, use, useCallback, useContext, useDeferredValue, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
|
|
@@ -561,7 +561,7 @@ var SOCKET_ID_HEADER = "x-gemi-socket";
|
|
|
561
561
|
*/
|
|
562
562
|
var mutationExtras = {
|
|
563
563
|
current: null,
|
|
564
|
-
load: () => import("../chunks/mutationExtras-
|
|
564
|
+
load: () => import("../chunks/mutationExtras-DpB8MtNs.js")
|
|
565
565
|
};
|
|
566
566
|
/** Starts loading `./mutationExtras`: the hooks' mount effect. */
|
|
567
567
|
function preloadMutationExtras() {
|
|
@@ -899,7 +899,7 @@ function useMutate() {
|
|
|
899
899
|
//#region client/fetchFile.ts
|
|
900
900
|
var request = {
|
|
901
901
|
current: null,
|
|
902
|
-
load: () => import("../chunks/fetchFileRequest-
|
|
902
|
+
load: () => import("../chunks/fetchFileRequest-C3wMigR3.js")
|
|
903
903
|
};
|
|
904
904
|
/**
|
|
905
905
|
* Downloads a file route's body as a `Blob`.
|
|
@@ -1903,7 +1903,11 @@ function mergeCarriedSegments(previous, next, carriedViews) {
|
|
|
1903
1903
|
* route on screen.
|
|
1904
1904
|
*/
|
|
1905
1905
|
async function loadRoutePayload(options) {
|
|
1906
|
-
const { url, from, takePrefetched, renderedRoute, onQueryPayload } = options;
|
|
1906
|
+
const { url, from, takePrefetched, renderedRoute, onQueryPayload, buildId, onOtherBuild } = options;
|
|
1907
|
+
const fromOtherBuild = (response) => {
|
|
1908
|
+
const served = otherBuild(response, buildId);
|
|
1909
|
+
return served !== null && onOtherBuild?.(served) === true;
|
|
1910
|
+
};
|
|
1907
1911
|
const prefetched = takePrefetched?.(url);
|
|
1908
1912
|
if (prefetched) {
|
|
1909
1913
|
const payload = await prefetched;
|
|
@@ -1919,12 +1923,15 @@ async function loadRoutePayload(options) {
|
|
|
1919
1923
|
console.error(e);
|
|
1920
1924
|
return null;
|
|
1921
1925
|
}
|
|
1922
|
-
if (!response.ok) return null;
|
|
1926
|
+
if (!response.ok || fromOtherBuild(response)) return null;
|
|
1923
1927
|
const payload = await readRoutePayload(response, onQueryPayload);
|
|
1924
1928
|
const claimed = payload?.partial ?? null;
|
|
1925
1929
|
if (claimed && claimed.from !== renderedRoute()) try {
|
|
1926
1930
|
const full = await fetch(url);
|
|
1927
|
-
if (full.ok)
|
|
1931
|
+
if (full.ok) {
|
|
1932
|
+
if (fromOtherBuild(full)) return null;
|
|
1933
|
+
return await readRoutePayload(full, onQueryPayload);
|
|
1934
|
+
}
|
|
1928
1935
|
} catch (e) {
|
|
1929
1936
|
console.error(e);
|
|
1930
1937
|
}
|
|
@@ -2076,7 +2083,7 @@ var Routes = (props) => {
|
|
|
2076
2083
|
const { routerSubject, fetchRouteCSS, preloadRouteModules, takePrefetched } = useContext(ClientRouterContext);
|
|
2077
2084
|
const { hydrate } = useContext(QueryManagerContext);
|
|
2078
2085
|
const [transitionPath, setTransitionPath] = useState([null, routerSubject?.getValue().pathname]);
|
|
2079
|
-
const { breadcrumbs, pageData, i18n, prefetchedData, features, appId: currentAppId, router } = useContext(ServerDataContext);
|
|
2086
|
+
const { breadcrumbs, pageData, i18n, prefetchedData, features, appId: currentAppId, buildId, router } = useContext(ServerDataContext);
|
|
2080
2087
|
const isNotFoundDocument = Boolean(router?.is404);
|
|
2081
2088
|
const [routeState, setRouteState] = useState({
|
|
2082
2089
|
params: routerSubject?.getValue().params,
|
|
@@ -2143,7 +2150,13 @@ var Routes = (props) => {
|
|
|
2143
2150
|
renderedRoute: () => renderedRouteRef.current,
|
|
2144
2151
|
onQueryPayload: ([path, variantKey, data]) => {
|
|
2145
2152
|
hydrate({ [path]: { [variantKey]: data } });
|
|
2146
|
-
}
|
|
2153
|
+
},
|
|
2154
|
+
buildId,
|
|
2155
|
+
onOtherBuild: (serverBuild) => recoverFromBuildMismatch({
|
|
2156
|
+
url: window.location.href,
|
|
2157
|
+
clientBuild: buildId,
|
|
2158
|
+
serverBuild
|
|
2159
|
+
})
|
|
2147
2160
|
});
|
|
2148
2161
|
if (payload) {
|
|
2149
2162
|
const { data, i18n, prefetchedData, breadcrumbs, meta, directive = {}, is404 = false, appId, features } = payload;
|
|
@@ -2195,7 +2208,8 @@ var Routes = (props) => {
|
|
|
2195
2208
|
preloadRouteModules,
|
|
2196
2209
|
takePrefetched,
|
|
2197
2210
|
replace,
|
|
2198
|
-
hydrate
|
|
2211
|
+
hydrate,
|
|
2212
|
+
buildId
|
|
2199
2213
|
]);
|
|
2200
2214
|
return /* @__PURE__ */ jsx(RouteTransitionProvider, {
|
|
2201
2215
|
isPending,
|