dinou 9.0.3 → 9.2.0
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 +24 -0
- package/README.md +520 -503
- package/dinou/cli.js +1 -1
- package/dinou/core/bailout-proxy.js +2 -2
- package/dinou/core/build-static-pages.js +2 -0
- package/dinou/core/cache-revalidate.js +77 -10
- package/dinou/core/cache-slot.js +176 -50
- package/dinou/core/get-jsx.js +405 -333
- package/dinou/core/handler.js +3078 -2983
- package/dinou/core/no-dynamic.js +25 -0
- package/dinou/core/ppr-context.js +500 -256
- package/dinou/core/ppr-runtime.js +660 -540
- package/dinou/core/render-jsx-to-client-jsx.js +576 -44
- package/dinou/core/rsc-renderer.js +3 -0
- package/dinou/esbuild/helpers-esbuild/swc-disk-cache.js +242 -242
- package/dinou/esbuild/plugins-esbuild/server-functions-plugin.js +253 -253
- package/dinou/esbuild/react-refresh/esm-hmr/client.js +209 -209
- package/dinou/index.d.ts +10 -0
- package/dinou/index.js +3 -0
- package/dinou/node/dev.js +2866 -2853
- package/dinou/package.json +4 -4
- package/dinou/rollup/react-refresh/esm-hmr/client.js +220 -220
- package/dinou/rollup/rollup-plugins/rollup-plugin-server-functions.js +182 -182
- package/dinou/server.d.ts +39 -0
- package/dinou/server.js +6 -0
- package/dinou/webpack/loaders/server-functions-loader.js +101 -101
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ 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
|
+
## [9.2.0] - 2026-11-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **React 19 Synchronous Server Component `useId()` & Stateless Hooks Support**: Implemented a deterministic Server Hooks dispatcher (`DinouServerHooksDispatcher`) supporting React 19's official synchronous Server Component hooks (`useId`, `use`, `useMemo`, `useCallback`, `useDebugValue`, and the React Compiler's `useMemoCache`) across all rendering modes (`dev`, Node.js AOT Dual-Bundle, Bun, Deno, Cloudflare Workers, and Netlify):
|
|
12
|
+
- **5-Tier Hierarchical Scoped ID Engine (`useServerId`)**: Guarantees 100% hydration parity between full-document SSR (`GET /path`) and segmented RSC endpoints (`GET /____rsc_layout____/path`, `GET /____rsc_page____/path`, and `GET /____rsc_slot____/:id`) by scoping generated IDs to their exact execution boundary: `<DinouCacheSlot>` (`_slot_<id>_dS_<N>_`), `<Suspense>` / PPR Hole (`_hole_<id>_dS_<N>_`), Page segment (`_page_dS_<N>_`), Layout / Parallel `@slot` segment (`_layout_dS_<N>_`), and a request-level fallback (`_dS_<N>_`).
|
|
13
|
+
- **Dual Dispatcher Interception**: Patched React's internal dispatcher setter (`__SERVER_INTERNALS` / `__CLIENT_INTERNALS`) so both Dinou's pre-evaluation pass (`asyncRenderJSXToClientJSX`) and `react-server-dom-webpack`'s live Flight streaming pass route `useId()` and `use()` through Dinou's context-aware dispatcher.
|
|
14
|
+
- **Sibling `<Suspense>` Race-Condition Immunity**: Enforces deterministic tree-order JSX traversal (`for...of`), pre-allocates `<Suspense>` boundary IDs (`layout-hole-N`, `ppr-hole-N`, `ppr-hole-N-M`), and isolates their internal `useId()` counters via `runInRuntimeDynamicHole` (evaluating eagerly during SSG/PPR/production so `ppr = false` static routes resolve into static HTML, and streaming via `<DinouSuspenseHoleBoundary>` in `dev`), preventing timer resolution order or Flight `MAX_ROW_SIZE` chunk deferrals from shifting sibling IDs.
|
|
15
|
+
- **`React.use(pendingPromise)` Replay Counter Rollback**: Snapshots and restores active scope ID counters whenever a synchronous Server Component suspends on a pending thenable via `React.use()`, ensuring re-invocations produce identical IDs without gaps.
|
|
16
|
+
- **`React.memo` & `React.forwardRef` Server Component Unwrapping**: Added support for stateless server hooks inside `React.memo`, `React.forwardRef`, and nested `React.memo(React.forwardRef(...))` Server Components across both standard RSC rendering and PPR dynamic hole streaming/splicing.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **Single-Pass Layout & Parallel `@slot` Evaluation with Error-Isolation Rollback**: Optimized `getJSX` to evaluate each `Layout` and parallel `@slot` once inside `runInLayoutSegment` using a structural children placeholder (`createLayoutChildrenPlaceholder` / `replaceLayoutChildrenPlaceholder`), rolling back segment ID and hole counters automatically if a nested layout or `@slot` throws and falls back to `error.tsx`.
|
|
20
|
+
|
|
21
|
+
## [9.1.0] - 2026-11-05
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **`noDynamic()` Opt-Out Hook for PPR Static `<Suspense>` Boundaries (`"dinou"` & `"dinou/server"`)**: Introduced the `noDynamic()` hook (exported from both `"dinou"` and `"dinou/server"` with zero `node:*` client-bundle dependencies) to opt an enclosing `<Suspense>` boundary out of becoming a Dynamic PPR Hole on `ppr = true` routes. Calling `noDynamic()` synchronously before the first `await` of an `async` Server Component resolves the boundary at build/revalidation time into `shell.html` and short-circuits its runtime execution (`0ms`) during dynamic hole streaming unless a dynamic request API (`cookies`, `headers`, `query`) is accessed later in the subtree.
|
|
25
|
+
- **Background Stale-While-Revalidate (SWR) for Static Shell `<DinouCacheSlot revalidate={N}>`**: Implemented non-blocking background SWR (`onlyRefreshSlots: true`) when a Static Shell `<DinouCacheSlot revalidate={N}>` (`N >= 1`) expires on both `ppr = false` and `ppr = true` routes. Instead of blocking the incoming request's TTFB while re-rendering the expired slot, Dinou now serves the cached `index.html` / `shell.html` (and `page.rsc` / `layout.rsc`) immediately (`0ms` TTFB) and refreshes only the expired `slot.json` and host HTML/RSC artifacts asynchronously in the background.
|
|
26
|
+
- **Unified Server Exports in `"dinou/server"`**: Exported `getContext()` and `noDynamic()` from `"dinou/server"`, and re-exported all server, route parameter, page/layout/error prop, request context, and plugin TypeScript types (`RequestContextStore`, `ResponseProxy`, `CookieOptions`, `Query`, `Cookies`, `Headers`, `PageProps`, `LayoutProps`, `ErrorProps`, `RouteParams`, `DinouRoutePattern`, `DinouRoute`, `DinouRouter`, `CleanRoutePath`, `ExtractRouteParams`, `ExtractSegmentParam`, `DinouConfig`, `DinouPlugin`, `ServerHookContext`, `NodeMiddleware`) from `dinou/server.d.ts`.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- **Default Dynamic Streaming for `async` Server Components Inside `<Suspense>` on PPR Routes (`ppr = true`)**: Refined the Partial Prerendering (`ppr = true`) mental model so that `<Suspense>` is the single boundary separating the Static Shell from Dynamic PPR Holes. On `ppr = true` routes, any `async` Server Component inside a `<Suspense>` boundary now automatically postpones at its first `await` during build time to become a Dynamic PPR Hole (`data-ppr-hole`), baking its `<Suspense fallback={...}>` into `shell.html` and streaming the resolved content at request time—without requiring explicit access to `req.cookies`, `req.headers`, `req.query`, or `revalidate={0}`. Outside `<Suspense>` (and on `ppr = false` routes), `async` Server Components continue to resolve at build time into the Static Shell.
|
|
30
|
+
- **Nesting-Order Semantics for `<Suspense>` and `<DinouCacheSlot>` in PPR Routes**: When `<Suspense>` wraps `<DinouCacheSlot>` (`<Suspense><DinouCacheSlot>...</DinouCacheSlot></Suspense>`) on a `ppr = true` route, the boundary now acts as a Cached Dynamic PPR Hole by default (unless opted out via `noDynamic()`), streaming its fallback in `shell.html` and caching `slot.json` across runtime hole streams. Conversely, when `<DinouCacheSlot>` wraps `<Suspense>` (`<DinouCacheSlot><Suspense>...</Suspense></DinouCacheSlot>`) without an outer `<Suspense>`, the slot resolves into the Static Shell (`shell.html` and `slot.json`) while preserving the inner `<Suspense>` boundary node so subsequent dynamic hole indices remain aligned.
|
|
31
|
+
|
|
8
32
|
## [9.0.3] - 2026-11-01
|
|
9
33
|
|
|
10
34
|
### Fixed
|