dinou 9.0.3 → 9.1.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 CHANGED
@@ -5,6 +5,17 @@ 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.1.0] - 2026-11-05
9
+
10
+ ### Added
11
+ - **`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.
12
+ - **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.
13
+ - **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`.
14
+
15
+ ### Changed
16
+ - **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.
17
+ - **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.
18
+
8
19
  ## [9.0.3] - 2026-11-01
9
20
 
10
21
  ### Fixed