@rshono/core 1.0.0-rc.25 → 1.0.0-rc.26

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.
@@ -158,9 +158,23 @@ async function payloadResponse(request) {
158
158
  /**
159
159
  * Asks a URL for its flight payload. Deliberately uncached — a payload can never be staler than the click
160
160
  * that wanted it, and the browser's own HTTP cache is what makes a repeat visit cheap.
161
+ *
162
+ * The body rides through a pass-through so its end is observable: a tee would keep a copy of every byte
163
+ * React has not parsed yet, and the flight stream is the one thing here that can be large.
161
164
  */
162
165
  function requestPayload(href, signal) {
163
- return createFromFetch(payloadResponse(createRscRequest(new URL(href, location.href).href, undefined, signal)));
166
+ const response = payloadResponse(createRscRequest(new URL(href, location.href).href, undefined, signal));
167
+ const { promise: settled, resolve: settle } = Promise.withResolvers();
168
+ const forFlight = response.then((value) => {
169
+ const body = value.body;
170
+ if (!body) {
171
+ settle();
172
+ return value;
173
+ }
174
+ const stream = body.pipeThrough(new TransformStream({ flush: () => settle() }));
175
+ return new Response(stream, { status: value.status, statusText: value.statusText, headers: value.headers });
176
+ });
177
+ return { payload: createFromFetch(forFlight), settled };
164
178
  }
165
179
  /**
166
180
  * Whether the browser hands us its navigations. Gated on `sourceElement` rather than on `navigation` itself:
@@ -487,6 +501,12 @@ let setPayload = () => {
487
501
  window.location.reload();
488
502
  return new Promise(() => { });
489
503
  };
504
+ /**
505
+ * Re-dispatches the payload already waiting to commit, for {@link loadPayload}'s lost-ping retry. Unlike
506
+ * {@link setPayload} it creates and releases no commit promise, so re-rendering the same payload cannot
507
+ * resolve the navigation's commit early. Assigned with {@link setPayload} by `BrowserRoot`.
508
+ */
509
+ let reapplyPayload = () => { };
490
510
  /** Runs work inside the nav transition so `useNavigation().pending` stays true across the round-trip. */
491
511
  let startNav = (run) => {
492
512
  void run();
@@ -522,20 +542,42 @@ function loadPayload(url, signal, afterCommit) {
522
542
  // work too, but only because React happens not to gate a commit on its async scope settling — an internal
523
543
  // this has no reason to depend on across the whole `^19.1.0` peer range.
524
544
  let committed;
545
+ // Whether the payload update has committed. A streamed transition can suspend on a flight chunk whose later
546
+ // resolution React never pings the lane back for; the retry below re-schedules the update once the stream
547
+ // has closed, but only while this is still false.
548
+ let committedSettled = false;
525
549
  const run = async () => {
526
- const payload = await requestPayload(url, abort);
550
+ const { payload, settled } = requestPayload(url, abort);
551
+ const nextPayload = await payload;
527
552
  // Checked again after the await because the fetch may already have resolved by then, and applying it
528
553
  // would repaint a page the user has left.
529
554
  if (abort.aborted || navigation !== currentNavigation)
530
555
  return;
531
- if (payload.redirect) {
532
- push(payload.redirect);
556
+ if (nextPayload.redirect) {
557
+ push(nextPayload.redirect);
533
558
  return;
534
559
  }
535
560
  // The fetch crossed an await, so its payload update needs a new synchronous transition scope.
536
561
  // Keep the commit promise outside the async Action; React tracks the scheduled update until commit.
537
562
  React.startTransition(() => {
538
- committed = setPayload(payload, afterCommit);
563
+ committed = setPayload(nextPayload, afterCommit);
564
+ void committed.then(() => (committedSettled = true));
565
+ });
566
+ // A streamed payload can suspend a transition on a flight chunk that resolves after the shell without
567
+ // React ever pinging the suspended lane back, which strands the navigation on the previous tree. The
568
+ // chunks have all landed by the time the stream closes, so one re-application — still a transition, so a
569
+ // payload that is waiting on something other than flight keeps the #52 behaviour — commits the render a
570
+ // lost ping stranded. It goes through `reapplyPayload` rather than `setPayload`: the payload is not
571
+ // replaced, so the commit the navigation waits on has to stay attached to it. The macrotask lets the
572
+ // decoder process the last chunk and React's own retry run first, so the normal path is not interrupted.
573
+ void settled.then(() => {
574
+ if (abort.aborted || navigation !== currentNavigation || committedSettled)
575
+ return;
576
+ setTimeout(() => {
577
+ if (abort.aborted || navigation !== currentNavigation || committedSettled)
578
+ return;
579
+ React.startTransition(reapplyPayload);
580
+ }, 0);
539
581
  });
540
582
  };
541
583
  // `startTransition` runs the work but hands nothing back, so the promise carrying a failure is caught here
@@ -711,6 +753,9 @@ async function main() {
711
753
  function BrowserRoot() {
712
754
  const [payload, setPayloadState] = React.useState(initialPayload);
713
755
  const [pending, startTransition] = React.useTransition();
756
+ // The payload the last `setPayload` put on screen or on its way there, so `reapplyPayload` re-renders
757
+ // that one rather than a payload a later navigation or action has already replaced.
758
+ const currentPayload = React.useRef(initialPayload);
714
759
  // The resolver the payload on screen still owes — see {@link loadPayload}.
715
760
  const pendingCommit = React.useRef(null);
716
761
  // The scroll the payload about to commit owes, set with it so a payload that supersedes another takes
@@ -720,16 +765,23 @@ async function main() {
720
765
  // Descendant passive effects can start a navigation before the root's passive effects run.
721
766
  // Install the live payload setter and transition runner before any such navigation starts.
722
767
  React.useLayoutEffect(() => {
723
- setPayload = (next, afterCommit) => new Promise((resolve) => {
724
- // A payload replaced before it ever painted still has a navigation waiting on it. React commits
725
- // only the newest, so the effect below never runs for the one it skipped: release it here.
726
- pendingCommit.current?.();
727
- pendingCommit.current = resolve;
728
- // Replaced rather than kept: a server action's payload carries no `afterCommit`, and the
729
- // navigation it superseded must not scroll the page the action is about to replace it with.
730
- pendingScroll.current = afterCommit ?? null;
731
- setPayloadState(next);
732
- });
768
+ setPayload = (next, afterCommit) => {
769
+ currentPayload.current = next;
770
+ return new Promise((resolve) => {
771
+ // A payload replaced before it ever painted still has a navigation waiting on it. React commits
772
+ // only the newest, so the effect below never runs for the one it skipped: release it here.
773
+ pendingCommit.current?.();
774
+ pendingCommit.current = resolve;
775
+ // Replaced rather than kept: a server action's payload carries no `afterCommit`, and the
776
+ // navigation it superseded must not scroll the page the action is about to replace it with.
777
+ pendingScroll.current = afterCommit ?? null;
778
+ setPayloadState(next);
779
+ });
780
+ };
781
+ // A re-dispatch of the payload above, for the retry in `loadPayload`: keeping `pendingCommit` and
782
+ // `pendingScroll` in place means the navigation already waiting resolves when this render commits,
783
+ // not when the retry runs.
784
+ reapplyPayload = () => setPayloadState(currentPayload.current);
733
785
  startNav = (run) => startTransition(run);
734
786
  }, [startTransition]);
735
787
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"entry.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KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,CAAC;IACrE,SAAS,CAAC,KAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { hydrateRoot } from 'react-dom/client';\nimport {\n createFromFetch,\n createFromReadableStream,\n createTemporaryReferenceSet,\n encodeReply,\n setServerCallback,\n} from 'react-server-dom-rspack/client.browser';\nimport { isControlDigest, parseRedirectDigest } from './control.js';\nimport type { DevMessage } from './dev-protocol.js';\nimport type { RscPayload } from './entry.rsc.js';\n// Dev-only: its one caller sits behind `import.meta.webpackHot`, which a production build compiles to\n// `false` — so this module is dropped there.\nimport { walkHotUpdates } from './hot-update.js';\nimport { RouterContext, type NavigationRouter } from './navigation.js';\nimport { createRscRequest } from './request.js';\n\nconst isDev = process.env.NODE_ENV === 'development';\n\ndeclare global {\n /** The array the payload `<script>` tags `flight-inject.ts` emits push their chunks into. */\n var __FLIGHT_DATA: Array<string | Uint8Array> | undefined;\n}\n\n/** The flight payload the document carried, read back out of `__FLIGHT_DATA` — see `flight-inject.ts`. */\nfunction readFlightPayload(): ReadableStream<Uint8Array> {\n const encoder = new TextEncoder();\n // Assigned synchronously by `start`, which `new ReadableStream` runs before it returns.\n let controller!: ReadableStreamDefaultController<Uint8Array>;\n const stream = new ReadableStream<Uint8Array>({\n start: (c) => void (controller = c),\n });\n const enqueue = (chunk: string | Uint8Array) => controller.enqueue(typeof chunk === 'string' ? encoder.encode(chunk) : chunk);\n\n // Payload scripts interleave with the document: the ones that already ran are in the array, the rest\n // arrive through `push`.\n const data = (self.__FLIGHT_DATA ??= []);\n for (const chunk of data) enqueue(chunk);\n data.push = enqueue as typeof data.push;\n\n // The last payload script lands before parsing finishes, so that is what closes the stream.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => controller.close(), { once: true });\n } else {\n controller.close();\n }\n return stream;\n}\n\n/** Created at module evaluation, not inside `main()`, so no chunk can be pushed before it is watching. */\nconst flightStream = readFlightPayload();\n\n/**\n * The part of the location a payload is rendered for — the document, without the fragment, which the server\n * never sees. Two URLs that differ only by `#hash` describe the same payload.\n */\nconst documentUrl = (): string => location.pathname + location.search;\n\n/**\n * The document URL the payload on screen was rendered for — see {@link documentUrl}. A fragment-only\n * traversal leaves it unchanged, which is how the `popstate` listener knows there is nothing to fetch.\n * Updated in the layout effect that commits a payload.\n */\nlet renderedUrl = documentUrl();\n\n/** Guarantees somewhere to attach the fatal overlay: the root container is `document`, so a teardown can take `<body>` with it. */\nfunction overlayHost(): HTMLElement {\n if (!document.documentElement) document.appendChild(document.createElement('html'));\n if (!document.body) document.documentElement.appendChild(document.createElement('body'));\n return document.body;\n}\n\n/**\n * Paints a full-viewport panel over whatever is on screen, and returns the box for the caller to fill.\n *\n * DOM calls rather than React (one caller runs because the renderer just failed), and `textContent` rather\n * than `innerHTML` (an error message is untrusted input). Queued on a macrotask: React's teardown runs after\n * the callback that reaches here returns, and would remove a node appended inline.\n */\nfunction paintOverlay(fill: (box: HTMLElement) => void): void {\n setTimeout(() => {\n const host = overlayHost();\n host.querySelector('[data-rshono-fatal]')?.remove();\n\n const box = document.createElement('div');\n box.setAttribute('data-rshono-fatal', '');\n box.setAttribute('role', 'alert');\n box.style.cssText =\n 'position:fixed;inset:0;z-index:2147483647;overflow:auto;padding:1.5rem;background:#18181b;color:#f4f4f5;' +\n 'font:14px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:left';\n\n fill(box);\n host.appendChild(box);\n }, 0);\n}\n\n/** The overlay's heading. */\nfunction overlayTitle(text: string): HTMLElement {\n const title = document.createElement('div');\n title.textContent = text;\n title.style.cssText = 'font-size:1.0625rem;font-weight:700;color:#f87171;margin:0 0 0.75rem';\n return title;\n}\n\n/**\n * Paints the reason for an uncaught render error over the blank page it leaves behind — the full stack in\n * dev, a generic notice and a reload button in production.\n */\nfunction showFatal(error: unknown, componentStack?: string | null): void {\n paintOverlay((box) => {\n box.appendChild(overlayTitle(isDev ? 'Unhandled error' : 'Something went wrong'));\n\n if (isDev) {\n const detail = document.createElement('pre');\n detail.style.cssText = 'margin:0;white-space:pre-wrap;word-break:break-word';\n detail.textContent =\n (error instanceof Error ? (error.stack ?? `${error.name}: ${error.message}`) : String(error)) +\n (componentStack ? `\\n\\nComponent stack:${componentStack}` : '');\n box.appendChild(detail);\n } else {\n const message = document.createElement('p');\n message.textContent = 'This page hit an unexpected error and can’t continue.';\n message.style.cssText = 'margin:0 0 1rem;color:#d4d4d8';\n box.appendChild(message);\n }\n\n const reload = document.createElement('button');\n reload.textContent = 'Reload page';\n reload.style.cssText =\n 'margin-top:1.25rem;padding:0.5rem 1rem;font:inherit;color:#18181b;background:#f4f4f5;border:0;border-radius:4px;cursor:pointer';\n reload.addEventListener('click', () => loadDocument());\n box.appendChild(reload);\n });\n}\n\n/**\n * The end of the line for a `notFound()` that arrived too late to be a 404 and did not survive a reload.\n *\n * No reload button, unlike {@link showFatal}: the reload has already been spent, and the second identical\n * response is what brought us here. \"Page not found\" is what the server was trying to say, so it is what the\n * visitor is told; the reason it could not say it properly is a message for whoever wrote the page, and dev is\n * where they are.\n */\nfunction showLateNotFound(): void {\n paintOverlay((box) => {\n box.appendChild(overlayTitle('Page not found'));\n\n const message = document.createElement('p');\n message.textContent = isDev\n ? 'notFound() was raised from a boundary that resolved after the page shell had been sent, so the response ' +\n 'could not be a 404 — and reloading rendered the same page again. Decide before the render starts ' +\n 'streaming: in Hono middleware, or in the page component body above the boundary.'\n : 'This page is not available.';\n message.style.cssText = 'margin:0;color:#d4d4d8';\n box.appendChild(message);\n });\n}\n/** What every flight response is typed as. The charset and any other parameters follow it. */\nconst FLIGHT_CONTENT_TYPE = 'text/x-component';\n\n/**\n * Fetches a payload, refusing a response that is not one.\n *\n * The status cannot be the gate: a payload legitimately arrives as a 404 from the `notFound` page and as a\n * 500 from an action that threw, and both carry a real payload the caller has to see. The content type is.\n *\n * What this catches is the response that is not a payload at all — a `bodyLimit()` 413, a proxy's error page,\n * a 502 mid-deploy. Handed to the flight parser those all surface as `Error: Connection closed.`, with the\n * status and the body nowhere in sight; here they become an error that says what arrived.\n */\nasync function payloadResponse(request: Request): Promise<Response> {\n const response = await fetch(request);\n const contentType = response.headers.get('content-type');\n if (contentType?.startsWith(FLIGHT_CONTENT_TYPE)) return response;\n // Read for the message: a plain-text refusal says what it refused only in its body, and HTTP/2 has no\n // `statusText` at all. Bounded, because this is an error path and the body is not ours to trust.\n const body = await response.text().then(\n (text) => text.trim().slice(0, 200),\n () => '',\n );\n const status = `${response.status}${response.statusText ? ` ${response.statusText}` : ''}`;\n throw new Error(`[rshono] the server answered ${status} (${contentType ?? 'no content type'}) instead of a payload${body ? `: ${body}` : ''}`);\n}\n\n/**\n * Asks a URL for its flight payload. Deliberately uncached — a payload can never be staler than the click\n * that wanted it, and the browser's own HTTP cache is what makes a repeat visit cheap.\n */\nfunction requestPayload(href: string, signal?: AbortSignal): Promise<RscPayload> {\n return createFromFetch<RscPayload>(payloadResponse(createRscRequest(new URL(href, location.href).href, undefined, signal)));\n}\n\n/**\n * Whether the browser hands us its navigations. Gated on `sourceElement` rather than on `navigation` itself:\n * Chrome shipped the event in 102 and that property only in 135, and without it a `data-native` link cannot\n * be told from any other — so the older window would soft-navigate the very links that asked not to be.\n *\n * Where this is false there is no interception at all and every navigation is a real browser load, which a\n * server-rendered app answers correctly on its own. Only the soft part is missing.\n *\n * Both globals are tested, and neither is touched before: this runs at module scope, where a ReferenceError\n * would take the whole client runtime down with it rather than degrading anything.\n */\nconst canSoftNavigate = typeof navigation !== 'undefined' && typeof NavigateEvent !== 'undefined' && 'sourceElement' in NavigateEvent.prototype;\n\n/**\n * The runtime owns a soft navigation's scroll, so the browser's own restoration has to be off: left on, a\n * traversal restores the destination's offset against the outgoing tree before the payload for that entry\n * has even been asked for, and the incoming tree overwrites it. `manual` only concerns the entries this\n * document creates — a navigation to another document creates its own entry `auto` — and it also turns the\n * browser's reload restoration off, which {@link readStoredScrollPositions} and the first layout effect put\n * back.\n *\n * Gated on the soft router: below the Navigation API floor every navigation is a real document load, which\n * a server-rendered app answers correctly and the browser restores correctly, and taking that over without\n * a router to repaint the entry would strand the visitor at the top.\n */\nif (canSoftNavigate) {\n try {\n history.scrollRestoration = 'manual';\n } catch {\n // A preference, not a requirement: where it cannot be set, the browser's restoration and the runtime's\n // own can race on a traversal, and the runtime's runs at commit, after.\n }\n}\n\n/** A scroll offset, in the coordinates `window.scrollTo` takes and `window.scrollX`/`window.scrollY` return. */\ntype ScrollPoint = { x: number; y: number };\n\n/**\n * Where each history entry of this document was left, keyed by its Navigation API key. In memory for the\n * document's life; {@link persistScrollPositions} also writes it to `sessionStorage` so a reload — which\n * the `manual` mode above stops the browser restoring — lands where the last document was left.\n */\nconst scrollPositions = new Map<string, ScrollPoint>();\n\n/** The `sessionStorage` key holding {@link scrollPositions}. */\nconst SCROLL_STORAGE_KEY = 'rshono:scroll';\n\n/** How many entries are kept in that snapshot; the oldest falls out first — `Map` iteration order. */\nconst SCROLL_STORAGE_LIMIT = 50;\n\n/** The key of the history entry being shown, or `undefined` where the soft router does not exist. */\nfunction currentEntryKey(): string | undefined {\n return canSoftNavigate ? navigation.currentEntry?.key : undefined;\n}\n\n/**\n * Records where the outgoing entry is being left. Read at `navigate` time — before the browser commits the\n * new entry — and at `pagehide`, so whatever the navigation turns out to be, the entry it leaves has a\n * position to come back to.\n */\nfunction rememberCurrentScroll(): void {\n const key = currentEntryKey();\n if (key) scrollPositions.set(key, { x: window.scrollX, y: window.scrollY });\n}\n\n/** The position `key` was left at, or `undefined` when this document never saw it. */\nfunction scrollPointFor(key: string | undefined): ScrollPoint | undefined {\n return key === undefined ? undefined : scrollPositions.get(key);\n}\n\n/**\n * Reads the last document's snapshot back into {@link scrollPositions}. Called once, on startup, before the\n * first payload commits: the in-memory map alone would lose every entry the moment the document is replaced.\n */\nfunction readStoredScrollPositions(): void {\n try {\n const raw = sessionStorage.getItem(SCROLL_STORAGE_KEY);\n if (!raw) return;\n for (const [key, point] of Object.entries(JSON.parse(raw) as Record<string, ScrollPoint>)) {\n if (Number.isFinite(point?.x) && Number.isFinite(point?.y)) scrollPositions.set(key, point);\n }\n } catch {\n // Blocked site data, or a snapshot written by a different version. Either way there is nothing to restore,\n // and the page is still correct without it.\n }\n}\n\n/** Writes {@link scrollPositions} out, oldest first, bounded — see {@link SCROLL_STORAGE_LIMIT}. */\nfunction persistScrollPositions(): void {\n try {\n while (scrollPositions.size > SCROLL_STORAGE_LIMIT) {\n const oldest = scrollPositions.keys().next().value;\n if (oldest === undefined) break;\n scrollPositions.delete(oldest);\n }\n sessionStorage.setItem(SCROLL_STORAGE_KEY, JSON.stringify(Object.fromEntries(scrollPositions)));\n } catch {\n // Blocked site data: the in-memory map still carries this document's navigations.\n }\n}\n\n/**\n * The snapshot starts with the document, not with hydration: the page is visible and clickable while the\n * initial payload streams, and a reload or a navigation away in that window would otherwise lose the offset\n * now that `manual` has stopped the browser restoring it. Nothing here depends on the router being mounted,\n * so it does not wait for {@link listenNavigation}.\n */\nif (canSoftNavigate) {\n window.addEventListener('pagehide', () => {\n rememberCurrentScroll();\n persistScrollPositions();\n });\n}\n\n/**\n * Drops a navigation's result promises. Both reject when a navigation is superseded or cancelled — routine\n * here, since a second click is meant to abandon the first — and unhandled they would be reported as faults.\n */\nfunction settle(result: NavigationResult): void {\n const ignore = () => {};\n void result.committed?.catch(ignore);\n void result.finished?.catch(ignore);\n}\n\n/**\n * The mark {@link loadDocument} puts on its navigations, so the `navigate` listener below recognizes them as\n * the runtime's own. A symbol because the identity has to survive the trip through the browser intact:\n * `NavigateEvent.info` hands the value back by reference, so only the navigation that was given it matches.\n */\nconst documentNavigation = Symbol('rshono:document-navigation');\n\n/**\n * Performs a navigation the router below must **not** intercept, and returns having asked for it.\n *\n * `listenNavigation` intercepts a `reload` on purpose — that is what `router.refresh()` is — and every caller\n * here is reaching for a *new document* precisely because the current one cannot be repaired: the React root\n * a soft load would render into is the thing that just failed, or is about to be torn down. Intercepted, the\n * escape hatch becomes a payload fetch that lands nowhere — which is how a late `notFound()` left the tab on\n * its Suspense fallback with no second document ever arriving, and how a late `redirect()` moved the address\n * bar to a page it then failed to render.\n *\n * The mark rides the navigation itself, through `info`, so the listener recognizes the event that owns it\n * instead of consuming a flag set in advance. There is no state to clear and none to leak: a navigation the\n * browser refuses cannot make the next one a full load. Below the Navigation API there is no interception to\n * opt out of, and `location.*` is already a document load.\n */\nfunction loadDocument(href?: string): void {\n if (!canSoftNavigate) {\n if (href === undefined) window.location.reload();\n else window.location.assign(href);\n return;\n }\n\n settle(href === undefined ? navigation.reload({ info: documentNavigation }) : navigation.navigate(href, { info: documentNavigation }));\n}\n\n// The imperative actions behind `useNavigation().router`. Each one only *asks*: the browser turns it into a\n// `navigate` event, which is where `listenNavigation` answers it — so a `router.push` and a link click reach\n// the same code by the same route, and inherit the same fetch, scroll and `pending` flag.\nfunction push(href: string): void {\n if (canSoftNavigate) settle(navigation.navigate(href, { history: 'push' }));\n else window.location.assign(href);\n}\n\nfunction replace(href: string): void {\n if (canSoftNavigate) settle(navigation.navigate(href, { history: 'replace' }));\n else window.location.replace(href);\n}\n\n// A traversal is the browser's to perform either way — `navigation` only hands it back as an interceptable\n// event first. Nothing to go back to is a rejection there and a no-op here; both amount to the same thing.\nfunction back(): void {\n if (canSoftNavigate) settle(navigation.back());\n else window.history.back();\n}\n\nfunction forward(): void {\n if (canSoftNavigate) settle(navigation.forward());\n else window.history.forward();\n}\n\n// A refresh keeps the URL, and is still a navigation: it arrives as `navigationType: 'reload'`, which is what\n// tells the listener to leave scroll and focus where the user left them.\nfunction refresh(): void {\n if (canSoftNavigate) settle(navigation.reload());\n else window.location.reload();\n}\n\n/** How long the recovery reload is given to replace this document before the panel is painted instead. */\nconst RELOAD_GRACE_MS = 2000;\n\n/** The `sessionStorage` key bounding the recovery reload for one URL. Spent here, released in {@link main}. */\nconst lateNotFoundKey = (): string => `rshono:late-not-found:${documentUrl()}`;\n\n/**\n * Spends the one reload a late `notFound()` gets, or paints if it has already been spent for this URL.\n *\n * `redirect()` is terminal on the client — there is somewhere to navigate to — and `notFound()` is not: the\n * response is already committed as a 200, so the only recovery left is asking for the page again and hoping\n * the signal comes early enough this time to be a real 404. That works where the lateness was incidental, a\n * boundary that happened to resolve after the shell on a slow request. Where it is structural — a page that\n * always signals from a late boundary — the reload gets a byte-identical response and reloads again, and the\n * tab spins until the visitor leaves. In production nothing is logged, because the warning that explains this\n * is `isDev`-only.\n *\n * So it is bounded: one reload per URL per tab, then {@link showLateNotFound}. `sessionStorage` because the\n * value has to outlive the document it is written in and must not outlive the tab, and keyed by URL so a\n * second page's late signal still gets its own attempt.\n */\nfunction reloadOnceForLateNotFound(): void {\n const key = lateNotFoundKey();\n let spent: boolean;\n try {\n spent = sessionStorage.getItem(key) !== null;\n if (!spent) sessionStorage.setItem(key, '1');\n } catch {\n // Storage can throw outright where site data is blocked, and a page that cannot count its reloads has\n // to pick a side. It picks the terminating one: a message on a page that might have recovered is a\n // worse outcome than a reload loop only by a lot less.\n spent = true;\n }\n if (spent) {\n showLateNotFound();\n return;\n }\n\n loadDocument();\n\n // The reload wins this race whenever it happens at all: the document goes away and takes the timer with\n // it. What this covers is a reload that does not happen — swallowed by an interceptor, refused by the\n // browser, held by a `beforeunload` — which used to leave the visitor on a Suspense fallback with nothing\n // coming and nothing said. The panel is the honest answer in that case too.\n setTimeout(() => {\n if (!document.querySelector('[data-rshono-fatal]')) showLateNotFound();\n }, RELOAD_GRACE_MS);\n}\n\n/**\n * Turns a control-signal digest — how `redirect()` / `notFound()` reach the browser — into a real\n * navigation. Returns false for anything else, so callers fall through to their own handling.\n *\n * `hard` forces a full document load, for signals that surfaced *through React*: it unmounts the root on\n * an uncaught error, leaving no live tree to soft-navigate with.\n */\nfunction handleControlDigest(error: unknown, { hard = false }: { hard?: boolean } = {}): boolean {\n const digest = (error as { digest?: unknown } | null)?.digest;\n if (!isControlDigest(digest)) return false;\n const redirect = parseRedirectDigest(digest);\n if (!redirect) {\n reloadOnceForLateNotFound();\n } else if (hard) {\n // The URL is resolved first: a malformed location then throws here, before any navigation is asked for.\n loadDocument(new URL(redirect.location, window.location.href).href);\n } else {\n push(redirect.location);\n }\n return true;\n}\n\n/**\n * Scrolls the document to its start.\n *\n * The options form rather than `scrollTo(0, 0)`: the two-argument call is `auto`, which follows a\n * `scroll-behavior` the app may have set on `html`, and a soft navigation that animates its own reset reads\n * as a glitch rather than a page change.\n */\nfunction scrollToTop(): void {\n window.scrollTo({ top: 0, left: 0, behavior: 'instant' });\n}\n\n/** Puts a saved offset back. Instant for the same reason {@link scrollToTop} passes it. */\nfunction scrollToPoint(point: ScrollPoint): void {\n window.scrollTo({ top: point.y, left: point.x, behavior: 'instant' });\n}\n\n/**\n * Scrolls to a fragment's target the way the browser's own fragment jump does.\n *\n * `scrollIntoView` is the algorithm that honours `scroll-padding-top` on the scrolling box and\n * `scroll-margin-top` on the target, which `window.scrollTo` does not. The lookup follows the browser's\n * \"find a potential indicated element\": the id first, then the name. A malformed percent-escape falls back\n * to the literal fragment, and a fragment nothing matches gets the top of the document — what a browser\n * gives a missing anchor on a real load.\n */\nfunction jumpToAnchor(hash: string): void {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n // No special case for `#top`: the browser only treats it as the top of the document when no element\n // matches, and the fallback below is that top.\n if (raw === '') {\n scrollToTop();\n return;\n }\n let id = raw;\n try {\n id = decodeURIComponent(raw);\n } catch {\n // Malformed escape — the literal fragment is the better guess at the id than nothing.\n }\n const target = document.getElementById(id) ?? document.getElementsByName(id)[0];\n if (target) target.scrollIntoView();\n else scrollToTop();\n}\n\n/**\n * Moves focus the way the browser's `focusReset: 'after-transition'` does: the first `autofocus` element,\n * else the document body. A traversal is no longer intercepted, so the browser performs no focus reset for\n * it; without this, Back would leave focus on the link that was clicked on the page being left, and the next\n * Tab would resume there. `preventScroll` because the traversal's own offset has just been restored.\n */\nfunction resetFocus(): void {\n const autofocus = document.querySelector<HTMLElement>('[autofocus]');\n if (autofocus) autofocus.focus({ preventScroll: true });\n else document.body.focus({ preventScroll: true });\n}\n\n/**\n * Puts a payload on screen, resolving once React has committed it. Replaced by `BrowserRoot`'s own on mount;\n * the default covers the window before hydration, where `setServerCallback` is already registered but there\n * is no root to update — a reload is the honest answer, and nothing after it needs to run.\n *\n * `afterCommit`, when given, runs in the same layout effect that releases the commit: after the new tree is\n * in the DOM and before the browser paints, which is the only moment a `#hash` target exists and the\n * pre-scroll position has not been shown.\n */\nlet setPayload: (payload: RscPayload, afterCommit?: () => void) => Promise<void> = () => {\n window.location.reload();\n return new Promise<void>(() => {});\n};\n\n/** Runs work inside the nav transition so `useNavigation().pending` stays true across the round-trip. */\nlet startNav: (run: () => void | Promise<void>) => void = (run) => {\n void run();\n};\n\n/**\n * The navigation whose payload is allowed to settle the screen. React runs async work concurrently, so two\n * navigations are two live fetches with no ordering between them; without this a slow first response landing\n * after a fast second one repaints the page the user already left. The Navigation API aborts an intercepted\n * navigation when a newer one starts, but a traversal has no `event.signal` to watch — `popstate` arrives\n * after the browser has already committed it — so ordering is the runtime's own for those.\n */\nlet currentNavigation = 0;\n\n/** The in-flight navigation's fetch, so a newer one can stop paying for it. */\nlet navigationFetch: AbortController | null = null;\n\n/**\n * Fetches the payload for `url` and puts it on screen.\n *\n * Resolves once React has **committed** it rather than when the fetch lands: `afterCommit` runs at that\n * point, and a `#hash` target does not exist until the new tree does. Rejects only on a genuine failure —\n * being superseded is not one, and resolves quietly, because the navigation that replaced this one owns the\n * screen from then on.\n */\nfunction loadPayload(url: string, signal?: AbortSignal, afterCommit?: () => void): Promise<void> {\n // This navigation's place in the queue, and its own abort switch: a fetch is abandoned by whichever comes\n // first, the browser superseding it (an intercepted navigation carries `event.signal`) or a newer runtime\n // fetch starting (a traversal, an action, a dev refresh).\n const navigation = ++currentNavigation;\n navigationFetch?.abort();\n const controller = (navigationFetch = new AbortController());\n const abort = signal ? AbortSignal.any([signal, controller.signal]) : controller.signal;\n\n // Deliberately not awaited inside the transition: the scope ends once the payload is handed to React, and\n // React holds `pending` until the update it scheduled commits. Awaiting the commit *inside* the scope would\n // work too, but only because React happens not to gate a commit on its async scope settling — an internal\n // this has no reason to depend on across the whole `^19.1.0` peer range.\n let committed: Promise<void> | undefined;\n\n const run = async () => {\n const payload = await requestPayload(url, abort);\n // Checked again after the await because the fetch may already have resolved by then, and applying it\n // would repaint a page the user has left.\n if (abort.aborted || navigation !== currentNavigation) return;\n if (payload.redirect) {\n push(payload.redirect);\n return;\n }\n // The fetch crossed an await, so its payload update needs a new synchronous transition scope.\n // Keep the commit promise outside the async Action; React tracks the scheduled update until commit.\n React.startTransition(() => {\n committed = setPayload(payload, afterCommit);\n });\n };\n\n // `startTransition` runs the work but hands nothing back, so the promise carrying a failure is caught here\n // instead. Assigned synchronously: React invokes the callback before `startNav` returns.\n let work!: Promise<void>;\n startNav(() => (work = run()));\n\n return work.then(\n // Undefined whenever nothing was applied — an abort, or a redirect — and there is then nothing to wait for.\n () => committed,\n (error: unknown) => {\n // Checked before the error is read: an abort is this navigation being replaced, and the one that\n // replaced it owns the outcome.\n if (abort.aborted || navigation !== currentNavigation || handleControlDigest(error)) return;\n throw error;\n },\n );\n}\n\n/**\n * Whether a destination names a file rather than a page. `public/`, `/_static` and an endpoint route that\n * serves a document (`/llms.txt`, `/sitemap.xml`) answer an RSC fetch with the file itself, not a flight\n * payload — so intercepting one buys nothing: the payload never arrives, and the only recovery left is the\n * document load the browser would have made directly. Handing it that navigation up front also gives the\n * entry the file loads into the browser's own history, so Back is an ordinary cross-document traversal. An\n * intercepted entry is same-document by construction, and traversing one with nothing to repaint it changes\n * the URL and nothing else — which is what a Back press out of an opened file was doing.\n *\n * A dot in the last path segment rather than a list of extensions: a list is never complete, and every miss\n * is the failed round trip above. A page route whose last segment carries a dot (`/release-1.0`) therefore\n * costs a document load — the direction to err in, and what a `data-native` link already asks for by hand.\n */\nfunction namesAFile(href: string): boolean {\n const lastSegment = new URL(href).pathname.split('/').pop() ?? '';\n return lastSegment.includes('.');\n}\n\n/**\n * Navigations the browser can hand over but shouldn't:\n *\n * - a fragment jump, which is same-document already and needs no payload — the browser's own jump is the one\n * that honours `scroll-padding-top`, and re-rendering would pull the target out from under it;\n * - a download, which is not a navigation of this page at all;\n * - a `POST` form, which is a submission and the server's to answer (a `GET` form carries its fields in the\n * URL, has no `formData`, and soft-navigates like any other link);\n * - a link marked `data-native`, the documented opt-out;\n * - a destination that names a file — see {@link namesAFile}.\n */\nfunction leaveToBrowser(event: NavigateEvent): boolean {\n return (\n event.hashChange ||\n event.downloadRequest !== null ||\n event.formData !== null ||\n event.sourceElement?.hasAttribute('data-native') === true ||\n namesAFile(event.destination.url)\n );\n}\n\n/**\n * The whole router, in one listener.\n *\n * Every navigation the page can make arrives as a `navigate` event — a link click, a `GET` form, a\n * `history.pushState`, the back button, `navigation.reload()` — already filtered by the browser: it does not\n * fire for a middle-click, a modified click or a new tab, and reports `canIntercept: false` for anything\n * cross-origin, or for a traversal that leaves the app. Those need no handling here; they are left alone, and\n * the browser performs them as it always would.\n */\nfunction listenNavigation(): () => void {\n if (!canSoftNavigate) return () => {};\n\n const onNavigate = (event: NavigateEvent) => {\n // A document navigation the runtime asked for itself, marked through `info`. Checked before the scroll\n // snapshot: the document is going away, so where its entry was left does not matter, and an unrelated\n // later navigation can never be mistaken for this one.\n if (event.info === documentNavigation) return;\n\n // Whatever the browser is about to do with this navigation, the entry it is leaving is about to lose the\n // offset it was at, and nothing else in this document will put it back. Saved before the branches below\n // return, so a fragment the browser performs itself is covered too.\n rememberCurrentScroll();\n\n if (!event.canIntercept || leaveToBrowser(event)) return;\n\n // A traversal is repainted by the `popstate` listener below, not intercepted. `intercept`ing one is what\n // makes WebKit stall the rendered viewport for about three seconds on a back swipe\n // (bugs.webkit.org/319414): the view gesture's snapshot is only removed once the navigation finishes, and\n // React's root attaches the wheel listener the bug also needs. Letting the traversal through means the\n // browser commits the entry straight away, and the runtime puts the payload on screen when it arrives.\n if (event.navigationType === 'traverse') return;\n\n // A replace or a refresh stays where it is, so neither should move. A push starts at the top of the\n // page, or at its fragment — and that scroll is the runtime's own now: WebKit performs no\n // `after-transition` reset at all for an intercepted push (bugs.webkit.org/304593). Chromium skips it\n // too, and a fragment jump rides the same code path. Passing `manual` here makes the browser hand the\n // handler over without scrolling; the `afterCommit` callback reaches the target once the new tree is on\n // screen. Focus stays the browser's, reset after the transition.\n const inPlace = event.navigationType === 'replace' || event.navigationType === 'reload';\n let afterCommit: (() => void) | undefined;\n if (event.navigationType === 'push') {\n const { hash } = new URL(event.destination.url);\n afterCommit = hash === '' ? scrollToTop : () => jumpToAnchor(hash);\n }\n\n event.intercept({\n scroll: 'manual',\n focusReset: inPlace ? 'manual' : 'after-transition',\n // The URL commits before the handler runs, so a failure leaves the address bar describing a page the\n // document is not showing. A real load is the only way back to agreement.\n handler: () => loadPayload(event.destination.url, event.signal, afterCommit).catch(() => loadDocument()),\n });\n };\n\n /**\n * Repaints a traversal the listener above deliberately left to the browser, and moves the viewport back\n * where the entry was left. `popstate` fires after the browser has committed the entry, so the destination\n * is `navigation.currentEntry` and its saved offset is in {@link scrollPositions}.\n */\n const onPopState = () => {\n const stored = scrollPointFor(currentEntryKey());\n const hash = location.hash;\n const apply = () => {\n if (stored) scrollToPoint(stored);\n else if (hash !== '') jumpToAnchor(hash);\n else scrollToTop();\n };\n\n // A fragment-only traversal never changed the payload: the address bar is back at an anchor of the page\n // already on screen, so there is nothing to fetch and nothing to wait for. The browser's own restoration\n // is off, so the offset comes from what `onNavigate` saved when the anchor was followed; no focus reset,\n // which is what leaving those navigations to the browser has always meant.\n if (documentUrl() === renderedUrl) {\n apply();\n return;\n }\n\n void loadPayload(location.href, undefined, () => {\n apply();\n // The browser performs this for an intercepted navigation; a traversal is no longer intercepted, so\n // without it Back would leave focus on the link that was clicked on the page being left.\n resetFocus();\n }).catch(() => loadDocument());\n };\n\n navigation.addEventListener('navigate', onNavigate);\n window.addEventListener('popstate', onPopState);\n return () => {\n navigation.removeEventListener('navigate', onNavigate);\n window.removeEventListener('popstate', onPopState);\n };\n}\n\nasync function main() {\n // The assertion is load-bearing under the compiler that builds this: TypeScript 7 declares `nonce` on\n // HTMLElement, 6 declares it on Element. ESLint runs the older lib — where the narrowing is redundant —\n // so it reports an assertion that `tsc` requires. Believe `typecheck`, not the rule.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const cspMeta = document.querySelector('meta[property=\"csp-nonce\"]') as HTMLMetaElement | null;\n if (cspMeta?.nonce) __webpack_nonce__ = cspMeta.nonce;\n\n const initialPayload = await createFromReadableStream<RscPayload>(flightStream);\n\n // The recovery reload landed: this document *is* the `notFound` page, so the signal that could only be a\n // digest on the `RSC: 1` request became a real 404 on the document request. The one-reload bound was spent\n // on a recovery that worked and has to be released — otherwise the *next* soft navigation to this URL sees a\n // spent key and paints {@link showLateNotFound} over a page the app can still render.\n //\n // This is the discriminator the bound was missing. A structurally late `notFound()` commits its 200 before\n // it signals, so its reloaded document is the page itself and carries no `notFound`: the key survives and\n // that loop stays bounded at one reload, which is the whole reason the bound exists.\n if (initialPayload.notFound) {\n try {\n sessionStorage.removeItem(lateNotFoundKey());\n } catch {\n // Blocked site data. `reloadOnceForLateNotFound` already treats that as the terminating case.\n }\n }\n\n // Everything the last document saved, read before any payload commits: the in-memory map alone would not\n // survive the reload that `history.scrollRestoration = 'manual'` just stopped the browser restoring. The\n // entry's key is stable across a reload, and the offset is applied by `BrowserRoot`'s first layout effect,\n // before the first paint of the new tree.\n if (canSoftNavigate) readStoredScrollPositions();\n const restored = scrollPointFor(currentEntryKey());\n\n function BrowserRoot() {\n const [payload, setPayloadState] = React.useState(initialPayload);\n const [pending, startTransition] = React.useTransition();\n // The resolver the payload on screen still owes — see {@link loadPayload}.\n const pendingCommit = React.useRef<(() => void) | null>(null);\n // The scroll the payload about to commit owes, set with it so a payload that supersedes another takes\n // its predecessor's scroll out of the queue along with its commit. Initialised with the reload's offset:\n // the first layout effect below applies it with the first payload, before the new tree is painted.\n const pendingScroll = React.useRef<(() => void) | null>(restored ? () => scrollToPoint(restored) : null);\n\n // Descendant passive effects can start a navigation before the root's passive effects run.\n // Install the live payload setter and transition runner before any such navigation starts.\n React.useLayoutEffect(() => {\n setPayload = (next, afterCommit) =>\n new Promise<void>((resolve) => {\n // A payload replaced before it ever painted still has a navigation waiting on it. React commits\n // only the newest, so the effect below never runs for the one it skipped: release it here.\n pendingCommit.current?.();\n pendingCommit.current = resolve;\n // Replaced rather than kept: a server action's payload carries no `afterCommit`, and the\n // navigation it superseded must not scroll the page the action is about to replace it with.\n pendingScroll.current = afterCommit ?? null;\n setPayloadState(next);\n });\n startNav = (run) => startTransition(run);\n }, [startTransition]);\n\n /**\n * Performs the pending scroll and releases the navigation waiting on this payload. A layout effect, so\n * the new tree is in the DOM and the pre-scroll position is never painted.\n */\n React.useLayoutEffect(() => {\n const scroll = pendingScroll.current;\n pendingScroll.current = null;\n scroll?.();\n // What the payload that just committed was rendered for — see {@link renderedUrl}. A redirect never\n // reaches here, and an action or a dev refresh keeps the URL it was fetched for.\n renderedUrl = documentUrl();\n const commit = pendingCommit.current;\n pendingCommit.current = null;\n commit?.();\n }, [payload]);\n\n // A descendant may navigate from its first passive effect. Intercept it before that effect runs.\n React.useLayoutEffect(() => listenNavigation(), []);\n\n const router = React.useMemo<NavigationRouter>(() => ({ push, replace, back, forward, refresh, pending }), [pending]);\n\n return <RouterContext.Provider value={router}>{payload.root}</RouterContext.Provider>;\n }\n\n setServerCallback(async (id, args) => {\n const temporaryReferences = createTemporaryReferenceSet();\n // The document the action is being called from. Every action response carries a fresh payload for that\n // page, so if a navigation has moved on by the time it arrives the payload describes a page the user has\n // left — the return value is still theirs, but painting it is not. Compared without the fragment, which\n // the server never saw.\n const calledFrom = documentUrl();\n const request = createRscRequest(window.location.href, {\n id,\n body: await encodeReply(args, { temporaryReferences }),\n });\n let payload: RscPayload;\n try {\n payload = await createFromFetch<RscPayload>(payloadResponse(request), { temporaryReferences });\n } catch (error) {\n if (handleControlDigest(error)) return undefined;\n throw error;\n }\n if (payload.redirect) {\n push(payload.redirect);\n return undefined;\n }\n if (documentUrl() === calledFrom) React.startTransition(() => void setPayload(payload));\n if (payload.notFound) return undefined;\n const result = payload.returnValue;\n if (!result) {\n // A payload that is not this action's own reply: the server rendered a page in its place. An action\n // that had already run has its result carried across (see `actionResults` in entry.rsc.tsx), and the\n // ways a *caller* can get a request wrong are refused ahead of any render — an unknown id or an\n // undecodable body is a `text/plain` 400, which `payloadResponse` turns into an error of its own\n // before this.\n //\n // What is left is the server failing before the action ran, which is answered with the `error` page —\n // a flight payload, so it arrives here rather than at `payloadResponse`, with no `returnValue` in it.\n // A module the deployment no longer holds is the reachable case: `loadServerAction` throws, the\n // framework reports it and 500s, and this is what the caller has to go on. Hence the message: the\n // failure is on the server and its log is where the error is. Below that it is still the defensive\n // floor for a payload shaped by another deployment or replaced by a proxy — reading `.ok` off it used\n // to hand the caller `Cannot read properties of undefined`.\n throw new Error(\n '[rshono] the server action produced no result — the request failed around it and the server answered with a page instead. Its log has the error.',\n );\n }\n if (!result.ok) throw result.error;\n return result.value;\n });\n\n // A `redirect()` / `notFound()` from a component below the page root reaches us through React: it rides the\n // flight payload as an error, and boundaries re-throw it so it lands here rather than in a fallback.\n //\n // Installing these hooks opts out of React's own defaults, so everything that isn't a control signal has to\n // be put back by hand — `reportError` rather than a bare log, so error-reporting tools still see it.\n hydrateRoot(document, <BrowserRoot />, {\n formState: initialPayload.formState,\n onCaughtError: (error, errorInfo) => {\n if (handleControlDigest(error, { hard: true })) return;\n // A boundary handled it and the tree is intact, so no overlay over the app's own fallback.\n console.error(error, errorInfo.componentStack ?? '');\n },\n onUncaughtError: (error, errorInfo) => {\n if (handleControlDigest(error, { hard: true })) return;\n // Nothing caught it, so React tears the root down — and the root is `document`.\n globalThis.reportError(error);\n showFatal(error, errorInfo.componentStack);\n },\n });\n\n if (import.meta.webpackHot) {\n initDevRefresh();\n }\n}\n\n/**\n * Dev-only refresh client, listening to the CLI's SSE endpoint:\n *\n * client-built → hot-apply the waiting updates; anything the page can't be patched up to reloads.\n * rsc-update → server component code changed: re-fetch the flight payload, state preserved.\n * hello → sent on (re)connect with the latest build hash; a mismatch means a missed event.\n */\nfunction initDevRefresh() {\n const hot = import.meta.webpackHot!;\n let connectedOnce = false;\n /** The newest build the dev server has announced — what {@link applyClientUpdate} walks towards. */\n let targetHash: string | undefined;\n\n function reload(reason: string, error?: unknown): void {\n console.warn(`[rshono] ${reason} — reloading`, ...(error === undefined ? [] : [error]));\n loadDocument();\n }\n\n async function applyClientUpdate(): Promise<void> {\n const giveUp = await walkHotUpdates(\n hot,\n () => __webpack_hash__,\n () => targetHash,\n );\n if (giveUp) reload(giveUp.reason, giveUp.error);\n }\n\n async function handle(message: DevMessage): Promise<void> {\n switch (message.type) {\n case 'hello':\n targetHash = message.hash ?? targetHash;\n if (connectedOnce) {\n await applyClientUpdate();\n await loadPayload(window.location.href).catch(() => loadDocument());\n }\n connectedOnce = true;\n break;\n case 'client-built':\n targetHash = message.hash;\n await applyClientUpdate();\n break;\n case 'rsc-update':\n console.log('[rshono] server components updated');\n await loadPayload(window.location.href).catch(() => loadDocument());\n break;\n }\n }\n\n const source = new EventSource('/_rshono/hmr');\n // Chained rather than handled as they arrive: `hot.check` may only run from `idle`, and a burst of saves\n // puts several frames on the wire inside the time one takes. Queueing drops nothing, because `targetHash`\n // is shared — whichever handler runs next walks to the newest build.\n let queue: Promise<void> = Promise.resolve();\n source.onmessage = (event: MessageEvent<string>) => {\n const message = JSON.parse(event.data) as DevMessage;\n queue = queue.then(() => handle(message)).catch((error) => reload('the dev client failed', error));\n };\n}\n\n// A bootstrap failure — a truncated initial payload, most likely — would otherwise be an unhandled\n// rejection: nothing hydrates, nothing is reported, and the page just sits there.\nmain().catch((error) => {\n console.error('[rshono] the client runtime failed to start:', error);\n showFatal(error);\n});\n"]}
1
+ {"version":3,"file":"entry.client.js","sourceRoot":"","sources":["../../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AAC;IAC/C,yGAAyG;IACzG,0GAA0G;IAC1G,qEAAqE;IACrE,IAAI,KAAK,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7C,MAAM,CAAC,SAAS,GAAG,CAAC,KAA2B,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAe,CAAC;QACrD,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC;IACrG,CAAC,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,kFAAkF;AAClF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,CAAC;IACrE,SAAS,CAAC,KAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { hydrateRoot } from 'react-dom/client';\nimport {\n createFromFetch,\n createFromReadableStream,\n createTemporaryReferenceSet,\n encodeReply,\n setServerCallback,\n} from 'react-server-dom-rspack/client.browser';\nimport { isControlDigest, parseRedirectDigest } from './control.js';\nimport type { DevMessage } from './dev-protocol.js';\nimport type { RscPayload } from './entry.rsc.js';\n// Dev-only: its one caller sits behind `import.meta.webpackHot`, which a production build compiles to\n// `false` — so this module is dropped there.\nimport { walkHotUpdates } from './hot-update.js';\nimport { RouterContext, type NavigationRouter } from './navigation.js';\nimport { createRscRequest } from './request.js';\n\nconst isDev = process.env.NODE_ENV === 'development';\n\ndeclare global {\n /** The array the payload `<script>` tags `flight-inject.ts` emits push their chunks into. */\n var __FLIGHT_DATA: Array<string | Uint8Array> | undefined;\n}\n\n/** The flight payload the document carried, read back out of `__FLIGHT_DATA` — see `flight-inject.ts`. */\nfunction readFlightPayload(): ReadableStream<Uint8Array> {\n const encoder = new TextEncoder();\n // Assigned synchronously by `start`, which `new ReadableStream` runs before it returns.\n let controller!: ReadableStreamDefaultController<Uint8Array>;\n const stream = new ReadableStream<Uint8Array>({\n start: (c) => void (controller = c),\n });\n const enqueue = (chunk: string | Uint8Array) => controller.enqueue(typeof chunk === 'string' ? encoder.encode(chunk) : chunk);\n\n // Payload scripts interleave with the document: the ones that already ran are in the array, the rest\n // arrive through `push`.\n const data = (self.__FLIGHT_DATA ??= []);\n for (const chunk of data) enqueue(chunk);\n data.push = enqueue as typeof data.push;\n\n // The last payload script lands before parsing finishes, so that is what closes the stream.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => controller.close(), { once: true });\n } else {\n controller.close();\n }\n return stream;\n}\n\n/** Created at module evaluation, not inside `main()`, so no chunk can be pushed before it is watching. */\nconst flightStream = readFlightPayload();\n\n/**\n * The part of the location a payload is rendered for — the document, without the fragment, which the server\n * never sees. Two URLs that differ only by `#hash` describe the same payload.\n */\nconst documentUrl = (): string => location.pathname + location.search;\n\n/**\n * The document URL the payload on screen was rendered for — see {@link documentUrl}. A fragment-only\n * traversal leaves it unchanged, which is how the `popstate` listener knows there is nothing to fetch.\n * Updated in the layout effect that commits a payload.\n */\nlet renderedUrl = documentUrl();\n\n/** Guarantees somewhere to attach the fatal overlay: the root container is `document`, so a teardown can take `<body>` with it. */\nfunction overlayHost(): HTMLElement {\n if (!document.documentElement) document.appendChild(document.createElement('html'));\n if (!document.body) document.documentElement.appendChild(document.createElement('body'));\n return document.body;\n}\n\n/**\n * Paints a full-viewport panel over whatever is on screen, and returns the box for the caller to fill.\n *\n * DOM calls rather than React (one caller runs because the renderer just failed), and `textContent` rather\n * than `innerHTML` (an error message is untrusted input). Queued on a macrotask: React's teardown runs after\n * the callback that reaches here returns, and would remove a node appended inline.\n */\nfunction paintOverlay(fill: (box: HTMLElement) => void): void {\n setTimeout(() => {\n const host = overlayHost();\n host.querySelector('[data-rshono-fatal]')?.remove();\n\n const box = document.createElement('div');\n box.setAttribute('data-rshono-fatal', '');\n box.setAttribute('role', 'alert');\n box.style.cssText =\n 'position:fixed;inset:0;z-index:2147483647;overflow:auto;padding:1.5rem;background:#18181b;color:#f4f4f5;' +\n 'font:14px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:left';\n\n fill(box);\n host.appendChild(box);\n }, 0);\n}\n\n/** The overlay's heading. */\nfunction overlayTitle(text: string): HTMLElement {\n const title = document.createElement('div');\n title.textContent = text;\n title.style.cssText = 'font-size:1.0625rem;font-weight:700;color:#f87171;margin:0 0 0.75rem';\n return title;\n}\n\n/**\n * Paints the reason for an uncaught render error over the blank page it leaves behind — the full stack in\n * dev, a generic notice and a reload button in production.\n */\nfunction showFatal(error: unknown, componentStack?: string | null): void {\n paintOverlay((box) => {\n box.appendChild(overlayTitle(isDev ? 'Unhandled error' : 'Something went wrong'));\n\n if (isDev) {\n const detail = document.createElement('pre');\n detail.style.cssText = 'margin:0;white-space:pre-wrap;word-break:break-word';\n detail.textContent =\n (error instanceof Error ? (error.stack ?? `${error.name}: ${error.message}`) : String(error)) +\n (componentStack ? `\\n\\nComponent stack:${componentStack}` : '');\n box.appendChild(detail);\n } else {\n const message = document.createElement('p');\n message.textContent = 'This page hit an unexpected error and can’t continue.';\n message.style.cssText = 'margin:0 0 1rem;color:#d4d4d8';\n box.appendChild(message);\n }\n\n const reload = document.createElement('button');\n reload.textContent = 'Reload page';\n reload.style.cssText =\n 'margin-top:1.25rem;padding:0.5rem 1rem;font:inherit;color:#18181b;background:#f4f4f5;border:0;border-radius:4px;cursor:pointer';\n reload.addEventListener('click', () => loadDocument());\n box.appendChild(reload);\n });\n}\n\n/**\n * The end of the line for a `notFound()` that arrived too late to be a 404 and did not survive a reload.\n *\n * No reload button, unlike {@link showFatal}: the reload has already been spent, and the second identical\n * response is what brought us here. \"Page not found\" is what the server was trying to say, so it is what the\n * visitor is told; the reason it could not say it properly is a message for whoever wrote the page, and dev is\n * where they are.\n */\nfunction showLateNotFound(): void {\n paintOverlay((box) => {\n box.appendChild(overlayTitle('Page not found'));\n\n const message = document.createElement('p');\n message.textContent = isDev\n ? 'notFound() was raised from a boundary that resolved after the page shell had been sent, so the response ' +\n 'could not be a 404 — and reloading rendered the same page again. Decide before the render starts ' +\n 'streaming: in Hono middleware, or in the page component body above the boundary.'\n : 'This page is not available.';\n message.style.cssText = 'margin:0;color:#d4d4d8';\n box.appendChild(message);\n });\n}\n/** What every flight response is typed as. The charset and any other parameters follow it. */\nconst FLIGHT_CONTENT_TYPE = 'text/x-component';\n\n/**\n * Fetches a payload, refusing a response that is not one.\n *\n * The status cannot be the gate: a payload legitimately arrives as a 404 from the `notFound` page and as a\n * 500 from an action that threw, and both carry a real payload the caller has to see. The content type is.\n *\n * What this catches is the response that is not a payload at all — a `bodyLimit()` 413, a proxy's error page,\n * a 502 mid-deploy. Handed to the flight parser those all surface as `Error: Connection closed.`, with the\n * status and the body nowhere in sight; here they become an error that says what arrived.\n */\nasync function payloadResponse(request: Request): Promise<Response> {\n const response = await fetch(request);\n const contentType = response.headers.get('content-type');\n if (contentType?.startsWith(FLIGHT_CONTENT_TYPE)) return response;\n // Read for the message: a plain-text refusal says what it refused only in its body, and HTTP/2 has no\n // `statusText` at all. Bounded, because this is an error path and the body is not ours to trust.\n const body = await response.text().then(\n (text) => text.trim().slice(0, 200),\n () => '',\n );\n const status = `${response.status}${response.statusText ? ` ${response.statusText}` : ''}`;\n throw new Error(`[rshono] the server answered ${status} (${contentType ?? 'no content type'}) instead of a payload${body ? `: ${body}` : ''}`);\n}\n\n/**\n * A payload fetch, split into what React parses and a signal for the end of the stream.\n *\n * The payload promise resolves as soon as the root model is ready, which for a streamed response is well\n * before the response body has delivered its last chunk. {@link loadPayload} needs the second promise to\n * recover a transition React can leave suspended when a later chunk resolves — see the retry there.\n */\ntype FetchedPayload = { payload: Promise<RscPayload>; settled: Promise<void> };\n\n/**\n * Asks a URL for its flight payload. Deliberately uncached — a payload can never be staler than the click\n * that wanted it, and the browser's own HTTP cache is what makes a repeat visit cheap.\n *\n * The body rides through a pass-through so its end is observable: a tee would keep a copy of every byte\n * React has not parsed yet, and the flight stream is the one thing here that can be large.\n */\nfunction requestPayload(href: string, signal?: AbortSignal): FetchedPayload {\n const response = payloadResponse(createRscRequest(new URL(href, location.href).href, undefined, signal));\n const { promise: settled, resolve: settle } = Promise.withResolvers<void>();\n const forFlight = response.then((value) => {\n const body = value.body;\n if (!body) {\n settle();\n return value;\n }\n const stream = body.pipeThrough(new TransformStream<Uint8Array, Uint8Array>({ flush: () => settle() }));\n return new Response(stream, { status: value.status, statusText: value.statusText, headers: value.headers });\n });\n return { payload: createFromFetch<RscPayload>(forFlight), settled };\n}\n\n/**\n * Whether the browser hands us its navigations. Gated on `sourceElement` rather than on `navigation` itself:\n * Chrome shipped the event in 102 and that property only in 135, and without it a `data-native` link cannot\n * be told from any other — so the older window would soft-navigate the very links that asked not to be.\n *\n * Where this is false there is no interception at all and every navigation is a real browser load, which a\n * server-rendered app answers correctly on its own. Only the soft part is missing.\n *\n * Both globals are tested, and neither is touched before: this runs at module scope, where a ReferenceError\n * would take the whole client runtime down with it rather than degrading anything.\n */\nconst canSoftNavigate = typeof navigation !== 'undefined' && typeof NavigateEvent !== 'undefined' && 'sourceElement' in NavigateEvent.prototype;\n\n/**\n * The runtime owns a soft navigation's scroll, so the browser's own restoration has to be off: left on, a\n * traversal restores the destination's offset against the outgoing tree before the payload for that entry\n * has even been asked for, and the incoming tree overwrites it. `manual` only concerns the entries this\n * document creates — a navigation to another document creates its own entry `auto` — and it also turns the\n * browser's reload restoration off, which {@link readStoredScrollPositions} and the first layout effect put\n * back.\n *\n * Gated on the soft router: below the Navigation API floor every navigation is a real document load, which\n * a server-rendered app answers correctly and the browser restores correctly, and taking that over without\n * a router to repaint the entry would strand the visitor at the top.\n */\nif (canSoftNavigate) {\n try {\n history.scrollRestoration = 'manual';\n } catch {\n // A preference, not a requirement: where it cannot be set, the browser's restoration and the runtime's\n // own can race on a traversal, and the runtime's runs at commit, after.\n }\n}\n\n/** A scroll offset, in the coordinates `window.scrollTo` takes and `window.scrollX`/`window.scrollY` return. */\ntype ScrollPoint = { x: number; y: number };\n\n/**\n * Where each history entry of this document was left, keyed by its Navigation API key. In memory for the\n * document's life; {@link persistScrollPositions} also writes it to `sessionStorage` so a reload — which\n * the `manual` mode above stops the browser restoring — lands where the last document was left.\n */\nconst scrollPositions = new Map<string, ScrollPoint>();\n\n/** The `sessionStorage` key holding {@link scrollPositions}. */\nconst SCROLL_STORAGE_KEY = 'rshono:scroll';\n\n/** How many entries are kept in that snapshot; the oldest falls out first — `Map` iteration order. */\nconst SCROLL_STORAGE_LIMIT = 50;\n\n/** The key of the history entry being shown, or `undefined` where the soft router does not exist. */\nfunction currentEntryKey(): string | undefined {\n return canSoftNavigate ? navigation.currentEntry?.key : undefined;\n}\n\n/**\n * Records where the outgoing entry is being left. Read at `navigate` time — before the browser commits the\n * new entry — and at `pagehide`, so whatever the navigation turns out to be, the entry it leaves has a\n * position to come back to.\n */\nfunction rememberCurrentScroll(): void {\n const key = currentEntryKey();\n if (key) scrollPositions.set(key, { x: window.scrollX, y: window.scrollY });\n}\n\n/** The position `key` was left at, or `undefined` when this document never saw it. */\nfunction scrollPointFor(key: string | undefined): ScrollPoint | undefined {\n return key === undefined ? undefined : scrollPositions.get(key);\n}\n\n/**\n * Reads the last document's snapshot back into {@link scrollPositions}. Called once, on startup, before the\n * first payload commits: the in-memory map alone would lose every entry the moment the document is replaced.\n */\nfunction readStoredScrollPositions(): void {\n try {\n const raw = sessionStorage.getItem(SCROLL_STORAGE_KEY);\n if (!raw) return;\n for (const [key, point] of Object.entries(JSON.parse(raw) as Record<string, ScrollPoint>)) {\n if (Number.isFinite(point?.x) && Number.isFinite(point?.y)) scrollPositions.set(key, point);\n }\n } catch {\n // Blocked site data, or a snapshot written by a different version. Either way there is nothing to restore,\n // and the page is still correct without it.\n }\n}\n\n/** Writes {@link scrollPositions} out, oldest first, bounded — see {@link SCROLL_STORAGE_LIMIT}. */\nfunction persistScrollPositions(): void {\n try {\n while (scrollPositions.size > SCROLL_STORAGE_LIMIT) {\n const oldest = scrollPositions.keys().next().value;\n if (oldest === undefined) break;\n scrollPositions.delete(oldest);\n }\n sessionStorage.setItem(SCROLL_STORAGE_KEY, JSON.stringify(Object.fromEntries(scrollPositions)));\n } catch {\n // Blocked site data: the in-memory map still carries this document's navigations.\n }\n}\n\n/**\n * The snapshot starts with the document, not with hydration: the page is visible and clickable while the\n * initial payload streams, and a reload or a navigation away in that window would otherwise lose the offset\n * now that `manual` has stopped the browser restoring it. Nothing here depends on the router being mounted,\n * so it does not wait for {@link listenNavigation}.\n */\nif (canSoftNavigate) {\n window.addEventListener('pagehide', () => {\n rememberCurrentScroll();\n persistScrollPositions();\n });\n}\n\n/**\n * Drops a navigation's result promises. Both reject when a navigation is superseded or cancelled — routine\n * here, since a second click is meant to abandon the first — and unhandled they would be reported as faults.\n */\nfunction settle(result: NavigationResult): void {\n const ignore = () => {};\n void result.committed?.catch(ignore);\n void result.finished?.catch(ignore);\n}\n\n/**\n * The mark {@link loadDocument} puts on its navigations, so the `navigate` listener below recognizes them as\n * the runtime's own. A symbol because the identity has to survive the trip through the browser intact:\n * `NavigateEvent.info` hands the value back by reference, so only the navigation that was given it matches.\n */\nconst documentNavigation = Symbol('rshono:document-navigation');\n\n/**\n * Performs a navigation the router below must **not** intercept, and returns having asked for it.\n *\n * `listenNavigation` intercepts a `reload` on purpose — that is what `router.refresh()` is — and every caller\n * here is reaching for a *new document* precisely because the current one cannot be repaired: the React root\n * a soft load would render into is the thing that just failed, or is about to be torn down. Intercepted, the\n * escape hatch becomes a payload fetch that lands nowhere — which is how a late `notFound()` left the tab on\n * its Suspense fallback with no second document ever arriving, and how a late `redirect()` moved the address\n * bar to a page it then failed to render.\n *\n * The mark rides the navigation itself, through `info`, so the listener recognizes the event that owns it\n * instead of consuming a flag set in advance. There is no state to clear and none to leak: a navigation the\n * browser refuses cannot make the next one a full load. Below the Navigation API there is no interception to\n * opt out of, and `location.*` is already a document load.\n */\nfunction loadDocument(href?: string): void {\n if (!canSoftNavigate) {\n if (href === undefined) window.location.reload();\n else window.location.assign(href);\n return;\n }\n\n settle(href === undefined ? navigation.reload({ info: documentNavigation }) : navigation.navigate(href, { info: documentNavigation }));\n}\n\n// The imperative actions behind `useNavigation().router`. Each one only *asks*: the browser turns it into a\n// `navigate` event, which is where `listenNavigation` answers it — so a `router.push` and a link click reach\n// the same code by the same route, and inherit the same fetch, scroll and `pending` flag.\nfunction push(href: string): void {\n if (canSoftNavigate) settle(navigation.navigate(href, { history: 'push' }));\n else window.location.assign(href);\n}\n\nfunction replace(href: string): void {\n if (canSoftNavigate) settle(navigation.navigate(href, { history: 'replace' }));\n else window.location.replace(href);\n}\n\n// A traversal is the browser's to perform either way — `navigation` only hands it back as an interceptable\n// event first. Nothing to go back to is a rejection there and a no-op here; both amount to the same thing.\nfunction back(): void {\n if (canSoftNavigate) settle(navigation.back());\n else window.history.back();\n}\n\nfunction forward(): void {\n if (canSoftNavigate) settle(navigation.forward());\n else window.history.forward();\n}\n\n// A refresh keeps the URL, and is still a navigation: it arrives as `navigationType: 'reload'`, which is what\n// tells the listener to leave scroll and focus where the user left them.\nfunction refresh(): void {\n if (canSoftNavigate) settle(navigation.reload());\n else window.location.reload();\n}\n\n/** How long the recovery reload is given to replace this document before the panel is painted instead. */\nconst RELOAD_GRACE_MS = 2000;\n\n/** The `sessionStorage` key bounding the recovery reload for one URL. Spent here, released in {@link main}. */\nconst lateNotFoundKey = (): string => `rshono:late-not-found:${documentUrl()}`;\n\n/**\n * Spends the one reload a late `notFound()` gets, or paints if it has already been spent for this URL.\n *\n * `redirect()` is terminal on the client — there is somewhere to navigate to — and `notFound()` is not: the\n * response is already committed as a 200, so the only recovery left is asking for the page again and hoping\n * the signal comes early enough this time to be a real 404. That works where the lateness was incidental, a\n * boundary that happened to resolve after the shell on a slow request. Where it is structural — a page that\n * always signals from a late boundary — the reload gets a byte-identical response and reloads again, and the\n * tab spins until the visitor leaves. In production nothing is logged, because the warning that explains this\n * is `isDev`-only.\n *\n * So it is bounded: one reload per URL per tab, then {@link showLateNotFound}. `sessionStorage` because the\n * value has to outlive the document it is written in and must not outlive the tab, and keyed by URL so a\n * second page's late signal still gets its own attempt.\n */\nfunction reloadOnceForLateNotFound(): void {\n const key = lateNotFoundKey();\n let spent: boolean;\n try {\n spent = sessionStorage.getItem(key) !== null;\n if (!spent) sessionStorage.setItem(key, '1');\n } catch {\n // Storage can throw outright where site data is blocked, and a page that cannot count its reloads has\n // to pick a side. It picks the terminating one: a message on a page that might have recovered is a\n // worse outcome than a reload loop only by a lot less.\n spent = true;\n }\n if (spent) {\n showLateNotFound();\n return;\n }\n\n loadDocument();\n\n // The reload wins this race whenever it happens at all: the document goes away and takes the timer with\n // it. What this covers is a reload that does not happen — swallowed by an interceptor, refused by the\n // browser, held by a `beforeunload` — which used to leave the visitor on a Suspense fallback with nothing\n // coming and nothing said. The panel is the honest answer in that case too.\n setTimeout(() => {\n if (!document.querySelector('[data-rshono-fatal]')) showLateNotFound();\n }, RELOAD_GRACE_MS);\n}\n\n/**\n * Turns a control-signal digest — how `redirect()` / `notFound()` reach the browser — into a real\n * navigation. Returns false for anything else, so callers fall through to their own handling.\n *\n * `hard` forces a full document load, for signals that surfaced *through React*: it unmounts the root on\n * an uncaught error, leaving no live tree to soft-navigate with.\n */\nfunction handleControlDigest(error: unknown, { hard = false }: { hard?: boolean } = {}): boolean {\n const digest = (error as { digest?: unknown } | null)?.digest;\n if (!isControlDigest(digest)) return false;\n const redirect = parseRedirectDigest(digest);\n if (!redirect) {\n reloadOnceForLateNotFound();\n } else if (hard) {\n // The URL is resolved first: a malformed location then throws here, before any navigation is asked for.\n loadDocument(new URL(redirect.location, window.location.href).href);\n } else {\n push(redirect.location);\n }\n return true;\n}\n\n/**\n * Scrolls the document to its start.\n *\n * The options form rather than `scrollTo(0, 0)`: the two-argument call is `auto`, which follows a\n * `scroll-behavior` the app may have set on `html`, and a soft navigation that animates its own reset reads\n * as a glitch rather than a page change.\n */\nfunction scrollToTop(): void {\n window.scrollTo({ top: 0, left: 0, behavior: 'instant' });\n}\n\n/** Puts a saved offset back. Instant for the same reason {@link scrollToTop} passes it. */\nfunction scrollToPoint(point: ScrollPoint): void {\n window.scrollTo({ top: point.y, left: point.x, behavior: 'instant' });\n}\n\n/**\n * Scrolls to a fragment's target the way the browser's own fragment jump does.\n *\n * `scrollIntoView` is the algorithm that honours `scroll-padding-top` on the scrolling box and\n * `scroll-margin-top` on the target, which `window.scrollTo` does not. The lookup follows the browser's\n * \"find a potential indicated element\": the id first, then the name. A malformed percent-escape falls back\n * to the literal fragment, and a fragment nothing matches gets the top of the document — what a browser\n * gives a missing anchor on a real load.\n */\nfunction jumpToAnchor(hash: string): void {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n // No special case for `#top`: the browser only treats it as the top of the document when no element\n // matches, and the fallback below is that top.\n if (raw === '') {\n scrollToTop();\n return;\n }\n let id = raw;\n try {\n id = decodeURIComponent(raw);\n } catch {\n // Malformed escape — the literal fragment is the better guess at the id than nothing.\n }\n const target = document.getElementById(id) ?? document.getElementsByName(id)[0];\n if (target) target.scrollIntoView();\n else scrollToTop();\n}\n\n/**\n * Moves focus the way the browser's `focusReset: 'after-transition'` does: the first `autofocus` element,\n * else the document body. A traversal is no longer intercepted, so the browser performs no focus reset for\n * it; without this, Back would leave focus on the link that was clicked on the page being left, and the next\n * Tab would resume there. `preventScroll` because the traversal's own offset has just been restored.\n */\nfunction resetFocus(): void {\n const autofocus = document.querySelector<HTMLElement>('[autofocus]');\n if (autofocus) autofocus.focus({ preventScroll: true });\n else document.body.focus({ preventScroll: true });\n}\n\n/**\n * Puts a payload on screen, resolving once React has committed it. Replaced by `BrowserRoot`'s own on mount;\n * the default covers the window before hydration, where `setServerCallback` is already registered but there\n * is no root to update — a reload is the honest answer, and nothing after it needs to run.\n *\n * `afterCommit`, when given, runs in the same layout effect that releases the commit: after the new tree is\n * in the DOM and before the browser paints, which is the only moment a `#hash` target exists and the\n * pre-scroll position has not been shown.\n */\nlet setPayload: (payload: RscPayload, afterCommit?: () => void) => Promise<void> = () => {\n window.location.reload();\n return new Promise<void>(() => {});\n};\n\n/**\n * Re-dispatches the payload already waiting to commit, for {@link loadPayload}'s lost-ping retry. Unlike\n * {@link setPayload} it creates and releases no commit promise, so re-rendering the same payload cannot\n * resolve the navigation's commit early. Assigned with {@link setPayload} by `BrowserRoot`.\n */\nlet reapplyPayload: () => void = () => {};\n\n/** Runs work inside the nav transition so `useNavigation().pending` stays true across the round-trip. */\nlet startNav: (run: () => void | Promise<void>) => void = (run) => {\n void run();\n};\n\n/**\n * The navigation whose payload is allowed to settle the screen. React runs async work concurrently, so two\n * navigations are two live fetches with no ordering between them; without this a slow first response landing\n * after a fast second one repaints the page the user already left. The Navigation API aborts an intercepted\n * navigation when a newer one starts, but a traversal has no `event.signal` to watch — `popstate` arrives\n * after the browser has already committed it — so ordering is the runtime's own for those.\n */\nlet currentNavigation = 0;\n\n/** The in-flight navigation's fetch, so a newer one can stop paying for it. */\nlet navigationFetch: AbortController | null = null;\n\n/**\n * Fetches the payload for `url` and puts it on screen.\n *\n * Resolves once React has **committed** it rather than when the fetch lands: `afterCommit` runs at that\n * point, and a `#hash` target does not exist until the new tree does. Rejects only on a genuine failure —\n * being superseded is not one, and resolves quietly, because the navigation that replaced this one owns the\n * screen from then on.\n */\nfunction loadPayload(url: string, signal?: AbortSignal, afterCommit?: () => void): Promise<void> {\n // This navigation's place in the queue, and its own abort switch: a fetch is abandoned by whichever comes\n // first, the browser superseding it (an intercepted navigation carries `event.signal`) or a newer runtime\n // fetch starting (a traversal, an action, a dev refresh).\n const navigation = ++currentNavigation;\n navigationFetch?.abort();\n const controller = (navigationFetch = new AbortController());\n const abort = signal ? AbortSignal.any([signal, controller.signal]) : controller.signal;\n\n // Deliberately not awaited inside the transition: the scope ends once the payload is handed to React, and\n // React holds `pending` until the update it scheduled commits. Awaiting the commit *inside* the scope would\n // work too, but only because React happens not to gate a commit on its async scope settling — an internal\n // this has no reason to depend on across the whole `^19.1.0` peer range.\n let committed: Promise<void> | undefined;\n // Whether the payload update has committed. A streamed transition can suspend on a flight chunk whose later\n // resolution React never pings the lane back for; the retry below re-schedules the update once the stream\n // has closed, but only while this is still false.\n let committedSettled = false;\n\n const run = async () => {\n const { payload, settled } = requestPayload(url, abort);\n const nextPayload = await payload;\n // Checked again after the await because the fetch may already have resolved by then, and applying it\n // would repaint a page the user has left.\n if (abort.aborted || navigation !== currentNavigation) return;\n if (nextPayload.redirect) {\n push(nextPayload.redirect);\n return;\n }\n // The fetch crossed an await, so its payload update needs a new synchronous transition scope.\n // Keep the commit promise outside the async Action; React tracks the scheduled update until commit.\n React.startTransition(() => {\n committed = setPayload(nextPayload, afterCommit);\n void committed.then(() => (committedSettled = true));\n });\n\n // A streamed payload can suspend a transition on a flight chunk that resolves after the shell without\n // React ever pinging the suspended lane back, which strands the navigation on the previous tree. The\n // chunks have all landed by the time the stream closes, so one re-application — still a transition, so a\n // payload that is waiting on something other than flight keeps the #52 behaviour — commits the render a\n // lost ping stranded. It goes through `reapplyPayload` rather than `setPayload`: the payload is not\n // replaced, so the commit the navigation waits on has to stay attached to it. The macrotask lets the\n // decoder process the last chunk and React's own retry run first, so the normal path is not interrupted.\n void settled.then(() => {\n if (abort.aborted || navigation !== currentNavigation || committedSettled) return;\n setTimeout(() => {\n if (abort.aborted || navigation !== currentNavigation || committedSettled) return;\n React.startTransition(reapplyPayload);\n }, 0);\n });\n };\n\n // `startTransition` runs the work but hands nothing back, so the promise carrying a failure is caught here\n // instead. Assigned synchronously: React invokes the callback before `startNav` returns.\n let work!: Promise<void>;\n startNav(() => (work = run()));\n\n return work.then(\n // Undefined whenever nothing was applied — an abort, or a redirect — and there is then nothing to wait for.\n () => committed,\n (error: unknown) => {\n // Checked before the error is read: an abort is this navigation being replaced, and the one that\n // replaced it owns the outcome.\n if (abort.aborted || navigation !== currentNavigation || handleControlDigest(error)) return;\n throw error;\n },\n );\n}\n\n/**\n * Whether a destination names a file rather than a page. `public/`, `/_static` and an endpoint route that\n * serves a document (`/llms.txt`, `/sitemap.xml`) answer an RSC fetch with the file itself, not a flight\n * payload — so intercepting one buys nothing: the payload never arrives, and the only recovery left is the\n * document load the browser would have made directly. Handing it that navigation up front also gives the\n * entry the file loads into the browser's own history, so Back is an ordinary cross-document traversal. An\n * intercepted entry is same-document by construction, and traversing one with nothing to repaint it changes\n * the URL and nothing else — which is what a Back press out of an opened file was doing.\n *\n * A dot in the last path segment rather than a list of extensions: a list is never complete, and every miss\n * is the failed round trip above. A page route whose last segment carries a dot (`/release-1.0`) therefore\n * costs a document load — the direction to err in, and what a `data-native` link already asks for by hand.\n */\nfunction namesAFile(href: string): boolean {\n const lastSegment = new URL(href).pathname.split('/').pop() ?? '';\n return lastSegment.includes('.');\n}\n\n/**\n * Navigations the browser can hand over but shouldn't:\n *\n * - a fragment jump, which is same-document already and needs no payload — the browser's own jump is the one\n * that honours `scroll-padding-top`, and re-rendering would pull the target out from under it;\n * - a download, which is not a navigation of this page at all;\n * - a `POST` form, which is a submission and the server's to answer (a `GET` form carries its fields in the\n * URL, has no `formData`, and soft-navigates like any other link);\n * - a link marked `data-native`, the documented opt-out;\n * - a destination that names a file — see {@link namesAFile}.\n */\nfunction leaveToBrowser(event: NavigateEvent): boolean {\n return (\n event.hashChange ||\n event.downloadRequest !== null ||\n event.formData !== null ||\n event.sourceElement?.hasAttribute('data-native') === true ||\n namesAFile(event.destination.url)\n );\n}\n\n/**\n * The whole router, in one listener.\n *\n * Every navigation the page can make arrives as a `navigate` event — a link click, a `GET` form, a\n * `history.pushState`, the back button, `navigation.reload()` — already filtered by the browser: it does not\n * fire for a middle-click, a modified click or a new tab, and reports `canIntercept: false` for anything\n * cross-origin, or for a traversal that leaves the app. Those need no handling here; they are left alone, and\n * the browser performs them as it always would.\n */\nfunction listenNavigation(): () => void {\n if (!canSoftNavigate) return () => {};\n\n const onNavigate = (event: NavigateEvent) => {\n // A document navigation the runtime asked for itself, marked through `info`. Checked before the scroll\n // snapshot: the document is going away, so where its entry was left does not matter, and an unrelated\n // later navigation can never be mistaken for this one.\n if (event.info === documentNavigation) return;\n\n // Whatever the browser is about to do with this navigation, the entry it is leaving is about to lose the\n // offset it was at, and nothing else in this document will put it back. Saved before the branches below\n // return, so a fragment the browser performs itself is covered too.\n rememberCurrentScroll();\n\n if (!event.canIntercept || leaveToBrowser(event)) return;\n\n // A traversal is repainted by the `popstate` listener below, not intercepted. `intercept`ing one is what\n // makes WebKit stall the rendered viewport for about three seconds on a back swipe\n // (bugs.webkit.org/319414): the view gesture's snapshot is only removed once the navigation finishes, and\n // React's root attaches the wheel listener the bug also needs. Letting the traversal through means the\n // browser commits the entry straight away, and the runtime puts the payload on screen when it arrives.\n if (event.navigationType === 'traverse') return;\n\n // A replace or a refresh stays where it is, so neither should move. A push starts at the top of the\n // page, or at its fragment — and that scroll is the runtime's own now: WebKit performs no\n // `after-transition` reset at all for an intercepted push (bugs.webkit.org/304593). Chromium skips it\n // too, and a fragment jump rides the same code path. Passing `manual` here makes the browser hand the\n // handler over without scrolling; the `afterCommit` callback reaches the target once the new tree is on\n // screen. Focus stays the browser's, reset after the transition.\n const inPlace = event.navigationType === 'replace' || event.navigationType === 'reload';\n let afterCommit: (() => void) | undefined;\n if (event.navigationType === 'push') {\n const { hash } = new URL(event.destination.url);\n afterCommit = hash === '' ? scrollToTop : () => jumpToAnchor(hash);\n }\n\n event.intercept({\n scroll: 'manual',\n focusReset: inPlace ? 'manual' : 'after-transition',\n // The URL commits before the handler runs, so a failure leaves the address bar describing a page the\n // document is not showing. A real load is the only way back to agreement.\n handler: () => loadPayload(event.destination.url, event.signal, afterCommit).catch(() => loadDocument()),\n });\n };\n\n /**\n * Repaints a traversal the listener above deliberately left to the browser, and moves the viewport back\n * where the entry was left. `popstate` fires after the browser has committed the entry, so the destination\n * is `navigation.currentEntry` and its saved offset is in {@link scrollPositions}.\n */\n const onPopState = () => {\n const stored = scrollPointFor(currentEntryKey());\n const hash = location.hash;\n const apply = () => {\n if (stored) scrollToPoint(stored);\n else if (hash !== '') jumpToAnchor(hash);\n else scrollToTop();\n };\n\n // A fragment-only traversal never changed the payload: the address bar is back at an anchor of the page\n // already on screen, so there is nothing to fetch and nothing to wait for. The browser's own restoration\n // is off, so the offset comes from what `onNavigate` saved when the anchor was followed; no focus reset,\n // which is what leaving those navigations to the browser has always meant.\n if (documentUrl() === renderedUrl) {\n apply();\n return;\n }\n\n void loadPayload(location.href, undefined, () => {\n apply();\n // The browser performs this for an intercepted navigation; a traversal is no longer intercepted, so\n // without it Back would leave focus on the link that was clicked on the page being left.\n resetFocus();\n }).catch(() => loadDocument());\n };\n\n navigation.addEventListener('navigate', onNavigate);\n window.addEventListener('popstate', onPopState);\n return () => {\n navigation.removeEventListener('navigate', onNavigate);\n window.removeEventListener('popstate', onPopState);\n };\n}\n\nasync function main() {\n // The assertion is load-bearing under the compiler that builds this: TypeScript 7 declares `nonce` on\n // HTMLElement, 6 declares it on Element. ESLint runs the older lib — where the narrowing is redundant —\n // so it reports an assertion that `tsc` requires. Believe `typecheck`, not the rule.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const cspMeta = document.querySelector('meta[property=\"csp-nonce\"]') as HTMLMetaElement | null;\n if (cspMeta?.nonce) __webpack_nonce__ = cspMeta.nonce;\n\n const initialPayload = await createFromReadableStream<RscPayload>(flightStream);\n\n // The recovery reload landed: this document *is* the `notFound` page, so the signal that could only be a\n // digest on the `RSC: 1` request became a real 404 on the document request. The one-reload bound was spent\n // on a recovery that worked and has to be released — otherwise the *next* soft navigation to this URL sees a\n // spent key and paints {@link showLateNotFound} over a page the app can still render.\n //\n // This is the discriminator the bound was missing. A structurally late `notFound()` commits its 200 before\n // it signals, so its reloaded document is the page itself and carries no `notFound`: the key survives and\n // that loop stays bounded at one reload, which is the whole reason the bound exists.\n if (initialPayload.notFound) {\n try {\n sessionStorage.removeItem(lateNotFoundKey());\n } catch {\n // Blocked site data. `reloadOnceForLateNotFound` already treats that as the terminating case.\n }\n }\n\n // Everything the last document saved, read before any payload commits: the in-memory map alone would not\n // survive the reload that `history.scrollRestoration = 'manual'` just stopped the browser restoring. The\n // entry's key is stable across a reload, and the offset is applied by `BrowserRoot`'s first layout effect,\n // before the first paint of the new tree.\n if (canSoftNavigate) readStoredScrollPositions();\n const restored = scrollPointFor(currentEntryKey());\n\n function BrowserRoot() {\n const [payload, setPayloadState] = React.useState(initialPayload);\n const [pending, startTransition] = React.useTransition();\n // The payload the last `setPayload` put on screen or on its way there, so `reapplyPayload` re-renders\n // that one rather than a payload a later navigation or action has already replaced.\n const currentPayload = React.useRef<RscPayload>(initialPayload);\n // The resolver the payload on screen still owes — see {@link loadPayload}.\n const pendingCommit = React.useRef<(() => void) | null>(null);\n // The scroll the payload about to commit owes, set with it so a payload that supersedes another takes\n // its predecessor's scroll out of the queue along with its commit. Initialised with the reload's offset:\n // the first layout effect below applies it with the first payload, before the new tree is painted.\n const pendingScroll = React.useRef<(() => void) | null>(restored ? () => scrollToPoint(restored) : null);\n\n // Descendant passive effects can start a navigation before the root's passive effects run.\n // Install the live payload setter and transition runner before any such navigation starts.\n React.useLayoutEffect(() => {\n setPayload = (next, afterCommit) => {\n currentPayload.current = next;\n return new Promise<void>((resolve) => {\n // A payload replaced before it ever painted still has a navigation waiting on it. React commits\n // only the newest, so the effect below never runs for the one it skipped: release it here.\n pendingCommit.current?.();\n pendingCommit.current = resolve;\n // Replaced rather than kept: a server action's payload carries no `afterCommit`, and the\n // navigation it superseded must not scroll the page the action is about to replace it with.\n pendingScroll.current = afterCommit ?? null;\n setPayloadState(next);\n });\n };\n // A re-dispatch of the payload above, for the retry in `loadPayload`: keeping `pendingCommit` and\n // `pendingScroll` in place means the navigation already waiting resolves when this render commits,\n // not when the retry runs.\n reapplyPayload = () => setPayloadState(currentPayload.current);\n startNav = (run) => startTransition(run);\n }, [startTransition]);\n\n /**\n * Performs the pending scroll and releases the navigation waiting on this payload. A layout effect, so\n * the new tree is in the DOM and the pre-scroll position is never painted.\n */\n React.useLayoutEffect(() => {\n const scroll = pendingScroll.current;\n pendingScroll.current = null;\n scroll?.();\n // What the payload that just committed was rendered for — see {@link renderedUrl}. A redirect never\n // reaches here, and an action or a dev refresh keeps the URL it was fetched for.\n renderedUrl = documentUrl();\n const commit = pendingCommit.current;\n pendingCommit.current = null;\n commit?.();\n }, [payload]);\n\n // A descendant may navigate from its first passive effect. Intercept it before that effect runs.\n React.useLayoutEffect(() => listenNavigation(), []);\n\n const router = React.useMemo<NavigationRouter>(() => ({ push, replace, back, forward, refresh, pending }), [pending]);\n\n return <RouterContext.Provider value={router}>{payload.root}</RouterContext.Provider>;\n }\n\n setServerCallback(async (id, args) => {\n const temporaryReferences = createTemporaryReferenceSet();\n // The document the action is being called from. Every action response carries a fresh payload for that\n // page, so if a navigation has moved on by the time it arrives the payload describes a page the user has\n // left — the return value is still theirs, but painting it is not. Compared without the fragment, which\n // the server never saw.\n const calledFrom = documentUrl();\n const request = createRscRequest(window.location.href, {\n id,\n body: await encodeReply(args, { temporaryReferences }),\n });\n let payload: RscPayload;\n try {\n payload = await createFromFetch<RscPayload>(payloadResponse(request), { temporaryReferences });\n } catch (error) {\n if (handleControlDigest(error)) return undefined;\n throw error;\n }\n if (payload.redirect) {\n push(payload.redirect);\n return undefined;\n }\n if (documentUrl() === calledFrom) React.startTransition(() => void setPayload(payload));\n if (payload.notFound) return undefined;\n const result = payload.returnValue;\n if (!result) {\n // A payload that is not this action's own reply: the server rendered a page in its place. An action\n // that had already run has its result carried across (see `actionResults` in entry.rsc.tsx), and the\n // ways a *caller* can get a request wrong are refused ahead of any render — an unknown id or an\n // undecodable body is a `text/plain` 400, which `payloadResponse` turns into an error of its own\n // before this.\n //\n // What is left is the server failing before the action ran, which is answered with the `error` page —\n // a flight payload, so it arrives here rather than at `payloadResponse`, with no `returnValue` in it.\n // A module the deployment no longer holds is the reachable case: `loadServerAction` throws, the\n // framework reports it and 500s, and this is what the caller has to go on. Hence the message: the\n // failure is on the server and its log is where the error is. Below that it is still the defensive\n // floor for a payload shaped by another deployment or replaced by a proxy — reading `.ok` off it used\n // to hand the caller `Cannot read properties of undefined`.\n throw new Error(\n '[rshono] the server action produced no result — the request failed around it and the server answered with a page instead. Its log has the error.',\n );\n }\n if (!result.ok) throw result.error;\n return result.value;\n });\n\n // A `redirect()` / `notFound()` from a component below the page root reaches us through React: it rides the\n // flight payload as an error, and boundaries re-throw it so it lands here rather than in a fallback.\n //\n // Installing these hooks opts out of React's own defaults, so everything that isn't a control signal has to\n // be put back by hand — `reportError` rather than a bare log, so error-reporting tools still see it.\n hydrateRoot(document, <BrowserRoot />, {\n formState: initialPayload.formState,\n onCaughtError: (error, errorInfo) => {\n if (handleControlDigest(error, { hard: true })) return;\n // A boundary handled it and the tree is intact, so no overlay over the app's own fallback.\n console.error(error, errorInfo.componentStack ?? '');\n },\n onUncaughtError: (error, errorInfo) => {\n if (handleControlDigest(error, { hard: true })) return;\n // Nothing caught it, so React tears the root down — and the root is `document`.\n globalThis.reportError(error);\n showFatal(error, errorInfo.componentStack);\n },\n });\n\n if (import.meta.webpackHot) {\n initDevRefresh();\n }\n}\n\n/**\n * Dev-only refresh client, listening to the CLI's SSE endpoint:\n *\n * client-built → hot-apply the waiting updates; anything the page can't be patched up to reloads.\n * rsc-update → server component code changed: re-fetch the flight payload, state preserved.\n * hello → sent on (re)connect with the latest build hash; a mismatch means a missed event.\n */\nfunction initDevRefresh() {\n const hot = import.meta.webpackHot!;\n let connectedOnce = false;\n /** The newest build the dev server has announced — what {@link applyClientUpdate} walks towards. */\n let targetHash: string | undefined;\n\n function reload(reason: string, error?: unknown): void {\n console.warn(`[rshono] ${reason} — reloading`, ...(error === undefined ? [] : [error]));\n loadDocument();\n }\n\n async function applyClientUpdate(): Promise<void> {\n const giveUp = await walkHotUpdates(\n hot,\n () => __webpack_hash__,\n () => targetHash,\n );\n if (giveUp) reload(giveUp.reason, giveUp.error);\n }\n\n async function handle(message: DevMessage): Promise<void> {\n switch (message.type) {\n case 'hello':\n targetHash = message.hash ?? targetHash;\n if (connectedOnce) {\n await applyClientUpdate();\n await loadPayload(window.location.href).catch(() => loadDocument());\n }\n connectedOnce = true;\n break;\n case 'client-built':\n targetHash = message.hash;\n await applyClientUpdate();\n break;\n case 'rsc-update':\n console.log('[rshono] server components updated');\n await loadPayload(window.location.href).catch(() => loadDocument());\n break;\n }\n }\n\n const source = new EventSource('/_rshono/hmr');\n // Chained rather than handled as they arrive: `hot.check` may only run from `idle`, and a burst of saves\n // puts several frames on the wire inside the time one takes. Queueing drops nothing, because `targetHash`\n // is shared — whichever handler runs next walks to the newest build.\n let queue: Promise<void> = Promise.resolve();\n source.onmessage = (event: MessageEvent<string>) => {\n const message = JSON.parse(event.data) as DevMessage;\n queue = queue.then(() => handle(message)).catch((error) => reload('the dev client failed', error));\n };\n}\n\n// A bootstrap failure — a truncated initial payload, most likely — would otherwise be an unhandled\n// rejection: nothing hydrates, nothing is reported, and the page just sits there.\nmain().catch((error) => {\n console.error('[rshono] the client runtime failed to start:', error);\n showFatal(error);\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ export function loadEnvFiles(rootDir) {
4
+ for (const file of ['.env.local', '.env']) {
5
+ const envPath = join(rootDir, file);
6
+ if (existsSync(envPath))
7
+ process.loadEnvFile(envPath);
8
+ }
9
+ }
10
+ //# sourceMappingURL=load-env.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rshono/core",
3
- "version": "1.0.0-rc.25",
3
+ "version": "1.0.0-rc.26",
4
4
  "description": "Minimalist web framework — Hono + Rspack + React Server Components",
5
5
  "author": "Lasse <lasse@lassetange.com> (https://www.lassetange.com)",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@hono/node-server": "^2.1.3",
55
- "@rspack/core": "2.2.7",
55
+ "@rspack/core": "2.2.8",
56
56
  "@rspack/plugin-react-refresh": "2.0.2",
57
57
  "react-refresh": "0.18.0",
58
58
  "react-server-dom-rspack": "0.1.0"