@rangojs/router 0.0.0-experimental.preview.1774295612 → 0.0.0-experimental.preview.1774295854

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.
@@ -1745,7 +1745,7 @@ import { resolve } from "node:path";
1745
1745
  // package.json
1746
1746
  var package_default = {
1747
1747
  name: "@rangojs/router",
1748
- version: "0.0.0-experimental.preview.1774295612",
1748
+ version: "0.0.0-experimental.preview.1774295854",
1749
1749
  description: "Django-inspired RSC router with composable URL patterns",
1750
1750
  keywords: [
1751
1751
  "react",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.preview.1774295612",
3
+ "version": "0.0.0-experimental.preview.1774295854",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -141,15 +141,25 @@ export async function initBrowserApp(
141
141
  initialTheme,
142
142
  } = options;
143
143
 
144
+ // Dev-only: create debug channel for SSR hydration.
145
+ // The debugId was injected into the bootstrap script by the SSR handler.
146
+ // By now the server is done writing — the relay has all debug data buffered.
147
+ // Creating the channel sends "ready" which triggers an immediate flush.
148
+ const ssrDebugId = (globalThis as any).__RANGO_DEBUG_ID__ as
149
+ | string
150
+ | undefined;
151
+ const ssrDebugChannel =
152
+ ssrDebugId && (import.meta as any).hot
153
+ ? createClientDebugChannel(ssrDebugId)
154
+ : undefined;
155
+
144
156
  // Load initial payload from SSR-injected __FLIGHT_DATA__
145
- // Note: debug channel is NOT used for hydration. The WS transport is
146
- // unreliable during initial page load (JS loads after server finishes
147
- // rendering, so the "ready" signal arrives too late and chunks are dropped).
148
- // If createFromReadableStream hangs on a stalled debug stream, the entire
149
- // app never initializes — blocking all subsequent SPA navigations.
150
- // Server Component tracks are available for SPA navigations instead.
151
- const initialPayload =
152
- await deps.createFromReadableStream<RscPayload>(rscStream);
157
+ const initialPayload = await deps.createFromReadableStream<RscPayload>(
158
+ rscStream,
159
+ ssrDebugChannel
160
+ ? { debugChannel: ssrDebugChannel, findSourceMapURL }
161
+ : undefined,
162
+ );
153
163
 
154
164
  // Extract themeConfig and initialTheme from payload if not explicitly provided
155
165
  // This allows virtual entries to work without importing the router