dinou 3.0.5 โ 4.0.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 +74 -1
- package/README.md +984 -883
- package/dinou/constants.js +7 -0
- package/dinou/core/asset-extensions.js +2 -2
- package/dinou/core/babel-esm-loader.js +1 -1
- package/dinou/core/babel-plugin-register-imports.js +50 -0
- package/dinou/core/build-static-pages.js +798 -135
- package/dinou/core/client-error-webpack.jsx +246 -23
- package/dinou/core/client-error.jsx +246 -23
- package/dinou/core/client-redirect.jsx +15 -0
- package/dinou/core/client-webpack.jsx +253 -10
- package/dinou/core/client.jsx +254 -10
- package/dinou/core/concurrency-manager.js +48 -0
- package/dinou/core/context-proxy.js +68 -0
- package/dinou/core/generate-static-page.js +77 -10
- package/dinou/core/generate-static-pages.js +110 -8
- package/dinou/core/generate-static-rsc.js +91 -13
- package/dinou/core/generate-static-rscs.js +103 -11
- package/dinou/core/generate-static.js +2 -2
- package/dinou/core/generating-isg.js +80 -0
- package/dinou/core/get-abs-path-with-ext.js +7 -7
- package/dinou/core/get-error-jsx.js +91 -10
- package/dinou/core/get-file-path-and-dynamic-params.js +106 -30
- package/dinou/core/get-jsx.js +88 -12
- package/dinou/core/get-ssg-jsx-or-jsx.js +7 -10
- package/dinou/core/get-ssg-jsx.js +66 -66
- package/dinou/core/get-ssg-metadata.js +39 -0
- package/dinou/core/jsx-json.js +55 -0
- package/dinou/core/link.jsx +40 -0
- package/dinou/core/navigation-utils.js +24 -0
- package/dinou/core/navigation.js +155 -0
- package/dinou/core/parse-exports.js +43 -0
- package/dinou/core/redirect.jsx +29 -0
- package/dinou/core/register-hooks.js +18 -0
- package/dinou/core/register-loader.mjs +0 -2
- package/dinou/core/render-app-to-html.js +211 -18
- package/dinou/core/render-html.js +137 -72
- package/dinou/core/render-jsx-to-client-jsx.js +10 -32
- package/dinou/core/request-context.js +38 -0
- package/dinou/core/revalidating.js +75 -22
- package/dinou/core/safe-rename.js +25 -0
- package/dinou/core/server-function-proxy-webpack.js +125 -5
- package/dinou/core/server-function-proxy.js +117 -4
- package/dinou/core/server.js +745 -84
- package/dinou/core/status-manifest.js +14 -0
- package/dinou/esbuild/build.mjs +15 -0
- package/dinou/esbuild/dev.mjs +14 -0
- package/dinou/esbuild/helpers-esbuild/get-config-esbuild-prod.mjs +1 -0
- package/dinou/esbuild/helpers-esbuild/get-config-esbuild.mjs +2 -1
- package/dinou/esbuild/helpers-esbuild/get-esbuild-entries.mjs +6 -73
- package/dinou/esbuild/helpers-esbuild/update-manifest-for-module.mjs +34 -0
- package/dinou/esbuild/plugins-esbuild/react-client-manifest-plugin.mjs +22 -16
- package/dinou/esbuild/plugins-esbuild/server-functions-plugin.mjs +29 -48
- package/dinou/esbuild/react-refresh/esm-hmr-plugin.mjs +94 -34
- package/dinou/index.d.ts +316 -0
- package/dinou/index.js +16 -0
- package/dinou/rollup/rollup-plugins/rollup-plugin-react-client-manifest.js +23 -44
- package/dinou/rollup/rollup-plugins/rollup-plugin-server-functions.js +31 -39
- package/dinou/rollup/rollup.config.js +67 -2
- package/dinou/webpack/helpers/get-webpack-entries.js +4 -7
- package/dinou/webpack/loaders/server-functions-loader.js +59 -53
- package/dinou/webpack/plugins/server-functions-plugin.js +74 -36
- package/dinou/webpack/webpack.config.js +76 -17
- package/package.json +10 -6
- package/dinou/core/get-static-paths.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,82 @@ 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
|
+
## [4.0.0]
|
|
9
|
+
|
|
10
|
+
### ๐ Major Release
|
|
11
|
+
|
|
12
|
+
This release marks a significant milestone for Dinou.
|
|
13
|
+
|
|
14
|
+
**Key Highlights:**
|
|
15
|
+
|
|
16
|
+
- **Public Typed API:** Import everything directly from `dinou`.
|
|
17
|
+
- **Hybrid Rendering Engine:** Automatic static/dynamic switching (Bailout).
|
|
18
|
+
- **SPA Experience:** Soft navigation, prefetching, and client-side caching.
|
|
19
|
+
- **Security Hardening:** Context isolation in Server Functions.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### ๐ฅ Breaking Changes
|
|
24
|
+
|
|
25
|
+
- **Server Functions Context:** The `{ req, res }` object is **no longer injected** as the last argument to Server Functions.
|
|
26
|
+
- **Migration:** Use the new `getContext()` hook inside your function body to access request/response objects.
|
|
27
|
+
- **Page Props:** Pages and Layouts no longer receive `searchParams` or `query` as props.
|
|
28
|
+
- **Migration:** Use the `useSearchParams()` hook for client-side or server-side access.
|
|
29
|
+
|
|
30
|
+
### โจ Features
|
|
31
|
+
|
|
32
|
+
#### ๐ฆ Core & API
|
|
33
|
+
|
|
34
|
+
- **`dinou` Export:** Introduced the main package export containing all hooks, types, and utilities.
|
|
35
|
+
- **`getContext()`:** New synchronous utility function to safely access `req` (cookies, headers, query) and `res` (cookie setting, redirects) within Server Components and Server Functions.
|
|
36
|
+
- **Universal `redirect()`:** Intelligent redirect helper that performs an HTTP 307 on the server (hard navigation) and a router replacement on the client (soft navigation).
|
|
37
|
+
|
|
38
|
+
#### โก Rendering & Performance
|
|
39
|
+
|
|
40
|
+
- **ISG (Incremental Static Generation):** New pages can now be generated on-demand after build time.
|
|
41
|
+
- **Automatic Bailout:** The engine now automatically opts out of static generation if dynamic APIs (cookies, headers, searchParams) are accessed during render.
|
|
42
|
+
- **Async `getStaticPaths`:** `getStaticPaths` in page functions can now be asynchronous, allowing for database-driven static paths.
|
|
43
|
+
- **ISR Fixes:** Complete overhaul of the Incremental Static Regeneration system for reliability.
|
|
44
|
+
|
|
45
|
+
#### ๐งญ Routing & Navigation
|
|
46
|
+
|
|
47
|
+
- **Soft Navigation (SPA):** Full client-side router implementation. Navigating between pages no longer triggers a full browser refresh.
|
|
48
|
+
- **`<Link>` Component:** New component with built-in:
|
|
49
|
+
- **Prefetching:** Loads data on hover.
|
|
50
|
+
- **Freshness Control:** `fresh` prop to bypass cache.
|
|
51
|
+
- **Scroll Management:** Intelligent scroll restoration.
|
|
52
|
+
- **Nested Dynamic Routes:** Support for complex nested dynamic patterns (e.g., `/shop/[category]/[product]`).
|
|
53
|
+
- **New Hooks:**
|
|
54
|
+
- `useRouter()`: Programmatic navigation (`push`, `replace`, `back`, `forward`, `refresh`).
|
|
55
|
+
- `usePathname()`: Reactive current path access.
|
|
56
|
+
- `useSearchParams()`: Reactive query string access.
|
|
57
|
+
- `useNavigationLoading()`: Global navigation state for loading indicators.
|
|
58
|
+
- **`ClientRedirect`:** Component for immediate client-side redirection on mount.
|
|
59
|
+
|
|
60
|
+
### ๐ก๏ธ Security
|
|
61
|
+
|
|
62
|
+
- **Context Isolation:** Removed implicit context passing to prevent accidental leakage of sensitive request data in Server Functions.
|
|
63
|
+
- **Typed Headers & Cookies:** `getContext().req.headers` and `cookies` are now fully typed and read-only by default to enforce security best practices.
|
|
64
|
+
|
|
65
|
+
### ๐ Fixed
|
|
66
|
+
|
|
67
|
+
- **Static Generation:** Fixed `collectPages` (buildStaticPages) to correctly identify and generate nested dynamic routes.
|
|
68
|
+
- **Dynamic Parameters:** Fixed `getFilePathAndDynamicParams` logic to correctly resolve complex nested slugs and catch-all routes.
|
|
69
|
+
- **RSC Stream:** Corrected handling of `BigInt` and `Map` types during the RSC stream transfer.
|
|
70
|
+
|
|
71
|
+
### ๐งช Testing
|
|
72
|
+
|
|
73
|
+
- **E2E Suite:** Introduced a comprehensive End-to-End test suite using **Playwright** to ensure framework stability across routing, rendering, and hydration scenarios.
|
|
74
|
+
|
|
75
|
+
## [3.0.6]
|
|
76
|
+
|
|
77
|
+
### Security
|
|
78
|
+
|
|
79
|
+
- Fix: Use fixes from React versions 19.2.3 and improve security of server function endpoint.
|
|
80
|
+
|
|
8
81
|
## [3.0.5]
|
|
9
82
|
|
|
10
|
-
|
|
83
|
+
### Security
|
|
11
84
|
|
|
12
85
|
- Fix: set minimum version for react-server-dom-webpack to 19.2.1.
|
|
13
86
|
|