@timber-js/app 0.2.0-alpha.16 → 0.2.0-alpha.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-entry.d.ts","sourceRoot":"","sources":["../../src/server/ssr-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA6BH;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qEAAqE;IACrE,SAAS,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACvC;;;0DAGsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;iFAE6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;4DACwD;IACxD,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,QAAQ,CAAC,CA4EnB;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ssr-entry.d.ts","sourceRoot":"","sources":["../../src/server/ssr-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA6BH;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qEAAqE;IACrE,SAAS,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACvC;;;0DAGsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;iFAE6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;4DACwD;IACxD,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,EACrC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,QAAQ,CAAC,CAoFnB;AAED,eAAe,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-render.d.ts","sourceRoot":"","sources":["../../src/server/ssr-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB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E,cAAc,CAAC,UAAU,CAAC,EACtC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,OAAO,GACvB,QAAQ,CASV"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.16",
3
+ "version": "0.2.0-alpha.18",
4
4
  "description": "Vite-native React framework for Cloudflare Workers — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -137,7 +137,9 @@ export async function handleSsr(
137
137
  // createFromReadableStream resolves client component references
138
138
  // (from "use client" modules) using the SSR environment's module
139
139
  // map, importing the actual components for server-side rendering.
140
+ const _s0 = performance.now();
140
141
  const element = createFromReadableStream(rscStream) as React.ReactNode;
142
+ const _s1 = performance.now();
141
143
 
142
144
  // Wrap with a server-safe nuqs adapter so that 'use client' components
143
145
  // that call nuqs hooks (useQueryStates, useQueryState) can SSR correctly.
@@ -145,6 +147,7 @@ export async function handleSsr(
145
147
  // over after hydration. This provider supplies the request's search params
146
148
  // as a static snapshot so nuqs renders the right initial values on the server.
147
149
  const wrappedElement = withNuqsSsrAdapter(navContext.searchParams, element);
150
+ const _s2 = performance.now();
148
151
 
149
152
  // Render to HTML stream (waits for onShellReady).
150
153
  // Pass bootstrapScriptContent so React injects a non-deferred <script>
@@ -174,10 +177,15 @@ export async function handleSsr(
174
177
  );
175
178
  }
176
179
 
180
+ const _s3 = performance.now();
177
181
  // Inject metadata into <head>, then interleave RSC payload chunks
178
182
  // into the body as they arrive from the tee'd RSC stream.
179
183
  let outputStream = injectHead(htmlStream, navContext.headHtml);
180
184
  outputStream = injectRscPayload(outputStream, navContext.rscStream);
185
+ const _s4 = performance.now();
186
+
187
+ // eslint-disable-next-line no-console
188
+ console.log(`[ssr] decode=${(_s1 - _s0).toFixed(1)}ms nuqs=${(_s2 - _s1).toFixed(1)}ms renderToStream=${(_s3 - _s2).toFixed(1)}ms transforms=${(_s4 - _s3).toFixed(1)}ms total=${(_s4 - _s0).toFixed(1)}ms`);
181
189
 
182
190
  // Build and return the Response.
183
191
  return buildSsrResponse(outputStream, navContext.statusCode, navContext.responseHeaders);
@@ -56,6 +56,7 @@ export async function renderSsrStream(
56
56
  options?: { bootstrapScriptContent?: string; deferSuspenseFor?: number; signal?: AbortSignal }
57
57
  ): Promise<ReadableStream<Uint8Array>> {
58
58
  const signal = options?.signal;
59
+ const _r0 = performance.now();
59
60
  const stream = await renderToReadableStream(element, {
60
61
  bootstrapScriptContent: options?.bootstrapScriptContent || undefined,
61
62
  signal,
@@ -66,6 +67,9 @@ export async function renderSsrStream(
66
67
  console.error('[timber] SSR render error:', formatSsrError(error));
67
68
  },
68
69
  });
70
+ const _r1 = performance.now();
71
+ // eslint-disable-next-line no-console
72
+ console.log(`[ssr-render] renderToReadableStream onShellReady=${(_r1 - _r0).toFixed(1)}ms`);
69
73
 
70
74
  // Prevent unhandled promise rejection from streaming-phase errors.
71
75
  // React DOM Server exposes `allReady` — a promise that resolves when