@rsc-kit/core 0.7.1 → 0.7.2

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.
Files changed (148) hide show
  1. package/README.md +4 -4
  2. package/dist/action.d.ts +0 -1
  3. package/dist/action.js.map +1 -1
  4. package/dist/build-rsc-vite.d.ts +0 -1
  5. package/dist/build-rsc-vite.js.map +1 -1
  6. package/dist/cache.d.ts +0 -1
  7. package/dist/cache.js.map +1 -1
  8. package/dist/devServer.d.ts +0 -1
  9. package/dist/devServer.js.map +1 -1
  10. package/dist/devUrls.d.ts +0 -1
  11. package/dist/devUrls.js.map +1 -1
  12. package/dist/embed.d.ts +0 -1
  13. package/dist/embed.js.map +1 -1
  14. package/dist/errors.d.ts +0 -1
  15. package/dist/errors.js.map +1 -1
  16. package/dist/export.d.ts +0 -1
  17. package/dist/export.js.map +1 -1
  18. package/dist/files.d.ts +0 -1
  19. package/dist/files.js.map +1 -1
  20. package/dist/headers.d.ts +0 -1
  21. package/dist/headers.js.map +1 -1
  22. package/dist/host.d.ts +0 -1
  23. package/dist/host.js.map +1 -1
  24. package/dist/hostCalls.d.ts +0 -1
  25. package/dist/hostCalls.js.map +1 -1
  26. package/dist/js/ActivityRouter.d.ts +0 -1
  27. package/dist/js/ActivityRouter.js.map +1 -1
  28. package/dist/js/DocumentTitle.d.ts +0 -1
  29. package/dist/js/DocumentTitle.js.map +1 -1
  30. package/dist/js/Form.d.ts +0 -1
  31. package/dist/js/Form.js.map +1 -1
  32. package/dist/js/Link.d.ts +0 -1
  33. package/dist/js/Link.js.map +1 -1
  34. package/dist/js/PathnameProvider.d.ts +0 -1
  35. package/dist/js/PathnameProvider.js.map +1 -1
  36. package/dist/js/RedirectBoundary.d.ts +0 -1
  37. package/dist/js/RedirectBoundary.js.map +1 -1
  38. package/dist/js/SegmentBoundary.d.ts +0 -1
  39. package/dist/js/SegmentBoundary.js.map +1 -1
  40. package/dist/js/SlotBoundary.d.ts +0 -1
  41. package/dist/js/SlotBoundary.js.map +1 -1
  42. package/dist/js/createViteRscApp.d.ts +0 -1
  43. package/dist/js/createViteRscApp.js.map +1 -1
  44. package/dist/js/errors.d.ts +0 -1
  45. package/dist/js/errors.js.map +1 -1
  46. package/dist/js/navigate.d.ts +0 -1
  47. package/dist/js/navigate.js.map +1 -1
  48. package/dist/js/onlineStore.d.ts +0 -1
  49. package/dist/js/onlineStore.js.map +1 -1
  50. package/dist/js/pagePayload.d.ts +0 -1
  51. package/dist/js/pagePayload.js.map +1 -1
  52. package/dist/js/router.d.ts +0 -1
  53. package/dist/js/router.js.map +1 -1
  54. package/dist/js/section.d.ts +0 -1
  55. package/dist/js/section.js.map +1 -1
  56. package/dist/js/segmentStore.d.ts +0 -1
  57. package/dist/js/segmentStore.js.map +1 -1
  58. package/dist/js/slotStore.d.ts +0 -1
  59. package/dist/js/slotStore.js.map +1 -1
  60. package/dist/js/standardSchema.d.ts +0 -1
  61. package/dist/js/standardSchema.js.map +1 -1
  62. package/dist/js/useForm.d.ts +0 -1
  63. package/dist/js/useForm.js.map +1 -1
  64. package/dist/js/useLinkStatus.d.ts +0 -1
  65. package/dist/js/useLinkStatus.js.map +1 -1
  66. package/dist/js/useOnline.d.ts +0 -1
  67. package/dist/js/useOnline.js.map +1 -1
  68. package/dist/js/usePathname.d.ts +0 -1
  69. package/dist/js/usePathname.js.map +1 -1
  70. package/dist/js/useSearchParams.d.ts +0 -1
  71. package/dist/js/useSearchParams.js.map +1 -1
  72. package/dist/manifest.d.ts +0 -1
  73. package/dist/manifest.js.map +1 -1
  74. package/dist/nondeterminism.d.ts +0 -1
  75. package/dist/nondeterminism.js.map +1 -1
  76. package/dist/prerender.d.ts +0 -1
  77. package/dist/prerender.js.map +1 -1
  78. package/dist/redirect.d.ts +0 -1
  79. package/dist/redirect.js.map +1 -1
  80. package/dist/redirectDigest.d.ts +0 -1
  81. package/dist/redirectDigest.js.map +1 -1
  82. package/dist/request.d.ts +0 -1
  83. package/dist/request.js.map +1 -1
  84. package/dist/revalidate.d.ts +0 -1
  85. package/dist/revalidate.js.map +1 -1
  86. package/dist/routes.d.ts +0 -1
  87. package/dist/routes.js.map +1 -1
  88. package/dist/routing.d.ts +0 -1
  89. package/dist/routing.js.map +1 -1
  90. package/dist/runtime.d.ts +0 -1
  91. package/dist/runtime.js.map +1 -1
  92. package/dist/safeUrl.d.ts +0 -1
  93. package/dist/safeUrl.js.map +1 -1
  94. package/dist/vite.d.ts +0 -1
  95. package/dist/vite.js +73 -9
  96. package/dist/vite.js.map +1 -1
  97. package/package.json +1 -5
  98. package/dist/action.d.ts.map +0 -1
  99. package/dist/build-rsc-vite.d.ts.map +0 -1
  100. package/dist/cache.d.ts.map +0 -1
  101. package/dist/cli.d.ts +0 -2
  102. package/dist/cli.d.ts.map +0 -1
  103. package/dist/cli.js +0 -84
  104. package/dist/cli.js.map +0 -1
  105. package/dist/devServer.d.ts.map +0 -1
  106. package/dist/devUrls.d.ts.map +0 -1
  107. package/dist/embed.d.ts.map +0 -1
  108. package/dist/errors.d.ts.map +0 -1
  109. package/dist/export.d.ts.map +0 -1
  110. package/dist/files.d.ts.map +0 -1
  111. package/dist/headers.d.ts.map +0 -1
  112. package/dist/host.d.ts.map +0 -1
  113. package/dist/hostCalls.d.ts.map +0 -1
  114. package/dist/js/ActivityRouter.d.ts.map +0 -1
  115. package/dist/js/DocumentTitle.d.ts.map +0 -1
  116. package/dist/js/Form.d.ts.map +0 -1
  117. package/dist/js/Link.d.ts.map +0 -1
  118. package/dist/js/PathnameProvider.d.ts.map +0 -1
  119. package/dist/js/RedirectBoundary.d.ts.map +0 -1
  120. package/dist/js/SegmentBoundary.d.ts.map +0 -1
  121. package/dist/js/SlotBoundary.d.ts.map +0 -1
  122. package/dist/js/createViteRscApp.d.ts.map +0 -1
  123. package/dist/js/errors.d.ts.map +0 -1
  124. package/dist/js/navigate.d.ts.map +0 -1
  125. package/dist/js/onlineStore.d.ts.map +0 -1
  126. package/dist/js/pagePayload.d.ts.map +0 -1
  127. package/dist/js/router.d.ts.map +0 -1
  128. package/dist/js/section.d.ts.map +0 -1
  129. package/dist/js/segmentStore.d.ts.map +0 -1
  130. package/dist/js/slotStore.d.ts.map +0 -1
  131. package/dist/js/standardSchema.d.ts.map +0 -1
  132. package/dist/js/useForm.d.ts.map +0 -1
  133. package/dist/js/useLinkStatus.d.ts.map +0 -1
  134. package/dist/js/useOnline.d.ts.map +0 -1
  135. package/dist/js/usePathname.d.ts.map +0 -1
  136. package/dist/js/useSearchParams.d.ts.map +0 -1
  137. package/dist/manifest.d.ts.map +0 -1
  138. package/dist/nondeterminism.d.ts.map +0 -1
  139. package/dist/prerender.d.ts.map +0 -1
  140. package/dist/redirect.d.ts.map +0 -1
  141. package/dist/redirectDigest.d.ts.map +0 -1
  142. package/dist/request.d.ts.map +0 -1
  143. package/dist/revalidate.d.ts.map +0 -1
  144. package/dist/routes.d.ts.map +0 -1
  145. package/dist/routing.d.ts.map +0 -1
  146. package/dist/runtime.d.ts.map +0 -1
  147. package/dist/safeUrl.d.ts.map +0 -1
  148. package/dist/vite.d.ts.map +0 -1
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,2EAA2E;AAC3E,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,2BAA2B;AAC3B,EAAE;AACF,+DAA+D;AAC/D,gGAAgG;AAEhG,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,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AAO,CAAC,CAAA;QACnD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACxF,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAEnF,wEAAwE;QACxE,yEAAyE;QACzE,gCAAgC;QAChC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAClD,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAC9D,CAAA;QAED,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE;YAC1B,OAAO,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,iCAAiC,EAAE,CAAC;SAC5E,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Everything a JavaScript host has to do to serve the RSC engine.\n//\n// PHP needs ~2,400 lines for this because it cannot run JavaScript: a socket\n// bridge, a worker pool, a frame protocol. A JS host imports the engine and\n// calls it, and what remains is the part every host would otherwise rewrite —\n// matching a url to a route, negotiating how much of the page to send, and\n// speaking the header protocol the client expects.\n//\n// Deliberately not Hono, or Express, or anything: this takes a Request and\n// returns a Response, so it runs under Bun.serve, Deno, Workers, Node's\n// fetch adapters and any framework built on them. `./hono` is the three-line\n// binding for one of them.\n//\n// const rsc = createRscHandler({ engine, manifest, assets })\n// Bun.serve({ fetch: (req) => rsc(req).then((r) => r ?? new Response('', { status: 404 })) })\n\nimport { matchIntercept, matchRoute, retentionKey, sharedDepth } from './routing.js'\nimport { pathKey, patternKey } from './prerender.js'\nimport { withRevalidation } from './revalidate.js'\nexport { revalidate } from './revalidate.js'\nimport { withRedirect } from './redirect.js'\nimport { withCache } from './cache.js'\nimport { withRequest, withResponseDraft } from './request.js'\nimport type { Redirection } from './redirect.js'\nexport { redirect } from './redirect.js'\n// Re-exported, not redefined: routing.ts is the one implementation, shared with\n// the prerenderer and the generated bundle, and this stays the adapter's\n// public surface so a host imports from one place.\nexport { matchIntercept, matchRoute, sharedDepth } from './routing.js'\nexport type { MatchedRoute } from './routing.js'\nimport { FLIGHT_TYPE, HEADER, HTML_TYPE, PER_CLIENT, REVALIDATE, VARY_ON_RSC } from './headers.js'\nimport type { MatchedRoute } from './routing.js'\nimport { ServerAuthenticationError, ServerAuthorizationError } from './js/errors.js'\nimport type { RouteManifest } from './manifest.js'\n\n/** The built server bundle. Only the parts a host calls. */\nexport interface RscEngine {\n /** The route table this bundle was built from. */\n manifest?(): RouteManifest\n installHostFn(fn: (name: string, ...args: unknown[]) => unknown): void\n handleRscStream(\n component: string,\n props?: Record<string, unknown>,\n layouts?: { component: string; props: Record<string, unknown> }[],\n loadings?: string[],\n parallelSlots?: Record<string, string>,\n slotOverrides?: Record<string, unknown>,\n from?: number,\n pageKey?: string,\n ): Promise<{ stream: ReadableStream; segmentDepth: number }>\n handleRscHtmlStream(\n component: string,\n props?: Record<string, unknown>,\n layouts?: { component: string; props: Record<string, unknown> }[],\n loadings?: string[],\n parallelSlots?: Record<string, string>,\n slotOverrides?: Record<string, unknown>,\n nonce?: string,\n pageKey?: string,\n bootstrap?: boolean,\n ): Promise<{ htmlStream: ReadableStream }>\n /**\n * Finish a shell frozen at build time, against data that exists now.\n *\n * Emits only the boundaries the shell left unfinished, meant to be written\n * straight after it. Optional so a host can be pointed at an engine built\n * before resuming existed; without it a shell has no way to be completed and\n * the page is rendered whole instead.\n */\n handleRscResume?(\n component: string,\n props?: Record<string, unknown>,\n layouts?: { component: string; props: Record<string, unknown> }[],\n loadings?: string[],\n parallelSlots?: Record<string, string>,\n slotOverrides?: Record<string, unknown>,\n postponed?: unknown,\n nonce?: string,\n pageKey?: string,\n ): Promise<{ htmlStream: ReadableStream }>\n handleRscRevalidate?(target: string, page: unknown): Promise<{ rscPayload: string }>\n /**\n * Run a route's middleware without rendering anything.\n *\n * For a frozen page: the host reads it from disk and the engine never sees\n * the request, so the check has to be asked for separately.\n */\n runRouteMiddleware?(component: string, props: Record<string, unknown>): Promise<void>\n handleAction(\n actionId: string,\n body: Uint8Array | string | FormData,\n contentType?: string,\n page?: unknown,\n takeRevalidated?: () => string[],\n ): Promise<{ stream: ReadableStream }>\n}\n\nexport interface RscHostOptions {\n /** The built server bundle — `import * as engine from './build/rsc/index.js'`. */\n engine: RscEngine\n /**\n * The route table. Defaults to the one the bundle was built with, which is\n * almost always what you want — a manifest passed separately can go stale\n * against the bundle it is describing.\n */\n manifest?: RouteManifest\n /**\n * Functions the app's server components call as `await rpc('name', ...args)`.\n *\n * In the Laravel host this crosses a socket into PHP. Here they are just\n * functions, which is the whole reason a JS host is smaller.\n */\n rpc?: Record<string, (...args: unknown[]) => unknown>\n /**\n * Where a host call goes when this process cannot answer it.\n *\n * `rpc` is checked first, so a host can answer some calls in JS and leave\n * the rest to a backend. `httpHostCalls` in `@rsc-kit/core/host-calls`\n * builds one of these over an ordinary POST, which is how a host written in\n * another language answers without implementing the socket framing.\n */\n hostCalls?: (name: string, ...args: unknown[]) => Promise<unknown>\n /**\n * Props for a page, given whatever its url bound.\n *\n * Defaults to the url params alone. A host that loads a user, reads a\n * session or resolves a tenant does it here — this is the one place the\n * engine cannot supply anything for.\n */\n props?: (match: MatchedRoute, request: Request) => Record<string, unknown> | Promise<Record<string, unknown>>\n /**\n * Reads what the prerenderer wrote, if this build has any.\n *\n * A function rather than a directory, because not every host has a\n * filesystem: on an edge runtime these live in a KV store or a static-asset\n * binding. `prerenderedFrom` in `@rsc-kit/core/files` is the one for a disk.\n *\n * Checked before rendering, and anything it cannot find falls through to\n * being rendered now — so a partial prerender is a valid state, not a\n * broken one.\n */\n prerendered?: (name: string) => Promise<string | null> | string | null\n /** Serve a built browser asset. Return null for anything not found. */\n assets?: (pathname: string, request: Request) => Promise<Response | null> | Response | null\n /**\n * Identifies this build to the client, which compares it on every\n * navigation and falls back to a full load when it changes. Without one a\n * client keeps talking to a deployment that no longer exists — worst behind\n * a CDN, where the shell it holds may already be from an older build.\n */\n version?: string\n}\n\n/**\n * The answer to a redirect that was decided before anything was written.\n *\n * A document gets a real status code. A payload request must NOT: `fetch`\n * follows a 3xx transparently, so the client would receive the destination's\n * HTML and hand it to the Flight decoder, which reports its own confusion\n * rather than the redirect. It gets 204 and a header instead, and navigates\n * itself — which is also what makes the redirect an SPA one.\n */\n/**\n * A string safe to write inside a <script> element.\n *\n * `JSON.stringify` escapes for JavaScript, and this is not a JavaScript\n * context — it is HTML that happens to contain JavaScript. The parser ends the\n * element at the first `</script`, wherever it appears, so a destination\n * carrying one closes the tag and whatever follows is markup the browser runs.\n *\n * That destination is routinely computed rather than written — redirect()\n * documents \"remembering where someone was going and sending them back to it\"\n * as the usual case, which is a query string or a cookie arriving verbatim\n * here. U+2028 and U+2029 are escaped too: legal in JSON, line terminators in\n * JavaScript.\n */\nfunction inScript(value: string): string {\n return JSON.stringify(value)\n .replace(/</g, '\\\\u003c')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\nfunction redirectResponse(to: Redirection, isPayloadRequest: boolean): Response {\n if (isPayloadRequest) {\n return new Response(null, {\n status: 204,\n headers: { [HEADER.redirect]: to.location, Vary: VARY_ON_RSC },\n })\n }\n\n return new Response(null, {\n status: to.status,\n headers: { Location: to.location, Vary: VARY_ON_RSC },\n })\n}\n\n/**\n * Append the redirect a render asked for after its shell had already gone out.\n *\n * The status line is spent by then, so the instruction travels in the body. A\n * script rather than waiting for hydration to notice the error digest: it runs\n * as the browser parses it, which is sooner, and it is the only path that\n * works at all for a route shipping no client runtime.\n *\n * Read on flush, because that is when the render has finished and a redirect\n * from inside a Suspense boundary is finally known.\n */\nfunction appendLateRedirect(\n stream: ReadableStream,\n taken: () => Redirection | null,\n): ReadableStream {\n // An engine that answered with a finished body rather than a stream has no\n // late window at all: the render was over before this was called, so the\n // caller's own check already saw everything there was to see.\n if (typeof stream?.getReader !== 'function') return stream\n\n const encoder = new TextEncoder()\n const reader = stream.getReader()\n\n // Read-and-re-emit rather than pipeThrough(new TransformStream(...)): a\n // TransformStream from a different realm than the stream it is piped into\n // is rejected outright, and a host embedded in a runtime that supplies its\n // own web streams is exactly that case.\n return new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read()\n\n if (!done) {\n controller.enqueue(value)\n\n return\n }\n\n const to = taken()\n\n // replace, so Back does not return to a url that redirected.\n if (to) {\n controller.enqueue(encoder.encode(`<script>location.replace(${inScript(to.location)})</script>`))\n }\n\n controller.close()\n },\n cancel(reason) {\n return reader.cancel(reason)\n },\n })\n}\n\n/**\n * The status a refusal deserves, or null when this was not one.\n *\n * A host answers an unauthenticated call 401 and an unauthorized one 403, and\n * the transport raises each as its own error. Without this they arrive at the\n * render as ordinary failures and leave as 500s — which reads, to anyone\n * looking at a log or a browser, as the application being broken rather than\n * the visitor being turned away.\n */\nfunction refusalStatus(error: unknown): number | null {\n if (error instanceof ServerAuthenticationError) return 401\n if (error instanceof ServerAuthorizationError) return 403\n\n // Named rather than matched by identity, because the error may have been\n // raised by another copy of the module: an app's actions are bundled apart\n // from the engine, and instanceof is false across that seam.\n const name = (error as { name?: string } | null)?.name\n\n if (name === 'ServerAuthenticationError') return 401\n if (name === 'ServerAuthorizationError') return 403\n\n // A status the host chose — a throttle's 429, a policy's 403 — carried on\n // the error by the transport. Bounded to refusals: a host answering 500\n // should not be able to make this look like a client's fault, and one\n // answering 200 should not turn a failed render into a success.\n const carried = (error as { refusalStatus?: unknown } | null)?.refusalStatus\n\n if (typeof carried === 'number' && carried >= 400 && carried <= 499) return carried\n\n return null\n}\n\nfunction refusalMessage(error: unknown): string {\n const message = (error as { message?: string } | null)?.message\n\n return typeof message === 'string' && message !== '' ? message : 'Refused.'\n}\n\n/**\n * Whether a browser was told it could post this action.\n *\n * Defence in depth, not the only defence. An action already requires the\n * X-RSC-Action header, which makes a cross-origin post a non-simple request —\n * so the browser must preflight it, and nothing here answers a preflight. A\n * browser can be tricked into sending cookies; it cannot be tricked into\n * sending a header it does not know. This is the belt to that pair of braces,\n * and it is what Next does for server actions.\n *\n * Compared against X-Forwarded-Host first, because a proxied deployment is the\n * normal one: the backend forwards the name the visitor typed, while Host is\n * this process on loopback. Comparing against Host alone would reject every\n * legitimate action that arrived through a proxy — a check that only fires on\n * correct requests is worse than none.\n *\n * No Origin at all is allowed through. It is absent on same-origin requests in\n * some browsers and on anything that is not a browser, and refusing those would\n * break server-to-server callers to catch an attacker who is already blocked by\n * the preflight.\n */\nexport function actionOriginAllowed(request: Request, url: URL): boolean {\n const origin = request.headers.get('origin')\n\n if (!origin) return true\n\n const expected = request.headers.get('x-forwarded-host') ?? request.headers.get('host') ?? url.host\n\n try {\n return new URL(origin).host === expected\n } catch {\n // An Origin that is not a url is not one this can vouch for.\n return false\n }\n}\n\nexport function createRscHandler(options: RscHostOptions): (request: Request) => Promise<Response | null> {\n const { engine, assets, version } = options\n // Annotated rather than inferred: the narrowing below is lost inside the\n // closures that use it, and every one of them runs after the throw.\n const manifest: RouteManifest | undefined = options.manifest ?? engine.manifest?.()\n\n if (!manifest) {\n throw new Error(\n 'No route table. Pass `manifest`, or build with a plugin version that embeds one in the bundle.',\n )\n }\n\n const routes: RouteManifest = manifest\n\n // Only when this host has functions of its own. Installing unconditionally\n // overwrites whatever was already registered — a prerenderer sharing the\n // same engine instance, or a host that set its own up first — and the\n // symptom is every call failing as unregistered.\n if (options.rpc || options.hostCalls) installHostFunctions(options.rpc ?? {}, options.hostCalls)\n\n function installHostFunctions(\n fns: NonNullable<RscHostOptions['rpc']>,\n remote: RscHostOptions['hostCalls'],\n ): void {\n engine.installHostFn(async (name: string, ...args: unknown[]) => {\n const fn = fns[name]\n\n if (fn) return await fn(...args)\n\n // A remote transport cannot enumerate what the backend registered, so\n // an unknown name is the backend's to reject — with a message naming the\n // function, which is more than this side could say.\n if (remote) return await remote(name, ...args)\n\n // Louder than returning null: a typo in a server component otherwise\n // renders as missing data with nothing anywhere saying why.\n throw new Error(\n `No host function named ${JSON.stringify(name)}. Registered: ${Object.keys(fns).join(', ') || '(none)'}`,\n )\n })\n }\n\n async function propsFor(match: MatchedRoute, request: Request): Promise<Record<string, unknown>> {\n return options.props ? await options.props(match, request) : match.params\n }\n\n /** The page a server action was invoked from, so it can re-render regions of it. */\n function pageContext(match: MatchedRoute, props: Record<string, unknown>) {\n return {\n component: match.route.component,\n props,\n layouts: match.route.layouts.map((component) => ({ component, props: {} })),\n loadings: match.route.loadings,\n parallelSlots: match.route.slots,\n // What may be named in X-RSC-Revalidate — see renderRevalidated.\n sections: match.route.sections,\n }\n }\n\n function withVersion(headers: Record<string, string>): Record<string, string> {\n return version ? { ...headers, [HEADER.version]: version } : headers\n }\n\n // A build made for export ships a client that asks for payloads by url,\n // because a static host cannot read a header. Serving that build from a\n // server is a reasonable thing to do — previewing an export, or one build\n // used both ways — and without this every navigation 404s in the console\n // while the page itself looks fine.\n const payloadName = manifest.build?.payloadName || ''\n\n /**\n * The page a payload url belongs to, if this is one.\n *\n * Both the whole-document name and the depth variants beside it: a client\n * built for export asks for index.seg1.rsc when it already holds a layout,\n * and matching only the plain name leaves that as a 404 no page reports.\n */\n const payloadNames = new RegExp(\n '/' + payloadName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/^index\\\\\\./, 'index(\\\\.seg\\\\d+)?\\\\.') + '$',\n )\n\n function pageForPayload(pathname: string): string | null {\n if (payloadName === '') return null\n\n const match = payloadNames.exec(pathname)\n\n if (!match) return null\n\n return pathname.slice(0, match.index) || '/'\n }\n\n // One memo table per request, opened at the outermost point so that\n // everything below shares it: middleware, layouts, the page, and an action. A\n // guard that reads the session and a layout that reads it again are one\n // query, not two.\n return async function handle(request: Request): Promise<Response | null> {\n return await withRequest(request, () =>\n withCache(() =>\n // Open for the whole request and sealed the moment an answer exists,\n // so middleware — which runs before any rendering — can put headers on\n // it, and a component, which runs after, is told why it cannot.\n withResponseDraft(async ({ taken, seal }) => {\n const response = await route(request)\n\n seal()\n\n if (!response) return null\n\n const collected = taken()\n\n collected.forEach((value, name) => {\n // Set-Cookie is applied below, once per cookie: iterating a Headers\n // gives it joined in some runtimes and per-cookie in others, and a\n // joined one is a single malformed cookie the browser discards.\n if (name.toLowerCase() === 'set-cookie') return\n\n // set, not append: a middleware asking for a header means that\n // value, not that value added to whatever the host already chose.\n response.headers.set(name, value)\n })\n\n // Appended, because several cookies are several headers.\n for (const cookie of collected.getSetCookie()) {\n response.headers.append('Set-Cookie', cookie)\n }\n\n return response\n }),\n ),\n )\n }\n\n async function route(request: Request): Promise<Response | null> {\n let url = new URL(request.url)\n const asPayload = pageForPayload(url.pathname)\n\n if (asPayload !== null) {\n // Rewritten to the page it is asking about, with the header the rest of\n // this handler reads — one path through, however the client asked.\n url = new URL(asPayload + url.search, url.origin)\n const headers = new Headers(request.headers)\n\n headers.set(HEADER.rsc, '1')\n request = new Request(url, { method: request.method, headers })\n }\n\n if (assets) {\n const asset = await assets(url.pathname, request)\n\n if (asset) return asset\n }\n\n if (request.method === 'POST' && url.pathname === HEADER.actionPath) {\n if (!actionOriginAllowed(request, url)) {\n return new Response('Cross-origin action', { status: 403 })\n }\n\n return await handleAction(request, url)\n }\n\n // The two halves an edge cache needs: hand it a shell it may keep, and\n // finish that shell for a visitor it cannot answer for itself.\n if (options.prerendered && url.pathname === HEADER.pprShellPath) {\n return await servePprShell(request, url, options.prerendered)\n }\n\n if (\n request.method === 'POST' &&\n options.prerendered &&\n url.pathname === HEADER.pprResumePath\n ) {\n return await servePprResume(request, url, options.prerendered)\n }\n\n if (request.method !== 'GET' && request.method !== 'HEAD') return null\n\n // One named region of this page, asked for without mutating anything to\n // earn it. What an action invalidated does not come through here — that\n // travels back inside the action's own answer, which is the whole point of\n // marking rather than telling the client to go and ask.\n const revalidating = request.headers.get(HEADER.revalidate)\n\n if (revalidating !== null && request.headers.get(HEADER.rsc) !== null) {\n return await handleRevalidate(request, url, revalidating)\n }\n\n // An intercepted navigation renders the page you are already on, with the\n // interceptor dropped into one of its slots — so the modal opens over it\n // and the url changes. Only ever on a client navigation: a hard load has\n // no referer to open over and gets the real page.\n const interceptSlot = request.headers.get(HEADER.intercept)\n\n if (interceptSlot !== null && request.headers.get(HEADER.rsc) !== null) {\n return await handleIntercept(request, url, interceptSlot)\n }\n\n // Only now. A frozen page is a whole page, and both requests above ask for\n // something smaller than one: answering a named region with the whole\n // document puts the entire page inside that region, and answering an\n // interception with it replaces the page the modal was opening over.\n const match = matchRoute(routes, url.pathname)\n\n if (options.prerendered) {\n // A guarded route can still be frozen: whether the content is the same\n // for everyone, and whether this caller may see it, are different\n // questions. The build answers the first; this answers the second, and\n // only then is the frozen page handed over.\n const refusal = await refuseUnlessAllowed(request, match)\n\n if (refusal) return refusal\n\n const frozen = await servePrerendered(request, url, options.prerendered)\n\n if (frozen) return frozen\n }\n\n if (!match) return null\n\n const props = await propsFor(match, request)\n const layouts = match.route.layouts.map((component) => ({ component, props: {} }))\n const chain = match.route.layouts\n\n // A payload request says so with a header on the page's own url, so one\n // route serves both the document and the navigation that follows it.\n if (request.headers.get(HEADER.rsc) === null) {\n // Scoped to this render, so two requests redirecting at once cannot read\n // each other's destination.\n return await withRedirect(async (taken) => {\n // Awaited, and that await is the whole design: React resolves this\n // when the SHELL is ready, so a redirect thrown above every Suspense\n // boundary rejects here — before a byte is written, with a status line\n // still available. Nothing is buffered to make that true.\n let htmlStream: ReadableStream\n\n try {\n ;({ htmlStream } = await engine.handleRscHtmlStream(\n match.route.component,\n props,\n layouts,\n match.route.loadings,\n match.route.slots,\n {},\n undefined,\n url.pathname,\n // A route that ships no runtime gets no bootstrap and no segment\n // boundary — the boundary is itself a client component, so leaving\n // it in means no page could ever be JS-free.\n match.route.clientJs !== false,\n ))\n } catch (error) {\n // A rejected shell is how a redirect above every boundary arrives:\n // React could not finish the shell, because the component that would\n // have produced it left instead.\n //\n // The scope decides, not the error. React catches what a component\n // threw and re-raises its own — whose message is stripped in\n // production — so testing the caught value for a redirect signal\n // fails exactly where it matters, and the answer is a 500 with the\n // destination sitting in a scope nobody read.\n const refused = taken()\n\n if (refused) return redirectResponse(refused, false)\n\n\n // A guard refusing is not a failed render. Without this a visitor\n // who may not see the page gets a 500, which reads as the\n // application being broken rather than them being turned away —\n // and a host middleware refusal arrives exactly here, because the\n // engine asks before it renders anything.\n const status = refusalStatus(error)\n\n if (status) return new Response(refusalMessage(error), { status })\n throw error\n }\n\n const early = taken()\n\n if (early) return redirectResponse(early, false)\n\n return new Response(appendLateRedirect(htmlStream, taken), {\n headers: withVersion({\n 'Content-Type': HTML_TYPE,\n [HEADER.layouts]: chain.join(','),\n Vary: VARY_ON_RSC,\n 'Cache-Control': match.route.middleware?.length ? PER_CLIENT : REVALIDATE,\n }),\n })\n })\n }\n\n const from = sharedDepth(request.headers.get(HEADER.segments), chain)\n\n // Proposed by the host, decided by the engine: an interceptor can force a\n // wider render than the client asked for, so what goes back is the depth\n // that came out, never the one that went in.\n return await withRedirect(async (taken) => {\n let stream: ReadableStream\n let segmentDepth: number\n\n try {\n ;({ stream, segmentDepth } = await engine.handleRscStream(\n match.route.component,\n props,\n layouts,\n match.route.loadings,\n match.route.slots,\n {},\n from,\n url.pathname,\n ))\n } catch (error) {\n // Same reasoning as the document path: what the render recorded is\n // reliable, what React re-raised is not.\n const refused = taken()\n\n if (refused) return redirectResponse(refused, true)\n\n\n // A payload request is guarded exactly as the document is. Narrowing\n // a request must never narrow what is checked.\n const status = refusalStatus(error)\n\n if (status) return new Response(refusalMessage(error), { status })\n throw error\n }\n\n const early = taken()\n\n // 204 and a header. A payload request that redirected later than this\n // carries the destination in the error digest instead, and the client's\n // RedirectBoundary performs it.\n if (early) return redirectResponse(early, true)\n\n return new Response(stream, {\n headers: withVersion({\n 'Content-Type': FLIGHT_TYPE,\n [HEADER.segmentDepth]: String(segmentDepth),\n [HEADER.layouts]: chain.join(','),\n Vary: VARY_ON_RSC,\n 'Cache-Control': PER_CLIENT,\n }),\n })\n })\n }\n\n /**\n * A page rendered at build time, if there is one for this url.\n *\n * The payload has to match the depth the client shares, not simply exist.\n * Serving the whole document to a client that already holds the layouts\n * replaces the root — and replacing the root unmounts everything retained\n * behind it, so going back stops restoring what you had.\n */\n /**\n * The shell an edge cache may hold, for a route named by `?url=`.\n *\n * Only ever a build artifact, so there is nothing here that belongs to\n * whoever asked. What it deliberately does NOT return is the postponed\n * state. Next's protocol hands that to the CDN and takes it back on the\n * resume, which makes the resume endpoint parse a blob an attacker can write\n * — the shape of a known denial-of-service against it. Our origin has the\n * file already, so the state never needs to leave.\n *\n * A guarded route is refused outright rather than guarded here. Its shell is\n * not cacheable by a shared cache at all, so handing one to an edge that\n * exists to cache things is an invitation to a mistake nobody would see.\n */\n async function servePprShell(\n request: Request,\n url: URL,\n read: NonNullable<RscHostOptions['prerendered']>,\n ): Promise<Response | null> {\n if (request.method !== 'GET' && request.method !== 'HEAD') return null\n\n const target = url.searchParams.get('url')\n\n if (!target || !target.startsWith('/')) {\n return new Response('A url is required', { status: 400 })\n }\n\n // Matched from the url asked for, never from anything else the caller sent.\n const route = matchRoute(routes, new URL(target, url.origin).pathname)\n\n if (!route) return new Response('No such page', { status: 404 })\n\n if (route.route.middleware?.length) {\n return new Response('This route is not edge-cacheable', { status: 404 })\n }\n\n const key = pathKey(new URL(target, url.origin).pathname)\n const shell = (await read(`${key}.ppr.html`)) ?? (await read(`${patternKey(route.route)}.ppr.html`))\n\n if (shell === null) return new Response('No shell for this page', { status: 404 })\n\n return new Response(JSON.stringify({ shell, version: version ?? null }), {\n headers: withVersion({\n 'Content-Type': 'application/json',\n // Deliberately NOT the REVALIDATE the rest of the host sends. That is\n // `max-age=0, must-revalidate`, which a cache honours by treating the\n // entry as stale the moment it arrives — an edge would store this and\n // never once serve it, so the whole thing would quietly do nothing\n // while looking like it worked, because the miss path serves correct\n // pages.\n //\n // This is build output with nothing of the caller in it, and a guarded\n // route never reaches here at all, so it is genuinely cacheable. An\n // hour bounds how long a deploy can be served against a stale shell;\n // the version below catches it sooner than that.\n 'Cache-Control': 'public, max-age=3600',\n }),\n })\n }\n\n /**\n * Finish a shell for the visitor this request belongs to.\n *\n * The whole security question lives here, because the holes are the part a\n * guard exists to protect — the shell is chrome, and everything private is\n * behind the boundaries this fills in. So it runs exactly the guard chain the\n * page itself would, derived from the url and nothing else, against the\n * cookies and headers the caller actually sent.\n *\n * Which means an edge worker must forward the visitor's request, not make one\n * of its own. A resume asked for with no cookies is an anonymous visitor and\n * gets an anonymous answer.\n */\n async function servePprResume(\n request: Request,\n url: URL,\n read: NonNullable<RscHostOptions['prerendered']>,\n ): Promise<Response | null> {\n const target = url.searchParams.get('url')\n\n if (!target || !target.startsWith('/')) {\n return new Response('A url is required', { status: 400 })\n }\n\n const pathname = new URL(target, url.origin).pathname\n const route = matchRoute(routes, pathname)\n\n if (!route) return new Response('No such page', { status: 404 })\n\n // The same refusal the document would get, before a byte of the holes is\n // rendered. Nothing below runs for a caller this turns away.\n const refusal = await refuseUnlessAllowed(request, route)\n\n if (refusal) return refusal\n\n if (!engine.handleRscResume) {\n return new Response('This engine cannot resume', { status: 500 })\n }\n\n const key = pathKey(pathname)\n const pattern = patternKey(route.route)\n\n let shellKey: string | null = null\n\n if ((await read(`${key}.ppr.html`)) !== null) shellKey = key\n else if ((await read(`${pattern}.ppr.html`)) !== null) shellKey = pattern\n\n // Read from our own artifacts. Never from the request body — that is the\n // difference between this and the protocol it is modelled on.\n const state = shellKey === null ? null : await read(`${shellKey}.postponed.json`)\n\n if (state === null) return new Response('Nothing to resume', { status: 404 })\n\n const { htmlStream } = await engine.handleRscResume(\n route.route.component,\n route.params,\n route.route.layouts.map((component) => ({ component, props: {} })),\n route.route.loadings,\n route.route.slots,\n {},\n JSON.parse(state),\n undefined,\n shellKey === key ? pathname : '',\n )\n\n // Carries the build version so a caller holding a cached shell can tell\n // that it no longer belongs to this origin. A shell from an older build\n // does not make the resume fail — it replays against slots that have moved\n // and React falls back to client rendering, silently and for good. Nothing\n // else would ever report it.\n return new Response(htmlStream, {\n headers: withVersion({\n 'Content-Type': HTML_TYPE,\n // Rendered for whoever asked. Never cacheable.\n 'Cache-Control': PER_CLIENT,\n }),\n })\n }\n\n async function servePrerendered(\n request: Request,\n url: URL,\n source: NonNullable<RscHostOptions['prerendered']>,\n ): Promise<Response | null> {\n const key = pathKey(url.pathname)\n const read = async (name: string) => await source(name)\n\n // Before anything else: a route that only redirects was frozen as the\n // redirect itself, so there is no page under this url and never will be.\n const frozenRedirect = await read(`${key}.redirect.json`)\n\n if (frozenRedirect !== null) {\n const to = JSON.parse(frozenRedirect) as { status: number; location: string }\n\n return redirectResponse(to, request.headers.get(HEADER.rsc) !== null)\n }\n\n if (request.headers.get(HEADER.rsc) === null) {\n // A frozen page first; then a shell, under this url or under the route's\n // pattern. Nothing in a shell varies by param, so one shell serves every\n // url its route matches — which is the only way a route whose urls were\n // never listed gets anything frozen at all.\n const route = matchRoute(routes, url.pathname)\n const whole = await read(`${key}.html`)\n\n // A whole page is finished. Nothing to resume, nothing to render.\n if (whole !== null) {\n return new Response(whole, {\n headers: withVersion({\n 'Content-Type': HTML_TYPE,\n Vary: VARY_ON_RSC,\n 'Cache-Control': route?.route.middleware?.length ? PER_CLIENT : REVALIDATE,\n }),\n })\n }\n\n // Then a shell, under this url or under the route's pattern. Which of the\n // two answered is tracked, because the state that resumes it sits beside\n // the file that was found rather than beside the url that was asked for.\n let shellKey: string | null = null\n let shell = await read(`${key}.ppr.html`)\n\n if (shell !== null) {\n shellKey = key\n } else if (route) {\n const pattern = patternKey(route.route)\n\n shell = await read(`${pattern}.ppr.html`)\n\n if (shell !== null) shellKey = pattern\n }\n\n if (shell === null || shellKey === null) return null\n\n const state = await read(`${shellKey}.postponed.json`)\n\n // A shell with no state cannot be finished by anyone. It was frozen with\n // its fallbacks showing and there is no record of what came next, so\n // serving it would be serving a page that stays on its loading state for\n // good. Fall through and render the page now instead.\n if (state === null || !engine.handleRscResume || !route) return null\n\n const { htmlStream } = await engine.handleRscResume(\n route.route.component,\n route.params,\n // Empty props, because that is what the build passed. Resuming replays\n // the tree against the slots the shell left, and React matches those by\n // key — so an argument that differs from the frozen render at all is a\n // tree that \"doesn't match\", and every boundary falls back to the\n // client instead of being filled here.\n route.route.layouts.map((component) => ({ component, props: {} })),\n route.route.loadings,\n route.route.slots,\n {},\n JSON.parse(state),\n undefined,\n // A shell found under the route's pattern was frozen for no particular\n // url, so it was rendered with no page key. Handing one over now would\n // key the tree differently from the one being resumed.\n shellKey === key ? url.pathname : '',\n )\n\n // The shell first, then whatever the resume writes. React's own script\n // travels with the resumed segments and moves them into place, so this is\n // a plain concatenation and the holes land without hydration.\n const body = new ReadableStream({\n async start(controller) {\n controller.enqueue(new TextEncoder().encode(shell))\n\n const reader = htmlStream.getReader()\n\n try {\n while (true) {\n const { done, value } = await reader.read()\n\n if (done) break\n\n controller.enqueue(value)\n }\n } finally {\n controller.close()\n }\n },\n })\n\n return new Response(body, {\n headers: withVersion({\n 'Content-Type': HTML_TYPE,\n Vary: VARY_ON_RSC,\n // The shell is cacheable; this response is not. It carries the holes,\n // which were rendered for whoever asked.\n 'Cache-Control': PER_CLIENT,\n }),\n })\n }\n\n // Only the document is ever served frozen for a shell. The payload is what\n // fills it in, and it has to be rendered now — answering with a frozen one\n // would hand back the same fallbacks the shell already shows, and the page\n // would never finish loading.\n\n const meta = await read(`${key}.meta.json`)\n\n // Both or neither: without the chain there is no way to know which depth a\n // payload is for, and guessing means handing the client a segment for a\n // boundary it does not have.\n if (meta === null) return null\n\n const chain = (JSON.parse(meta).layouts ?? []) as string[]\n const shared = sharedDepth(request.headers.get(HEADER.segments), chain)\n\n // The variant for exactly this depth, or the whole document. Anything else\n // would be a payload for a boundary the client is not holding.\n const variant = shared > 0 ? await read(`${key}.seg${shared}.flight`) : null\n const payload = variant ?? (await read(`${key}.flight`))\n\n if (payload === null) return null\n\n return new Response(payload, {\n headers: withVersion({\n 'Content-Type': FLIGHT_TYPE,\n [HEADER.segmentDepth]: String(variant ? shared : 0),\n [HEADER.layouts]: chain.join(','),\n Vary: VARY_ON_RSC,\n 'Cache-Control': PER_CLIENT,\n }),\n })\n }\n\n /**\n * The middleware of a route, or null to go ahead.\n *\n * Used wherever a render can be reached without the engine running the chain\n * itself: a page served from disk, and an interception, which renders a\n * component the route table did not choose.\n *\n * Asked before anything is read or rendered — the answer to a refusal must\n * not be a page that has already been fetched.\n */\n async function refuseUnlessAllowed(\n request: Request,\n match: MatchedRoute | null,\n ): Promise<Response | null> {\n // hostMiddleware as well as the engine's own. A page served from disk\n // never touches the engine, so a route guarded only by the host would be\n // handed over without anyone being asked — the guard would hold right up\n // until the build froze the page, then silently stop.\n if (!match) return null\n\n const guarded =\n (match.route.middleware?.length ?? 0) > 0 || (match.route.hostMiddleware?.length ?? 0) > 0\n\n if (!guarded) return null\n\n // A route that declares middleware and an engine that cannot run it is not\n // \"no middleware\" — it is a check that silently does not happen. Refusing\n // is the only safe reading, and it names the cause rather than serving the\n // guarded page. Reachable when a host runs a bundle built by an older\n // plugin, where the export did not exist.\n if (!engine.runRouteMiddleware) {\n return new Response(\n 'This route declares middleware, and the engine cannot run it. ' +\n 'Rebuild the app against the current @rsc-kit/core.',\n { status: 500 },\n )\n }\n\n const asPayload = request.headers.get(HEADER.rsc) !== null\n\n return await withRedirect(async (taken) => {\n try {\n await engine.runRouteMiddleware!(match.route.component, await propsFor(match, request))\n } catch (error) {\n const refused = taken()\n\n if (refused) return redirectResponse(refused, asPayload)\n\n // A visitor who may not see this page has not caused a server\n // error. Answering 500 makes a guarded route indistinguishable from\n // a broken one, in the logs and to the person looking at it.\n const status = refusalStatus(error)\n\n if (status) return new Response(refusalMessage(error), { status })\n\n throw error\n }\n\n const refused = taken()\n\n return refused ? redirectResponse(refused, asPayload) : null\n })\n }\n\n async function handleRevalidate(request: Request, url: URL, target: string): Promise<Response> {\n if (!engine.handleRscRevalidate) {\n return new Response('This build cannot revalidate', { status: 501 })\n }\n\n const match = matchRoute(routes, url.pathname)\n\n if (!match) return new Response('No such page', { status: 404 })\n\n // Scoped like the render paths: a guard above the target may refuse, and\n // that refusal is an answer rather than a failure.\n return await withRedirect(async (taken) => {\n let rscPayload: string\n\n try {\n ;({ rscPayload } = await engine.handleRscRevalidate!(\n target,\n pageContext(match, await propsFor(match, request)),\n ))\n } catch (error) {\n const refused = taken()\n\n if (refused) return redirectResponse(refused, true)\n\n throw error\n }\n\n const refused = taken()\n\n if (refused) return redirectResponse(refused, true)\n\n return new Response(rscPayload, {\n headers: withVersion({\n 'Content-Type': FLIGHT_TYPE,\n // Echoed so the client can tell which region it is holding.\n [HEADER.revalidate]: target,\n Vary: VARY_ON_RSC,\n 'Cache-Control': 'private, no-store',\n }),\n })\n })\n }\n\n async function handleIntercept(request: Request, url: URL, slot: string): Promise<Response> {\n const intercept = matchIntercept(routes, url.pathname, slot)\n\n if (!intercept) return new Response('No interceptor for this url', { status: 404 })\n\n // The guards of the route being intercepted, before anything is rendered.\n //\n // An interceptor exists to show the same resource as the route it stands in\n // for — a modal over /orders/[id] shows that order. So it has to be behind\n // the same checks, and nothing else in this path runs them: the engine is\n // handed the interceptor component, which the route table did not choose\n // and whose middleware chain is keyed off manifest().routes, where an\n // interceptor does not appear.\n //\n // Derived from the url, never from X-RSC-Referer. The referer is a header\n // the caller writes, and guarding by it means the caller picks the guard.\n const intercepted = matchRoute(routes, url.pathname)\n\n // Nothing to guard means nothing to serve. A url that matches an\n // interceptor but no route has no middleware chain to consult, so there is\n // no way to know whether this caller may see it — and an interceptor\n // stands in for a route, so a url with no route behind it is not a page\n // anyone was entitled to open a modal over.\n if (!intercepted) return new Response('No such page', { status: 404 })\n\n const refusal = await refuseUnlessAllowed(request, intercepted)\n\n if (refusal) return refusal\n\n const referer = request.headers.get(HEADER.referer)\n const under = referer ? matchRoute(routes, new URL(referer, url.origin).pathname) : null\n\n // Without a page to open over there is nothing to intercept: render the\n // interceptor on its own rather than answering with the wrong page.\n const component = under ? under.route.component : intercept.component\n const props = under ? await propsFor(under, request) : intercept.params\n const chain = under ? under.route.layouts : []\n const slots = under ? under.route.slots : {}\n const loadings = under ? under.route.loadings : []\n\n // The interceptor alone, when there is a page to open it over and this\n // build can render a region on its own.\n //\n // Re-rendering the page underneath would put the modal on screen at the\n // cost of rebuilding everything below the layout that declares the slot —\n // so opening a modal from a half-filled form throws the form away. The\n // page beneath is already mounted and correct; only the slot is new.\n if (under && engine.handleRscRevalidate) {\n const { rscPayload } = await engine.handleRscRevalidate(slot, {\n component: under.route.component,\n // The target's params, not the page's: a modal for /posts/hello opened\n // from /feed is about hello.\n props: intercept.params,\n layouts: [],\n loadings: [],\n // Named as the slot so the renderer finds it there, but pointing at\n // the interceptor rather than the default this route would otherwise\n // fill it with.\n parallelSlots: { [slot]: intercept.component },\n })\n\n return new Response(rscPayload, {\n headers: withVersion({\n 'Content-Type': FLIGHT_TYPE,\n // Says what this payload is, so the client puts it in the slot\n // instead of treating it as a segment of the page.\n [HEADER.revalidate]: slot,\n Vary: VARY_ON_RSC,\n // Per-client by construction: which region this is was chosen by a\n // request header, so a shared cache has nothing useful to key on.\n 'Cache-Control': 'private, no-store',\n }),\n })\n }\n\n const { stream, segmentDepth } = await engine.handleRscStream(\n component,\n props,\n chain.map((layout) => ({ component: layout, props: {} })),\n loadings,\n slots,\n {},\n sharedDepth(request.headers.get(HEADER.segments), chain),\n retentionKey(url.pathname, slot),\n )\n\n return new Response(stream, {\n headers: withVersion({\n 'Content-Type': FLIGHT_TYPE,\n [HEADER.segmentDepth]: String(segmentDepth),\n [HEADER.layouts]: chain.join(','),\n Vary: VARY_ON_RSC,\n 'Cache-Control': PER_CLIENT,\n }),\n })\n }\n\n async function handleAction(request: Request, url: URL): Promise<Response> {\n const actionId = request.headers.get(HEADER.action)\n\n if (!actionId) return new Response('Missing X-RSC-Action', { status: 400 })\n\n // The body travels as application/octet-stream so a host that parses\n // multipart cannot consume it first; its real type rides in a header.\n const body = new Uint8Array(await request.arrayBuffer())\n const contentType = request.headers.get(HEADER.contentType) ?? 'text/plain;charset=UTF-8'\n\n // Where it was invoked from, so anything the action invalidates can be\n // re-rendered against the page that is actually on screen.\n const referer = request.headers.get(HEADER.referer)\n const match = referer ? matchRoute(routes, new URL(referer, url.origin).pathname) : null\n const page = match ? pageContext(match, await propsFor(match, request)) : undefined\n\n // Scoped to this action: revalidate() called anywhere inside it, at any\n // depth, marks here and nowhere else — two requests can be in flight and\n // marking is per-request state.\n const { stream } = await withRevalidation((taken) =>\n engine.handleAction(actionId, body, contentType, page, taken),\n )\n\n return new Response(stream, {\n headers: withVersion({ 'Content-Type': 'text/x-component; charset=utf-8' }),\n })\n }\n}\n"]}
@@ -83,4 +83,3 @@ export interface HostCallReply {
83
83
  * The function to hand to `installHostFn`, or to `hostCalls` on the JS host.
84
84
  */
85
85
  export declare function httpHostCalls(options: HttpHostCallsOptions): (name: string, ...args: unknown[]) => Promise<unknown>;
86
- //# sourceMappingURL=hostCalls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hostCalls.js","sourceRoot":"","sources":["../src/hostCalls.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,uDAAuD;AACvD,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,+DAA+D;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,yBAA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// A server component writing `await rpc('Orders.recent')` needs the host\n// mid-render. The Laravel path answers on a second unix socket with its own\n// framing (PROTOCOL.md, \"The callback channel\"), which every non-JS host has\n// to reimplement before it can render a single page that fetches anything.\n// This is the same conversation over an ordinary POST.\n//\n// The transport is the only thing that changes. The engine still sees one\n// function, the deferred-release ordering in streaming.ts still applies, and a\n// reply may still carry `revalidate` — a Go host that answers this endpoint\n// gets the same semantics the socket has, without the framing.\n\nimport { headers as incomingHeaders } from './request.js'\nimport { revalidate } from './revalidate.js'\nimport { ActionValidationError } from './action.js'\nimport { redirect } from './redirect.js'\nimport { ServerAuthenticationError, ServerAuthorizationError } from './js/errors.js'\n\nexport interface HttpHostCallsOptions {\n /**\n * Where calls are POSTed. A loopback address or a unix socket url — see the\n * note on `secret` for why this must not be a public one.\n */\n endpoint: string\n /**\n * Sent as `X-RSC-Host-Secret`, and required rather than optional.\n *\n * This endpoint runs functions by name on behalf of a render. PROTOCOL.md\n * Part 3b draws the line at client-supplied input deciding what RUNS, and an\n * unauthenticated callback endpoint is on the wrong side of it: anyone who\n * can reach it can invoke any registered host function directly, with\n * whatever arguments they like and none of the app's routing in front. A\n * default of \"off\" would be the kind that ships.\n */\n secret: string\n /**\n * Request headers copied from the render's own request onto the call.\n *\n * This is what makes a host call run as the person browsing: the backend's\n * session middleware reads its cookie and finds the same user. Nothing else\n * is forwarded, because everything else is either meaningless to the backend\n * or actively wrong — `content-length` and `content-type` describe this POST,\n * not the page request.\n */\n forwardHeaders?: string[]\n /** Defaults to 30s. A render blocked on a host that never answers is a hung request. */\n timeoutMs?: number\n /** Injectable for tests and for a runtime whose fetch is not global. */\n fetch?: typeof fetch\n /**\n * What to do with whatever a reply reported as invalidated.\n *\n * Defaults to marking it on the engine, which is the only thing that makes\n * `Revalidate(ctx, \"orders\")` on the host side mean anything: an action's\n * answer carries the re-rendered region only if the target reached the\n * revalidation scope before the action returned. Without it a host reports\n * what it dirtied, nothing listens, and the browser is told nothing — the\n * page simply shows stale data with no error anywhere.\n */\n onRevalidate?: (targets: string[]) => void\n}\n\nconst DEFAULT_FORWARDED = ['cookie', 'authorization']\n\nexport interface HostCallReply {\n result?: unknown\n error?: string\n revalidate?: string[]\n /**\n * Field name to messages, when the host refused the input.\n *\n * The same shape everything else here already uses: Laravel's own\n * `$e->errors()`, the socket protocol's `validation_errors`, and what\n * `issuesToErrors` turns a Standard Schema result into. Dot-joined for a\n * nested field, the empty string for a message about the form rather than\n * any one field.\n */\n validationErrors?: Record<string, string[]>\n /** The caller has no session. Becomes the engine's own authentication error. */\n unauthenticated?: boolean\n /** The caller has a session and still may not. */\n unauthorized?: boolean\n /**\n * Where the host says this request should go instead.\n *\n * Answered with a 200 and this field, never as a 3xx: fetch follows a\n * redirect transparently, so a real one would send the host call itself to\n * the destination and hand whatever came back to the render as the\n * function's result.\n */\n redirect?: string\n /** The status to redirect with. Defaults to 307, which preserves the method. */\n redirectStatus?: number\n /**\n * The status a refusal should be answered with.\n *\n * A middleware that aborted meant what it aborted with — throttle answers\n * 429, a signed-url check 403 — and collapsing those to 500 makes a\n * rate-limited visitor indistinguishable from a broken server.\n */\n refusalStatus?: number\n}\n\n/**\n * The function to hand to `installHostFn`, or to `hostCalls` on the JS host.\n */\nexport function httpHostCalls(\n options: HttpHostCallsOptions,\n): (name: string, ...args: unknown[]) => Promise<unknown> {\n const {\n endpoint,\n secret,\n forwardHeaders = DEFAULT_FORWARDED,\n timeoutMs = 30_000,\n fetch: fetchImpl,\n onRevalidate,\n } = options\n\n if (!secret) {\n throw new Error('httpHostCalls requires a secret — see the note on the option.')\n }\n\n const forwarded = forwardHeaders.map((name) => name.toLowerCase())\n\n return async function hostCall(name: string, ...args: unknown[]): Promise<unknown> {\n const doFetch = fetchImpl ?? globalThis.fetch\n\n const headers: Record<string, string> = {\n 'content-type': 'application/json',\n 'x-rsc-host-secret': secret,\n }\n\n // Outside a render — a prerender pass, or a host calling one directly —\n // there is no request to forward from, and that is not an error. The call\n // simply carries no session, which is exactly what a build-time render\n // should be doing.\n //\n // Only that one condition is swallowed. A blanket catch here is the wrong\n // shape: anything else going wrong while reading the request would come\n // out as a call with no session, which is not a failure the caller sees —\n // it is the visitor silently becoming anonymous, and the page rendering as\n // though they were logged out.\n try {\n const from = await incomingHeaders()\n\n\n for (const key of forwarded) {\n const value = from.get(key)\n if (value !== null) headers[key] = value\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n\n if (!message.startsWith('No request in scope')) throw error\n }\n\n // AbortSignal.timeout is not on every runtime this engine targets, so the\n // controller is written out rather than assumed.\n const controller = new AbortController()\n const timer = setTimeout(() => controller.abort(), timeoutMs)\n\n let response: Response\n\n try {\n response = await doFetch(endpoint, {\n method: 'POST',\n headers,\n body: JSON.stringify({ function: name, args }),\n signal: controller.signal,\n })\n } catch (error) {\n if (controller.signal.aborted) {\n throw new Error(`Host call ${JSON.stringify(name)} timed out after ${timeoutMs}ms`)\n }\n\n throw new Error(\n `Host call ${JSON.stringify(name)} could not reach the host at ${endpoint}: ${\n error instanceof Error ? error.message : String(error)\n }`,\n )\n } finally {\n clearTimeout(timer)\n }\n\n // Read the body before branching on status: a host that reports the error\n // in JSON with a 500 is saying something more useful than \"500\", and\n // throwing on the status alone discards it.\n const text = await response.text()\n let reply: HostCallReply | null = null\n\n try {\n reply = text ? (JSON.parse(text) as HostCallReply) : null\n } catch {\n reply = null\n }\n\n // Refusing the input is not the call failing — it is the call answering.\n //\n // Thrown rather than returned, so a handler stops where it is instead of\n // carrying on with data the host rejected. createActionClient catches this\n // on the way out and returns { validationErrors }, which is the shape\n // useForm reads: React serialises a REJECTED server action opaquely, so a\n // validation error that stays thrown reaches the browser as \"an error\n // occurred\" with every field it named gone.\n //\n // Checked before `error`, so a host that sends both is read as a refusal\n // rather than as a failure with no fields.\n if (reply?.validationErrors) {\n throw new ActionValidationError(reply.validationErrors)\n }\n\n // Raised as the engine's own redirect, so it travels the path every other\n // redirect travels — a real 3xx above a Suspense boundary, the digest\n // below one — rather than becoming an error the page has to interpret.\n if (reply?.redirect) {\n redirect(reply.redirect as never, reply.redirectStatus ?? 307)\n }\n\n if (reply?.unauthenticated) {\n throw new ServerAuthenticationError(reply.error ?? 'Unauthenticated.')\n }\n\n if (reply?.unauthorized) {\n throw new ServerAuthorizationError(reply.error ?? 'This action is unauthorized.')\n }\n\n if (reply?.error !== undefined) {\n const failure = new Error(`Host call ${JSON.stringify(name)} failed: ${reply.error}`)\n\n // Carried on the error rather than thrown as another class: the host\n // chose a status and the only job here is not to lose it on the way to\n // whoever writes the response.\n if (reply.refusalStatus) {\n ;(failure as Error & { refusalStatus?: number }).refusalStatus = reply.refusalStatus\n }\n\n throw failure\n }\n\n if (!response.ok) {\n throw new Error(\n `Host call ${JSON.stringify(name)} failed: ${response.status} ${response.statusText}`.trim() +\n (text ? ` — ${text.slice(0, 200)}` : ''),\n )\n }\n\n if (reply === null) {\n throw new Error(\n `Host call ${JSON.stringify(name)} returned a body that is not JSON: ${text.slice(0, 200)}`,\n )\n }\n\n if (reply.revalidate?.length) {\n if (onRevalidate) onRevalidate(reply.revalidate)\n else for (const target of reply.revalidate) revalidate(target)\n }\n\n return reply.result ?? null\n }\n}\n"]}
@@ -44,4 +44,3 @@ export declare function ActivityRoot({ initialKey, initialTree }: {
44
44
  initialKey: string;
45
45
  initialTree: ReactNode;
46
46
  }): import("react").JSX.Element;
47
- //# sourceMappingURL=ActivityRouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActivityRouter.js","sourceRoot":"","sources":["../../src/js/ActivityRouter.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE1E,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAiB1D,oFA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SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,YAC3E,KAAK,CAAC,IAAI,IADE,KAAK,CAAC,GAAG,CAEb,CACZ,CAAC,GACD,CACJ,CAAA;AACH,CAAC","sourcesContent":["/**\n * Keeps recently visited pages mounted but hidden, so going back restores them\n * rather than rebuilding them.\n *\n * Rendering each navigation with root.render() unmounts the previous tree, and\n * unmounting destroys client state: a half-typed form, an open disclosure, a\n * scrolled list. React's <Activity mode=\"hidden\"> hides a tree without\n * unmounting it — effects are torn down, but state survives — which is what\n * makes returning feel like the browser's own back button rather than a reload.\n *\n * Retention is bounded. Hidden trees keep their DOM, so an unbounded history\n * would grow the document for the length of the session; the least recently\n * visited entry is dropped past the limit.\n */\n\nimport { Activity, useCallback, useEffect, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { setNavigateHandler, setRestoreHandler } from './navigate'\nimport { clearSegments, setSegment } from './segmentStore'\n\nexport interface RouterEntry {\n /** Identifies the page: its URL, or the intercept variant of one. */\n key: string\n tree: ReactNode\n}\n\nexport interface ActivityRouterHandle {\n /** Show `tree` for `key`, retaining whatever was visible before. */\n show(key: string, tree: ReactNode): void\n /** Reveal a retained page without refetching. False when not retained. */\n restore(key: string): boolean\n /** Drop every retained page but the visible one. */\n clear(): void\n}\n\n/** Pages kept alive behind the visible one. Four covers ordinary back-and-forth. */\nexport const DEFAULT_RETENTION = 4\n\nexport function useActivityRouter(\n initial: RouterEntry,\n retention: number = DEFAULT_RETENTION,\n): { entries: RouterEntry[]; activeKey: string; handle: ActivityRouterHandle } {\n const [entries, setEntries] = useState<RouterEntry[]>([initial])\n const [activeKey, setActiveKey] = useState(initial.key)\n\n // The router calls into this from outside React, where the values captured by\n // the last render may already be stale. Refs mirror state so those calls read\n // what is actually mounted.\n const entriesRef = useRef(entries)\n const orderRef = useRef<string[]>([initial.key])\n\n const commit = useCallback((next: RouterEntry[]) => {\n entriesRef.current = next\n setEntries(next)\n }, [])\n\n // Recency, most recent last. Retention is by visit order rather than\n // insertion, so bouncing between two pages evicts neither.\n const touch = useCallback(\n (key: string) => {\n const next = orderRef.current.filter((k) => k !== key)\n next.push(key)\n orderRef.current = next.slice(-Math.max(1, retention))\n\n return orderRef.current\n },\n [retention],\n )\n\n const show = useCallback(\n (key: string, tree: ReactNode) => {\n const kept = touch(key)\n const others = entriesRef.current.filter((entry) => entry.key !== key && kept.includes(entry.key))\n\n commit([...others, { key, tree }])\n setActiveKey(key)\n },\n [commit, touch],\n )\n\n const restore = useCallback(\n (key: string) => {\n if (!entriesRef.current.some((entry) => entry.key === key)) return false\n\n touch(key)\n setActiveKey(key)\n\n return true\n },\n [touch],\n )\n\n const clear = useCallback(() => {\n const kept = entriesRef.current.filter((entry) => entry.key === activeKey)\n\n commit(kept)\n orderRef.current = [activeKey]\n }, [activeKey, commit])\n\n const handleRef = useRef<ActivityRouterHandle>({ show, restore, clear })\n handleRef.current = { show, restore, clear }\n\n return { entries, activeKey, handle: handleRef.current }\n}\n\n/**\n * Root of the hydrated app.\n *\n * Registers itself with the navigation engine so a navigation becomes a state\n * update here rather than a fresh root.render(), which is what allows the\n * previous page to stay mounted.\n */\nexport function ActivityRoot({ initialKey, initialTree }: { initialKey: string; initialTree: ReactNode }) {\n const { entries, activeKey, handle } = useActivityRouter({ key: initialKey, tree: initialTree })\n\n useEffect(() => {\n setNavigateHandler((tree, key, segmentDepth) => {\n // A partial payload replaces one segment inside the page that is already\n // showing; only a whole document is a new page to retain.\n if (segmentDepth > 0) {\n setSegment(segmentDepth, key, tree as ReactNode)\n\n return\n }\n\n clearSegments()\n handle.show(key, tree as ReactNode)\n })\n\n setRestoreHandler((key) => handle.restore(key))\n }, [handle])\n\n return (\n <>\n {entries.map((entry) => (\n <Activity key={entry.key} mode={entry.key === activeKey ? 'visible' : 'hidden'}>\n {entry.tree}\n </Activity>\n ))}\n </>\n )\n}\n"]}
@@ -19,4 +19,3 @@
19
19
  export declare function DocumentTitle({ title }: {
20
20
  title: string;
21
21
  }): null;
22
- //# sourceMappingURL=DocumentTitle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentTitle.js","sourceRoot":"","sources":["../../src/js/DocumentTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAqB;IACxD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK;YAAE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IACvD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"DocumentTitle.js","sourceRoot":"","sources":["../../src/js/DocumentTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAqB;IACxD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK;YAAE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IACvD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\n\n/**\n * Keeps document.title on the page you are actually looking at.\n *\n * A page's <title> is rendered inside its own tree so React 19 hoists it into\n * <head>, which is right for a server render and wrong the moment a boundary\n * starts retaining pages. A retained page is still mounted — that is what makes\n * returning to it restore its state — so its <title> is still in the tree, React\n * hoists that one too, and <head> ends up holding one per retained page.\n * `document.title` reads the first, which is the oldest of them: the title lags\n * a navigation behind, deterministically, and looks like a race because it\n * depends on which pages happen to be retained.\n *\n * An effect settles it, because `<Activity mode=\"hidden\">` tears effects down\n * and re-runs them on show. Exactly one page's effect is live at a time — the\n * visible one — so this needs no notion of navigation, history or which tree is\n * current. It is only rendered on a route that ships a runtime; one that does\n * not has no router, no retention, and a single <title> that was always right.\n */\nexport function DocumentTitle({ title }: { title: string }) {\n useEffect(() => {\n if (document.title !== title) document.title = title;\n }, [title]);\n\n return null;\n}\n"]}
package/dist/js/Form.d.ts CHANGED
@@ -51,4 +51,3 @@ export declare function useFormStatus<T extends Record<string, unknown> = Record
51
51
  export default function Form<T extends Record<string, unknown> = Record<string, unknown>>({ action, method: methodProp, prefetch, cacheFor, replace, preserveScroll, resetOnSuccess, schema, transform, optimistic, onSuccess, onError, onSubmit, children, ...rest }: FormProps<T>): import("react").JSX.Element;
52
52
  export { Form };
53
53
  export { useForm } from "./useForm";
54
- //# sourceMappingURL=Form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sourceRoot":"","sources":["../../src/js/Form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAIL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,GACd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiDhD;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAE5D,MAAM,MAAM,GAAG,KAA8E,CAAA;IAE7F,IAAI,MAAM,CAAC,gBAAgB;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAA;IACvE,IAAI,MAAM,CAAC,WAAW;QAAE,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,C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,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAClI,CAAC;IAEF,MAAM,UAAU,GAAuB;QACrC,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,WAAW;QACjB,MAAM;QACN,KAAK;QACL,WAAW;QACX,KAAK,EAAE,SAAS;KACjB,CAAC;IAEF,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,UAA6B,YAC9D,eACE,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,kBAC7C,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KACpC,IAAI,YAEP,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,GAC5D,GACoB,CAC9B,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,8EAA8E;AAC9E,+EAA+E;AAC/E,sEAAsE;AACtE,+EAA+E;AAC/E,2EAA2E;AAC3E,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["\"use client\";\n\nimport type { Href } from \"../routes.js\";\nimport {\n type FormHTMLAttributes,\n type FormEvent,\n type ReactNode,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n useTransition,\n} from \"react\";\nimport { ServerValidationError, ServerDumpError } from \"./errors\";\nimport { validateWith } from \"./standardSchema\";\nimport type { StandardSchemaV1 } from \"./standardSchema\";\n\ntype PrefetchStrategy = \"hover\" | \"mount\" | \"none\";\n\ninterface FormRenderProps<T extends Record<string, unknown> = Record<string, unknown>> {\n pending: boolean;\n data: T;\n errors: Record<string, string[]>;\n error: (field: keyof T & string) => string | undefined;\n clearErrors: (...fields: (keyof T & string)[]) => void;\n reset: () => void;\n}\n\ninterface FormProps<T extends Record<string, unknown> = Record<string, unknown>>\n extends Omit<FormHTMLAttributes<HTMLFormElement>, \"action\" | \"method\" | \"children\" | \"onSubmit\" | \"onError\"> {\n action: Href | ((formData: FormData) => Promise<unknown>);\n method?: \"get\" | \"post\";\n prefetch?: PrefetchStrategy;\n cacheFor?: number;\n replace?: boolean;\n preserveScroll?: boolean;\n resetOnSuccess?: boolean;\n /**\n * Check the fields before submitting, with any Standard Schema — Zod,\n * Valibot, ArkType.\n *\n * A failure fills `errors` and the action is never called, so a mistake\n * costs no round trip. It is a courtesy and not a control: the same action\n * is reachable without this form, so the server still has to check.\n */\n schema?: StandardSchemaV1;\n /** Transform form data before submitting to the server action. */\n transform?: (data: T) => Record<string, unknown>;\n /** Called inside the transition with typed form data. Use it to call your useOptimistic setter. */\n optimistic?: (data: T) => void;\n onSuccess?: (result: unknown) => void;\n /**\n * Called when a submit does not succeed.\n *\n * Validation failures arrive as field errors, with no second argument.\n * Anything else arrives as an empty error map and the thrown value — there\n * are no field errors to report, but the form still has to say so.\n */\n onError?: (errors: Record<string, string[]>, error?: unknown) => void;\n onSubmit?: (formData: FormData) => void | false;\n children: ReactNode | ((form: FormRenderProps<T>) => ReactNode);\n}\n\n/**\n * What an action built with createActionClient answers with.\n *\n * Recognised rather than thrown, because React serialises a rejected server\n * action opaquely: production strips the message and the fields it named are\n * gone. A returned object crosses intact, so a form reads it.\n */\nfunction resultOf(value: unknown): { errors?: Record<string, string[]>; serverError?: string } | null {\n if (typeof value !== 'object' || value === null) return null\n\n const result = value as { validationErrors?: Record<string, string[]>; serverError?: string }\n\n if (result.validationErrors) return { errors: result.validationErrors }\n if (result.serverError) return { serverError: result.serverError }\n\n return null\n}\n\nconst FormStatusContext = createContext<FormRenderProps>({\n pending: false,\n data: {},\n errors: {},\n error: () => undefined,\n clearErrors: () => {},\n reset: () => {},\n});\n\nexport function useFormStatus<T extends Record<string, unknown> = Record<string, unknown>>(): FormRenderProps<T> {\n return useContext(FormStatusContext) as FormRenderProps<T>;\n}\n\nfunction formDataToObject<T extends Record<string, unknown>>(formData: FormData): T {\n const obj: Record<string, unknown> = {};\n for (const [key, value] of formData.entries()) {\n if (typeof value === \"string\") {\n obj[key] = value;\n }\n }\n return obj as T;\n}\n\n/**\n * Also exported by name, and re-exported below, because both spellings are in\n * use: `import Form from` and `import { Form } from`.\n */\nexport default function Form<T extends Record<string, unknown> = Record<string, unknown>>({\n action,\n method: methodProp,\n prefetch = \"hover\",\n cacheFor,\n replace = false,\n preserveScroll = false,\n resetOnSuccess = true,\n schema,\n transform,\n optimistic,\n onSuccess,\n onError,\n onSubmit,\n children,\n ...rest\n}: FormProps<T>) {\n const isGetForm = typeof action === \"string\";\n const method = methodProp ?? (isGetForm ? \"get\" : \"post\");\n const [errors, setErrors] = useState<Record<string, string[]>>({});\n const [currentData, setCurrentData] = useState<T>({} as T);\n const [isPending, startTransition] = useTransition();\n const formRef = useRef<HTMLFormElement>(null);\n\n const error = useCallback(\n (field: keyof T & string): string | undefined => errors[field]?.[0],\n [errors]\n );\n\n const clearErrors = useCallback(\n (...fields: (keyof T & string)[]) => {\n if (fields.length === 0) {\n setErrors({});\n } else {\n setErrors((prev) => {\n const next = { ...prev };\n for (const f of fields) {\n delete next[f];\n }\n return next;\n });\n }\n },\n []\n );\n\n const resetForm = useCallback(() => {\n formRef.current?.reset();\n setErrors({});\n setCurrentData({} as T);\n }, []);\n\n useEffect(() => {\n if (isGetForm && prefetch === \"mount\") {\n const fn = (window as any).__rsc_prefetch;\n fn?.(action, cacheFor);\n }\n }, [isGetForm, prefetch, action, cacheFor]);\n\n const doPrefetch = useCallback(() => {\n if (!isGetForm) return;\n const fn = (window as any).__rsc_prefetch;\n fn?.(action as string, cacheFor);\n }, [isGetForm, action, cacheFor]);\n\n const handleSubmit = useCallback(\n async (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n const data = formDataToObject<T>(formData);\n setCurrentData(data);\n\n if (onSubmit?.(formData) === false) {\n return;\n }\n\n if (isGetForm && method === \"get\") {\n const url = new URL(action as string, window.location.origin);\n for (const [key, value] of formData.entries()) {\n if (typeof value === \"string\" && value !== \"\") {\n url.searchParams.set(key, value);\n }\n }\n\n const path = url.pathname + url.search;\n const shell = action as string;\n const nav = (window as any).__rsc_navigate;\n const prefetched = (window as any).__rsc_is_prefetched;\n\n // The route without its query is that route's shell: the layout, the\n // chrome, and whatever it renders with nothing to show yet. Prefetching\n // on hover put it in the cache, so going there first costs no request\n // and puts the page on screen while the real query is still running.\n //\n // The query itself is never prefetched. It is the expensive half, and\n // hovering a search button is not a reason to run someone's search.\n if (path !== shell && prefetched?.(shell)) {\n // Awaited rather than raced: navigate() aborts whatever is in flight,\n // so starting the real one first would cancel the shell before it\n // could render. It is a cache hit, so this is a render, not a wait.\n Promise.resolve(nav?.(shell, { replace, preserveScroll })).then(() =>\n // Replaces, so the shell does not become a back-button stop of its\n // own — the pair leaves exactly one entry behind.\n nav?.(path, { replace: true, preserveScroll })\n );\n\n return;\n }\n\n nav?.(path, { replace, preserveScroll });\n return;\n }\n\n const serverAction = action as (formData: FormData) => Promise<unknown>;\n\n // Apply transform — rebuild FormData from transformed values\n if (transform) {\n const transformed = transform(data);\n for (const key of [...formData.keys()]) {\n formData.delete(key);\n }\n for (const [key, val] of Object.entries(transformed)) {\n if (val === null || val === undefined) continue;\n if (val instanceof File) {\n formData.append(key, val);\n } else if (typeof val === \"boolean\") {\n formData.append(key, val ? \"1\" : \"0\");\n } else if (Array.isArray(val)) {\n for (const item of val) {\n formData.append(`${key}[]`, String(item));\n }\n } else {\n formData.append(key, String(val));\n }\n }\n }\n\n setErrors({});\n\n // Before the transition, so a failure neither runs the optimistic\n // update nor leaves the form looking like it is submitting.\n const invalid = await validateWith(schema, data);\n\n if (invalid) {\n setErrors(invalid);\n onError?.(invalid);\n\n return;\n }\n\n startTransition(async () => {\n try {\n // Call optimistic updater inside the transition so React's\n // useOptimistic picks it up and auto-reverts on settle.\n optimistic?.(data);\n\n const result = await serverAction(formData);\n const refused = resultOf(result);\n\n if (refused) {\n if (refused.errors) {\n setErrors(refused.errors);\n onError?.(refused.errors);\n } else {\n onError?.({}, new Error(refused.serverError));\n }\n\n return;\n }\n\n if (resetOnSuccess) {\n formRef.current?.reset();\n setCurrentData({} as T);\n }\n\n setErrors({});\n onSuccess?.(result);\n } catch (err) {\n if (err instanceof ServerValidationError) {\n setErrors(err.errors);\n onError?.(err.errors);\n } else if (err instanceof ServerDumpError) {\n // Dump overlay is already shown — silently swallow\n } else if (onError) {\n // Not rethrown. A rejected action never settles, and until it\n // settles React keeps the optimistic update on screen — so an\n // unexpected failure left the row showing as though the write had\n // worked. Settling is what takes it back.\n onError({}, err);\n } else {\n // Nothing is handling it, and swallowing here would lose it\n // entirely — the reason this used to rethrow.\n console.error('[rsc-kit] form submit failed', err);\n }\n }\n });\n },\n [action, isGetForm, method, replace, preserveScroll, resetOnSuccess, schema, transform, optimistic, onSubmit, onSuccess, onError]\n );\n\n const formStatus: FormRenderProps<T> = {\n pending: isPending,\n data: currentData,\n errors,\n error,\n clearErrors,\n reset: resetForm,\n };\n\n return (\n <FormStatusContext.Provider value={formStatus as FormRenderProps}>\n <form\n ref={formRef}\n onSubmit={handleSubmit}\n onMouseEnter={prefetch === \"hover\" ? doPrefetch : undefined}\n data-pending={isPending ? \"\" : undefined}\n {...rest}\n >\n {typeof children === \"function\" ? children(formStatus) : children}\n </form>\n </FormStatusContext.Provider>\n );\n}\n\n// Also by name, because both spellings are in use: `import Form` and\n// `import { Form }`. This was a re-export of \"./Form\" — from inside Form.tsx,\n// so the module named itself. It survived on the bundler tolerating a circular\n// self-reference, left over from when a separate barrel re-exported a\n// FormComponent.tsx that a case-insensitive filesystem would not let be called\n// Form.ts. There is one file now, and it can just export what it declares.\nexport { Form };\nexport { useForm } from \"./useForm\";\n"]}
package/dist/js/Link.d.ts CHANGED
@@ -26,4 +26,3 @@ export declare function useLinkStatus(): {
26
26
  };
27
27
  export default function Link({ href, prefetch: prefetchProp, cacheFor, replace, preserveScroll, children, onClick, onMouseEnter, onMouseLeave, ...rest }: LinkProps): import("react").JSX.Element;
28
28
  export {};
29
- //# sourceMappingURL=Link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/js/Link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAIL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAyBf,MAAM,iBAAiB,GAAG,aAAa,CAAuB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAElF,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,CAAgC;IAC5D,OAAO,CACL,CAAC,CAAC,CAAC,gBAAgB;QACnB,CAAC,CAAC,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC,OAAO;QACV,CAAC,CAAC,CAAC,OAAO;QACV,CAAC,CAAC,CAAC,QAAQ;QACX,CAAC,CAAC,CAAC,MAAM,CACV,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,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;QACxC,IAAI,gBAAgB,KAAK,OAAO,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACjE,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEnC,6EAA6E;IAC7E,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QACnB,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,YAC5C,YACE,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,kBAChB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAClC,IAAI,YAEP,QAAQ,GACP,GACuB,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport type { Href } from \"../routes.js\";\nimport {\n type AnchorHTMLAttributes,\n type MouseEvent,\n type Ref,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\ntype PrefetchStrategy = \"hover\" | \"mount\" | \"click\" | \"none\" | boolean;\n\ninterface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n /**\n * Where this goes. Typed to the routes the build found, so a link to a page\n * that does not exist stops compiling; `path as Href` when it is computed.\n */\n href: Href;\n /**\n * The underlying anchor.\n *\n * Spread onto it like any other prop — React 19 passes ref through a\n * function component without forwardRef — but declared here because it is\n * not part of AnchorHTMLAttributes. A link that cannot be focused is a link\n * a dialog cannot move focus to when it opens.\n */\n ref?: Ref<HTMLAnchorElement>;\n prefetch?: PrefetchStrategy;\n cacheFor?: number;\n replace?: boolean;\n preserveScroll?: boolean;\n}\n\nconst LinkStatusContext = createContext<{ pending: boolean }>({ pending: false });\n\nexport function useLinkStatus(): { pending: boolean } {\n return useContext(LinkStatusContext);\n}\n\nfunction isExternalUrl(url: string): boolean {\n try {\n return new URL(url, window.location.origin).origin !== window.location.origin;\n } catch {\n return false;\n }\n}\n\nfunction shouldInterceptClick(e: MouseEvent<HTMLAnchorElement>): boolean {\n return (\n !e.defaultPrevented &&\n e.button === 0 &&\n !e.metaKey &&\n !e.ctrlKey &&\n !e.shiftKey &&\n !e.altKey\n );\n}\n\n/**\n * How long a pointer has to settle on a link before it prefetches.\n *\n * A pointer crossing a nav bar enters every link on the way, and each one used\n * to fire a request immediately — enough to fill the browser's per-origin\n * connection limit with pages the user never meant to visit. Waiting is close\n * to free: the prefetch only has to beat the click, and a click that follows a\n * hover this short would not have had its payload back anyway.\n */\nconst HOVER_PREFETCH_DELAY_MS = 100;\n\nexport default function Link({\n href,\n prefetch: prefetchProp = \"hover\",\n cacheFor,\n replace = false,\n preserveScroll = false,\n children,\n onClick,\n onMouseEnter,\n onMouseLeave,\n ...rest\n}: LinkProps) {\n const [pending, setPending] = useState(false);\n const hoverTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const prefetchStrategy = prefetchProp === true\n ? \"hover\"\n : prefetchProp === false\n ? \"none\"\n : prefetchProp;\n\n const doPrefetch = useCallback(() => {\n if (isExternalUrl(href)) return;\n const fn = (window as any).__rsc_prefetch;\n fn?.(href, cacheFor);\n }, [href, cacheFor]);\n\n // Only useEffect needed: prefetch on mount strategy\n useEffect(() => {\n if (prefetchStrategy === \"mount\") {\n doPrefetch();\n }\n }, [prefetchStrategy, doPrefetch]);\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLAnchorElement>) => {\n onClick?.(e);\n\n if (e.defaultPrevented) return;\n\n const target = (e.currentTarget as HTMLAnchorElement).target;\n if (target && target !== \"_self\") return;\n if (!shouldInterceptClick(e) || isExternalUrl(href)) return;\n\n // Hash-only links (#section) — let the browser scroll natively\n if (href.startsWith(\"#\")) return;\n\n e.preventDefault();\n setPending(true);\n\n // navigate() returns a Promise — clear pending when it resolves or rejects\n const nav = (window as any).__rsc_navigate;\n const promise = nav?.(href, { replace, preserveScroll });\n promise?.then(\n () => setPending(false),\n () => setPending(false),\n );\n },\n [href, replace, preserveScroll, onClick]\n );\n\n const handleMouseEnter = useCallback(\n (e: MouseEvent<HTMLAnchorElement>) => {\n onMouseEnter?.(e);\n\n if (prefetchStrategy !== \"hover\" && prefetchStrategy !== \"click\") return;\n\n if (hoverTimer.current !== null) clearTimeout(hoverTimer.current);\n\n hoverTimer.current = setTimeout(() => {\n hoverTimer.current = null;\n doPrefetch();\n }, HOVER_PREFETCH_DELAY_MS);\n },\n [prefetchStrategy, doPrefetch, onMouseEnter]\n );\n\n const handleMouseLeave = useCallback(\n (e: MouseEvent<HTMLAnchorElement>) => {\n onMouseLeave?.(e);\n\n // Never fired: the pointer passed over on its way somewhere else.\n if (hoverTimer.current !== null) {\n clearTimeout(hoverTimer.current);\n hoverTimer.current = null;\n }\n\n // Already in flight: give the connection back to whatever the pointer is\n // heading for. A prefetch that has landed is kept — see cancelPrefetch.\n if (isExternalUrl(href)) return;\n (window as any).__rsc_cancel_prefetch?.(href);\n },\n [href, onMouseLeave]\n );\n\n // Touch gets no delay. There is no hovering to disambiguate — a touch is\n // already the start of a tap — and touchstart leads the click by little\n // enough that spending any of it waiting would waste the head start.\n const handleTouchStart = useCallback(() => {\n if (prefetchStrategy === \"hover\" || prefetchStrategy === \"click\") {\n doPrefetch();\n }\n }, [prefetchStrategy, doPrefetch]);\n\n // A link unmounted mid-hover (navigating away) must not prefetch afterwards.\n useEffect(() => () => {\n if (hoverTimer.current !== null) clearTimeout(hoverTimer.current);\n }, []);\n\n return (\n <LinkStatusContext.Provider value={{ pending }}>\n <a\n href={href}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={handleTouchStart}\n data-pending={pending ? \"\" : undefined}\n {...rest}\n >\n {children}\n </a>\n </LinkStatusContext.Provider>\n );\n}\n"]}
@@ -5,4 +5,3 @@ export declare function PathnameProvider({ value, children }: {
5
5
  }): import("react").JSX.Element;
6
6
  /** What the server rendered. On the client this is the url it was hydrated with. */
7
7
  export declare function useRenderedPathname(): string;
8
- //# sourceMappingURL=PathnameProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PathnameProvider.js","sourceRoot":"","sources":["../../src/js/PathnameProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,eAAe,GAAG,aAAa,CAAS,GAAG,CAAC,CAAC;AAEnD,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA0C;IAC1F,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA4B,CAAC;AACvF,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC"}
1
+ {"version":3,"file":"PathnameProvider.js","sourceRoot":"","sources":["../../src/js/PathnameProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,eAAe,GAAG,aAAa,CAAS,GAAG,CAAC,CAAC;AAEnD,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA0C;IAC1F,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA4B,CAAC;AACvF,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC","sourcesContent":["\"use client\";\n\n/**\n * The url the server rendered, handed to the client hooks.\n *\n * usePathname used to answer \"/\" during a server render, because a hook has no\n * props and the module had nothing else to go on. Every prerendered page\n * therefore shipped with the wrong link marked active, corrected only once\n * hydration ran — a visible flash, and simply wrong on a route that ships no\n * client runtime at all.\n *\n * A context rather than a module-level variable: two requests render at once\n * in the same process, and a variable would hand one page the other's url.\n */\n\nimport { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nconst PathnameContext = createContext<string>(\"/\");\n\nexport function PathnameProvider({ value, children }: { value: string; children: ReactNode }) {\n return <PathnameContext.Provider value={value}>{children}</PathnameContext.Provider>;\n}\n\n/** What the server rendered. On the client this is the url it was hydrated with. */\nexport function useRenderedPathname(): string {\n return useContext(PathnameContext);\n}\n"]}
@@ -15,4 +15,3 @@ export declare class RedirectBoundary extends Component<Props, State> {
15
15
  render(): ReactNode;
16
16
  }
17
17
  export {};
18
- //# sourceMappingURL=RedirectBoundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectBoundary.js","sourceRoot":"","sources":["../../src/js/RedirectBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAqBb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAYjC,MAAM,OAAO,gBAAiB,SAAQ,SAAuB;IAC3D,KAAK,GAAU,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IAEtC,MAAM,CAAC,wBAAwB,CAAC,KAAc;QAC5C,oEAAoE;QACpE,qEAAqE;QACrE,OAAO,mBAAmB,CAAE,KAA8B,EAAE,MAAM,CAAC;YACjE,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC,IAAI,CAAC;IACX,CAA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AE5E,IAAI,CAAC,MAAM;YAAE,MAAM,KAAK,CAAC;QAEzB,uEAAuE;QACvE,sEAAsE;QACtE,wEAAwE;QACxE,wDAAwD;QACxD,EAAE;QACF,uEAAuE;QACvE,uEAAuE;QACvE,uEAAuE;QACvE,KAAK,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC;QAE/D,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF","sourcesContent":["\"use client\";\n\n/**\n * Performs a redirect that was decided too late to be a status code.\n *\n * A redirect thrown above every Suspense boundary is answered by the host\n * before anything is written — the browser never sees this page, and this\n * component is never involved. One thrown inside a boundary arrives after the\n * shell, as an error carrying the destination in its digest, and this is what\n * turns that back into a navigation.\n *\n * An error boundary rather than a hook because that is the only thing React\n * offers for \"a child threw\": the throw happens in a server component whose\n * error is serialised into the payload, and it surfaces here when the client\n * renders it.\n *\n * Anything that is not a redirect is rethrown untouched, so an app's own error\n * boundaries still see the errors they exist for.\n */\n\nimport type { Href } from \"../routes.js\";\nimport { Component } from \"react\";\nimport type { ErrorInfo, ReactNode } from \"react\";\nimport { parseRedirectDigest } from \"../redirectDigest.js\";\nimport { visit } from \"./router\";\n\ninterface Props {\n children: ReactNode;\n /** Shown while the navigation is in flight. Null keeps the space empty. */\n fallback?: ReactNode;\n}\n\ninterface State {\n redirecting: boolean;\n}\n\nexport class RedirectBoundary extends Component<Props, State> {\n state: State = { redirecting: false };\n\n static getDerivedStateFromError(error: unknown): State | null {\n // Reading `digest` rather than the message: React replaces a server\n // error's message in production and transmits the digest either way.\n return parseRedirectDigest((error as { digest?: unknown })?.digest)\n ? { redirecting: true }\n : null;\n }\n\n componentDidCatch(error: unknown, _info: ErrorInfo): void {\n const target = parseRedirectDigest((error as { digest?: unknown })?.digest);\n\n if (!target) throw error;\n\n // An SPA navigation, not a location assignment: the layouts above this\n // boundary are already mounted and correct, so replacing the document\n // would throw away state the user can see — including whatever they had\n // typed into a page that is only being redirected past.\n //\n // replace, because the url being left never became a page the user was\n // on; leaving a history entry for it means Back returns to a redirect.\n // The server chose this, so it is not one of the app's authored hrefs.\n void visit(target.location as Href, { replace: true });\n }\n\n render(): ReactNode {\n if (this.state.redirecting) return this.props.fallback ?? null;\n\n return this.props.children;\n }\n}\n"]}
@@ -5,4 +5,3 @@ export declare function SegmentBoundary({ depth, pageKey, children, }: {
5
5
  pageKey?: string;
6
6
  children: ReactNode;
7
7
  }): import("react").JSX.Element;
8
- //# sourceMappingURL=SegmentBoundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentBoundary.js","sourceRoot":"","sources":["../../src/js/SegmentBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEjF,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,GAMT;IACC,MAAM,KAAK,GAAG,oBAAoB,CAChC,CAAC,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,EACjD,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC;IAC5B,wEAAwE;IACxE,sEAAsE;IACtE,GAAG,EAAE,CAAC,IAAI,CACX,CAAA;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO;YAAE,WAAW,C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AAyE;IACzE,6EAA6E;IAC7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO;YAAE,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IACpD,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE9B,4EAA4E;IAC5E,yEAAyE;IACzE,4EAA4E;IAC5E,mEAAmE;IACnE,IAAI,CAAC,KAAK;QAAE,OAAO,KAAC,gBAAgB,cAAE,QAAQ,GAAoB,CAAA;IAElE,OAAO,CACL,KAAC,gBAAgB,cACd,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,QAAQ,IAAiB,IAAI,EAAE,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,YACjF,KAAK,CAAC,IAAiB,IADX,KAAK,CAAC,GAAG,CAEb,CACZ,CAAC,GACe,CACpB,CAAA;AACH,CAAC","sourcesContent":["\"use client\";\n\n/**\n * The point in the tree a navigation can replace on its own.\n *\n * Sits between a layout and its children, so showing a different segment\n * re-renders from here down and leaves the layouts above it mounted. Server\n * components cannot be re-rendered on the client, which is why the seam has to\n * be a client component reading from a store rather than the layout itself.\n *\n * Pages it has already shown stay mounted behind <Activity mode=\"hidden\">.\n * Hidden is not unmounted: effects are torn down but state survives, so\n * returning to a page brings back the form you were filling in. Rendering only\n * the current one would throw that away, which is what replacing the root did.\n */\n\nimport { Activity, useEffect, useSyncExternalStore } from 'react'\nimport type { ReactNode } from 'react'\nimport { RedirectBoundary } from './RedirectBoundary'\nimport { getSegmentState, seedSegment, subscribeToSegment } from './segmentStore'\n\nexport function SegmentBoundary({\n depth,\n pageKey,\n children,\n}: {\n depth: number\n /** The page these server-rendered children belong to. */\n pageKey?: string\n children: ReactNode\n}) {\n const state = useSyncExternalStore(\n (listener) => subscribeToSegment(depth, listener),\n () => getSegmentState(depth),\n // On the server the tree being rendered IS the current one, so there is\n // never an override; returning null keeps hydration from mismatching.\n () => null,\n )\n\n // Record the page we arrived on, so a later navigation away and back can\n // return to it. Without this the first page is the one page you cannot keep.\n useEffect(() => {\n if (pageKey) seedSegment(depth, pageKey, children)\n }, [depth, pageKey, children])\n\n // Wrapped here rather than around the whole app because this is the closest\n // client component above a page: a redirect thrown inside the page's own\n // Suspense boundary surfaces at the nearest error boundary, and catching it\n // here leaves the layouts above mounted while the navigation runs.\n if (!state) return <RedirectBoundary>{children}</RedirectBoundary>\n\n return (\n <RedirectBoundary>\n {state.entries.map((entry) => (\n <Activity key={entry.key} mode={entry.key === state.activeKey ? 'visible' : 'hidden'}>\n {entry.tree as ReactNode}\n </Activity>\n ))}\n </RedirectBoundary>\n )\n}\n"]}
@@ -12,4 +12,3 @@ export declare function SlotBoundary({ name, children }: {
12
12
  name: string;
13
13
  children: ReactNode;
14
14
  }): ReactNode;
15
- //# sourceMappingURL=SlotBoundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SlotBoundary.js","sourceRoot":"","sources":["../../src/js/SlotBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAyC;IACpF,MAAM,KAAK,GAAG,oBAAoB,CAChC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC7C,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACxB,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAc,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"SlotBoundary.js","sourceRoot":"","sources":["../../src/js/SlotBoundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAyC;IACpF,MAAM,KAAK,GAAG,oBAAoB,CAChC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC7C,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACxB,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAc,CAAC;AACzE,CAAC","sourcesContent":["\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { getSlotState, subscribeToSlot } from \"./slotStore\";\n\n/**\n * The seam a re-rendered slot is swapped in at.\n *\n * Server components cannot be re-rendered in the browser, so the swap point\n * has to be a client component reading from a store. With nothing stored it\n * renders what the server sent with the page — which is the behaviour that\n * existed before slots could be revalidated, and is what makes this safe to\n * wrap every slot in.\n */\nexport function SlotBoundary({ name, children }: { name: string; children: ReactNode }) {\n const state = useSyncExternalStore(\n (listener) => subscribeToSlot(name, listener),\n () => getSlotState(name),\n () => getSlotState(name),\n );\n\n return (state.tree === undefined ? children : state.tree) as ReactNode;\n}\n"]}
@@ -5,4 +5,3 @@ export declare function createViteRscApp(container?: Document | Element, interce
5
5
  staticPayloads?: string | null;
6
6
  routes?: unknown[] | null;
7
7
  }): Promise<void>;
8
- //# sourceMappingURL=createViteRscApp.d.ts.map