Skip to content

types for next/root-params #80618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: lubieowoce/rootparams-module
Choose a base branch
from

Conversation

lubieowoce
Copy link
Member

No description provided.

Copy link
Member Author

lubieowoce commented Jun 17, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lubieowoce lubieowoce mentioned this pull request Jun 17, 2025
@lubieowoce lubieowoce changed the title declare next/root-params as empty types for next/root-params Jun 17, 2025
@ijjk
Copy link
Member

ijjk commented Jun 17, 2025

Failing test suites

Commit: 41da255

pnpm test-dev test/e2e/app-dir/app-root-params-getters/simple.test.ts

  • app-root-param-getters - simple > should error when used in a server action
  • app-root-param-getters - simple > should error when used in a route handler (until we implement it)
Expand output

● app-root-param-getters - simple › should error when used in a server action

page.goto: net::ERR_CONNECTION_REFUSED at http://localhost:37867/en/us/server-action
Call log:
  - navigating to "http://localhost:37867/en/us/server-action", waiting until "load"

  313 |     opts?.beforePageLoad?.(page)
  314 |
> 315 |     await page.goto(url, { waitUntil: 'load' })
      |                ^
  316 |   }
  317 |
  318 |   back(options?: Parameters<Page['goBack']>[0]) {

  at Playwright.goto (lib/browsers/playwright.ts:315:16)
  at webdriver (lib/next-webdriver.ts:143:3)
  at Object.<anonymous> (e2e/app-dir/app-root-params-getters/simple.test.ts:102:21)

● app-root-param-getters - simple › should error when used in a route handler (until we implement it)

FetchError: request to http://localhost:37867/en/us/route-handler failed, reason: connect ECONNREFUSED 127.0.0.1:37867

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1491:11)

Read more about building and testing Next.js in contributing.md.

pnpm test test/integration/middleware-overrides-node.js-api/test/index.test.ts(rspack)

  • Middleware overriding a Node.js API > development mode > does not show a warning and allows overriding
Expand output

● Middleware overriding a Node.js API › development mode › does not show a warning and allows overriding

expect(received).not.toContain(expected) // indexOf

Expected substring: not "A Node.js API is used (process.cwd"
Received string:        "   No config file found
   No config file found
   ▲ Next.js 15.4.0-canary.85 (Rspack)
   - Local:        http://[::1]:39563
   - Network:      http://[::]:39563

 ✓ Starting...
   No config file found
   No config file found
 ✓ Ready in 1137ms
 ⚠ ⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 2) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21

⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 3) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21
 ⚠ ⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 2) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21

⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 3) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21
 ⚠ ⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 2) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21

⚠ MiddlewarePlugin: A Node.js API is used (process.cwd at line: 3) which is not supported in the Edge Runtime.
  │ Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  │     at buildWebpackError (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:157:19)
  │     at codeAnalyzerBySwc (/root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:385:34)
  │     at async /root/actions-runner/_work/next.js/next.js/packages/next/dist/build/webpack/plugins/middleware-plugin.js:534:21
fixed-value true
 ○ Compiling /middleware ...
"

  42 |         expect(output).not.toContain('TypeError')
  43 |         expect(output).not.toContain('A Node.js API is used (process.env')
> 44 |         expect(output).not.toContain('A Node.js API is used (process.cwd')
     |                            ^
  45 |       })
  46 |     }
  47 |   )

  at Object.toContain (integration/middleware-overrides-node.js-api/test/index.test.ts:44:28)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/app-root-params-getters/multiple-roots.test.ts (PPR)

  • app-root-param-getters - multiple roots > should add getters when new root layouts are added or renamed
Expand output

● app-root-param-getters - multiple roots › should add getters when new root layouts are added or renamed

expect(received).toBe(expected) // Object.is equality

Expected: "hello new root: {\"stuff\":\"123\"}"
Received: ""

  85 |         const params = { stuff: '123' }
  86 |         await browser.get(new URL(`/new-root/${params.stuff}`, next.url).href)
> 87 |         expect(await browser.elementByCss('p').text()).toBe(
     |                                                        ^
  88 |           `hello new root: ${JSON.stringify(params)}`
  89 |         )
  90 |       }

  at Object.toBe (e2e/app-dir/app-root-params-getters/multiple-roots.test.ts:87:56)

Read more about building and testing Next.js in contributing.md.

pnpm test-start test/e2e/app-dir/segment-cache/search-params/segment-cache-search-params.test.ts

  • segment cache (search params) > when fetching without PPR (e.g. prefetch={true}), includes the search params in the cache key
Expand output

● segment cache (search params) › when fetching without PPR (e.g. prefetch={true}), includes the search params in the cache key

thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  68 |   })
  69 |
> 70 |   it('when fetching without PPR (e.g. prefetch={true}), includes the search params in the cache key', async () => {
     |   ^
  71 |     let act: ReturnType<typeof createRouterAct>
  72 |     const browser = await next.browser('/search-params', {
  73 |       beforePageLoad(page) {

  at it (e2e/app-dir/segment-cache/search-params/segment-cache-search-params.test.ts:70:3)
  at Object.describe (e2e/app-dir/segment-cache/search-params/segment-cache-search-params.test.ts:4:1)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-rspack test/e2e/app-dir/actions/app-action-node-middleware.test.ts(rspack)

  • app-dir action handling > should forward action request to a worker that contains the action handler (edge)
Expand output

● app-dir action handling › should forward action request to a worker that contains the action handler (edge)

page.waitForSelector: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('#other-page')

  454 |   waitForElementByCss(selector: string, timeout = 10_000) {
  455 |     return this.startChain(async () => {
> 456 |       const el = await page.waitForSelector(selector, {
      |                             ^
  457 |         timeout,
  458 |         state: 'attached',
  459 |       })

  at waitForSelector (lib/browsers/playwright.ts:456:29)
  at Playwright._chain (lib/browsers/playwright.ts:568:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:549:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:455:17)
  at waitForElementByCss (e2e/app-dir/actions/app-action.test.ts:908:21)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented Jun 17, 2025

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
buildDuration 18.2s 15.4s N/A
buildDurationCached 14.6s 12.5s N/A
nodeModulesSize 439 MB 439 MB ⚠️ +186 kB
nextStartRea..uration (ms) 388ms 388ms
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
194b18f3-HASH.js gzip 54.1 kB 54.1 kB N/A
2192.HASH.js gzip 169 B 169 B
4719-HASH.js gzip 5.3 kB 5.26 kB N/A
6236-HASH.js gzip 44.9 kB 45.4 kB ⚠️ +497 B
framework-HASH.js gzip 57.4 kB 57.4 kB N/A
main-app-HASH.js gzip 257 B 262 B N/A
main-HASH.js gzip 33.3 kB 33.5 kB ⚠️ +171 B
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 78.4 kB 79.1 kB ⚠️ +668 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 182 B 182 B
amp-HASH.js gzip 501 B 503 B N/A
css-HASH.js gzip 335 B 334 B N/A
dynamic-HASH.js gzip 1.83 kB 1.83 kB N/A
edge-ssr-HASH.js gzip 256 B 255 B N/A
head-HASH.js gzip 350 B 351 B N/A
hooks-HASH.js gzip 382 B 383 B N/A
image-HASH.js gzip 4.68 kB 4.65 kB N/A
index-HASH.js gzip 259 B 258 B N/A
link-HASH.js gzip 2.52 kB 2.51 kB N/A
routerDirect..HASH.js gzip 319 B 319 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 316 B 316 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 1.5 kB 1.5 kB
Client Build Manifests
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
_buildManifest.js gzip 752 B 753 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
index.html gzip 530 B 531 B N/A
link.html gzip 544 B 544 B
withRouter.html gzip 526 B 526 B
Overall change 1.07 kB 1.07 kB
Edge SSR bundle Size
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
edge-ssr.js gzip 140 kB 140 kB N/A
page.js gzip 237 kB 237 kB N/A
Overall change 0 B 0 B
Middleware size Overall increase ⚠️
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
middleware-b..fest.js gzip 677 B 675 B N/A
middleware-r..fest.js gzip 155 B 155 B
middleware.js gzip 32.2 kB 32.6 kB ⚠️ +477 B
edge-runtime..pack.js gzip 853 B 853 B
Overall change 33.2 kB 33.6 kB ⚠️ +477 B
Next Runtimes
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
app-page-exp...dev.js gzip 292 kB 292 kB N/A
app-page-exp..prod.js gzip 163 kB 163 kB
app-page-tur...dev.js gzip 292 kB 292 kB
app-page-tur..prod.js gzip 163 kB 163 kB
app-page-tur...dev.js gzip 279 kB 279 kB N/A
app-page-tur..prod.js gzip 158 kB 158 kB
app-page.run...dev.js gzip 279 kB 279 kB N/A
app-page.run..prod.js gzip 158 kB 158 kB
app-route-ex...dev.js gzip 69.2 kB 69.2 kB
app-route-ex..prod.js gzip 47.6 kB 47.6 kB
app-route-tu...dev.js gzip 69.3 kB 69.3 kB
app-route-tu..prod.js gzip 47.6 kB 47.6 kB
app-route-tu...dev.js gzip 68.6 kB 68.6 kB
app-route-tu..prod.js gzip 47.3 kB 47.3 kB
app-route.ru...dev.js gzip 68.6 kB 68.6 kB
app-route.ru..prod.js gzip 47.3 kB 47.3 kB
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 328 B 328 B
dist_client_...dev.js gzip 320 B 320 B
dist_client_...dev.js gzip 318 B 318 B
pages-api-tu...dev.js gzip 42.5 kB 42.5 kB
pages-api-tu..prod.js gzip 31.7 kB 31.7 kB
pages-api.ru...dev.js gzip 42.4 kB 42.4 kB
pages-api.ru..prod.js gzip 31.7 kB 31.7 kB
pages-turbo....dev.js gzip 52.7 kB 52.7 kB
pages-turbo...prod.js gzip 39.1 kB 39.1 kB
pages.runtim...dev.js gzip 52.8 kB 52.8 kB
pages.runtim..prod.js gzip 39.2 kB 39.2 kB
server.runti..prod.js gzip 63.8 kB 63.8 kB
Overall change 1.8 MB 1.8 MB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js lubieowoce/root-params-types Change
0.pack gzip 3.94 MB 3.94 MB ⚠️ +6.9 kB
index.pack gzip 91 kB 90.8 kB N/A
Overall change 3.94 MB 3.94 MB ⚠️ +6.9 kB
Diff details
Diff for page.js

Diff too large to display

Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js
failed to diff
Diff for amp-HASH.js
@@ -1,56 +1,34 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [5034],
   {
-    /***/ 3960: /***/ (
+    /***/ 3870: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(5313);
+      module.exports = __webpack_require__(9298);
 
       /***/
     },
 
-    /***/ 5313: /***/ (module, exports, __webpack_require__) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "useAmp", {
-        enumerable: true,
-        get: function () {
-          return useAmp;
+    /***/ 8318: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/amp",
+        function () {
+          return __webpack_require__(8921);
         },
-      });
-      const _interop_require_default = __webpack_require__(1532);
-      const _react = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(148)
-      );
-      const _ampcontextsharedruntime = __webpack_require__(919);
-      const _ampmode = __webpack_require__(1615);
-      function useAmp() {
-        // Don't assign the context value to a variable to save bytes
-        return (0, _ampmode.isInAmpMode)(
-          _react.default.useContext(_ampcontextsharedruntime.AmpStateContext)
-        );
+      ]);
+      if (false) {
       }
-      if (
-        (typeof exports.default === "function" ||
-          (typeof exports.default === "object" && exports.default !== null)) &&
-        typeof exports.default.__esModule === "undefined"
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true,
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=amp.js.map
 
       /***/
     },
 
-    /***/ 6756: /***/ (
+    /***/ 8921: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -63,7 +41,7 @@
         /* harmony export */
       });
       /* harmony import */ var next_amp__WEBPACK_IMPORTED_MODULE_0__ =
-        __webpack_require__(3960);
+        __webpack_require__(3870);
       /* harmony import */ var next_amp__WEBPACK_IMPORTED_MODULE_0___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_amp__WEBPACK_IMPORTED_MODULE_0__
@@ -81,19 +59,41 @@
       /***/
     },
 
-    /***/ 7252: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/amp",
-        function () {
-          return __webpack_require__(6756);
+    /***/ 9298: /***/ (module, exports, __webpack_require__) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "useAmp", {
+        enumerable: true,
+        get: function () {
+          return useAmp;
         },
-      ]);
-      if (false) {
+      });
+      const _interop_require_default = __webpack_require__(1532);
+      const _react = /*#__PURE__*/ _interop_require_default._(
+        __webpack_require__(148)
+      );
+      const _ampcontextsharedruntime = __webpack_require__(326);
+      const _ampmode = __webpack_require__(9474);
+      function useAmp() {
+        // Don't assign the context value to a variable to save bytes
+        return (0, _ampmode.isInAmpMode)(
+          _react.default.useContext(_ampcontextsharedruntime.AmpStateContext)
+        );
       }
+      if (
+        (typeof exports.default === "function" ||
+          (typeof exports.default === "object" && exports.default !== null)) &&
+        typeof exports.default.__esModule === "undefined"
+      ) {
+        Object.defineProperty(exports.default, "__esModule", {
+          value: true,
+        });
+        Object.assign(exports.default, exports);
+        module.exports = exports.default;
+      } //# sourceMappingURL=amp.js.map
 
       /***/
     },
@@ -103,7 +103,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(7252)
+      __webpack_exec__(8318)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for css-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [9813],
   {
-    /***/ 1586: /***/ (
+    /***/ 2628: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/css",
         function () {
-          return __webpack_require__(4362);
+          return __webpack_require__(5892);
         },
       ]);
       if (false) {
@@ -18,14 +18,7 @@
       /***/
     },
 
-    /***/ 4350: /***/ (module) => {
-      // extracted by mini-css-extract-plugin
-      module.exports = { helloWorld: "css_helloWorld__aUdUq" };
-
-      /***/
-    },
-
-    /***/ 4362: /***/ (
+    /***/ 5892: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -39,7 +32,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5640);
       /* harmony import */ var _css_module_css__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(4350);
+        __webpack_require__(8937);
       /* harmony import */ var _css_module_css__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           _css_module_css__WEBPACK_IMPORTED_MODULE_1__
@@ -58,13 +51,20 @@
 
       /***/
     },
+
+    /***/ 8937: /***/ (module) => {
+      // extracted by mini-css-extract-plugin
+      module.exports = { helloWorld: "css_helloWorld__aUdUq" };
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1586)
+      __webpack_exec__(2628)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for dynamic-HASH.js
@@ -1,17 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [2291],
   {
-    /***/ 283: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(6990);
-
-      /***/
-    },
-
-    /***/ 505: /***/ (
+    /***/ 290: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -53,7 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       const _react = /*#__PURE__*/ _interop_require_default._(
         __webpack_require__(148)
       );
-      const _loadablecontextsharedruntime = __webpack_require__(6179);
+      const _loadablecontextsharedruntime = __webpack_require__(8452);
       function resolve(obj) {
         return obj && obj.default ? obj.default : obj;
       }
@@ -288,7 +278,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /***/
     },
 
-    /***/ 5703: /***/ (
+    /***/ 1934: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(9141);
+
+      /***/
+    },
+
+    /***/ 2598: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -303,7 +303,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5640);
       /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(283);
+        __webpack_require__(1934);
       /* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_dynamic__WEBPACK_IMPORTED_MODULE_1__
@@ -312,12 +312,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       const DynamicHello = next_dynamic__WEBPACK_IMPORTED_MODULE_1___default()(
         () =>
           __webpack_require__
-            .e(/* import() */ 2192)
-            .then(__webpack_require__.bind(__webpack_require__, 2192))
+            .e(/* import() */ 8751)
+            .then(__webpack_require__.bind(__webpack_require__, 8751))
             .then((mod) => mod.Hello),
         {
           loadableGenerated: {
-            webpack: () => [/*require.resolve*/ 2192],
+            webpack: () => [/*require.resolve*/ 8751],
           },
         }
       );
@@ -344,7 +344,24 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /***/
     },
 
-    /***/ 6179: /***/ (
+    /***/ 2976: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/dynamic",
+        function () {
+          return __webpack_require__(2598);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 8452: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -371,7 +388,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
       /***/
     },
 
-    /***/ 6990: /***/ (module, exports, __webpack_require__) => {
+    /***/ 9141: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -404,7 +421,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
         __webpack_require__(148)
       );
       const _loadablesharedruntime = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(505)
+        __webpack_require__(290)
       );
       const isServerSide = "object" === "undefined";
       // Normalize loader to return the module as form { default: Component } for `React.lazy`.
@@ -504,30 +521,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
       /***/
     },
-
-    /***/ 9254: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/dynamic",
-        function () {
-          return __webpack_require__(5703);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(9254)
+      __webpack_exec__(2976)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for hooks-HASH.js
@@ -1,24 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [9804],
   {
-    /***/ 1664: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/hooks",
-        function () {
-          return __webpack_require__(6130);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 6130: /***/ (
+    /***/ 3251: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -76,13 +59,30 @@
 
       /***/
     },
+
+    /***/ 5426: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/hooks",
+        function () {
+          return __webpack_require__(3251);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1664)
+      __webpack_exec__(5426)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for image-HASH.js

Diff too large to display

Diff for link-HASH.js
@@ -1,108 +1,116 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [4672],
   {
-    /***/ 1854: /***/ (
-      __unused_webpack_module,
-      __webpack_exports__,
-      __webpack_require__
-    ) => {
-      "use strict";
-      __webpack_require__.r(__webpack_exports__);
-      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
-        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
-        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
-        /* harmony export */
-      });
-      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
-        __webpack_require__(5640);
-      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(8770);
-      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
-        /*#__PURE__*/ __webpack_require__.n(
-          next_link__WEBPACK_IMPORTED_MODULE_1__
-        );
-
-      function aLink(props) {
-        return /*#__PURE__*/ (0,
-        react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
-          children: [
-            /*#__PURE__*/ (0,
-            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", {
-              children: "A Link page!",
-            }),
-            /*#__PURE__*/ (0,
-            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
-              next_link__WEBPACK_IMPORTED_MODULE_1___default(),
-              {
-                href: "/",
-                children: "Go to /",
-              }
-            ),
-          ],
-        });
-      }
-      var __N_SSP = true;
-      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = aLink;
-
-      /***/
-    },
-
-    /***/ 3199: /***/ (__unused_webpack_module, exports) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "errorOnce", {
-        enumerable: true,
-        get: function () {
-          return errorOnce;
-        },
-      });
-      let errorOnce = (_) => {};
-      if (false) {
-      } //# sourceMappingURL=error-once.js.map
-
-      /***/
-    },
-
-    /***/ 3568: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/link",
-        function () {
-          return __webpack_require__(1854);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 3857: /***/ (module, exports, __webpack_require__) => {
+    /***/ 606: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
         value: true,
       });
-      Object.defineProperty(exports, "getDomainLocale", {
+      Object.defineProperty(exports, "useIntersection", {
         enumerable: true,
         get: function () {
-          return getDomainLocale;
+          return useIntersection;
         },
       });
-      const _normalizetrailingslash = __webpack_require__(4869);
-      const basePath =
-        /* unused pure expression or super */ null && (false || "");
-      function getDomainLocale(path, locale, locales, domainLocales) {
-        if (false) {
-        } else {
-          return false;
+      const _react = __webpack_require__(148);
+      const _requestidlecallback = __webpack_require__(9940);
+      const hasIntersectionObserver =
+        typeof IntersectionObserver === "function";
+      const observers = new Map();
+      const idList = [];
+      function createObserver(options) {
+        const id = {
+          root: options.root || null,
+          margin: options.rootMargin || "",
+        };
+        const existing = idList.find(
+          (obj) => obj.root === id.root && obj.margin === id.margin
+        );
+        let instance;
+        if (existing) {
+          instance = observers.get(existing);
+          if (instance) {
+            return instance;
+          }
         }
+        const elements = new Map();
+        const observer = new IntersectionObserver((entries) => {
+          entries.forEach((entry) => {
+            const callback = elements.get(entry.target);
+            const isVisible =
+              entry.isIntersecting || entry.intersectionRatio > 0;
+            if (callback && isVisible) {
+              callback(isVisible);
+            }
+          });
+        }, options);
+        instance = {
+          id,
+          observer,
+          elements,
+        };
+        idList.push(id);
+        observers.set(id, instance);
+        return instance;
+      }
+      function observe(element, callback, options) {
+        const { id, observer, elements } = createObserver(options);
+        elements.set(element, callback);
+        observer.observe(element);
+        return function unobserve() {
+          elements.delete(element);
+          observer.unobserve(element);
+          // Destroy observer when there's nothing left to watch:
+          if (elements.size === 0) {
+            observer.disconnect();
+            observers.delete(id);
+            const index = idList.findIndex(
+              (obj) => obj.root === id.root && obj.margin === id.margin
+            );
+            if (index > -1) {
+              idList.splice(index, 1);
+            }
+          }
+        };
+      }
+      function useIntersection(param) {
+        let { rootRef, rootMargin, disabled } = param;
+        const isDisabled = disabled || !hasIntersectionObserver;
+        const [visible, setVisible] = (0, _react.useState)(false);
+        const elementRef = (0, _react.useRef)(null);
+        const setElement = (0, _react.useCallback)((element) => {
+          elementRef.current = element;
+        }, []);
+        (0, _react.useEffect)(() => {
+          if (hasIntersectionObserver) {
+            if (isDisabled || visible) return;
+            const element = elementRef.current;
+            if (element && element.tagName) {
+              const unobserve = observe(
+                element,
+                (isVisible) => isVisible && setVisible(isVisible),
+                {
+                  root: rootRef == null ? void 0 : rootRef.current,
+                  rootMargin,
+                }
+              );
+              return unobserve;
+            }
+          } else {
+            if (!visible) {
+              const idleCallback = (0,
+              _requestidlecallback.requestIdleCallback)(() => setVisible(true));
+              return () =>
+                (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
+            }
+          }
+          // eslint-disable-next-line react-hooks/exhaustive-deps
+        }, [isDisabled, rootMargin, rootRef, visible, elementRef.current]);
+        const resetVisible = (0, _react.useCallback)(() => {
+          setVisible(false);
+        }, []);
+        return [setElement, visible, resetVisible];
       }
       if (
         (typeof exports.default === "function" ||
@@ -114,12 +122,22 @@
         });
         Object.assign(exports.default, exports);
         module.exports = exports.default;
-      } //# sourceMappingURL=get-domain-locale.js.map
+      } //# sourceMappingURL=use-intersection.js.map
 
       /***/
     },
 
-    /***/ 3947: /***/ (module, exports, __webpack_require__) => {
+    /***/ 1148: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(2994);
+
+      /***/
+    },
+
+    /***/ 2994: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -146,17 +164,17 @@
       const _react = /*#__PURE__*/ _interop_require_wildcard._(
         __webpack_require__(148)
       );
-      const _resolvehref = __webpack_require__(3161);
-      const _islocalurl = __webpack_require__(2309);
-      const _formaturl = __webpack_require__(3768);
-      const _utils = __webpack_require__(5554);
-      const _addlocale = __webpack_require__(7591);
-      const _routercontextsharedruntime = __webpack_require__(3556);
-      const _useintersection = __webpack_require__(5624);
-      const _getdomainlocale = __webpack_require__(3857);
-      const _addbasepath = __webpack_require__(4356);
-      const _usemergedref = __webpack_require__(4985);
-      const _erroronce = __webpack_require__(3199);
+      const _resolvehref = __webpack_require__(8624);
+      const _islocalurl = __webpack_require__(6722);
+      const _formaturl = __webpack_require__(4411);
+      const _utils = __webpack_require__(1061);
+      const _addlocale = __webpack_require__(2006);
+      const _routercontextsharedruntime = __webpack_require__(2479);
+      const _useintersection = __webpack_require__(606);
+      const _getdomainlocale = __webpack_require__(4194);
+      const _addbasepath = __webpack_require__(2135);
+      const _usemergedref = __webpack_require__(6156);
+      const _erroronce = __webpack_require__(5174);
       const prefetched = new Set();
       function prefetch(router, href, as, options) {
         if (false) {
@@ -545,7 +563,108 @@
       /***/
     },
 
-    /***/ 4985: /***/ (module, exports, __webpack_require__) => {
+    /***/ 3645: /***/ (
+      __unused_webpack_module,
+      __webpack_exports__,
+      __webpack_require__
+    ) => {
+      "use strict";
+      __webpack_require__.r(__webpack_exports__);
+      /* harmony export */ __webpack_require__.d(__webpack_exports__, {
+        /* harmony export */ __N_SSP: () => /* binding */ __N_SSP,
+        /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__,
+        /* harmony export */
+      });
+      /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
+        __webpack_require__(5640);
+      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
+        __webpack_require__(1148);
+      /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
+        /*#__PURE__*/ __webpack_require__.n(
+          next_link__WEBPACK_IMPORTED_MODULE_1__
+        );
+
+      function aLink(props) {
+        return /*#__PURE__*/ (0,
+        react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
+          children: [
+            /*#__PURE__*/ (0,
+            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", {
+              children: "A Link page!",
+            }),
+            /*#__PURE__*/ (0,
+            react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
+              next_link__WEBPACK_IMPORTED_MODULE_1___default(),
+              {
+                href: "/",
+                children: "Go to /",
+              }
+            ),
+          ],
+        });
+      }
+      var __N_SSP = true;
+      /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = aLink;
+
+      /***/
+    },
+
+    /***/ 4194: /***/ (module, exports, __webpack_require__) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "getDomainLocale", {
+        enumerable: true,
+        get: function () {
+          return getDomainLocale;
+        },
+      });
+      const _normalizetrailingslash = __webpack_require__(6036);
+      const basePath =
+        /* unused pure expression or super */ null && (false || "");
+      function getDomainLocale(path, locale, locales, domainLocales) {
+        if (false) {
+        } else {
+          return false;
+        }
+      }
+      if (
+        (typeof exports.default === "function" ||
+          (typeof exports.default === "object" && exports.default !== null)) &&
+        typeof exports.default.__esModule === "undefined"
+      ) {
+        Object.defineProperty(exports.default, "__esModule", {
+          value: true,
+        });
+        Object.assign(exports.default, exports);
+        module.exports = exports.default;
+      } //# sourceMappingURL=get-domain-locale.js.map
+
+      /***/
+    },
+
+    /***/ 5174: /***/ (__unused_webpack_module, exports) => {
+      "use strict";
+
+      Object.defineProperty(exports, "__esModule", {
+        value: true,
+      });
+      Object.defineProperty(exports, "errorOnce", {
+        enumerable: true,
+        get: function () {
+          return errorOnce;
+        },
+      });
+      let errorOnce = (_) => {};
+      if (false) {
+      } //# sourceMappingURL=error-once.js.map
+
+      /***/
+    },
+
+    /***/ 6156: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -623,138 +742,19 @@
       /***/
     },
 
-    /***/ 5624: /***/ (module, exports, __webpack_require__) => {
-      "use strict";
-
-      Object.defineProperty(exports, "__esModule", {
-        value: true,
-      });
-      Object.defineProperty(exports, "useIntersection", {
-        enumerable: true,
-        get: function () {
-          return useIntersection;
-        },
-      });
-      const _react = __webpack_require__(148);
-      const _requestidlecallback = __webpack_require__(3543);
-      const hasIntersectionObserver =
-        typeof IntersectionObserver === "function";
-      const observers = new Map();
-      const idList = [];
-      function createObserver(options) {
-        const id = {
-          root: options.root || null,
-          margin: options.rootMargin || "",
-        };
-        const existing = idList.find(
-          (obj) => obj.root === id.root && obj.margin === id.margin
-        );
-        let instance;
-        if (existing) {
-          instance = observers.get(existing);
-          if (instance) {
-            return instance;
-          }
-        }
-        const elements = new Map();
-        const observer = new IntersectionObserver((entries) => {
-          entries.forEach((entry) => {
-            const callback = elements.get(entry.target);
-            const isVisible =
-              entry.isIntersecting || entry.intersectionRatio > 0;
-            if (callback && isVisible) {
-              callback(isVisible);
-            }
-          });
-        }, options);
-        instance = {
-          id,
-          observer,
-          elements,
-        };
-        idList.push(id);
-        observers.set(id, instance);
-        return instance;
-      }
-      function observe(element, callback, options) {
-        const { id, observer, elements } = createObserver(options);
-        elements.set(element, callback);
-        observer.observe(element);
-        return function unobserve() {
-          elements.delete(element);
-          observer.unobserve(element);
-          // Destroy observer when there's nothing left to watch:
-          if (elements.size === 0) {
-            observer.disconnect();
-            observers.delete(id);
-            const index = idList.findIndex(
-              (obj) => obj.root === id.root && obj.margin === id.margin
-            );
-            if (index > -1) {
-              idList.splice(index, 1);
-            }
-          }
-        };
-      }
-      function useIntersection(param) {
-        let { rootRef, rootMargin, disabled } = param;
-        const isDisabled = disabled || !hasIntersectionObserver;
-        const [visible, setVisible] = (0, _react.useState)(false);
-        const elementRef = (0, _react.useRef)(null);
-        const setElement = (0, _react.useCallback)((element) => {
-          elementRef.current = element;
-        }, []);
-        (0, _react.useEffect)(() => {
-          if (hasIntersectionObserver) {
-            if (isDisabled || visible) return;
-            const element = elementRef.current;
-            if (element && element.tagName) {
-              const unobserve = observe(
-                element,
-                (isVisible) => isVisible && setVisible(isVisible),
-                {
-                  root: rootRef == null ? void 0 : rootRef.current,
-                  rootMargin,
-                }
-              );
-              return unobserve;
-            }
-          } else {
-            if (!visible) {
-              const idleCallback = (0,
-              _requestidlecallback.requestIdleCallback)(() => setVisible(true));
-              return () =>
-                (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
-            }
-          }
-          // eslint-disable-next-line react-hooks/exhaustive-deps
-        }, [isDisabled, rootMargin, rootRef, visible, elementRef.current]);
-        const resetVisible = (0, _react.useCallback)(() => {
-          setVisible(false);
-        }, []);
-        return [setElement, visible, resetVisible];
-      }
-      if (
-        (typeof exports.default === "function" ||
-          (typeof exports.default === "object" && exports.default !== null)) &&
-        typeof exports.default.__esModule === "undefined"
-      ) {
-        Object.defineProperty(exports.default, "__esModule", {
-          value: true,
-        });
-        Object.assign(exports.default, exports);
-        module.exports = exports.default;
-      } //# sourceMappingURL=use-intersection.js.map
-
-      /***/
-    },
-
-    /***/ 8770: /***/ (
-      module,
+    /***/ 9666: /***/ (
+      __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(3947);
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/link",
+        function () {
+          return __webpack_require__(3645);
+        },
+      ]);
+      if (false) {
+      }
 
       /***/
     },
@@ -764,7 +764,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(3568)
+      __webpack_exec__(9666)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for routerDirect-HASH.js
@@ -1,7 +1,24 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [188],
   {
-    /***/ 3618: /***/ (
+    /***/ 1810: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/routerDirect",
+        function () {
+          return __webpack_require__(7989);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 7989: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -16,7 +33,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5640);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(4631);
+        __webpack_require__(9413);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_router__WEBPACK_IMPORTED_MODULE_1__
@@ -36,29 +53,12 @@
       /***/
     },
 
-    /***/ 4631: /***/ (
+    /***/ 9413: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(7086);
-
-      /***/
-    },
-
-    /***/ 7824: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/routerDirect",
-        function () {
-          return __webpack_require__(3618);
-        },
-      ]);
-      if (false) {
-      }
+      module.exports = __webpack_require__(9751);
 
       /***/
     },
@@ -68,7 +68,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(7824)
+      __webpack_exec__(1810)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for script-HASH.js
@@ -1,7 +1,17 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [1209],
   {
-    /***/ 1984: /***/ (
+    /***/ 2227: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(9765);
+
+      /***/
+    },
+
+    /***/ 3642: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +19,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/script",
         function () {
-          return __webpack_require__(5769);
+          return __webpack_require__(8034);
         },
       ]);
       if (false) {
@@ -18,7 +28,7 @@
       /***/
     },
 
-    /***/ 5769: /***/ (
+    /***/ 8034: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -33,7 +43,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5640);
       /* harmony import */ var next_script__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(8293);
+        __webpack_require__(2227);
       /* harmony import */ var next_script__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_script__WEBPACK_IMPORTED_MODULE_1__
@@ -65,23 +75,13 @@
 
       /***/
     },
-
-    /***/ 8293: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(900);
-
-      /***/
-    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(1984)
+      __webpack_exec__(3642)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for withRouter-HASH.js
@@ -1,34 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [3263],
   {
-    /***/ 4631: /***/ (
-      module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      module.exports = __webpack_require__(7086);
-
-      /***/
-    },
-
-    /***/ 9216: /***/ (
-      __unused_webpack_module,
-      __unused_webpack_exports,
-      __webpack_require__
-    ) => {
-      (window.__NEXT_P = window.__NEXT_P || []).push([
-        "/withRouter",
-        function () {
-          return __webpack_require__(9803);
-        },
-      ]);
-      if (false) {
-      }
-
-      /***/
-    },
-
-    /***/ 9803: /***/ (
+    /***/ 2148: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -43,7 +16,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5640);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(4631);
+        __webpack_require__(9413);
       /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_router__WEBPACK_IMPORTED_MODULE_1__
@@ -61,13 +34,40 @@
 
       /***/
     },
+
+    /***/ 3962: /***/ (
+      __unused_webpack_module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      (window.__NEXT_P = window.__NEXT_P || []).push([
+        "/withRouter",
+        function () {
+          return __webpack_require__(2148);
+        },
+      ]);
+      if (false) {
+      }
+
+      /***/
+    },
+
+    /***/ 9413: /***/ (
+      module,
+      __unused_webpack_exports,
+      __webpack_require__
+    ) => {
+      module.exports = __webpack_require__(9751);
+
+      /***/
+    },
   },
   /******/ (__webpack_require__) => {
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(9216)
+      __webpack_exec__(3962)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 4719-HASH.js

Diff too large to display

Diff for 6236-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Diff for app-page-exp..ntime.dev.js
failed to diff
Diff for app-page-tur..ntime.dev.js
failed to diff
Diff for app-page-tur..ntime.dev.js
failed to diff
Diff for app-page.runtime.dev.js
failed to diff
Commit: 6cf65cb

Copy link

codspeed-hq bot commented Jun 17, 2025

CodSpeed Performance Report

Merging #80618 will not alter performance

Comparing lubieowoce/root-params-types (e67bd13) with lubieowoce/rootparams-module (419702b)

Summary

✅ 9 untouched benchmarks

@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from d146b4f to 6e0bd4a Compare June 18, 2025 11:52
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 90d8729 to 76e5337 Compare June 18, 2025 11:52
@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. Rspack tests Turbopack Related to Turbopack with Next.js. type: next labels Jun 18, 2025
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 6e0bd4a to 9f4af52 Compare June 19, 2025 11:29
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 76e5337 to 41da255 Compare June 19, 2025 11:29
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 9f4af52 to 3f90bd5 Compare June 19, 2025 12:08
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 41da255 to 1674139 Compare June 19, 2025 12:08
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 3f90bd5 to c25486a Compare June 19, 2025 13:12
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch 2 times, most recently from b129141 to 68666ef Compare June 19, 2025 14:16
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from c25486a to 0fa1aa4 Compare June 19, 2025 14:16
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 68666ef to 8a43e92 Compare June 20, 2025 12:03
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch 2 times, most recently from f94f678 to f0cf3bb Compare June 20, 2025 16:10
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 8a43e92 to 34ecb17 Compare June 20, 2025 16:10
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from f0cf3bb to 0c326b8 Compare June 20, 2025 16:17
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 34ecb17 to 7b579f8 Compare June 20, 2025 16:17
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 0c326b8 to 988d8c8 Compare June 23, 2025 09:58
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 7b579f8 to 752d7e6 Compare June 23, 2025 09:58
@lubieowoce lubieowoce changed the base branch from lubieowoce/rootparams-module to graphite-base/80618 June 23, 2025 16:03
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 752d7e6 to 6cf65cb Compare June 27, 2025 11:39
@lubieowoce lubieowoce force-pushed the graphite-base/80618 branch from 988d8c8 to 48e21df Compare June 27, 2025 11:39
@lubieowoce lubieowoce changed the base branch from graphite-base/80618 to lubieowoce/rootparams-module June 27, 2025 11:39
this.app_project.collected_root_params(),
)
.await?;
server_assets.extend(type_declarations.iter());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from tobias: maybe just emit directly, writing assets might clear the require cache and this doesn't need that bc it's only types

@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 48e21df to 7b8c1f6 Compare July 9, 2025 19:11
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 6cf65cb to 6b6d73a Compare July 9, 2025 19:11
Comment on lines +34 to +50
pub enum DynamicSegmentKind {
/// e.g. `/[id]`
Dynamic,
/// e.g. `/[...slug]`
CatchAll,
/// e.g. `/[[...slug]]`
OptionalCatchAll,
}

impl DynamicSegmentKind {
fn get_typescript_type(self) -> RcStr {
match self {
Self::CatchAll => "string[]".into(),
Self::OptionalCatchAll => "string[] | undefined".into(),
Self::Dynamic => "string".into(),
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rust DynamicSegmentKind enum is missing support for intercepted route variants that exist in the TypeScript implementation, which could cause type generation inconsistencies.

📄 Review details

🔍 Technical Analysis

The Rust implementation of type generation for next/root-params defines a DynamicSegmentKind enum with only three variants: Dynamic, CatchAll, and OptionalCatchAll. However, the parallel TypeScript implementation in packages/next/src/build/webpack/loaders/next-root-params-loader.ts handles five DynamicParamTypes: 'dynamic', 'dynamic-intercepted', 'catchall', 'catchall-intercepted', and 'optional-catchall'.

This inconsistency means that if intercepted routes (like (@modal)/[id] or (@auth)/[...slug]) contain root parameters, the Rust implementation won't be able to handle them properly, while the TypeScript implementation will. This could lead to:

  1. Missing type declarations for root params in intercepted routes when using the Rust-based compiler
  2. Runtime errors if the Rust code encounters intercepted route segments it can't classify
  3. Inconsistent behavior between different build modes (dev vs prod, webpack vs turbopack)

The TypeScript implementation correctly maps intercepted variants to the same types as their non-intercepted counterparts (dynamic-interceptedstring, catchall-interceptedstring[]).


🔧 Suggested Fix

Add the missing intercepted route variants to the DynamicSegmentKind enum:

#[turbo_tasks::value]
#[derive(Debug, Hash, Copy, Clone)]
pub enum DynamicSegmentKind {
    /// e.g. `/[id]`
    Dynamic,
    /// e.g. `/(@modal)/[id]`
    DynamicIntercepted,
    /// e.g. `/[...slug]`
    CatchAll,
    /// e.g. `/(@auth)/[...slug]`
    CatchAllIntercepted,
    /// e.g. `/[[...slug]]`
    OptionalCatchAll,
}

Then update the get_typescript_type method to handle the new variants:

impl DynamicSegmentKind {
    fn get_typescript_type(self) -> RcStr {
        match self {
            Self::CatchAll | Self::CatchAllIntercepted => "string[]".into(),
            Self::OptionalCatchAll => "string[] | undefined".into(),
            Self::Dynamic | Self::DynamicIntercepted => "string".into(),
        }
    }
}

Also update the from_page_segment method to handle intercepted routes if the PageSegment enum is extended to support them.


👍 or 👎 to improve Vade.

@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 6b6d73a to 11ede39 Compare July 9, 2025 19:38
collected_root_params: Vc<CollectedRootParams>,
) -> Result<Vc<OutputAssets>> {
Ok(OutputAssets::new(vec![
// avoid TS errors if the project package.json has `"type": "module"`` set
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra backtick in a comment that should be removed.

📄 Review details

🔍 Technical Analysis

Line 18 contains a comment with an extra backtick: "module"`` should be "module"`. This is a minor formatting issue in the comment that makes it appear as if there's an unclosed backtick, which could be confusing when reading the code.


🔧 Suggested Fix

Change line 18 from:

// avoid TS errors if the project package.json has `"type": "module"`` set

to:

// avoid TS errors if the project package.json has `"type": "module"` set

👍 or 👎 to improve Vade.

@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 11ede39 to 80bdbc2 Compare July 9, 2025 19:59
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from 08e5f0c to a25e367 Compare July 9, 2025 19:59
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 80bdbc2 to 639d677 Compare July 9, 2025 20:13
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch 3 times, most recently from e6f8b73 to a125e53 Compare July 10, 2025 17:07
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from 639d677 to cb48272 Compare July 10, 2025 17:07
if we just do `declare module next/root-params`, generated declarations will not be merged with it properly --
instead, the contents will all be typed as `any`.
This isn't ideal, because it means that imports from 'next/root-params' will error before running build/dev,
but i don't currently see a better way.
@lubieowoce lubieowoce force-pushed the lubieowoce/rootparams-module branch from a125e53 to 419702b Compare July 11, 2025 13:20
@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-types branch from cb48272 to e67bd13 Compare July 11, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js team PRs by the Next.js team. Rspack tests Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants