@rangojs/router 0.0.0-experimental.tapabs2 → 0.0.0-experimental.tapabs3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/src/router/match-handlers.ts +13 -0
package/dist/vite/index.js
CHANGED
|
@@ -2393,7 +2393,7 @@ import { resolve } from "node:path";
|
|
|
2393
2393
|
// package.json
|
|
2394
2394
|
var package_default = {
|
|
2395
2395
|
name: "@rangojs/router",
|
|
2396
|
-
version: "0.0.0-experimental.
|
|
2396
|
+
version: "0.0.0-experimental.tapabs3",
|
|
2397
2397
|
description: "Django-inspired RSC router with composable URL patterns",
|
|
2398
2398
|
keywords: [
|
|
2399
2399
|
"react",
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { INTERNAL_RANGO_DEBUG } from "../internal-debug.js";
|
|
2
3
|
import { sanitizeError } from "../errors";
|
|
3
4
|
import type { ErrorInfo, ErrorPhase, MatchResult } from "../types";
|
|
4
5
|
import type {
|
|
@@ -291,7 +292,13 @@ export function createMatchHandlers<TEnv = any>(
|
|
|
291
292
|
});
|
|
292
293
|
emitter.start();
|
|
293
294
|
|
|
295
|
+
const ctxBuildStart = INTERNAL_RANGO_DEBUG ? performance.now() : 0;
|
|
294
296
|
const result = await createMatchContextForFull(request, env);
|
|
297
|
+
if (INTERNAL_RANGO_DEBUG) {
|
|
298
|
+
console.log(
|
|
299
|
+
`[Server][match] context built +${Math.round(performance.now() - ctxBuildStart)}ms (abs ${Math.round(performance.now())})`,
|
|
300
|
+
);
|
|
301
|
+
}
|
|
295
302
|
|
|
296
303
|
if ("type" in result && result.type === "redirect") {
|
|
297
304
|
emitter.end(0, false);
|
|
@@ -310,7 +317,13 @@ export function createMatchHandlers<TEnv = any>(
|
|
|
310
317
|
try {
|
|
311
318
|
const state = createPipelineState();
|
|
312
319
|
const pipeline = createMatchPartialPipeline(ctx, state);
|
|
320
|
+
const pipeStart = INTERNAL_RANGO_DEBUG ? performance.now() : 0;
|
|
313
321
|
const matchResult = await collectMatchResult(pipeline, ctx, state);
|
|
322
|
+
if (INTERNAL_RANGO_DEBUG) {
|
|
323
|
+
console.log(
|
|
324
|
+
`[Server][match] pipeline collected +${Math.round(performance.now() - pipeStart)}ms (abs ${Math.round(performance.now())})`,
|
|
325
|
+
);
|
|
326
|
+
}
|
|
314
327
|
if (hasTelemetry || cacheSignalEnabled) {
|
|
315
328
|
const signalSegments = buildSignal(ctx.routeKey, state);
|
|
316
329
|
recordSignalIfEnabled(signalSegments);
|