dinou 10.0.0 → 10.0.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [10.0.1] - 2026-11-21
9
+
10
+ ### Fixed
11
+ - **Static Export Client RSC Stream-Abort Race in Firefox (`dinou/core/client.jsx`, `dinou/core/client-webpack.jsx`)**: Buffered static-export `page.rsc` and `layout.rsc` responses into an in-memory `ArrayBuffer` (`bufferStaticExportResponse`) before handing them to React Flight's `createFromFetch`, preventing Firefox from throwing an unhandled `TypeError: Error in input stream` when a non-RSC static HTML fallback triggers `window.location.replace()` while a parallel `.rsc` response stream (such as `/layout.rsc`) is still in flight; also added `isStaticExportUnloading()` guards to `hydrateRoot`'s `onUncaughtError` and `onCaughtError` handlers alongside `onRecoverableError` (without affecting progressive streaming in server/edge modes).
12
+
8
13
  ## [10.0.0] - 2026-11-21
9
14
 
10
15
  > **Upgrading from v9?** Read the complete [Migration Guide from v9 to v10](https://dinou.dev/docs/migration/v9-to-v10) for step-by-step before/after examples and a verification checklist.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Dinou
2
2
 
3
3
  [![Documentation](https://img.shields.io/badge/docs-dinou.dev-blue?style=flat-square)](https://dinou.dev)
4
- [![Version](https://img.shields.io/badge/version-10.0.0-orange?style=flat-square)](https://www.npmjs.com/package/dinou)
4
+ [![Version](https://img.shields.io/badge/version-10.0.1-orange?style=flat-square)](https://www.npmjs.com/package/dinou)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](./LICENSE.md)
6
6
 
7
7
  **The Ejectable Full-Stack React 19 Framework.**
package/dinou/cli.js CHANGED
@@ -38,7 +38,7 @@ program
38
38
  .description(
39
39
  "Full-stack React 19 framework with native RSC, progressive streaming, and dual-mode vendoring"
40
40
  )
41
- .version("10.0.0")
41
+ .version("10.0.1")
42
42
  .option(
43
43
  "-u, --unvendorized",
44
44
  "Run with standard node_modules dependencies instead of pre-bundled vendor packages"
@@ -294,6 +294,37 @@ const isStaticExportMode = () =>
294
294
  const isStaticExportUnloading = () =>
295
295
  typeof window !== "undefined" && Boolean(window.__DINOU_STATIC_EXPORT_UNLOADING__);
296
296
 
297
+ // Static-export .rsc payloads are pre-rendered static files (not streaming SSR).
298
+ // Buffer the body into an in-memory ArrayBuffer before handing a Response to
299
+ // createFromFetch so that triggering window.location.replace() on a non-RSC
300
+ // fallback cannot abort an in-flight network ReadableStream (e.g. Firefox's
301
+ // "Error in input stream") inside React Flight's stream reader.
302
+ const bufferStaticExportResponse = (res) => {
303
+ if (isStaticExportUnloading()) {
304
+ return new Promise(() => {});
305
+ }
306
+ return res.arrayBuffer().then(
307
+ (buf) => {
308
+ if (isStaticExportUnloading()) {
309
+ return new Promise(() => {});
310
+ }
311
+ return new Response(buf, {
312
+ status: res.status,
313
+ statusText: res.statusText,
314
+ headers: {
315
+ "Content-Type": res.headers.get("content-type") || "text/x-component",
316
+ },
317
+ });
318
+ },
319
+ (err) => {
320
+ if (isStaticExportUnloading()) {
321
+ return new Promise(() => {});
322
+ }
323
+ throw err;
324
+ }
325
+ );
326
+ };
327
+
297
328
  const buildStaticExportRscUrl = (rawRouteOrKey, fileName) => {
298
329
  const withoutHash = String(rawRouteOrKey || "/").split("#")[0];
299
330
  const qIdx = withoutHash.indexOf("?");
@@ -378,6 +409,9 @@ const getPagePayload = (route, isPrefetch = false, version = 0) => {
378
409
  }
379
410
  return new Promise(() => {});
380
411
  }
412
+ if (isStaticExportUnloading()) {
413
+ return new Promise(() => {});
414
+ }
381
415
  if (
382
416
  staticExport &&
383
417
  (!res.ok ||
@@ -391,6 +425,9 @@ const getPagePayload = (route, isPrefetch = false, version = 0) => {
391
425
  }
392
426
  return new Promise(() => {});
393
427
  }
428
+ if (staticExport) {
429
+ return bufferStaticExportResponse(res);
430
+ }
394
431
  return res;
395
432
  }, (err) => {
396
433
  if (isStaticExportUnloading()) {
@@ -481,6 +518,9 @@ const getLayoutPayload = (layoutKey, searchPart = "", version = 0) => {
481
518
  ) {
482
519
  return new Promise(() => {});
483
520
  }
521
+ if (staticExport) {
522
+ return bufferStaticExportResponse(res);
523
+ }
484
524
  if (!res.ok) {
485
525
  console.warn(
486
526
  `[Dinou Router] Layout ${layoutKey} fetch returned status ${res.status}`
@@ -1109,6 +1149,24 @@ const onRecoverableError = (error) => {
1109
1149
  }
1110
1150
  };
1111
1151
 
1152
+ const onUncaughtError = (error) => {
1153
+ if (isStaticExportUnloading()) {
1154
+ return;
1155
+ }
1156
+ if (typeof reportError === "function") {
1157
+ reportError(error);
1158
+ } else {
1159
+ console.error(error);
1160
+ }
1161
+ };
1162
+
1163
+ const onCaughtError = (error) => {
1164
+ if (isStaticExportUnloading()) {
1165
+ return;
1166
+ }
1167
+ console.error(error);
1168
+ };
1169
+
1112
1170
  // If the server rendered a fatal layout error during SSR (meaning there is no layout DOM to hydrate),
1113
1171
  // do NOT attempt to hydrate the application over it.
1114
1172
  const hasInitialServerError =
@@ -1117,7 +1175,11 @@ const isLayoutError =
1117
1175
  hasInitialServerError && window.__DINOU_ERROR_SEGMENT__ !== "page";
1118
1176
 
1119
1177
  if (!isLayoutError) {
1120
- hydrateRoot(document, app, { onRecoverableError });
1178
+ hydrateRoot(document, app, {
1179
+ onRecoverableError,
1180
+ onUncaughtError,
1181
+ onCaughtError,
1182
+ });
1121
1183
  } else {
1122
1184
  console.warn(
1123
1185
  "[Dinou] Initial layout server error detected:",
@@ -294,6 +294,37 @@ const isStaticExportMode = () =>
294
294
  const isStaticExportUnloading = () =>
295
295
  typeof window !== "undefined" && Boolean(window.__DINOU_STATIC_EXPORT_UNLOADING__);
296
296
 
297
+ // Static-export .rsc payloads are pre-rendered static files (not streaming SSR).
298
+ // Buffer the body into an in-memory ArrayBuffer before handing a Response to
299
+ // createFromFetch so that triggering window.location.replace() on a non-RSC
300
+ // fallback cannot abort an in-flight network ReadableStream (e.g. Firefox's
301
+ // "Error in input stream") inside React Flight's stream reader.
302
+ const bufferStaticExportResponse = (res) => {
303
+ if (isStaticExportUnloading()) {
304
+ return new Promise(() => {});
305
+ }
306
+ return res.arrayBuffer().then(
307
+ (buf) => {
308
+ if (isStaticExportUnloading()) {
309
+ return new Promise(() => {});
310
+ }
311
+ return new Response(buf, {
312
+ status: res.status,
313
+ statusText: res.statusText,
314
+ headers: {
315
+ "Content-Type": res.headers.get("content-type") || "text/x-component",
316
+ },
317
+ });
318
+ },
319
+ (err) => {
320
+ if (isStaticExportUnloading()) {
321
+ return new Promise(() => {});
322
+ }
323
+ throw err;
324
+ }
325
+ );
326
+ };
327
+
297
328
  const buildStaticExportRscUrl = (rawRouteOrKey, fileName) => {
298
329
  const withoutHash = String(rawRouteOrKey || "/").split("#")[0];
299
330
  const qIdx = withoutHash.indexOf("?");
@@ -378,6 +409,9 @@ const getPagePayload = (route, isPrefetch = false, version = 0) => {
378
409
  }
379
410
  return new Promise(() => {});
380
411
  }
412
+ if (isStaticExportUnloading()) {
413
+ return new Promise(() => {});
414
+ }
381
415
  if (
382
416
  staticExport &&
383
417
  (!res.ok ||
@@ -391,6 +425,9 @@ const getPagePayload = (route, isPrefetch = false, version = 0) => {
391
425
  }
392
426
  return new Promise(() => {});
393
427
  }
428
+ if (staticExport) {
429
+ return bufferStaticExportResponse(res);
430
+ }
394
431
  return res;
395
432
  }, (err) => {
396
433
  if (isStaticExportUnloading()) {
@@ -481,6 +518,9 @@ const getLayoutPayload = (layoutKey, searchPart = "", version = 0) => {
481
518
  ) {
482
519
  return new Promise(() => {});
483
520
  }
521
+ if (staticExport) {
522
+ return bufferStaticExportResponse(res);
523
+ }
484
524
  if (!res.ok) {
485
525
  console.warn(
486
526
  `[Dinou Router] Layout ${layoutKey} fetch returned status ${res.status}`
@@ -1111,6 +1151,24 @@ const onRecoverableError = (error) => {
1111
1151
  }
1112
1152
  };
1113
1153
 
1154
+ const onUncaughtError = (error) => {
1155
+ if (isStaticExportUnloading()) {
1156
+ return;
1157
+ }
1158
+ if (typeof reportError === "function") {
1159
+ reportError(error);
1160
+ } else {
1161
+ console.error(error);
1162
+ }
1163
+ };
1164
+
1165
+ const onCaughtError = (error) => {
1166
+ if (isStaticExportUnloading()) {
1167
+ return;
1168
+ }
1169
+ console.error(error);
1170
+ };
1171
+
1114
1172
  // If the server rendered a fatal layout error during SSR (meaning there is no layout DOM to hydrate),
1115
1173
  // do NOT attempt to hydrate the application over it.
1116
1174
  const hasInitialServerError =
@@ -1119,7 +1177,11 @@ const isLayoutError =
1119
1177
  hasInitialServerError && window.__DINOU_ERROR_SEGMENT__ !== "page";
1120
1178
 
1121
1179
  if (!isLayoutError) {
1122
- hydrateRoot(document, app, { onRecoverableError });
1180
+ hydrateRoot(document, app, {
1181
+ onRecoverableError,
1182
+ onUncaughtError,
1183
+ onCaughtError,
1184
+ });
1123
1185
  } else {
1124
1186
  console.warn(
1125
1187
  "[Dinou] Initial layout server error detected:",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinou-ejected",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinou",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "Full-stack React 19 framework with native RSC, Server Functions, progressive streaming, and zero vendor lock-in.",
5
5
  "type": "module",
6
6
  "main": "./dinou/index.js",
@@ -35,7 +35,8 @@
35
35
  "types": "./dinou/index.d.ts",
36
36
  "scripts": {
37
37
  "test": "echo \"Error: no test specified\" && exit 1",
38
- "build:vendors": "node dinou/scripts/build-vendors.js"
38
+ "build:vendors": "node dinou/scripts/build-vendors.js",
39
+ "prepack": "node -e \"const fs=require('node:fs');const p='dinou/cli.js';const s=fs.readFileSync(p,'utf8');if(s.includes('\\r')){fs.writeFileSync(p,s.replace(/\\r\\n?/g,'\\n'),'utf8');console.log('Normalized dinou/cli.js to LF');}\""
39
40
  },
40
41
  "keywords": [
41
42
  "react",