@rangojs/router 0.0.0-experimental.8123bb7e → 0.0.0-experimental.8678bb02

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.8123bb7e",
1748
+ version: "0.0.0-experimental.8678bb02",
1749
1749
  description: "Django-inspired RSC router with composable URL patterns",
1750
1750
  keywords: [
1751
1751
  "react",
@@ -4968,11 +4968,6 @@ function performanceTracksPlugin() {
4968
4968
  });
4969
4969
  server.middlewares.use((req, _res, next) => {
4970
4970
  const existingId = req.headers[DEBUG_ID_HEADER.toLowerCase()];
4971
- const isHtml = req.headers.accept?.includes("text/html");
4972
- if (!existingId && !isHtml) {
4973
- next();
4974
- return;
4975
- }
4976
4971
  const debugId = existingId || crypto.randomUUID();
4977
4972
  if (!existingId) {
4978
4973
  const lowerName = DEBUG_ID_HEADER.toLowerCase();
@@ -4983,10 +4978,11 @@ function performanceTracksPlugin() {
4983
4978
  }
4984
4979
  registerDebugChannel(debugId);
4985
4980
  console.log(
4986
- "[perf-tracks] middleware: created channel for",
4981
+ "[perf-tracks] middleware: channel for",
4987
4982
  debugId,
4988
- "from",
4989
- existingId ? "client header" : "SSR inject"
4983
+ "url:",
4984
+ req.url?.slice(0, 60),
4985
+ existingId ? "(client)" : "(server-generated)"
4990
4986
  );
4991
4987
  next();
4992
4988
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.8123bb7e",
3
+ "version": "0.0.0-experimental.8678bb02",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -201,18 +201,12 @@ export function performanceTracksPlugin(): Plugin {
201
201
  }
202
202
  });
203
203
 
204
- // Register middleware directly (not as post-hook) so it runs
205
- // BEFORE the RSC handler the channel must exist before rendering.
204
+ // Register middleware for ALL requests create a debug channel so
205
+ // the RSC handler can attach it to renderToReadableStream.
206
206
  server.middlewares.use((req: any, _res: any, next: any) => {
207
207
  const existingId = req.headers[DEBUG_ID_HEADER.toLowerCase()] as string;
208
- const isHtml = req.headers.accept?.includes("text/html");
209
-
210
- if (!existingId && !isHtml) {
211
- next();
212
- return;
213
- }
214
-
215
208
  const debugId = existingId || crypto.randomUUID();
209
+
216
210
  if (!existingId) {
217
211
  const lowerName = DEBUG_ID_HEADER.toLowerCase();
218
212
  req.headers[lowerName] = debugId;
@@ -223,10 +217,11 @@ export function performanceTracksPlugin(): Plugin {
223
217
 
224
218
  registerDebugChannel(debugId);
225
219
  console.log(
226
- "[perf-tracks] middleware: created channel for",
220
+ "[perf-tracks] middleware: channel for",
227
221
  debugId,
228
- "from",
229
- existingId ? "client header" : "SSR inject",
222
+ "url:",
223
+ req.url?.slice(0, 60),
224
+ existingId ? "(client)" : "(server-generated)",
230
225
  );
231
226
  next();
232
227
  });