From acd9eb53f65929ef26c629ad32a4fc3f023df6bc Mon Sep 17 00:00:00 2001 From: sleevezip Date: Fri, 13 Sep 2024 22:54:38 +0200 Subject: [PATCH 01/43] Update sitemap.mdx (#66668) added js version of 'localized sitemap', which was missing from the md --------- Co-authored-by: JJ Kasper --- .../01-metadata/sitemap.mdx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx index d361a2bec8afb..32342d172f8c2 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx @@ -201,6 +201,43 @@ export default function sitemap(): MetadataRoute.Sitemap { } ``` +```js filename="app/sitemap.js" switcher +export default function sitemap() { + return [ + { + url: 'https://acme.com', + lastModified: new Date(), + alternates: { + languages: { + es: 'https://acme.com/es', + de: 'https://acme.com/de', + }, + }, + }, + { + url: 'https://acme.com/about', + lastModified: new Date(), + alternates: { + languages: { + es: 'https://acme.com/es/about', + de: 'https://acme.com/de/about', + }, + }, + }, + { + url: 'https://acme.com/blog', + lastModified: new Date(), + alternates: { + languages: { + es: 'https://acme.com/es/blog', + de: 'https://acme.com/de/blog', + }, + }, + }, + ] +} +``` + Output: ```xml filename="acme.com/sitemap.xml" From c4ccacee8991c59e7db8d8766d02ed728bae6d76 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Fri, 13 Sep 2024 14:00:13 -0700 Subject: [PATCH 02/43] docs(ppr): Add note about canary for PPR (#70053) ## Why? Experimental PPR does not work for Next.js v14. Technically, you can try using v14 canary, but at that point, you should just be using v15 canary because both requires React v19. - Fixes https://github.com/vercel/next.js/issues/69791 --------- Co-authored-by: JJ Kasper --- docs/02-app/02-api-reference/05-next-config-js/ppr.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/ppr.mdx b/docs/02-app/02-api-reference/05-next-config-js/ppr.mdx index 85db31271f652..0e7ccd30617ed 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/ppr.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/ppr.mdx @@ -83,7 +83,7 @@ export default function Page() { ### Enabling PPR (Version 14) -For version 14, you can enable it by adding the [`ppr`](/docs/app/api-reference/next-config-js/ppr) option to your `next.config.js` file. This will apply to all routes in your application: +For version 14, you can enable it by adding the [`ppr`](/docs/app/api-reference/next-config-js/ppr) option to your `next.config.js` file. You must also be on the canary version to enable PPR. This will apply to all routes in your application: ```ts filename="next.config.ts" switcher import type { NextConfig } from 'next' @@ -108,7 +108,7 @@ const nextConfig = { module.exports = nextConfig ``` -| Version | Changes | -| --------- | ------------------------------ | -| `v15.0.0` | `incremental` value introduced | -| `v14.0.0` | experimental `ppr` introduced | +| Version | Changes | +| --------- | ------------------------------------------- | +| `v15.0.0` | experimental `incremental` value introduced | +| `v14.0.0` | experimental `ppr` introduced | From ce9c28fa2c886ff720ef76df9329136f72c77ee1 Mon Sep 17 00:00:00 2001 From: Iakhub Seitasanov Date: Sat, 14 Sep 2024 00:00:21 +0300 Subject: [PATCH 03/43] skip generating cert each time (#67122) --------- Co-authored-by: JJ Kasper --- packages/next/src/lib/mkcert.ts | 26 ++++++++++++++++--- .../https-server.generated-key.test.ts | 9 +++++++ test/lib/next-modes/base.ts | 2 -- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/packages/next/src/lib/mkcert.ts b/packages/next/src/lib/mkcert.ts index 5a2a7dc89ec7e..06eb46a369052 100644 --- a/packages/next/src/lib/mkcert.ts +++ b/packages/next/src/lib/mkcert.ts @@ -1,8 +1,9 @@ -import fs from 'fs' -import path from 'path' +import fs from 'node:fs' +import path from 'node:path' +import { X509Certificate, createPrivateKey } from 'node:crypto' import { getCacheDirectory } from './helpers/get-cache-directory' import * as Log from '../build/output/log' -import { execSync } from 'child_process' +import { execSync } from 'node:child_process' const { WritableStream } = require('node:stream/web') as { WritableStream: typeof global.WritableStream } @@ -112,6 +113,25 @@ export async function createSelfSignedCertificate( const keyPath = path.resolve(resolvedCertDir, 'localhost-key.pem') const certPath = path.resolve(resolvedCertDir, 'localhost.pem') + if (fs.existsSync(keyPath) && fs.existsSync(certPath)) { + const cert = new X509Certificate(fs.readFileSync(certPath)) + const key = fs.readFileSync(keyPath) + + if ( + cert.checkHost(host ?? 'localhost') && + cert.checkPrivateKey(createPrivateKey(key)) + ) { + Log.info('Using already generated self signed certificate') + const caLocation = execSync(`"${binaryPath}" -CAROOT`).toString().trim() + + return { + key: keyPath, + cert: certPath, + rootCA: `${caLocation}/rootCA.pem`, + } + } + } + Log.info( 'Attempting to generate self signed certificate. This may prompt for your password' ) diff --git a/test/development/experimental-https-server/https-server.generated-key.test.ts b/test/development/experimental-https-server/https-server.generated-key.test.ts index 82dc95332fe9c..c20fa2ff7864e 100644 --- a/test/development/experimental-https-server/https-server.generated-key.test.ts +++ b/test/development/experimental-https-server/https-server.generated-key.test.ts @@ -33,4 +33,13 @@ describe('experimental-https-server (generated certificate)', () => { const html = await renderViaHTTP(next.url, '/2', undefined, { agent }) expect(html).toContain('Hello from Pages') }) + + it('should successfully reuse generated certificates', async () => { + await next.stop() + await next.start() + expect(next.url).toInclude('https://') + expect(next.cliOutput).toContain( + 'Using already generated self signed certificate' + ) + }) }) diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index bfff29d05d280..ed2ff87feab2d 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -79,8 +79,6 @@ export class NextInstance { this.env = {} Object.assign(this, opts) - require('console').log('packageJson??', this.packageJson) - if (!isNextDeploy) { this.env = { ...this.env, From a449e4a176d68825e7971d83f9f6d56b214346f3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 13 Sep 2024 15:06:51 -0600 Subject: [PATCH 04/43] fix: clone response in first handler to prevent race (#70082) This fixes a race where if the body was resolved before the clone operation, it would clone later, resulting in an error being thrown due to the body already being consumed. --- packages/next/src/server/lib/patch-fetch.ts | 49 +++++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/packages/next/src/server/lib/patch-fetch.ts b/packages/next/src/server/lib/patch-fetch.ts index e109e68b363e3..09ca70a054e43 100644 --- a/packages/next/src/server/lib/patch-fetch.ts +++ b/packages/next/src/server/lib/patch-fetch.ts @@ -859,34 +859,55 @@ export function createPatchedFetcher( }) } - /** - * We used to just resolve the Response and clone it however for static generation - * with dynamicIO we need the response to be able to be resolved in a microtask - * and Response#clone() will never have a body that can resolve in a microtask in node (as observed through experimentation) - * So instead we await the body and then when it is available we construct manually - * cloned Response objects with the body as an ArrayBuffer. This will be resolvable in - * a microtask making it compatiable with dynamicIO - */ + // We used to just resolve the Response and clone it however for + // static generation with dynamicIO we need the response to be able to + // be resolved in a microtask and Response#clone() will never have a + // body that can resolve in a microtask in node (as observed through + // experimentation) So instead we await the body and then when it is + // available we construct manually cloned Response objects with the + // body as an ArrayBuffer. This will be resolvable in a microtask + // making it compatible with dynamicIO. const pendingResponse = doOriginalFetch(true, cacheReasonOverride) + const nextRevalidate = pendingResponse .then(async (response) => { + // Clone the response here. It'll run first because we attached + // the resolve before we returned below. We have to clone it + // because the original response is going to be consumed by + // at a later point in time. + const clonedResponse = response.clone() + return { - body: await response.arrayBuffer(), - headers: response.headers, - status: response.status, - statusText: response.statusText, + body: await clonedResponse.arrayBuffer(), + headers: clonedResponse.headers, + status: clonedResponse.status, + statusText: clonedResponse.statusText, } }) .finally(() => { - staticGenerationStore.pendingRevalidates ??= {} + // If the pending revalidate is not present in the store, then + // we have nothing to delete. + if ( + !staticGenerationStore.pendingRevalidates?.[ + pendingRevalidateKey + ] + ) { + return + } + delete staticGenerationStore.pendingRevalidates[ pendingRevalidateKey ] }) + + // Attach the empty catch here so we don't get a "unhandled promise + // rejection" warning nextRevalidate.catch(() => {}) + staticGenerationStore.pendingRevalidates[pendingRevalidateKey] = nextRevalidate - return (await pendingResponse).clone() + + return pendingResponse } else { return doOriginalFetch(false, cacheReasonOverride) } From e99f73622b8a734b7311bf8ab3c03a7a8d032adb Mon Sep 17 00:00:00 2001 From: SamPhillemon <55310066+Sam-Phillemon9493@users.noreply.github.com> Date: Sat, 14 Sep 2024 02:39:24 +0530 Subject: [PATCH 05/43] Update with web worker example to utilize the App Router (#70058) This PR updates the with-web-worker example to use the App Router. Here are the changes that have been made: - Renamed the `pages` folder to the `app` folder. - Updated the routing for `/` files to align with the App Router. - Added the layout.tsx file as part of the App Router. - Updated the package.json file. The following actions were performed as part of this PR: - Ran `pnpm prettier-check` with no issues found. - Executed the `pnpm check-examples` script. --------- Co-authored-by: samcx --- examples/with-web-worker/app/layout.tsx | 16 ++++++++++++++++ .../{pages/index.tsx => app/page.tsx} | 1 + examples/with-web-worker/next-env.d.ts | 2 +- examples/with-web-worker/package.json | 11 ++++++----- examples/with-web-worker/tsconfig.json | 19 +++++++++++++------ 5 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 examples/with-web-worker/app/layout.tsx rename examples/with-web-worker/{pages/index.tsx => app/page.tsx} (97%) diff --git a/examples/with-web-worker/app/layout.tsx b/examples/with-web-worker/app/layout.tsx new file mode 100644 index 0000000000000..5ff842ef07b83 --- /dev/null +++ b/examples/with-web-worker/app/layout.tsx @@ -0,0 +1,16 @@ +export const metadata = { + title: "Next.js", + description: "Generated by Next.js", +}; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + {children} + + ); +} diff --git a/examples/with-web-worker/pages/index.tsx b/examples/with-web-worker/app/page.tsx similarity index 97% rename from examples/with-web-worker/pages/index.tsx rename to examples/with-web-worker/app/page.tsx index f37ad6a744b58..e47eb34d191bc 100644 --- a/examples/with-web-worker/pages/index.tsx +++ b/examples/with-web-worker/app/page.tsx @@ -1,3 +1,4 @@ +"use client"; import { useEffect, useRef, useCallback } from "react"; export default function Index() { diff --git a/examples/with-web-worker/next-env.d.ts b/examples/with-web-worker/next-env.d.ts index a4a7b3f5cfa2f..40c3d68096c27 100644 --- a/examples/with-web-worker/next-env.d.ts +++ b/examples/with-web-worker/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/examples/with-web-worker/package.json b/examples/with-web-worker/package.json index 02e5f0e4cef7f..bf852366308a3 100644 --- a/examples/with-web-worker/package.json +++ b/examples/with-web-worker/package.json @@ -7,12 +7,13 @@ }, "dependencies": { "next": "latest", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.3.1", + "react-dom": "^18.3.1" }, "devDependencies": { - "@types/node": "18.7.18", - "@types/react": "16.9.17", - "typescript": "4.8.2" + "@types/node": "^22.5.4", + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "typescript": "^5.6.2" } } diff --git a/examples/with-web-worker/tsconfig.json b/examples/with-web-worker/tsconfig.json index 50bcb22f653d7..d8b93235f205e 100644 --- a/examples/with-web-worker/tsconfig.json +++ b/examples/with-web-worker/tsconfig.json @@ -1,20 +1,27 @@ { "compilerOptions": { - "target": "es5", + "target": "ES2017", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, - "forceConsistentCasingInFileNames": true, "noEmit": true, - "incremental": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./*"] + } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] } From 35706e30e6e35fe0acc9ed5232c77ce45dc8edd5 Mon Sep 17 00:00:00 2001 From: Yuns Date: Fri, 13 Sep 2024 22:06:25 +0000 Subject: [PATCH 06/43] fix: eslint-plugin-next glob (#68773) Closes https://github.com/vercel/next.js/issues/68752 --------- Co-authored-by: Sam Ko --- .../src/utils/get-root-dirs.ts | 6 ++-- .../no-html-link-for-pages.test.ts | 28 +++++++++++++++++++ .../demos/with-nextjs/pages/index.jsx | 1 + 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 test/unit/eslint-plugin-next/with-nested-pages-dir/demos/with-nextjs/pages/index.jsx diff --git a/packages/eslint-plugin-next/src/utils/get-root-dirs.ts b/packages/eslint-plugin-next/src/utils/get-root-dirs.ts index 9f031ff1d78b6..186684b4b1b27 100644 --- a/packages/eslint-plugin-next/src/utils/get-root-dirs.ts +++ b/packages/eslint-plugin-next/src/utils/get-root-dirs.ts @@ -5,9 +5,9 @@ import type { Rule } from 'eslint' * Process a Next.js root directory glob. */ const processRootDir = (rootDir: string): string[] => { - // Ensures we only match folders. - if (!rootDir.endsWith('/')) rootDir += '/' - return globSync(rootDir) + return globSync(rootDir, { + onlyDirectories: true, + }) } /** diff --git a/test/unit/eslint-plugin-next/no-html-link-for-pages.test.ts b/test/unit/eslint-plugin-next/no-html-link-for-pages.test.ts index fe3ac7b429203..30fec47cf8705 100644 --- a/test/unit/eslint-plugin-next/no-html-link-for-pages.test.ts +++ b/test/unit/eslint-plugin-next/no-html-link-for-pages.test.ts @@ -5,6 +5,7 @@ import assert from 'assert' import path from 'path' const withCustomPagesDirectory = path.join(__dirname, 'with-custom-pages-dir') +const withNestedPagesDirectory = path.join(__dirname, 'with-nested-pages-dir') const withoutPagesLinter = new Linter({ cwd: path.join(__dirname, 'without-pages-dir'), @@ -12,6 +13,9 @@ const withoutPagesLinter = new Linter({ const withAppLinter = new Linter({ cwd: path.join(__dirname, 'with-app-dir'), }) +const withNestedPagesLinter = new Linter({ + cwd: withNestedPagesDirectory, +}) const withCustomPagesLinter = new Linter({ cwd: withCustomPagesDirectory, }) @@ -50,6 +54,14 @@ const linterConfigWithMultipleDirectories = { ], }, } +const linterConfigWithNestedContentRootDirDirectory = { + ...linterConfig, + settings: { + next: { + rootDir: path.join(withNestedPagesDirectory, 'demos/with-nextjs'), + }, + }, +} withoutPagesLinter.defineRules({ 'no-html-link-for-pages': rule, @@ -57,6 +69,9 @@ withoutPagesLinter.defineRules({ withAppLinter.defineRules({ 'no-html-link-for-pages': rule, }) +withNestedPagesLinter.defineRules({ + 'no-html-link-for-pages': rule, +}) withCustomPagesLinter.defineRules({ 'no-html-link-for-pages': rule, }) @@ -212,6 +227,19 @@ export class Blah extends Head { ` describe('no-html-link-for-pages', function () { + it('does not print warning when there are "pages" or "app" directories with rootDir in context settings', function () { + const consoleSpy = jest.spyOn(console, 'warn').mockImplementation() + withNestedPagesLinter.verify( + validCode, + linterConfigWithNestedContentRootDirDirectory, + { + filename: 'foo.js', + } + ) + expect(consoleSpy).not.toHaveBeenCalled() + + consoleSpy.mockRestore() + }) it('prints warning when there are no "pages" or "app" directories', function () { const consoleSpy = jest.spyOn(console, 'warn').mockImplementation() withoutPagesLinter.verify(validCode, linterConfig, { diff --git a/test/unit/eslint-plugin-next/with-nested-pages-dir/demos/with-nextjs/pages/index.jsx b/test/unit/eslint-plugin-next/with-nested-pages-dir/demos/with-nextjs/pages/index.jsx new file mode 100644 index 0000000000000..ead516c976e9b --- /dev/null +++ b/test/unit/eslint-plugin-next/with-nested-pages-dir/demos/with-nextjs/pages/index.jsx @@ -0,0 +1 @@ +export default () => {} From 5732610118b39933668ea44c4ce46b25058b776b Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Fri, 13 Sep 2024 15:24:56 -0700 Subject: [PATCH 07/43] fix(create-next-app): Add ts lint rule if --empty flag (#70089) Closes: https://github.com/vercel/next.js/pull/69260 Co-authored-by: Kawahara Shotaro <121674121+k-taro56@users.noreply.github.com> --- packages/create-next-app/templates/app-empty/ts/eslintrc.json | 2 +- .../create-next-app/templates/app-tw-empty/ts/eslintrc.json | 2 +- .../create-next-app/templates/default-empty/ts/eslintrc.json | 2 +- .../create-next-app/templates/default-tw-empty/ts/eslintrc.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/create-next-app/templates/app-empty/ts/eslintrc.json b/packages/create-next-app/templates/app-empty/ts/eslintrc.json index bffb357a71225..37224185490e6 100644 --- a/packages/create-next-app/templates/app-empty/ts/eslintrc.json +++ b/packages/create-next-app/templates/app-empty/ts/eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "next/typescript"] } diff --git a/packages/create-next-app/templates/app-tw-empty/ts/eslintrc.json b/packages/create-next-app/templates/app-tw-empty/ts/eslintrc.json index bffb357a71225..37224185490e6 100644 --- a/packages/create-next-app/templates/app-tw-empty/ts/eslintrc.json +++ b/packages/create-next-app/templates/app-tw-empty/ts/eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "next/typescript"] } diff --git a/packages/create-next-app/templates/default-empty/ts/eslintrc.json b/packages/create-next-app/templates/default-empty/ts/eslintrc.json index bffb357a71225..37224185490e6 100644 --- a/packages/create-next-app/templates/default-empty/ts/eslintrc.json +++ b/packages/create-next-app/templates/default-empty/ts/eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "next/typescript"] } diff --git a/packages/create-next-app/templates/default-tw-empty/ts/eslintrc.json b/packages/create-next-app/templates/default-tw-empty/ts/eslintrc.json index bffb357a71225..37224185490e6 100644 --- a/packages/create-next-app/templates/default-tw-empty/ts/eslintrc.json +++ b/packages/create-next-app/templates/default-tw-empty/ts/eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "next/typescript"] } From 6d8cd427ebf8ba5cb342fcfc69eaf51d2fac98ec Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Fri, 13 Sep 2024 15:49:50 -0700 Subject: [PATCH 08/43] perf(turbo-tasks): Use native async traits for TaskInput (not the async_trait macro) (#70084) ## What? Use rustc's relatively new native support for async traits: https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html Instead of the `async_trait` macro: https://docs.rs/async-trait/latest/async_trait/ The main differences are: - `async_trait` supports dynamic dispatch. The compiler-native version does not yet. - The compiler-native version often requires using messier `-> impl Future<...> + Send + '_` return types to declare additional bounds (usually `Send`). - `async_trait` forcibly boxes your returned `Future<...>` as a `Box>`. ## Why? - We don't need dynamic dispatch. - Most of the `TaskInput` code is macro-generated, so the uglier `impl Future` syntax doesn't matter. - This is a hot codepath, and there's overhead associated with boxing a `dyn Future`. Removing the dynamic dispatch avoids pointer indirection and gives the compiler more opportunities to inline code. ## Benchmarks No measurable change. ``` cargo bench -p turbopack-bench -p turbopack-cli -- "hmr_to_eval/Turbopack CSR" ``` ``` bench_hmr_to_eval/Turbopack CSR/1000 modules time: [15.439 ms 15.633 ms 15.978 ms] change: [-1.3769% +1.0017% +3.3534%] (p = 0.46 > 0.05) No change in performance detected. ``` ``` TURBOPACK_BENCH_STRESS=yes cargo bench -p turbo-tasks-memory 500 ``` ``` turbo_tasks_memory_stress/fibonacci/500 time: [539.45 ms 544.10 ms 548.41 ms] thrpt: [228.39 Kelem/s 230.20 Kelem/s 232.18 Kelem/s] change: time: [-1.3718% -0.1154% +1.1538%] (p = 0.87 > 0.05) thrpt: [-1.1406% +0.1155% +1.3909%] No change in performance detected. Found 1 outliers among 20 measurements (5.00%) 1 (5.00%) low mild ``` --- .../src/derive/task_input_macro.rs | 13 +++++++++++-- turbopack/crates/turbo-tasks/src/task/task_input.rs | 13 +++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/turbopack/crates/turbo-tasks-macros/src/derive/task_input_macro.rs b/turbopack/crates/turbo-tasks-macros/src/derive/task_input_macro.rs index 7a96916784d59..a9b0c8b647fab 100644 --- a/turbopack/crates/turbo-tasks-macros/src/derive/task_input_macro.rs +++ b/turbopack/crates/turbo-tasks-macros/src/derive/task_input_macro.rs @@ -168,8 +168,17 @@ pub fn derive_task_input(input: TokenStream) -> TokenStream { #[allow(non_snake_case)] #[allow(unreachable_code)] // This can occur for enums with no variants. - async fn resolve(&self) -> turbo_tasks::Result { - #resolve_impl + #[allow(clippy::manual_async_fn)] // some impls need the manual return type to work :( + fn resolve( + &self, + ) -> impl + ::std::future::Future> + + ::std::marker::Send + + '_ + { + async move { + #resolve_impl + } } } } diff --git a/turbopack/crates/turbo-tasks/src/task/task_input.rs b/turbopack/crates/turbo-tasks/src/task/task_input.rs index 17f5a9ba4b58c..9e6cca5139220 100644 --- a/turbopack/crates/turbo-tasks/src/task/task_input.rs +++ b/turbopack/crates/turbo-tasks/src/task/task_input.rs @@ -1,7 +1,6 @@ -use std::{any::Any, fmt::Debug, hash::Hash}; +use std::{any::Any, fmt::Debug, future::Future, hash::Hash}; use anyhow::Result; -use async_trait::async_trait; use serde::{Deserialize, Serialize}; use crate::{ @@ -12,10 +11,9 @@ use crate::{ /// [`#[turbo_tasks::function]`][crate::function] argument. /// /// See also [`ConcreteTaskInput`]. -#[async_trait] pub trait TaskInput: Send + Sync + Clone + Debug + PartialEq + Eq + Hash { - async fn resolve(&self) -> Result { - Ok(self.clone()) + fn resolve(&self) -> impl Future> + Send + '_ { + async { Ok(self.clone()) } } fn is_resolved(&self) -> bool { true @@ -28,7 +26,6 @@ pub trait TaskInput: Send + Sync + Clone + Debug + PartialEq + Eq + Hash { macro_rules! impl_task_input { ($($t:ty),*) => { $( - #[async_trait] impl TaskInput for $t {} )* }; @@ -48,7 +45,6 @@ impl_task_input! { ValueTypeId } -#[async_trait] impl TaskInput for Vec where T: TaskInput, @@ -70,7 +66,6 @@ where } } -#[async_trait] impl TaskInput for Option where T: TaskInput, @@ -97,7 +92,6 @@ where } } -#[async_trait] impl TaskInput for Vc where T: Send, @@ -220,7 +214,6 @@ impl<'de, T> Deserialize<'de> for TransientInstance { macro_rules! tuple_impls { ( $( $name:ident )+ ) => { - #[async_trait] impl<$($name: TaskInput),+> TaskInput for ($($name,)+) where $($name: TaskInput),+ { From a5bd4709e09dba0e461fc7b8ec138f4fa25a8eb2 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 13 Sep 2024 23:23:57 +0000 Subject: [PATCH 09/43] v15.0.0-canary.155 --- lerna.json | 2 +- packages/create-next-app/package.json | 2 +- packages/eslint-config-next/package.json | 4 ++-- packages/eslint-plugin-next/package.json | 2 +- packages/font/package.json | 2 +- packages/next-bundle-analyzer/package.json | 2 +- packages/next-codemod/package.json | 2 +- packages/next-env/package.json | 2 +- packages/next-mdx/package.json | 2 +- packages/next-plugin-storybook/package.json | 2 +- packages/next-polyfill-module/package.json | 2 +- packages/next-polyfill-nomodule/package.json | 2 +- packages/next-swc/package.json | 2 +- packages/next/package.json | 18 +++++++++--------- packages/react-refresh-utils/package.json | 2 +- packages/third-parties/package.json | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lerna.json b/lerna.json index 51da33edec535..a75f1b45bccf6 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.0.0-canary.154" + "version": "15.0.0-canary.155" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 5ff8e743d98b0..c89612ab03cbe 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index d5be914cddf71..38e1f5de74595 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config", "dependencies": { - "@next/eslint-plugin-next": "15.0.0-canary.154", + "@next/eslint-plugin-next": "15.0.0-canary.155", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index 17496c4af4f4f..cc68366eb99ae 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", diff --git a/packages/font/package.json b/packages/font/package.json index 457b58df55e61..d72ea96c815c2 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,7 +1,7 @@ { "name": "@next/font", "private": true, - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 218d3e0c3180b..33257e6da49af 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index aecf75b401dec..37f453505d4bc 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 15397f1d51dc2..7a6b995a601b4 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 6f9142f5e76b1..2fdf1651f157d 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 38bdf4915a539..4fa6db8129884 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 6fb0fa8267080..7d96ea3d56b55 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index a52983d684492..9abe2853a4b7f 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index b7e2917908786..b073952de21f8 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", diff --git a/packages/next/package.json b/packages/next/package.json index b61853ccb41aa..9354fb5d1f3f1 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -95,7 +95,7 @@ ] }, "dependencies": { - "@next/env": "15.0.0-canary.154", + "@next/env": "15.0.0-canary.155", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.13", "busboy": "1.6.0", @@ -160,11 +160,11 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/font": "15.0.0-canary.154", - "@next/polyfill-module": "15.0.0-canary.154", - "@next/polyfill-nomodule": "15.0.0-canary.154", - "@next/react-refresh-utils": "15.0.0-canary.154", - "@next/swc": "15.0.0-canary.154", + "@next/font": "15.0.0-canary.155", + "@next/polyfill-module": "15.0.0-canary.155", + "@next/polyfill-nomodule": "15.0.0-canary.155", + "@next/react-refresh-utils": "15.0.0-canary.155", + "@next/swc": "15.0.0-canary.155", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@swc/core": "1.7.0-nightly-20240714.1", @@ -234,6 +234,7 @@ "content-disposition": "0.5.3", "content-type": "1.0.4", "cookie": "0.4.1", + "cross-env": "6.0.3", "cross-spawn": "7.0.3", "crypto-browserify": "3.12.0", "css.escape": "1.5.1", @@ -330,8 +331,7 @@ "webpack-sources1": "npm:webpack-sources@1.4.3", "webpack-sources3": "npm:webpack-sources@3.2.3", "ws": "8.2.3", - "zod": "3.22.3", - "cross-env": "6.0.3" + "zod": "3.22.3" }, "keywords": [ "react", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 37b333dc692e7..8cd4e43668958 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 0e70c8973d80e..80b3b8fb266dd 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.0.0-canary.154", + "version": "15.0.0-canary.155", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.0.0-canary.154", + "next": "15.0.0-canary.155", "outdent": "0.8.0", "prettier": "2.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e65272afdf5e..fafc921241bbc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -786,7 +786,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.3.3 @@ -847,7 +847,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../next-env '@swc/counter': specifier: 0.1.3 @@ -978,19 +978,19 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/font': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../font '@next/polyfill-module': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../react-refresh-utils '@next/swc': - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1606,7 +1606,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 15.0.0-canary.154 + specifier: 15.0.0-canary.155 version: link:../next outdent: specifier: 0.8.0 From 30ce5d4b3f585929198d12b779152f7eb4b1e089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sat, 14 Sep 2024 12:51:17 +0900 Subject: [PATCH 10/43] feat(turbopack): Use source map while reporting CSS parsing error (#68648) ### What? Improve error messages about invalid CSS files. ### Why? Currently, `sass-loader` compiles CSS as a single line, and as the issue emitter prints the whole line, the error message is not good. ### How? Closes PACK-3187 Fixes #68311 --------- Co-authored-by: Tobias Koppers --- crates/next-core/src/app_segment_config.rs | 2 +- .../src/next_shared/webpack_rules/sass.rs | 2 +- test/development/sass-error/app/global.scss | 81 +++++++ test/development/sass-error/app/layout.js | 7 + .../sass-error/app/sass-error/page.js | 9 + test/development/sass-error/index.test.ts | 44 ++++ .../turbopack-core/src/issue/analyze.rs | 5 +- .../crates/turbopack-core/src/issue/mod.rs | 95 ++++++++ .../turbopack-core/src/issue/resolve.rs | 2 +- .../turbopack-core/src/source_map/mod.rs | 224 ++++++++++++------ turbopack/crates/turbopack-css/src/process.rs | 16 +- .../src/references/mod.rs | 13 +- turbopack/crates/turbopack-mdx/src/lib.rs | 8 +- .../turbopack-node/src/transforms/postcss.rs | 13 + 14 files changed, 422 insertions(+), 99 deletions(-) create mode 100644 test/development/sass-error/app/global.scss create mode 100644 test/development/sass-error/app/layout.js create mode 100644 test/development/sass-error/app/sass-error/page.js create mode 100644 test/development/sass-error/index.test.ts diff --git a/crates/next-core/src/app_segment_config.rs b/crates/next-core/src/app_segment_config.rs index 75017df65b832..7dc9480dfab34 100644 --- a/crates/next-core/src/app_segment_config.rs +++ b/crates/next-core/src/app_segment_config.rs @@ -219,7 +219,7 @@ impl Issue for NextSegmentConfigParsingIssue { #[turbo_tasks::function] fn source(&self) -> Vc { - Vc::cell(Some(self.source)) + Vc::cell(Some(self.source.resolve_source_map(self.ident.path()))) } } diff --git a/crates/next-core/src/next_shared/webpack_rules/sass.rs b/crates/next-core/src/next_shared/webpack_rules/sass.rs index 4dd0330e58897..ce18ca0b90b83 100644 --- a/crates/next-core/src/next_shared/webpack_rules/sass.rs +++ b/crates/next-core/src/next_shared/webpack_rules/sass.rs @@ -50,7 +50,7 @@ pub async fn maybe_add_sass_loader( options: take( serde_json::json!({ //https://github.com/vercel/turbo/blob/d527eb54be384a4658243304cecd547d09c05c6b/crates/turbopack-node/src/transforms/webpack.rs#L191 - "sourceMap": false + "sourceMap": true }) .as_object_mut() .unwrap(), diff --git a/test/development/sass-error/app/global.scss b/test/development/sass-error/app/global.scss new file mode 100644 index 0000000000000..8790ab1ae54c0 --- /dev/null +++ b/test/development/sass-error/app/global.scss @@ -0,0 +1,81 @@ +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + font-family: monospace; + color: white; + background-color: #0e0f0f; + + @media (max-width: 1200px) { + font-size: 16px; + } + + @media (max-width: 992px) { + font-size: 14px; + } +} + +input.defaultCheckbox { + color: white; +} + +input.defaultCheckbox::before { + content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.66662 10.115L12.7946 3.98633L13.7379 4.92899L6.66662 12.0003L2.42395 7.75766L3.36662 6.81499L6.66662 10.115Z' fill='white'/%3E%3C/svg%3E%0A"); + fill: currentColor; + opacity: 0; + height: 16px; + width: 16px; + top: -2px; + position: absolute; + left: 50%; + transform: translate(-50%, 0px); +} + +input.defaultCheckbox::before path { + fill: currentColor; +} + +input:checked.defaultCheckbox::before { + opacity: 1; +} + +.slide { + animation: slide_anim 0.5s; +} + +@keyframes slide_anim { + from { + transform: translateX(50px); + opacity: 0.4; + } + + to { + transform: translateX(0); + opacity: 1; + } +} + +.animation-opacity { + animation: opacity_anim 0.5s; +} + +@keyframes opacity_anim { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/test/development/sass-error/app/layout.js b/test/development/sass-error/app/layout.js new file mode 100644 index 0000000000000..f18ea1021004c --- /dev/null +++ b/test/development/sass-error/app/layout.js @@ -0,0 +1,7 @@ +'use client' + +import './global.scss' + +export default function Layout({ children }) { + return <>{children} +} diff --git a/test/development/sass-error/app/sass-error/page.js b/test/development/sass-error/app/sass-error/page.js new file mode 100644 index 0000000000000..30cd93c8cdba9 --- /dev/null +++ b/test/development/sass-error/app/sass-error/page.js @@ -0,0 +1,9 @@ +'use client' + +export default function Page() { + return ( + <> +
+ + ) +} diff --git a/test/development/sass-error/index.test.ts b/test/development/sass-error/index.test.ts new file mode 100644 index 0000000000000..f1d55a54413af --- /dev/null +++ b/test/development/sass-error/index.test.ts @@ -0,0 +1,44 @@ +import { nextTestSetup } from 'e2e-utils' +import { getRedboxSource } from 'next-test-utils' + +describe('app dir - css', () => { + const { next, skipped } = nextTestSetup({ + files: __dirname, + skipDeployment: true, + dependencies: { + sass: 'latest', + }, + }) + + if (skipped) { + return + } + + describe('sass support', () => { + ;(process.env.TURBOPACK ? describe : describe.skip)( + 'error handling', + () => { + it('should use original source points for sass errors', async () => { + const browser = await next.browser('/sass-error') + + const source = await getRedboxSource(browser) + + // css-loader does not report an error for this case + expect(source).toMatchInlineSnapshot(` + "./app/global.scss.css:45:1 + Parsing css source code failed + 43 | } + 44 | + > 45 | input.defaultCheckbox::before path { + | ^ + 46 | fill: currentColor; + 47 | } + 48 | + + Pseudo-elements like '::before' or '::after' can't be followed by selectors like 'Ident("path")' at [project]/app/global.scss.css:0:884" + `) + }) + } + ) + }) +}) diff --git a/turbopack/crates/turbopack-core/src/issue/analyze.rs b/turbopack/crates/turbopack-core/src/issue/analyze.rs index 435bf7325fc5d..82354d06bcf6e 100644 --- a/turbopack/crates/turbopack-core/src/issue/analyze.rs +++ b/turbopack/crates/turbopack-core/src/issue/analyze.rs @@ -57,6 +57,9 @@ impl Issue for AnalyzeIssue { #[turbo_tasks::function] fn source(&self) -> Vc { - Vc::cell(self.source) + Vc::cell( + self.source + .map(|s| s.resolve_source_map(self.source_ident.path())), + ) } } diff --git a/turbopack/crates/turbopack-core/src/issue/mod.rs b/turbopack/crates/turbopack-core/src/issue/mod.rs index b79517dca6589..90f97aae7454d 100644 --- a/turbopack/crates/turbopack-core/src/issue/mod.rs +++ b/turbopack/crates/turbopack-core/src/issue/mod.rs @@ -21,6 +21,7 @@ use turbo_tasks_hash::{DeterministicHash, Xxh3Hash64Hasher}; use crate::{ asset::{Asset, AssetContent}, source::Source, + source_map::{convert_to_turbopack_source_map, GenerateSourceMap, TokenWithSource}, source_pos::SourcePos, }; @@ -159,6 +160,7 @@ pub trait Issue { Some(detail) => Some((*detail.await?).clone()), None => None, }; + Ok(PlainIssue { severity: *self.severity().await?, file_path: self.file_path().to_string().await?.clone_value(), @@ -463,6 +465,42 @@ impl IssueSource { }) } + #[turbo_tasks::function] + pub async fn resolve_source_map( + self: Vc, + origin: Vc, + ) -> Result> { + let this = self.await?; + + if let Some(range) = this.range { + let (start, end) = match &*range.await? { + SourceRange::LineColumn(start, end) => (*start, *end), + + SourceRange::ByteOffset(start, end) => { + if let FileLinesContent::Lines(lines) = &*this.source.content().lines().await? { + let start = find_line_and_column(lines.as_ref(), *start); + let end = find_line_and_column(lines.as_ref(), *end); + (start, end) + } else { + return Ok(self); + } + } + }; + + // If we have a source map, map the line/column to the original source. + let mapped = source_pos(this.source, origin, start, end).await?; + + if let Some((source, start, end)) = mapped { + return Ok(Self::cell(IssueSource { + source, + range: Some(SourceRange::LineColumn(start, end).cell()), + })); + } + } + + Ok(self) + } + /// Create a [`IssueSource`] from byte offsets given by an swc ast node /// span. /// @@ -518,6 +556,63 @@ impl IssueSource { } } +async fn source_pos( + source: Vc>, + origin: Vc, + start: SourcePos, + end: SourcePos, +) -> Result>, SourcePos, SourcePos)>> { + let Some(generator) = Vc::try_resolve_sidecast::>(source).await? + else { + return Ok(None); + }; + + let srcmap = generator.generate_source_map(); + + let Some(srcmap) = *convert_to_turbopack_source_map(srcmap, origin).await? else { + return Ok(None); + }; + + let find = |line: usize, col: usize| async move { + let TokenWithSource { + token, + source_content, + } = &*srcmap.lookup_token_and_source(line, col).await?; + + match &*token.await? { + crate::source_map::Token::Synthetic(t) => Ok::<_, anyhow::Error>(( + SourcePos { + line: t.generated_line as _, + column: t.generated_column as _, + }, + *source_content, + )), + crate::source_map::Token::Original(t) => Ok(( + SourcePos { + line: t.original_line as _, + column: t.original_column as _, + }, + *source_content, + )), + } + }; + + let (start, content_1) = find(start.line, start.column).await?; + let (end, content_2) = find(end.line, end.column).await?; + + let Some((content_1, content_2)) = content_1.zip(content_2) else { + return Ok(None); + }; + + let (content_1, content_2) = (content_1.resolve().await?, content_2.resolve().await?); + + if content_1 != content_2 { + return Ok(None); + } + + Ok(Some((content_1, start, end))) +} + #[turbo_tasks::value(transparent)] pub struct OptionIssueSource(Option>); diff --git a/turbopack/crates/turbopack-core/src/issue/resolve.rs b/turbopack/crates/turbopack-core/src/issue/resolve.rs index 9f5f5035a0a1d..dd05450798711 100644 --- a/turbopack/crates/turbopack-core/src/issue/resolve.rs +++ b/turbopack/crates/turbopack-core/src/issue/resolve.rs @@ -119,7 +119,7 @@ impl Issue for ResolvingIssue { #[turbo_tasks::function] fn source(&self) -> Vc { - Vc::cell(self.source) + Vc::cell(self.source.map(|s| s.resolve_source_map(self.file_path))) } // TODO add sub_issue for a description of resolve_options diff --git a/turbopack/crates/turbopack-core/src/source_map/mod.rs b/turbopack/crates/turbopack-core/src/source_map/mod.rs index ddaa6a3ee8cdf..58321b86d4228 100644 --- a/turbopack/crates/turbopack-core/src/source_map/mod.rs +++ b/turbopack/crates/turbopack-core/src/source_map/mod.rs @@ -10,10 +10,13 @@ use sourcemap::{DecodedMap, SourceMap as RegularMap, SourceMapBuilder, SourceMap use turbo_tasks::{RcStr, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::{ rope::{Rope, RopeBuilder}, - FileContent, FileSystemPath, + File, FileContent, FileSystem, FileSystemPath, VirtualFileSystem, }; -use crate::{source_pos::SourcePos, SOURCE_MAP_PREFIX}; +use crate::{ + asset::AssetContent, source::Source, source_pos::SourcePos, virtual_source::VirtualSource, + SOURCE_MAP_PREFIX, +}; pub(crate) mod source_map_asset; @@ -80,6 +83,13 @@ pub enum Token { Original(OriginalToken), } +#[turbo_tasks::value] +#[derive(Clone, Debug)] +pub struct TokenWithSource { + pub token: Vc, + pub source_content: Option>>, +} + /// A SyntheticToken represents a region of the generated file that was created /// by some build tool. #[turbo_tasks::value] @@ -313,77 +323,31 @@ impl SourceMap { /// synthetic code or user-authored original code. #[turbo_tasks::function] pub async fn lookup_token(self: Vc, line: usize, column: usize) -> Result> { - let token = match &*self.await? { - SourceMap::Decoded(map) => { - let mut token = map - .lookup_token(line as u32, column as u32) - .map(Token::from) - .unwrap_or_else(|| { - Token::Synthetic(SyntheticToken { - generated_line: line, - generated_column: column, - guessed_original_file: None, - }) - }); - if let Token::Synthetic(SyntheticToken { - guessed_original_file, - .. - }) = &mut token - { - if let DecodedMap::Regular(map) = &map.map.0 { - if map.get_source_count() == 1 { - let source = map.sources().next().unwrap(); - *guessed_original_file = Some(source.to_string()); - } - } - } - token - } - - SourceMap::Sectioned(map) => { - let len = map.sections.len(); - let mut low = 0; - let mut high = len; - let pos = SourcePos { line, column }; - - // A "greatest lower bound" binary search. We're looking for the closest section - // offset <= to our line/col. - while low < high { - let mid = (low + high) / 2; - if pos < map.sections[mid].offset { - high = mid; - } else { - low = mid + 1; - } - } - - // Our GLB search will return the section immediately to the right of the - // section we actually want to recurse into, because the binary search does not - // early exit on an exact match (it'll `low = mid + 1`). - if low > 0 && low <= len { - let SourceMapSection { map, offset } = &map.sections[low - 1]; - // We're looking for the position `l` lines into region covered by this - // sourcemap's section. - let l = line - offset.line; - // The source map starts offset by the section's column only on its first line. - // On the 2nd+ line, the source map covers starting at column 0. - let c = if line == offset.line { - column - offset.column - } else { - column - }; - return Ok(map.lookup_token(l, c)); - } - Token::Synthetic(SyntheticToken { - generated_line: line, - generated_column: column, - guessed_original_file: None, - }) - } - }; - Ok(token.cell()) + let (token, _) = self + .await? + .lookup_token_and_source_internal(line, column, true) + .await?; + Ok(token) } + /// Traces a generated line/column into an mapping token representing either + /// synthetic code or user-authored original code. + #[turbo_tasks::function] + pub async fn lookup_token_and_source( + self: Vc, + line: usize, + column: usize, + ) -> Result> { + let (token, content) = self + .await? + .lookup_token_and_source_internal(line, column, true) + .await?; + Ok(TokenWithSource { + token, + source_content: content, + } + .cell()) + } #[turbo_tasks::function] pub async fn with_resolved_sources( self: Vc, @@ -523,6 +487,113 @@ impl SourceMap { } } +impl SourceMap { + async fn lookup_token_and_source_internal( + &self, + line: usize, + column: usize, + need_source_content: bool, + ) -> Result<(Vc, Option>>)> { + let mut content: Option>> = None; + + let token: Token = match self { + SourceMap::Decoded(map) => { + let tok = map.lookup_token(line as u32, column as u32); + let mut token = tok.map(Token::from).unwrap_or_else(|| { + Token::Synthetic(SyntheticToken { + generated_line: line, + generated_column: column, + guessed_original_file: None, + }) + }); + + if let Token::Synthetic(SyntheticToken { + guessed_original_file, + .. + }) = &mut token + { + if let DecodedMap::Regular(map) = &map.map.0 { + if map.get_source_count() == 1 { + let source = map.sources().next().unwrap(); + *guessed_original_file = Some(source.to_string()); + } + } + } + + if need_source_content && content.is_none() { + if let Some(map) = map.map.as_regular_source_map() { + content = tok.and_then(|tok| { + let src_id = tok.get_src_id(); + + let name = map.get_source(src_id); + let content = map.get_source_contents(src_id); + + let (name, content) = name.zip(content)?; + + let path = VirtualFileSystem::new().root().join(name.into()); + let content = + AssetContent::file(FileContent::new(File::from(content)).cell()); + + Some(Vc::upcast(VirtualSource::new(path, content))) + }); + } + } + + token + } + + SourceMap::Sectioned(map) => { + let len = map.sections.len(); + let mut low = 0; + let mut high = len; + let pos = SourcePos { line, column }; + + // A "greatest lower bound" binary search. We're looking for the closest section + // offset <= to our line/col. + while low < high { + let mid = (low + high) / 2; + if pos < map.sections[mid].offset { + high = mid; + } else { + low = mid + 1; + } + } + + // Our GLB search will return the section immediately to the right of the + // section we actually want to recurse into, because the binary search does not + // early exit on an exact match (it'll `low = mid + 1`). + if low > 0 && low <= len { + let SourceMapSection { map, offset } = &map.sections[low - 1]; + // We're looking for the position `l` lines into region covered by this + // sourcemap's section. + let l = line - offset.line; + // The source map starts offset by the section's column only on its first line. + // On the 2nd+ line, the source map covers starting at column 0. + let c = if line == offset.line { + column - offset.column + } else { + column + }; + + if need_source_content { + let result = map.lookup_token_and_source(l, c).await?; + return Ok((result.token, result.source_content)); + } else { + return Ok((map.lookup_token(l, c), None)); + } + } + Token::Synthetic(SyntheticToken { + generated_line: line, + generated_column: column, + guessed_original_file: None, + }) + } + }; + + Ok((token.cell(), content)) + } +} + #[turbo_tasks::value_impl] impl GenerateSourceMap for SourceMap { #[turbo_tasks::function] @@ -682,3 +753,14 @@ impl SourceMapSection { }) } } + +#[turbo_tasks::function] +pub async fn convert_to_turbopack_source_map( + source_map: Vc, + origin: Vc, +) -> Result> { + let Some(source_map) = *source_map.await? else { + return Ok(Vc::cell(None)); + }; + Ok(Vc::cell(Some(source_map.with_resolved_sources(origin)))) +} diff --git a/turbopack/crates/turbopack-css/src/process.rs b/turbopack/crates/turbopack-css/src/process.rs index fa153ea91399a..85f7ed2ec70b6 100644 --- a/turbopack/crates/turbopack-css/src/process.rs +++ b/turbopack/crates/turbopack-css/src/process.rs @@ -574,6 +574,7 @@ async fn process_content( match err.kind { lightningcss::error::ParserError::UnexpectedToken(_) | lightningcss::error::ParserError::UnexpectedImportRule + | lightningcss::error::ParserError::SelectorError(..) | lightningcss::error::ParserError::EndOfInput => { let source = err.loc.as_ref().map(|loc| { let pos = SourcePos { @@ -586,7 +587,7 @@ async fn process_content( ParsingIssue { file: fs_path_vc, msg: Vc::cell(err.to_string().into()), - source: Vc::cell(source), + source, } .cell() .emit(); @@ -609,11 +610,10 @@ async fn process_content( }; IssueSource::from_line_col(source, pos, pos) }); - ParsingIssue { file: fs_path_vc, msg: Vc::cell(e.to_string().into()), - source: Vc::cell(source), + source, } .cell() .emit(); @@ -738,11 +738,11 @@ impl CssError { ParsingIssue { file, msg: Vc::cell(CSS_MODULE_ERROR.into()), - source: Vc::cell(Some(IssueSource::from_swc_offsets( + source: Some(IssueSource::from_swc_offsets( source, span.lo.0 as _, span.hi.0 as _, - ))), + )), } .cell() .emit(); @@ -751,7 +751,7 @@ impl CssError { ParsingIssue { file, msg: Vc::cell(format!("{CSS_MODULE_ERROR}, (lightningcss, {selector})").into()), - source: Vc::cell(None), + source: None, } .cell() .emit(); @@ -1073,7 +1073,7 @@ impl TransformConfig for ModuleTransformConfig { struct ParsingIssue { msg: Vc, file: Vc, - source: Vc, + source: Option>, } #[turbo_tasks::value_impl] @@ -1095,7 +1095,7 @@ impl Issue for ParsingIssue { #[turbo_tasks::function] fn source(&self) -> Vc { - self.source + Vc::cell(self.source.map(|s| s.resolve_source_map(self.file))) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs index 8eaad44b4be35..f743af2a5e5e1 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs @@ -71,7 +71,7 @@ use turbopack_core::{ resolve, FindContextFileResult, ModulePart, }, source::Source, - source_map::{GenerateSourceMap, OptionSourceMap, SourceMap}, + source_map::{convert_to_turbopack_source_map, GenerateSourceMap, OptionSourceMap, SourceMap}, }; use turbopack_resolve::{ ecmascript::{apply_cjs_specific_options, cjs_resolve_source}, @@ -3203,14 +3203,3 @@ fn maybe_decode_data_url(url: RcStr) -> Vc { Vc::cell(None) } } - -#[turbo_tasks::function] -async fn convert_to_turbopack_source_map( - source_map: Vc, - origin: Vc, -) -> Result> { - let Some(source_map) = *source_map.await? else { - return Ok(Vc::cell(None)); - }; - Ok(Vc::cell(Some(source_map.with_resolved_sources(origin)))) -} diff --git a/turbopack/crates/turbopack-mdx/src/lib.rs b/turbopack/crates/turbopack-mdx/src/lib.rs index 041a47e1e04ca..d7cf78fff4aee 100644 --- a/turbopack/crates/turbopack-mdx/src/lib.rs +++ b/turbopack/crates/turbopack-mdx/src/lib.rs @@ -187,7 +187,7 @@ impl MdxTransformedAsset { } .cell()), Err(err) => { - let loc = Vc::cell(err.place.map(|p| { + let loc = err.place.map(|p| { let (start, end) = match *p { // markdown's positions are 1-indexed, SourcePos is 0-indexed. // Both end positions point to the first character after the range @@ -211,7 +211,7 @@ impl MdxTransformedAsset { }; IssueSource::from_line_col(this.source, start, end) - })); + }); MdxIssue { path: this.source.ident().path(), @@ -241,7 +241,7 @@ struct MdxTransformResult { struct MdxIssue { /// Place of message. path: Vc, - loc: Vc, + loc: Option>, /// Reason for message (should use markdown). reason: String, /// Category of message. @@ -259,7 +259,7 @@ impl Issue for MdxIssue { #[turbo_tasks::function] fn source(&self) -> Vc { - self.loc + Vc::cell(self.loc.map(|s| s.resolve_source_map(self.path))) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-node/src/transforms/postcss.rs b/turbopack/crates/turbopack-node/src/transforms/postcss.rs index 82fb65bc9f5ba..d0a8004c9759f 100644 --- a/turbopack/crates/turbopack-node/src/transforms/postcss.rs +++ b/turbopack/crates/turbopack-node/src/transforms/postcss.rs @@ -21,6 +21,7 @@ use turbopack_core::{ reference_type::{EntryReferenceSubType, InnerAssets, ReferenceType}, resolve::{find_context_file_or_package_key, options::ImportMapping, FindContextFileResult}, source::Source, + source_map::{GenerateSourceMap, OptionSourceMap}, source_transform::SourceTransform, virtual_source::VirtualSource, }; @@ -408,6 +409,18 @@ async fn find_config_in_location( Ok(None) } +#[turbo_tasks::value_impl] +impl GenerateSourceMap for PostCssTransformedAsset { + #[turbo_tasks::function] + async fn generate_source_map(&self) -> Result> { + let source = Vc::try_resolve_sidecast::>(self.source).await?; + match source { + Some(source) => Ok(source.generate_source_map()), + None => Ok(Vc::cell(None)), + } + } +} + #[turbo_tasks::value_impl] impl PostCssTransformedAsset { #[turbo_tasks::function] From 8f7b0fb787d3ea933d373019886e0d355ccffccc Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Sat, 14 Sep 2024 12:33:42 +0200 Subject: [PATCH 11/43] Turbopack build: Fix edge-runtime-configurable-guards tests (#70088) This test was checking for an unsupported feature, skipped and documented. --- docs/04-architecture/turbopack.mdx | 1 + .../test/index.test.js | 108 +++++++++++------- test/turbopack-build-tests-manifest.json | 20 ++-- 3 files changed, 75 insertions(+), 54 deletions(-) diff --git a/docs/04-architecture/turbopack.mdx b/docs/04-architecture/turbopack.mdx index 98b5c7bf6abb4..ef193685fb343 100644 --- a/docs/04-architecture/turbopack.mdx +++ b/docs/04-architecture/turbopack.mdx @@ -72,6 +72,7 @@ These features are currently not supported: - We are currently not planning to support `experimental.urlImports` in Next.js with Turbopack. - [`:import` and `:export` ICSS rules](https://github.com/css-modules/icss) - We are currently not planning to support `:import` and `:export` ICSS rules in Next.js with Turbopack as [Lightning CSS](https://lightningcss.dev/css-modules.html) the CSS parser Turbopack uses does not support these rules. +- `unstable_allowDynamic` configuration in edge runtime ## Generating Trace Files diff --git a/test/integration/edge-runtime-configurable-guards/test/index.test.js b/test/integration/edge-runtime-configurable-guards/test/index.test.js index 6a50a2c41a716..5b3228ca668fc 100644 --- a/test/integration/edge-runtime-configurable-guards/test/index.test.js +++ b/test/integration/edge-runtime-configurable-guards/test/index.test.js @@ -109,7 +109,7 @@ describe('Edge runtime configurable guards', () => { const output = await nextBuild(context.appDir, undefined, { stdout: true, stderr: true, - env: { NEXT_TELEMETRY_DEBUG: 1 }, + env: process.env.TURBOPACK ? {} : { NEXT_TELEMETRY_DEBUG: 1 }, }) expect(output.code).toBe(1) @@ -314,27 +314,38 @@ describe('Edge runtime configurable guards', () => { ;(process.env.TURBOPACK_DEV ? describe.skip : describe)( 'production mode', () => { - it('build and does not warn at runtime', async () => { - const output = await nextBuild(context.appDir, undefined, { - stdout: true, - stderr: true, - env: { NEXT_TELEMETRY_DEBUG: 1 }, - }) - expect(output.stderr).not.toContain(`Build failed`) - expect(output.stderr).toContain(TELEMETRY_EVENT_NAME) - context.appPort = await findPort() - context.app = await nextStart( - context.appDir, - context.appPort, - appOption - ) - const res = await fetchViaHTTP(context.appPort, url) - expect(res.status).toBe(200) - expect(context.logs.output).not.toContain(`warn`) - expect(context.logs.output).not.toContain( - `Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime` - ) - }) + // This checks the unstable_allowDynamic configuration which is not supported in Turbopack. + ;(process.env.TURBOPACK ? it.skip : it)( + 'build and does not warn at runtime', + async () => { + const output = await nextBuild(context.appDir, undefined, { + stdout: true, + stderr: true, + env: process.env.TURBOPACK ? {} : { NEXT_TELEMETRY_DEBUG: 1 }, + }) + // eslint-disable-next-line jest/no-standalone-expect + expect(output.stderr).not.toContain(`Build failed`) + if (!process.env.TURBOPACK) { + // eslint-disable-next-line jest/no-standalone-expect + expect(output.stderr).toContain(TELEMETRY_EVENT_NAME) + } + context.appPort = await findPort() + context.app = await nextStart( + context.appDir, + context.appPort, + appOption + ) + const res = await fetchViaHTTP(context.appPort, url) + // eslint-disable-next-line jest/no-standalone-expect + expect(res.status).toBe(200) + // eslint-disable-next-line jest/no-standalone-expect + expect(context.logs.output).not.toContain(`warn`) + // eslint-disable-next-line jest/no-standalone-expect + expect(context.logs.output).not.toContain( + `Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime` + ) + } + ) } ) }) @@ -403,13 +414,14 @@ describe('Edge runtime configurable guards', () => { const output = await nextBuild(context.appDir, undefined, { stdout: true, stderr: true, - env: { NEXT_TELEMETRY_DEBUG: 1 }, + env: process.env.TURBOPACK ? {} : { NEXT_TELEMETRY_DEBUG: 1 }, }) - expect(output.stderr).toContain(`Build failed`) expect(output.stderr).toContain( `Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime` ) - expect(output.stderr).toContain(TELEMETRY_EVENT_NAME) + if (!process.env.TURBOPACK) { + expect(output.stderr).toContain(TELEMETRY_EVENT_NAME) + } }) } ) @@ -457,26 +469,34 @@ describe('Edge runtime configurable guards', () => { ;(process.env.TURBOPACK_DEV ? describe.skip : describe)( 'production mode', () => { + // This checks the unstable_allowDynamic configuration which is not supported in Turbopack. // eslint-disable-next-line jest/no-identical-title - it('build and does not warn at runtime', async () => { - const output = await nextBuild(context.appDir, undefined, { - stdout: true, - stderr: true, - }) - expect(output.stderr).not.toContain(`Build failed`) - context.appPort = await findPort() - context.app = await nextStart( - context.appDir, - context.appPort, - appOption - ) - const res = await fetchViaHTTP(context.appPort, url) - expect(res.status).toBe(200) - expect(context.logs.output).not.toContain(`warn`) - expect(context.logs.output).not.toContain( - `Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime` - ) - }) + ;(process.env.TURBOPACK ? it.skip : it)( + 'build and does not warn at runtime', + async () => { + const output = await nextBuild(context.appDir, undefined, { + stdout: true, + stderr: true, + }) + // eslint-disable-next-line jest/no-standalone-expect + expect(output.stderr).not.toContain(`Build failed`) + context.appPort = await findPort() + context.app = await nextStart( + context.appDir, + context.appPort, + appOption + ) + const res = await fetchViaHTTP(context.appPort, url) + // eslint-disable-next-line jest/no-standalone-expect + expect(res.status).toBe(200) + // eslint-disable-next-line jest/no-standalone-expect + expect(context.logs.output).not.toContain(`warn`) + // eslint-disable-next-line jest/no-standalone-expect + expect(context.logs.output).not.toContain( + `Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime` + ) + } + ) } ) }) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 2c146c053fa41..12914172b56ca 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -8968,25 +8968,25 @@ "Edge runtime configurable guards Edge API using lib with unallowed, used dynamic code warns in dev at runtime", "Edge runtime configurable guards Edge API with allowed, used dynamic code still warns in dev at runtime", "Edge runtime configurable guards Edge API with use of Function as a type does not warn in dev at runtime", - "Edge runtime configurable guards Edge API with use of Function as a type production mode build and does not warn at runtime", "Edge runtime configurable guards Middleware using lib with allowed, used dynamic code still warns in dev at runtime", "Edge runtime configurable guards Middleware using lib with unallowed, used dynamic code warns in dev at runtime", "Edge runtime configurable guards Middleware with allowed, used dynamic code still warns in dev at runtime", "Edge runtime configurable guards Middleware with use of Function as a type does not warn in dev at runtime", - "Edge runtime configurable guards Middleware with use of Function as a type production mode build and does not warn at runtime", "Edge runtime configurable guards Multiple functions with different configurations warns in dev for allowed code", "Edge runtime configurable guards Multiple functions with different configurations warns in dev for unallowed code", - "Edge runtime configurable guards Multiple functions with different configurations production mode fails to build because of unallowed code" - ], - "failed": [ - "Edge runtime configurable guards Edge API using lib with allowed, unused dynamic code production mode build and does not warn at runtime", + "Edge runtime configurable guards Multiple functions with different configurations production mode fails to build because of unallowed code", "Edge runtime configurable guards Edge API using lib with unallowed, used dynamic code production mode fails to build because of dynamic code evaluation", + "Edge runtime configurable guards Middleware using lib with unallowed, used dynamic code production mode fails to build because of dynamic code evaluation" + ], + "failed": [], + "pending": [ + "Edge runtime configurable guards Edge API with use of Function as a type production mode build and does not warn at runtime", + "Edge runtime configurable guards Middleware with use of Function as a type production mode build and does not warn at runtime", "Edge runtime configurable guards Edge API with allowed, unused dynamic code production mode build and does not warn at runtime", - "Edge runtime configurable guards Middleware using lib with allowed, unused dynamic code production mode build and does not warn at runtime", - "Edge runtime configurable guards Middleware using lib with unallowed, used dynamic code production mode fails to build because of dynamic code evaluation", - "Edge runtime configurable guards Middleware with allowed, unused dynamic code production mode build and does not warn at runtime" + "Edge runtime configurable guards Middleware with allowed, unused dynamic code production mode build and does not warn at runtime", + "Edge runtime configurable guards Edge API using lib with allowed, unused dynamic code production mode build and does not warn at runtime", + "Edge runtime configurable guards Middleware using lib with allowed, unused dynamic code production mode build and does not warn at runtime" ], - "pending": [], "flakey": [], "runtimeError": false }, From c9d31383def47130a4a03e1a059b2f9aba1e1e57 Mon Sep 17 00:00:00 2001 From: Jam Balaya Date: Sat, 14 Sep 2024 19:44:52 +0900 Subject: [PATCH 12/43] fix(examples): typo command name (#70094) --- examples/route-handlers/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/route-handlers/README.md b/examples/route-handlers/README.md index 50061a905f177..d736924bf33c3 100644 --- a/examples/route-handlers/README.md +++ b/examples/route-handlers/README.md @@ -13,11 +13,11 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: ```bash -npx create-next-app --example route-handlerss route-handlers-app +npx create-next-app --example route-handlers route-handlers-app ``` ```bash -yarn create next-app --example route-handlers route-handlerss-app +yarn create next-app --example route-handlers route-handlers-app ``` ```bash From d66a8271a26c21ec6f73a4c5d18165cdb8142ed6 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Sat, 14 Sep 2024 23:23:18 +0000 Subject: [PATCH 13/43] v15.0.0-canary.156 --- lerna.json | 2 +- packages/create-next-app/package.json | 2 +- packages/eslint-config-next/package.json | 4 ++-- packages/eslint-plugin-next/package.json | 2 +- packages/font/package.json | 2 +- packages/next-bundle-analyzer/package.json | 2 +- packages/next-codemod/package.json | 2 +- packages/next-env/package.json | 2 +- packages/next-mdx/package.json | 2 +- packages/next-plugin-storybook/package.json | 2 +- packages/next-polyfill-module/package.json | 2 +- packages/next-polyfill-nomodule/package.json | 2 +- packages/next-swc/package.json | 2 +- packages/next/package.json | 14 +++++++------- packages/react-refresh-utils/package.json | 2 +- packages/third-parties/package.json | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index a75f1b45bccf6..8f1460e440a06 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.0.0-canary.155" + "version": "15.0.0-canary.156" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index c89612ab03cbe..a7bd69cf95243 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 38e1f5de74595..b5f1924c5af28 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config", "dependencies": { - "@next/eslint-plugin-next": "15.0.0-canary.155", + "@next/eslint-plugin-next": "15.0.0-canary.156", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index cc68366eb99ae..bef15b9379550 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", diff --git a/packages/font/package.json b/packages/font/package.json index d72ea96c815c2..297629cbd4846 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,7 +1,7 @@ { "name": "@next/font", "private": true, - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 33257e6da49af..d9ec3fa7a61a3 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 37f453505d4bc..46d38a016f6ee 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 7a6b995a601b4..30e6dd5d5b8ca 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 2fdf1651f157d..a7c1d227f17cc 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 4fa6db8129884..3ac03e3a07a84 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 7d96ea3d56b55..4fa076ed1810a 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 9abe2853a4b7f..a06028643e3f0 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index b073952de21f8..dc3492924983e 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", diff --git a/packages/next/package.json b/packages/next/package.json index 9354fb5d1f3f1..55052817e2d0d 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -95,7 +95,7 @@ ] }, "dependencies": { - "@next/env": "15.0.0-canary.155", + "@next/env": "15.0.0-canary.156", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.13", "busboy": "1.6.0", @@ -160,11 +160,11 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/font": "15.0.0-canary.155", - "@next/polyfill-module": "15.0.0-canary.155", - "@next/polyfill-nomodule": "15.0.0-canary.155", - "@next/react-refresh-utils": "15.0.0-canary.155", - "@next/swc": "15.0.0-canary.155", + "@next/font": "15.0.0-canary.156", + "@next/polyfill-module": "15.0.0-canary.156", + "@next/polyfill-nomodule": "15.0.0-canary.156", + "@next/react-refresh-utils": "15.0.0-canary.156", + "@next/swc": "15.0.0-canary.156", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@swc/core": "1.7.0-nightly-20240714.1", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 8cd4e43668958..832881de06b37 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 80b3b8fb266dd..48e0d955f8c47 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.0.0-canary.155", + "version": "15.0.0-canary.156", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.0.0-canary.155", + "next": "15.0.0-canary.156", "outdent": "0.8.0", "prettier": "2.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fafc921241bbc..d5eea524905d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -786,7 +786,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.3.3 @@ -847,7 +847,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../next-env '@swc/counter': specifier: 0.1.3 @@ -978,19 +978,19 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/font': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../font '@next/polyfill-module': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../react-refresh-utils '@next/swc': - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1606,7 +1606,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 15.0.0-canary.155 + specifier: 15.0.0-canary.156 version: link:../next outdent: specifier: 0.8.0 From 528700d7b5813ce9467a6e41a9cb4e4165c3c274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 16 Sep 2024 15:50:02 +0900 Subject: [PATCH 14/43] fix(turbopack): Do not create invalid `EcmascriptModulePartAsset` (#70016) ### What? `EcmascriptModulePartAsset` is invalid if the splitting is failed. We now carefully create it only when the original module is splittable. ### Why? This is part of [the tree-shaking PR](https://github.com/vercel/next.js/pull/69344). --- test/turbopack-build-tests-manifest.json | 7 ++++--- .../src/references/esm/base.rs | 9 +++++---- .../turbopack-ecmascript/src/tree_shake/asset.rs | 14 ++++++++++++++ turbopack/crates/turbopack/src/lib.rs | 9 ++++----- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 12914172b56ca..11f144d3e7244 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -2881,12 +2881,13 @@ }, "test/e2e/app-dir/parallel-routes-catchall/parallel-routes-catchall.test.ts": { "passed": [ - "parallel-routes-catchall should match both the catch-all page & slot", "parallel-routes-catchall should match correctly when defining an explicit page & slot", - "parallel-routes-catchall should match correctly when defining an explicit page but no slot", "parallel-routes-catchall should match correctly when defining an explicit slot but no page" ], - "failed": [], + "failed": [ + "parallel-routes-catchall should match both the catch-all page & slot", + "parallel-routes-catchall should match correctly when defining an explicit page but no slot" + ], "pending": [], "flakey": [], "runtimeError": false diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs index adebc322228a6..456c45b48577e 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs @@ -170,14 +170,15 @@ impl ModuleReference for EsmAssetReference { if let Request::Module { module, .. } = &*self.request.await? { if module == TURBOPACK_PART_IMPORT_SOURCE { if let Some(part) = self.export_name { - let full_module: Vc = + let module: Vc = Vc::try_resolve_downcast_type(self.origin) .await? .expect("EsmAssetReference origin should be a EcmascriptModuleAsset"); - let module = EcmascriptModulePartAsset::new(full_module, part); - - return Ok(ModuleResolveResult::module(Vc::upcast(module)).cell()); + return Ok(ModuleResolveResult::module( + EcmascriptModulePartAsset::select_part(module, part), + ) + .cell()); } bail!("export_name is required for part import") diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs index 450b9b1352052..ed45606d0b687 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs @@ -95,6 +95,20 @@ impl EcmascriptModulePartAsset { .cell() } + #[turbo_tasks::function] + pub async fn select_part( + module: Vc, + part: Vc, + ) -> Result>> { + let split_result = split_module(module).await?; + + Ok(if matches!(&*split_result, SplitResult::Failed { .. }) { + Vc::upcast(module) + } else { + Vc::upcast(EcmascriptModulePartAsset::new(module, part)) + }) + } + #[turbo_tasks::function] pub async fn is_async_module(self: Vc) -> Result> { let this = self.await?; diff --git a/turbopack/crates/turbopack/src/lib.rs b/turbopack/crates/turbopack/src/lib.rs index ce6fab9ebc23b..79278443855a4 100644 --- a/turbopack/crates/turbopack/src/lib.rs +++ b/turbopack/crates/turbopack/src/lib.rs @@ -190,11 +190,10 @@ async fn apply_module_type( let options = options.await?; match options.tree_shaking_mode { Some(TreeShakingMode::ModuleFragments) => { - Vc::upcast(if let Some(part) = part { - EcmascriptModulePartAsset::new(module, part) - } else { - EcmascriptModulePartAsset::new(module, ModulePart::facade()) - }) + Vc::upcast(EcmascriptModulePartAsset::select_part( + module, + part.unwrap_or(ModulePart::facade()), + )) } Some(TreeShakingMode::ReexportsOnly) => { if let Some(part) = part { From 76cc22d2798df2b7656f392924aeb4e9ebb45116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 16 Sep 2024 17:16:51 +0900 Subject: [PATCH 15/43] fix(turbopack): Improve analyzer of tree-shaking pass (#70017) ### What? Improve the graph analyzer of the tree-shaking pass. This PR does **not** server-action specific changes for tree shaking. ### Why? This is part of [the tree-shaking PR](https://github.com/vercel/next.js/pull/69344). ### How? --- .../crates/turbopack-ecmascript/src/minify.rs | 6 +- .../src/references/esm/export.rs | 40 +- .../src/tree_shake/asset.rs | 23 +- .../src/tree_shake/graph.rs | 122 +- .../src/tree_shake/mod.rs | 109 +- .../src/tree_shake/tests.rs | 18 +- .../tree-shaker/analyzer/app-route/output.md | 24 +- .../analyzer/combined-export/output.md | 8 +- .../tree-shaker/analyzer/failed-2/output.md | 865 ++-- .../tree-shaker/analyzer/grouping/output.md | 4 +- .../tree-shaker/analyzer/mui-sys/output.md | 4040 ++++++++++++----- .../analyzer/multi-export/output.md | 4 +- .../tree-shaker/analyzer/nanoid/output.md | 20 +- .../analyzer/nextjs-tracer/output.md | 380 +- .../tree-shaker/analyzer/node-fetch/output.md | 199 +- .../tree-shaker/analyzer/shared-2/output.md | 15 + .../shared-and-side-effects/output.md | 270 +- .../analyzer/shared-regression/output.md | 15 + .../analyzer/simple-vars-1/output.md | 8 +- .../analyzer/template-pages/output.md | 3014 ++++++++---- .../analyzer/write-order/output.md | 177 +- ...e-shake_dynamic-import_input_lib_e521f1.js | 14 +- ...-tree-shake_export-named_input_1823b4._.js | 8 +- ...e-shake_export-namespace_input_6b9ee3._.js | 16 +- ...e-shake_import-named-all_input_84a6ca._.js | 6 +- ...-tree-shake_import-named_input_4f48a0._.js | 6 +- ...e-shake_import-namespace_input_519014._.js | 14 +- ...shake_import-side-effect_input_55cb06._.js | 2 +- ...hake_require-side-effect_input_c7b81e._.js | 14 +- ...ke_tree-shake-test-1_input_index_950e23.js | 14 +- 30 files changed, 6367 insertions(+), 3088 deletions(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/minify.rs b/turbopack/crates/turbopack-ecmascript/src/minify.rs index bfb65333b290f..eff1d49051d06 100644 --- a/turbopack/crates/turbopack-ecmascript/src/minify.rs +++ b/turbopack/crates/turbopack-ecmascript/src/minify.rs @@ -49,15 +49,15 @@ pub async fn minify(path: Vc, code: Vc) -> Result None, ); let mut parser = Parser::new_from(lexer); - // TODO should use our own handler that emits issues instead. + let program = try_with_handler(cm.clone(), Default::default(), |handler| { GLOBALS.set(&Default::default(), || { let program = match parser.parse_program() { Ok(program) => program, Err(err) => { - // TODO should emit an issue + err.into_diagnostic(handler).emit(); bail!( - "failed to parse source code\n{err:?}\n{}", + "failed to parse source code\n{}", code.source_code().to_str()? ) } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs index 4ab974ffd5237..3f2ebe8bcf5b3 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, collections::{BTreeMap, HashSet}, ops::ControlFlow, }; @@ -9,8 +10,9 @@ use serde::{Deserialize, Serialize}; use swc_core::{ common::DUMMY_SP, ecma::ast::{ - self, ComputedPropName, Expr, ExprStmt, Ident, KeyValueProp, Lit, MemberExpr, MemberProp, - ModuleItem, ObjectLit, Program, Prop, PropName, PropOrSpread, Script, Stmt, Str, + self, AssignTarget, ComputedPropName, Expr, ExprStmt, Ident, KeyValueProp, Lit, MemberExpr, + MemberProp, ModuleItem, ObjectLit, Program, Prop, PropName, PropOrSpread, Script, + SimpleAssignTarget, Stmt, Str, }, quote, quote_expr, }; @@ -28,7 +30,7 @@ use super::base::ReferencedAsset; use crate::{ chunk::{EcmascriptChunkPlaceable, EcmascriptExports}, code_gen::{CodeGenerateable, CodeGeneration}, - create_visitor, + create_visitor, magic_identifier, references::esm::base::insert_hoisted_stmt, }; @@ -497,12 +499,17 @@ impl CodeGenerateable for EsmExports { "(() => { throw new Error(\"Failed binding. See build errors!\"); })" as Expr, )), EsmExport::LocalBinding(name, mutable) => { + let local = if name == "default" { + Cow::Owned(magic_identifier::mangle("default export")) + } else { + Cow::Borrowed(name.as_str()) + }; if *mutable { Some(quote!( "([() => $local, ($new) => $local = $new])" as Expr, - local = Ident::new((name as &str).into(), DUMMY_SP, Default::default()), + local = Ident::new(local.into(), DUMMY_SP, Default::default()), new = Ident::new( - format!("{name}_new_value").into(), + format!("new_{name}").into(), DUMMY_SP, Default::default() ), @@ -518,9 +525,13 @@ impl CodeGenerateable for EsmExports { let referenced_asset = ReferencedAsset::from_resolve_result(esm_ref.resolve_reference()).await?; referenced_asset.get_ident().await?.map(|ident| { - let expr = Expr::Member(MemberExpr { + let expr = MemberExpr { span: DUMMY_SP, - obj: Box::new(Expr::Ident(Ident::new(ident.into(), DUMMY_SP, Default::default()))), + obj: Box::new(Expr::Ident(Ident::new( + ident.into(), + DUMMY_SP, + Default::default(), + ))), prop: MemberProp::Computed(ComputedPropName { span: DUMMY_SP, expr: Box::new(Expr::Lit(Lit::Str(Str { @@ -529,17 +540,22 @@ impl CodeGenerateable for EsmExports { raw: None, }))), }), - }); + }; if *mutable { quote!( - "([() => $expr, ($new) => $expr = $new])" as Expr, - expr: Expr = expr, - new = Ident::new(format!("{name}_new_value").into(), DUMMY_SP, Default::default()), + "([() => $expr, ($new) => $lhs = $new])" as Expr, + expr: Expr = Expr::Member(expr.clone()), + lhs: AssignTarget = AssignTarget::Simple(SimpleAssignTarget::Member(expr)), + new = Ident::new( + format!("new_{name}").into(), + DUMMY_SP, + Default::default() + ), ) } else { quote!( "(() => $expr)" as Expr, - expr: Expr = expr, + expr: Expr = Expr::Member(expr), ) } }) diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs index ed45606d0b687..71435bf946ab3 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs @@ -11,7 +11,7 @@ use turbopack_core::{ use super::{ chunk_item::EcmascriptModulePartChunkItem, get_part_id, part_of_module, split, split_module, - Key, SplitResult, + Key, PartId, SplitResult, }; use crate::{ chunk::{EcmascriptChunkPlaceable, EcmascriptExports}, @@ -27,7 +27,7 @@ use crate::{ #[turbo_tasks::value] pub struct EcmascriptModulePartAsset { pub full_module: Vc, - pub(crate) part: Vc, + pub part: Vc, } #[turbo_tasks::value_impl] @@ -40,15 +40,14 @@ impl EcmascriptParsable for EcmascriptModulePartAsset { let split_data = split(this.full_module.ident(), this.full_module.source(), parsed); Ok(part_of_module(split_data, this.part)) } - #[turbo_tasks::function] - async fn parse_original(self: Vc) -> Result> { - Ok(self.await?.full_module.parse_original()) + fn parse_original(&self) -> Result> { + Ok(self.full_module.parse_original()) } #[turbo_tasks::function] - async fn ty(self: Vc) -> Result> { - Ok(self.await?.full_module.ty()) + async fn ty(&self) -> Result> { + Ok(self.full_module.ty()) } } @@ -212,11 +211,17 @@ impl Module for EcmascriptModulePartAsset { let mut assets = deps .iter() - .map(|&part_id| { + .map(|part_id| { Ok(Vc::upcast(SingleModuleReference::new( Vc::upcast(EcmascriptModulePartAsset::new( self.full_module, - ModulePart::internal(part_id), + match part_id { + PartId::Internal(part_id) => ModulePart::internal(*part_id), + PartId::Export(name) => ModulePart::export(name.clone()), + _ => unreachable!( + "PartId other than Internal and Export should not be used here" + ), + }, )), Vc::cell("ecmascript module part".into()), ))) diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs index bce2ad4e1fda1..71cd2a08b44f1 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -11,7 +11,7 @@ use petgraph::{ }; use rustc_hash::{FxHashMap, FxHashSet, FxHasher}; use swc_core::{ - common::{util::take::Take, SyntaxContext, DUMMY_SP}, + common::{comments::Comments, util::take::Take, Spanned, SyntaxContext, DUMMY_SP}, ecma::{ ast::{ op, ClassDecl, Decl, DefaultDecl, EsReserved, ExportAll, ExportDecl, @@ -21,7 +21,7 @@ use swc_core::{ PropName, PropOrSpread, Stmt, VarDecl, VarDeclKind, VarDeclarator, }, atoms::JsWord, - utils::{find_pat_ids, private_ident, quote_ident}, + utils::{find_pat_ids, private_ident, quote_ident, ExprCtx, ExprExt}, }, }; use turbo_tasks::RcStr; @@ -207,7 +207,7 @@ pub(super) struct SplitModuleResult { pub entrypoints: FxHashMap, /// Dependency between parts. - pub part_deps: FxHashMap>, + pub part_deps: FxHashMap>, pub modules: Vec, pub star_reexports: Vec, @@ -241,10 +241,14 @@ impl DepGraph { /// a usage side, `import` and `export` will be added. /// /// Note: ESM imports are immutable, but we do not handle it. - pub(super) fn split_module(&self, data: &FxHashMap) -> SplitModuleResult { - let groups = self.finalize(); + pub(super) fn split_module( + &self, + directives: &[ModuleItem], + data: &FxHashMap, + ) -> SplitModuleResult { + let groups = self.finalize(data); let mut exports = FxHashMap::default(); - let mut part_deps = FxHashMap::<_, Vec<_>>::default(); + let mut part_deps = FxHashMap::<_, Vec>::default(); let star_reexports: Vec<_> = data .values() @@ -253,6 +257,7 @@ impl DepGraph { .collect(); let mut modules = vec![]; let mut exports_module = Module::dummy(); + exports_module.body.extend(directives.iter().cloned()); if groups.graph_ix.is_empty() { // If there's no dependency, all nodes are in the module evaluaiotn group. @@ -265,6 +270,7 @@ impl DepGraph { } let mut declarator = FxHashMap::default(); + let mut exporter = FxHashMap::default(); for (ix, group) in groups.graph_ix.iter().enumerate() { for id in group { @@ -273,6 +279,10 @@ impl DepGraph { for var in item.var_decls.iter() { declarator.entry(var.clone()).or_insert_with(|| ix as u32); } + + if let Some(export) = &item.export { + exporter.insert(export.clone(), ix as u32); + } } } @@ -288,7 +298,7 @@ impl DepGraph { for (ix, group) in groups.graph_ix.iter().enumerate() { let mut chunk = Module { span: DUMMY_SP, - body: vec![], + body: directives.to_vec(), shebang: None, }; @@ -342,7 +352,7 @@ impl DepGraph { src: Some(Box::new(TURBOPACK_PART_IMPORT_SOURCE.into())), type_only: false, with: Some(Box::new(create_turbopack_part_id_assert( - PartId::Export(export.to_string().into()), + PartId::Export(export.as_str().into()), ))), }), )); @@ -376,7 +386,7 @@ impl DepGraph { } // Import variables - for var in required_vars { + for &var in &required_vars { let Some(&dep) = declarator.get(var) else { continue; }; @@ -395,7 +405,10 @@ impl DepGraph { is_type_only: false, })]; - part_deps.entry(ix as u32).or_default().push(dep); + part_deps + .entry(ix as u32) + .or_default() + .push(PartId::Internal(dep)); chunk .body @@ -412,6 +425,17 @@ impl DepGraph { } for g in group { + // Skip directives, as we copy them to each modules. + if let ModuleItem::Stmt(Stmt::Expr(ExprStmt { + expr: box Expr::Lit(Lit::Str(s)), + .. + })) = &data[g].content + { + if s.value.starts_with("use ") { + continue; + } + } + chunk.body.push(data[g].content.clone()); } @@ -481,7 +505,10 @@ impl DepGraph { /// /// Note that [ModuleItem] and [Module] are represented as [ItemId] for /// performance. - pub(super) fn finalize(&self) -> InternedGraph> { + pub(super) fn finalize( + &self, + _data: &FxHashMap, + ) -> InternedGraph> { let graph = self.g.idx_graph.clone().into_graph::(); let condensed = condensation(graph, false); @@ -528,6 +555,7 @@ impl DepGraph { pub(super) fn init( &mut self, module: &Module, + comments: &dyn Comments, unresolved_ctxt: SyntaxContext, top_level_ctxt: SyntaxContext, ) -> (Vec, FxHashMap) { @@ -542,13 +570,13 @@ impl DepGraph { match item { ModuleDecl::ExportDecl(item) => match &item.decl { Decl::Fn(FnDecl { ident, .. }) | Decl::Class(ClassDecl { ident, .. }) => { - exports.push((ident.to_id(), None)); + exports.push((ident.to_id(), ident.sym.clone())); } Decl::Var(v) => { for decl in &v.decls { let ids: Vec = find_pat_ids(&decl.name); for id in ids { - exports.push((id, None)); + exports.push((id.clone(), id.0)); } } } @@ -587,7 +615,7 @@ impl DepGraph { ModuleExportName::Ident(i) => i.clone(), ModuleExportName::Str(..) => quote_ident!("_tmp").into(), }, - Some(s.exported.clone().unwrap_or_else(|| s.orig.clone())), + s.exported.clone().unwrap_or_else(|| s.orig.clone()), ), ExportSpecifier::Default(s) => ( Some(ModuleExportName::Ident(Ident::new( @@ -596,7 +624,7 @@ impl DepGraph { Default::default(), ))), quote_ident!("default").into(), - Some(ModuleExportName::Ident(s.exported.clone())), + ModuleExportName::Ident(s.exported.clone()), ), ExportSpecifier::Namespace(s) => ( None, @@ -604,7 +632,7 @@ impl DepGraph { ModuleExportName::Ident(i) => i.clone(), ModuleExportName::Str(..) => quote_ident!("_tmp").into(), }, - Some(s.name.clone()), + s.name.clone(), ), }; @@ -615,7 +643,7 @@ impl DepGraph { local = local.into_private(); } - exports.push((local.to_id(), exported.clone())); + exports.push((local.to_id(), exported.atom().clone())); if let Some(src) = &item.src { let id = ItemId::Item { @@ -708,10 +736,21 @@ impl DepGraph { write_vars: used_ids.write, eventual_write_vars: captured_ids.write, var_decls: [default_var.to_id()].into_iter().collect(), - content: ModuleItem::ModuleDecl(item.clone()), + content: ModuleItem::Stmt(Stmt::Decl(match &export.decl { + DefaultDecl::Class(c) => Decl::Class(ClassDecl { + ident: default_var.clone(), + declare: false, + class: c.class.clone(), + }), + DefaultDecl::Fn(f) => Decl::Fn(FnDecl { + ident: default_var.clone(), + declare: false, + function: f.function.clone(), + }), + DefaultDecl::TsInterfaceDecl(_) => unreachable!(), + })), ..Default::default() }; - let id = ItemId::Item { index, kind: ItemIdItemKind::Normal, @@ -720,10 +759,7 @@ impl DepGraph { items.insert(id, data); } - exports.push(( - default_var.to_id(), - Some(ModuleExportName::Ident(quote_ident!("default").into())), - )); + exports.push((default_var.to_id(), "default".into())); } ModuleDecl::ExportDefaultExpr(export) => { let default_var = @@ -782,10 +818,7 @@ impl DepGraph { { // For export default __TURBOPACK__default__export__ - exports.push(( - default_var.to_id(), - Some(ModuleExportName::Ident(quote_ident!("default").into())), - )); + exports.push((default_var.to_id(), "default".into())); } } @@ -938,6 +971,11 @@ impl DepGraph { }; ids.push(id.clone()); + let has_explicit_pure = match &decl.init { + Some(e) => comments.has_flag(e.span().lo, "PURE"), + _ => false, + }; + let decl_ids: Vec = find_pat_ids(&decl.name); let mut vars = ids_used_by_ignoring_nested( &decl.init, @@ -955,7 +993,14 @@ impl DepGraph { vars.read.retain(|id| !decl_ids.contains(id)); eventual_vars.read.retain(|id| !decl_ids.contains(id)); - let side_effects = vars.found_unresolved; + let side_effects = !has_explicit_pure + && (vars.found_unresolved + || decl.init.as_deref().map_or(false, |e| { + e.may_have_side_effects(&ExprCtx { + unresolved_ctxt, + is_unresolved_ref_safe: false, + }) + })); let var_decl = Box::new(VarDecl { decls: vec![decl.clone()], @@ -966,10 +1011,15 @@ impl DepGraph { items.insert( id, ItemData { + pure: has_explicit_pure, var_decls: decl_ids.clone().into_iter().collect(), read_vars: vars.read, + write_vars: if has_explicit_pure { + Default::default() + } else { + vars.write + }, eventual_read_vars: eventual_vars.read, - write_vars: vars.write, eventual_write_vars: eventual_vars.write, content, side_effects, @@ -1081,11 +1131,7 @@ impl DepGraph { } for (local, export_name) in exports { - let name = match &export_name { - Some(ModuleExportName::Ident(v)) => v.sym.clone(), - _ => local.0.clone(), - }; - let id = ItemId::Group(ItemIdGroupKind::Export(local.clone(), name.clone())); + let id = ItemId::Group(ItemIdGroupKind::Export(local.clone(), export_name.clone())); ids.push(id.clone()); items.insert( id.clone(), @@ -1095,7 +1141,11 @@ impl DepGraph { specifiers: vec![ExportSpecifier::Named(ExportNamedSpecifier { span: DUMMY_SP, orig: ModuleExportName::Ident(local.clone().into()), - exported: export_name, + exported: if local.0 == export_name { + None + } else { + Some(ModuleExportName::Ident(export_name.clone().into())) + }, is_type_only: false, })], src: None, @@ -1103,7 +1153,7 @@ impl DepGraph { with: None, })), read_vars: [local.clone()].into_iter().collect(), - export: Some(name), + export: Some(export_name), ..Default::default() }, ); diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs index 96429ea0d1b48..c9087725ef662 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs @@ -4,11 +4,11 @@ use anyhow::{bail, Result}; use indexmap::IndexSet; use rustc_hash::FxHashMap; use swc_core::{ - common::{util::take::Take, SyntaxContext, DUMMY_SP, GLOBALS}, + common::{comments::Comments, util::take::Take, SyntaxContext, DUMMY_SP, GLOBALS}, ecma::{ ast::{ - ExportAll, ExportNamedSpecifier, Id, Ident, ImportDecl, Module, ModuleDecl, - ModuleExportName, ModuleItem, NamedExport, Program, + ExportAll, ExportNamedSpecifier, Expr, ExprStmt, Id, Ident, ImportDecl, Lit, Module, + ModuleDecl, ModuleExportName, ModuleItem, NamedExport, Program, Stmt, }, codegen::to_code, }, @@ -65,11 +65,12 @@ fn get_var<'a>(map: &'a FxHashMap, id: &Id) -> Cow<'a, VarState> { impl Analyzer<'_> { pub(super) fn analyze( module: &Module, + comments: &dyn Comments, unresolved_ctxt: SyntaxContext, top_level_ctxt: SyntaxContext, ) -> (DepGraph, FxHashMap) { let mut g = DepGraph::default(); - let (item_ids, mut items) = g.init(module, unresolved_ctxt, top_level_ctxt); + let (item_ids, mut items) = g.init(module, comments, unresolved_ctxt, top_level_ctxt); let mut analyzer = Analyzer { g: &mut g, @@ -397,7 +398,7 @@ pub(crate) enum SplitResult { modules: Vec>, #[turbo_tasks(trace_ignore)] - deps: FxHashMap>, + deps: FxHashMap>, #[turbo_tasks(debug_ignore, trace_ignore)] star_reexports: Vec, @@ -451,9 +452,26 @@ pub(super) async fn split( Program::Script(..) => unreachable!("CJS is already handled"), }; + // We copy directives like `use client` or `use server` to each module + let directives = module + .body + .iter() + .take_while(|item| { + matches!( + item, + ModuleItem::Stmt(Stmt::Expr(ExprStmt { + expr: box Expr::Lit(Lit::Str(..)), + .. + })) + ) + }) + .cloned() + .collect::>(); + let (mut dep_graph, items) = GLOBALS.set(globals, || { Analyzer::analyze( module, + comments, SyntaxContext::empty().apply_mark(eval_context.unresolved_mark), SyntaxContext::empty().apply_mark(eval_context.top_level_mark), ) @@ -466,7 +484,7 @@ pub(super) async fn split( part_deps, modules, star_reexports, - } = dep_graph.split_module(&items); + } = dep_graph.split_module(&directives, &items); assert_ne!(modules.len(), 0, "modules.len() == 0;\nModule: {module:?}",); @@ -518,7 +536,7 @@ pub(super) async fn split( } #[turbo_tasks::function] -pub(super) async fn part_of_module( +pub(crate) async fn part_of_module( split_data: Vc, part: Vc, ) -> Result> { @@ -627,83 +645,6 @@ pub(super) async fn part_of_module( } } - if matches!(&*part.await?, ModulePart::Exports) { - if let ParseResult::Ok { - comments, - eval_context, - globals, - source_map, - .. - } = &*modules[0].await? - { - let mut export_names = entrypoints - .keys() - .filter_map(|key| { - if let Key::Export(v) = key { - Some(v.clone()) - } else { - None - } - }) - .collect::>(); - export_names.sort(); - - let mut module = Module::dummy(); - - for export_name in export_names { - // We can't use quote! as `with` is not standard yet - let chunk_prop = - create_turbopack_part_id_assert(PartId::Export(export_name.clone())); - - let specifier = - swc_core::ecma::ast::ExportSpecifier::Named(ExportNamedSpecifier { - span: DUMMY_SP, - orig: ModuleExportName::Ident(Ident::new( - export_name.as_str().into(), - DUMMY_SP, - Default::default(), - )), - exported: None, - is_type_only: false, - }); - module - .body - .push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed( - NamedExport { - span: DUMMY_SP, - specifiers: vec![specifier], - src: Some(Box::new(TURBOPACK_PART_IMPORT_SOURCE.into())), - type_only: false, - with: Some(Box::new(chunk_prop)), - }, - ))); - } - - module.body.extend(star_reexports.iter().map(|export_all| { - ModuleItem::ModuleDecl(ModuleDecl::ExportAll(export_all.clone())) - })); - - let program = Program::Module(module); - let eval_context = EvalContext::new( - &program, - eval_context.unresolved_mark, - eval_context.top_level_mark, - None, - None, - ); - return Ok(ParseResult::Ok { - program, - comments: comments.clone(), - eval_context, - globals: globals.clone(), - source_map: source_map.clone(), - } - .cell()); - } else { - unreachable!() - } - } - let part_id = get_part_id(&split_data, part).await?; if part_id as usize >= modules.len() { diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs index 12c3d572b0961..60cec2fa34bf1 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs @@ -10,12 +10,12 @@ use indexmap::IndexSet; use rustc_hash::FxHasher; use serde::Deserialize; use swc_core::{ - common::{util::take::Take, Mark, SourceMap, SyntaxContext}, + common::{comments::SingleThreadedComments, util::take::Take, Mark, SourceMap, SyntaxContext}, ecma::{ ast::{EsVersion, Id, Module}, atoms::JsWord, codegen::text_writer::JsWriter, - parser::parse_file_as_module, + parser::{parse_file_as_module, EsSyntax}, visit::VisitMutWith, }, testing::{self, fixture, NormalizedOutput}, @@ -52,11 +52,15 @@ fn run(input: PathBuf) { testing::run_test(false, |cm, _handler| { let fm = cm.load_file(&input).unwrap(); + let comments = SingleThreadedComments::default(); let mut module = parse_file_as_module( &fm, - Default::default(), + swc_core::ecma::parser::Syntax::Es(EsSyntax { + jsx: true, + ..Default::default() + }), EsVersion::latest(), - None, + Some(&comments), &mut vec![], ) .unwrap(); @@ -73,7 +77,7 @@ fn run(input: PathBuf) { )); let mut g = DepGraph::default(); - let (item_ids, mut items) = g.init(&module, unresolved_ctxt, top_level_ctxt); + let (item_ids, mut items) = g.init(&module, &comments, unresolved_ctxt, top_level_ctxt); let mut s = String::new(); @@ -163,7 +167,7 @@ fn run(input: PathBuf) { writeln!(s, "# Phase 4").unwrap(); writeln!(s, "```mermaid\n{}```", render_graph(&item_ids, analyzer.g)).unwrap(); - let mut condensed = analyzer.g.finalize(); + let mut condensed = analyzer.g.finalize(analyzer.items); writeln!(s, "# Final").unwrap(); writeln!( @@ -190,7 +194,7 @@ fn run(input: PathBuf) { modules, entrypoints, .. - } = g.split_module(analyzer.items); + } = g.split_module(&[], analyzer.items); writeln!(s, "# Entrypoints\n\n```\n{:#?}\n```\n\n", entrypoints).unwrap(); diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/app-route/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/app-route/output.md index 9efed6d60f87a..33f07097a587a 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/app-route/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/app-route/output.md @@ -444,7 +444,7 @@ import "__TURBOPACK_PART__" assert { import { a as originalPathname } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { originalPathname as originalPathname }; +export { originalPathname }; ``` ## Part 2 @@ -597,7 +597,7 @@ import "__TURBOPACK_PART__" assert { import { f as routeModule } from "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -export { routeModule as routeModule }; +export { routeModule }; ``` ## Part 13 @@ -628,7 +628,7 @@ import "__TURBOPACK_PART__" assert { import { i as serverHooks } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { serverHooks as serverHooks }; +export { serverHooks }; ``` ## Part 15 @@ -639,7 +639,7 @@ import "__TURBOPACK_PART__" assert { import { h as staticGenerationAsyncStorage } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { staticGenerationAsyncStorage as staticGenerationAsyncStorage }; +export { staticGenerationAsyncStorage }; ``` ## Part 16 @@ -684,7 +684,7 @@ import "__TURBOPACK_PART__" assert { import { j as patchFetch } from "__TURBOPACK_PART__" assert { __turbopack_part__: 16 }; -export { patchFetch as patchFetch }; +export { patchFetch }; ``` ## Part 18 @@ -695,7 +695,7 @@ import "__TURBOPACK_PART__" assert { import { g as requestAsyncStorage } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { requestAsyncStorage as requestAsyncStorage }; +export { requestAsyncStorage }; ``` ## Part 19 @@ -785,7 +785,7 @@ import "__TURBOPACK_PART__" assert { import { a as originalPathname } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { originalPathname as originalPathname }; +export { originalPathname }; ``` ## Part 2 @@ -915,7 +915,7 @@ import "__TURBOPACK_PART__" assert { import { f as routeModule } from "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -export { routeModule as routeModule }; +export { routeModule }; ``` ## Part 12 @@ -974,7 +974,7 @@ import "__TURBOPACK_PART__" assert { import { j as patchFetch } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { patchFetch as patchFetch }; +export { patchFetch }; ``` ## Part 15 @@ -985,7 +985,7 @@ import "__TURBOPACK_PART__" assert { import { i as serverHooks } from "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -export { serverHooks as serverHooks }; +export { serverHooks }; ``` ## Part 16 @@ -996,7 +996,7 @@ import "__TURBOPACK_PART__" assert { import { h as staticGenerationAsyncStorage } from "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -export { staticGenerationAsyncStorage as staticGenerationAsyncStorage }; +export { staticGenerationAsyncStorage }; ``` ## Part 17 @@ -1007,7 +1007,7 @@ import "__TURBOPACK_PART__" assert { import { g as requestAsyncStorage } from "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -export { requestAsyncStorage as requestAsyncStorage }; +export { requestAsyncStorage }; ``` ## Part 18 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/combined-export/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/combined-export/output.md index 7e7a4569f4ac8..14b3cfa980ace 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/combined-export/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/combined-export/output.md @@ -120,7 +120,7 @@ import "__TURBOPACK_PART__" assert { import { a as b } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { b as b }; +export { b }; ``` ## Part 2 @@ -139,7 +139,7 @@ import "__TURBOPACK_PART__" assert { import { b as a } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { a as a }; +export { a }; ``` ## Part 4 @@ -195,7 +195,7 @@ import "__TURBOPACK_PART__" assert { import { a as b } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { b as b }; +export { b }; ``` ## Part 2 @@ -214,7 +214,7 @@ import "__TURBOPACK_PART__" assert { import { b as a } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { a as a }; +export { a }; ``` ## Part 4 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-2/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-2/output.md index 7ebaa096bdbd4..fae660f2d010f 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-2/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/failed-2/output.md @@ -89,6 +89,7 @@ const hasPostpone = typeof React.unstable_postpone === 'function'; ``` +- Side effects - Declares: `hasPostpone` - Reads: `React` - Write: `React`, `hasPostpone` @@ -389,6 +390,15 @@ graph TD Item4 --> Item2; Item4 --> Item3; Item9 --> Item5; + Item9 --> Item1; + Item9 --> Item2; + Item9 --> Item3; + Item9 --> Item4; + Item9 -.-> Item8; + Item9 -.-> Item7; + Item9 -.-> Item15; + Item9 -.-> Item6; + Item9 -.-> Item18; Item21 --> Item10; Item22 --> Item11; Item23 --> Item12; @@ -445,6 +455,15 @@ graph TD Item4 --> Item2; Item4 --> Item3; Item9 --> Item5; + Item9 --> Item1; + Item9 --> Item2; + Item9 --> Item3; + Item9 --> Item4; + Item9 -.-> Item8; + Item9 -.-> Item7; + Item9 -.-> Item15; + Item9 -.-> Item6; + Item9 -.-> Item18; Item21 --> Item10; Item22 --> Item11; Item23 --> Item12; @@ -518,6 +537,15 @@ graph TD Item4 --> Item2; Item4 --> Item3; Item9 --> Item5; + Item9 --> Item1; + Item9 --> Item2; + Item9 --> Item3; + Item9 --> Item4; + Item9 -.-> Item8; + Item9 -.-> Item7; + Item9 -.-> Item15; + Item9 -.-> Item6; + Item9 -.-> Item18; Item21 --> Item10; Item22 --> Item11; Item23 --> Item12; @@ -547,74 +575,77 @@ graph TD Item20 --> Item2; Item20 --> Item3; Item20 --> Item4; + Item20 --> Item9; ``` # Final ```mermaid graph TD - N0["Items: [ItemId(1, ImportBinding(0))]"]; - N1["Items: [ItemId(2, ImportBinding(0))]"]; - N2["Items: [ItemId(3, ImportBinding(0))]"]; - N3["Items: [ItemId(12, Normal)]"]; - N4["Items: [ItemId(Export(("formatDynamicAPIAccesses", #2), "formatDynamicAPIAccesses"))]"]; - N5["Items: [ItemId(11, Normal)]"]; - N6["Items: [ItemId(Export(("usedDynamicAPIs", #2), "usedDynamicAPIs"))]"]; - N7["Items: [ItemId(5, Normal)]"]; - N8["Items: [ItemId(Export(("createPrerenderState", #2), "createPrerenderState"))]"]; + N0["Items: [ItemId(12, Normal)]"]; + N1["Items: [ItemId(Export(("formatDynamicAPIAccesses", #2), "formatDynamicAPIAccesses"))]"]; + N2["Items: [ItemId(11, Normal)]"]; + N3["Items: [ItemId(Export(("usedDynamicAPIs", #2), "usedDynamicAPIs"))]"]; + N4["Items: [ItemId(5, Normal)]"]; + N5["Items: [ItemId(Export(("createPrerenderState", #2), "createPrerenderState"))]"]; + N6["Items: [ItemId(1, ImportBinding(0))]"]; + N7["Items: [ItemId(2, ImportBinding(0))]"]; + N8["Items: [ItemId(3, ImportBinding(0))]"]; N9["Items: [ItemId(0, ImportBinding(0))]"]; - N10["Items: [ItemId(4, VarDeclarator(0))]"]; - N11["Items: [ItemId(13, Normal)]"]; - N12["Items: [ItemId(14, Normal)]"]; - N13["Items: [ItemId(Export(("createPostponedAbortSignal", #2), "createPostponedAbortSignal"))]"]; - N14["Items: [ItemId(10, Normal)]"]; - N15["Items: [ItemId(9, Normal)]"]; - N16["Items: [ItemId(Export(("trackDynamicFetch", #2), "trackDynamicFetch"))]"]; - N17["Items: [ItemId(8, Normal)]"]; - N18["Items: [ItemId(Export(("Postpone", #2), "Postpone"))]"]; - N19["Items: [ItemId(7, Normal)]"]; - N20["Items: [ItemId(Export(("trackDynamicDataAccessed", #2), "trackDynamicDataAccessed"))]"]; - N21["Items: [ItemId(6, Normal)]"]; - N22["Items: [ItemId(Export(("markCurrentScopeAsDynamic", #2), "markCurrentScopeAsDynamic"))]"]; - N23["Items: [ItemId(0, ImportOfModule)]"]; - N24["Items: [ItemId(1, ImportOfModule)]"]; - N25["Items: [ItemId(2, ImportOfModule)]"]; - N26["Items: [ItemId(3, ImportOfModule)]"]; - N27["Items: [ItemId(ModuleEvaluation)]"]; - N24 --> N23; - N25 --> N23; - N25 --> N24; - N26 --> N23; - N26 --> N24; - N26 --> N25; - N10 --> N9; - N8 --> N7; - N22 --> N21; - N20 --> N19; - N18 --> N17; - N16 --> N15; - N6 --> N5; - N4 --> N3; - N13 --> N12; - N21 --> N2; - N21 --> N1; - N21 --> N14; - N21 --> N0; - N19 --> N2; - N19 --> N1; - N19 --> N14; - N19 --> N0; - N17 --> N14; - N15 --> N14; - N14 --> N11; - N14 --> N10; - N14 --> N9; + N10["Items: [ItemId(0, ImportOfModule)]"]; + N11["Items: [ItemId(1, ImportOfModule)]"]; + N12["Items: [ItemId(2, ImportOfModule)]"]; + N13["Items: [ItemId(3, ImportOfModule)]"]; + N14["Items: [ItemId(4, VarDeclarator(0)), ItemId(10, Normal), ItemId(13, Normal)]"]; + N15["Items: [ItemId(ModuleEvaluation)]"]; + N16["Items: [ItemId(14, Normal)]"]; + N17["Items: [ItemId(Export(("createPostponedAbortSignal", #2), "createPostponedAbortSignal"))]"]; + N18["Items: [ItemId(9, Normal)]"]; + N19["Items: [ItemId(Export(("trackDynamicFetch", #2), "trackDynamicFetch"))]"]; + N20["Items: [ItemId(8, Normal)]"]; + N21["Items: [ItemId(Export(("Postpone", #2), "Postpone"))]"]; + N22["Items: [ItemId(7, Normal)]"]; + N23["Items: [ItemId(Export(("trackDynamicDataAccessed", #2), "trackDynamicDataAccessed"))]"]; + N24["Items: [ItemId(6, Normal)]"]; + N25["Items: [ItemId(Export(("markCurrentScopeAsDynamic", #2), "markCurrentScopeAsDynamic"))]"]; N11 --> N10; - N12 --> N11; N12 --> N10; - N12 --> N9; - N27 --> N23; - N27 --> N24; - N27 --> N25; - N27 --> N26; + N12 --> N11; + N13 --> N10; + N13 --> N11; + N13 --> N12; + N14 --> N9; + N14 --> N10; + N14 --> N11; + N14 --> N12; + N14 --> N13; + N14 -.-> N8; + N14 -.-> N7; + N14 --> N14; + N14 -.-> N6; + N5 --> N4; + N25 --> N24; + N23 --> N22; + N21 --> N20; + N19 --> N18; + N3 --> N2; + N1 --> N0; + N17 --> N16; + N24 --> N8; + N24 --> N7; + N24 --> N14; + N24 --> N6; + N22 --> N8; + N22 --> N7; + N22 --> N14; + N22 --> N6; + N20 --> N14; + N18 --> N14; + N16 --> N14; + N16 --> N9; + N15 --> N10; + N15 --> N11; + N15 --> N12; + N15 --> N13; + N15 --> N14; ``` # Entrypoints @@ -622,30 +653,30 @@ graph TD { Export( "createPrerenderState", - ): 8, - ModuleEvaluation: 27, + ): 5, + ModuleEvaluation: 15, Export( "markCurrentScopeAsDynamic", - ): 22, + ): 25, Export( "usedDynamicAPIs", - ): 6, + ): 3, Export( "trackDynamicFetch", - ): 16, + ): 19, Export( "Postpone", - ): 18, + ): 21, Export( "trackDynamicDataAccessed", - ): 20, + ): 23, Export( "createPostponedAbortSignal", - ): 13, + ): 17, Export( "formatDynamicAPIAccesses", - ): 4, - Exports: 28, + ): 1, + Exports: 26, } ``` @@ -653,30 +684,6 @@ graph TD # Modules (dev) ## Part 0 ```js -import { DynamicServerError } from '../../client/components/hooks-server-context'; -export { DynamicServerError as a } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 1 -```js -import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'; -export { StaticGenBailoutError as b } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 2 -```js -import { getPathname } from '../../lib/url'; -export { getPathname as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 3 -```js function formatDynamicAPIAccesses(prerenderState) { return prerenderState.dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{ stack = stack.split('\n').slice(4).filter((line)=>{ @@ -694,44 +701,44 @@ function formatDynamicAPIAccesses(prerenderState) { return `Dynamic API Usage Debug - ${expression}:\n${stack}`; }); } -export { formatDynamicAPIAccesses as d } from "__TURBOPACK_VAR__" assert { +export { formatDynamicAPIAccesses as a } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 4 +## Part 1 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 + __turbopack_part__: 0 }; -import { d as formatDynamicAPIAccesses } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 +import { a as formatDynamicAPIAccesses } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 }; export { formatDynamicAPIAccesses }; ``` -## Part 5 +## Part 2 ```js function usedDynamicAPIs(prerenderState) { return prerenderState.dynamicAccesses.length > 0; } -export { usedDynamicAPIs as e } from "__TURBOPACK_VAR__" assert { +export { usedDynamicAPIs as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 6 +## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 2 }; -import { e as usedDynamicAPIs } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 +import { b as usedDynamicAPIs } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 }; export { usedDynamicAPIs }; ``` -## Part 7 +## Part 4 ```js function createPrerenderState(isDebugSkeleton) { return { @@ -739,21 +746,45 @@ function createPrerenderState(isDebugSkeleton) { dynamicAccesses: [] }; } -export { createPrerenderState as f } from "__TURBOPACK_VAR__" assert { +export { createPrerenderState as c } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 8 +## Part 5 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 4 }; -import { f as createPrerenderState } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import { c as createPrerenderState } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; export { createPrerenderState }; +``` +## Part 6 +```js +import { DynamicServerError } from '../../client/components/hooks-server-context'; +export { DynamicServerError as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 7 +```js +import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'; +export { StaticGenBailoutError as e } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 8 +```js +import { getPathname } from '../../lib/url'; +export { getPathname as f } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + ``` ## Part 9 ```js @@ -765,86 +796,124 @@ export { React as g } from "__TURBOPACK_VAR__" assert { ``` ## Part 10 ```js +import 'react'; + +``` +## Part 11 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 9 + __turbopack_part__: 10 }; -import { g as React } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 9 +import '../../client/components/hooks-server-context'; + +``` +## Part 12 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -const hasPostpone = typeof React.unstable_postpone === 'function'; -export { hasPostpone as h } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; +import '../../client/components/static-generation-bailout'; ``` -## Part 11 +## Part 13 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -import { h as hasPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -function assertPostpone() { - if (!hasPostpone) { - throw new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`); - } -} -export { assertPostpone as i } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 }; +import '../../lib/url'; ``` -## Part 12 +## Part 14 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 9 + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; import { g as React } from "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; -import { i as assertPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 -}; -function createPostponedAbortSignal(reason) { +const hasPostpone = typeof React.unstable_postpone === 'function'; +function postponeWithTracking(prerenderState, expression, pathname) { assertPostpone(); - const controller = new AbortController(); - try { - React.unstable_postpone(reason); - } catch (x) { - controller.abort(x); + const reason = `Route ${pathname} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`; + prerenderState.dynamicAccesses.push({ + stack: prerenderState.isDebugSkeleton ? new Error().stack : undefined, + expression + }); + React.unstable_postpone(reason); +} +function assertPostpone() { + if (!hasPostpone) { + throw new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`); } - return controller.signal; } -export { createPostponedAbortSignal as j } from "__TURBOPACK_VAR__" assert { +export { hasPostpone as h } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; +export { postponeWithTracking as i } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; +export { assertPostpone as j } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 13 +## Part 15 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 10 }; -import { j as createPostponedAbortSignal } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -export { createPostponedAbortSignal }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +"module evaluation"; ``` -## Part 14 +## Part 16 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 9 @@ -852,29 +921,41 @@ import "__TURBOPACK_PART__" assert { import { g as React } from "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; -import { i as assertPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 +import { j as assertPostpone } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -function postponeWithTracking(prerenderState, expression, pathname) { +function createPostponedAbortSignal(reason) { assertPostpone(); - const reason = `Route ${pathname} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`; - prerenderState.dynamicAccesses.push({ - stack: prerenderState.isDebugSkeleton ? new Error().stack : undefined, - expression - }); - React.unstable_postpone(reason); + const controller = new AbortController(); + try { + React.unstable_postpone(reason); + } catch (x) { + controller.abort(x); + } + return controller.signal; } -export { postponeWithTracking as k } from "__TURBOPACK_VAR__" assert { +export { createPostponedAbortSignal as k } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 15 +## Part 17 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import { k as createPostponedAbortSignal } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +export { createPostponedAbortSignal }; + +``` +## Part 18 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; -import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { +import { i as postponeWithTracking } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; function trackDynamicFetch(store, expression) { @@ -886,23 +967,23 @@ export { trackDynamicFetch as l } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 16 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 18 }; import { l as trackDynamicFetch } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 18 }; export { trackDynamicFetch }; ``` -## Part 17 +## Part 20 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; -import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { +import { i as postponeWithTracking } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; function Postpone({ reason, prerenderState, pathname }) { @@ -913,41 +994,41 @@ export { Postpone as m } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 18 +## Part 21 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 20 }; import { m as Postpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 20 }; export { Postpone }; ``` -## Part 19 +## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 6 }; -import { a as DynamicServerError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import { d as DynamicServerError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { c as getPathname } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { f as getPathname } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -import { b as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { e as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { +import { i as postponeWithTracking } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; function trackDynamicDataAccessed(store, expression) { @@ -973,41 +1054,41 @@ export { trackDynamicDataAccessed as n } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 20 +## Part 23 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 19 + __turbopack_part__: 22 }; import { n as trackDynamicDataAccessed } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 19 + __turbopack_part__: 22 }; export { trackDynamicDataAccessed }; ``` -## Part 21 +## Part 24 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 6 }; -import { a as DynamicServerError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import { d as DynamicServerError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { c as getPathname } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { f as getPathname } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -import { b as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { e as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { +import { i as postponeWithTracking } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; function markCurrentScopeAsDynamic(store, expression) { @@ -1033,73 +1114,18 @@ export { markCurrentScopeAsDynamic as o } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 22 +## Part 25 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 24 }; import { o as markCurrentScopeAsDynamic } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 24 }; export { markCurrentScopeAsDynamic }; ``` -## Part 23 -```js -import 'react'; - -``` -## Part 24 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import '../../client/components/hooks-server-context'; - -``` -## Part 25 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import '../../client/components/static-generation-bailout'; - -``` -## Part 26 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 -}; -import '../../lib/url'; - -``` -## Part 27 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 -}; -"module evaluation"; - -``` -## Part 28 +## Part 26 ```js export { formatDynamicAPIAccesses } from "__TURBOPACK_PART__" assert { __turbopack_part__: "export formatDynamicAPIAccesses" @@ -1130,16 +1156,19 @@ export { markCurrentScopeAsDynamic } from "__TURBOPACK_PART__" assert { ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 14 }; "module evaluation"; @@ -1150,29 +1179,29 @@ import "__TURBOPACK_PART__" assert { { Export( "createPrerenderState", - ): 8, + ): 5, ModuleEvaluation: 27, Export( "markCurrentScopeAsDynamic", - ): 22, + ): 26, Export( "usedDynamicAPIs", - ): 6, + ): 3, Export( "trackDynamicFetch", - ): 16, + ): 20, Export( "Postpone", - ): 18, + ): 22, Export( "trackDynamicDataAccessed", - ): 20, + ): 24, Export( "createPostponedAbortSignal", - ): 13, + ): 17, Export( "formatDynamicAPIAccesses", - ): 4, + ): 1, Exports: 28, } ``` @@ -1181,30 +1210,6 @@ import "__TURBOPACK_PART__" assert { # Modules (prod) ## Part 0 ```js -import { DynamicServerError } from '../../client/components/hooks-server-context'; -export { DynamicServerError as a } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 1 -```js -import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'; -export { StaticGenBailoutError as b } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 2 -```js -import { getPathname } from '../../lib/url'; -export { getPathname as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 3 -```js function formatDynamicAPIAccesses(prerenderState) { return prerenderState.dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{ stack = stack.split('\n').slice(4).filter((line)=>{ @@ -1222,44 +1227,44 @@ function formatDynamicAPIAccesses(prerenderState) { return `Dynamic API Usage Debug - ${expression}:\n${stack}`; }); } -export { formatDynamicAPIAccesses as d } from "__TURBOPACK_VAR__" assert { +export { formatDynamicAPIAccesses as a } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 4 +## Part 1 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 + __turbopack_part__: 0 }; -import { d as formatDynamicAPIAccesses } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 +import { a as formatDynamicAPIAccesses } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 }; export { formatDynamicAPIAccesses }; ``` -## Part 5 +## Part 2 ```js function usedDynamicAPIs(prerenderState) { return prerenderState.dynamicAccesses.length > 0; } -export { usedDynamicAPIs as e } from "__TURBOPACK_VAR__" assert { +export { usedDynamicAPIs as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 6 +## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 2 }; -import { e as usedDynamicAPIs } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 +import { b as usedDynamicAPIs } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 }; export { usedDynamicAPIs }; ``` -## Part 7 +## Part 4 ```js function createPrerenderState(isDebugSkeleton) { return { @@ -1267,21 +1272,45 @@ function createPrerenderState(isDebugSkeleton) { dynamicAccesses: [] }; } -export { createPrerenderState as f } from "__TURBOPACK_VAR__" assert { +export { createPrerenderState as c } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 8 +## Part 5 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 4 }; -import { f as createPrerenderState } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import { c as createPrerenderState } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; export { createPrerenderState }; +``` +## Part 6 +```js +import { DynamicServerError } from '../../client/components/hooks-server-context'; +export { DynamicServerError as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 7 +```js +import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'; +export { StaticGenBailoutError as e } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 8 +```js +import { getPathname } from '../../lib/url'; +export { getPathname as f } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + ``` ## Part 9 ```js @@ -1293,9 +1322,59 @@ export { React as g } from "__TURBOPACK_VAR__" assert { ``` ## Part 10 ```js +import 'react'; + +``` +## Part 11 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import '../../client/components/hooks-server-context'; + +``` +## Part 12 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import '../../client/components/static-generation-bailout'; + +``` +## Part 13 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import '../../lib/url'; + +``` +## Part 14 +```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; import { g as React } from "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; @@ -1305,13 +1384,13 @@ export { hasPostpone as h } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 11 +## Part 15 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 14 }; import { h as hasPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 14 }; function assertPostpone() { if (!hasPostpone) { @@ -1323,13 +1402,13 @@ export { assertPostpone as i } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 12 +## Part 16 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 9 @@ -1338,7 +1417,7 @@ import { g as React } from "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; import { i as assertPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 + __turbopack_part__: 15 }; function createPostponedAbortSignal(reason) { assertPostpone(); @@ -1355,24 +1434,24 @@ export { createPostponedAbortSignal as j } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 13 +## Part 17 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 16 }; import { j as createPostponedAbortSignal } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 16 }; export { createPostponedAbortSignal }; ``` -## Part 14 +## Part 18 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 9 @@ -1381,7 +1460,7 @@ import { g as React } from "__TURBOPACK_PART__" assert { __turbopack_part__: 9 }; import { i as assertPostpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 + __turbopack_part__: 15 }; function postponeWithTracking(prerenderState, expression, pathname) { assertPostpone(); @@ -1397,13 +1476,13 @@ export { postponeWithTracking as k } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 15 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; function trackDynamicFetch(store, expression) { if (!store.prerenderState || store.isUnstableCacheCallback) return; @@ -1414,24 +1493,24 @@ export { trackDynamicFetch as l } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 16 +## Part 20 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 19 }; import { l as trackDynamicFetch } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 19 }; export { trackDynamicFetch }; ``` -## Part 17 +## Part 21 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; function Postpone({ reason, prerenderState, pathname }) { postponeWithTracking(prerenderState, reason, pathname); @@ -1441,42 +1520,42 @@ export { Postpone as m } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 18 +## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 21 }; import { m as Postpone } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 21 }; export { Postpone }; ``` -## Part 19 +## Part 23 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 6 }; -import { a as DynamicServerError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import { d as DynamicServerError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { c as getPathname } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { f as getPathname } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -import { b as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { e as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; function trackDynamicDataAccessed(store, expression) { const pathname = getPathname(store.urlPathname); @@ -1501,42 +1580,42 @@ export { trackDynamicDataAccessed as n } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 20 +## Part 24 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 19 + __turbopack_part__: 23 }; import { n as trackDynamicDataAccessed } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 19 + __turbopack_part__: 23 }; export { trackDynamicDataAccessed }; ``` -## Part 21 +## Part 25 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 6 }; -import { a as DynamicServerError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import { d as DynamicServerError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { c as getPathname } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { f as getPathname } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -import { b as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { e as StaticGenBailoutError } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; import { k as postponeWithTracking } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 18 }; function markCurrentScopeAsDynamic(store, expression) { const pathname = getPathname(store.urlPathname); @@ -1561,68 +1640,33 @@ export { markCurrentScopeAsDynamic as o } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 22 +## Part 26 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 25 }; import { o as markCurrentScopeAsDynamic } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 25 }; export { markCurrentScopeAsDynamic }; ``` -## Part 23 -```js -import 'react'; - -``` -## Part 24 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import '../../client/components/hooks-server-context'; - -``` -## Part 25 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import '../../client/components/static-generation-bailout'; - -``` -## Part 26 +## Part 27 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 12 }; -import '../../lib/url'; - -``` -## Part 27 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 10 }; "module evaluation"; @@ -1658,16 +1702,19 @@ export { markCurrentScopeAsDynamic } from "__TURBOPACK_PART__" assert { ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; "module evaluation"; diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/grouping/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/grouping/output.md index 351711bd7bdf4..9180e805fd1c9 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/grouping/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/grouping/output.md @@ -471,7 +471,7 @@ import "__TURBOPACK_PART__" assert { import { a as x } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { x as x }; +export { x }; ``` ## Part 10 @@ -701,7 +701,7 @@ import "__TURBOPACK_PART__" assert { import { a as x } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { x as x }; +export { x }; ``` ## Part 11 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/mui-sys/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/mui-sys/output.md index a133a7f84f598..c917d6cc8b413 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/mui-sys/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/mui-sys/output.md @@ -259,6 +259,7 @@ export const gridColumn = style({ ``` +- Side effects - Declares: `gridColumn` - Reads: `style` - Write: `gridColumn` @@ -272,6 +273,7 @@ export const gridRow = style({ ``` +- Side effects - Declares: `gridRow` - Reads: `style` - Write: `gridRow` @@ -285,6 +287,7 @@ export const gridAutoFlow = style({ ``` +- Side effects - Declares: `gridAutoFlow` - Reads: `style` - Write: `gridAutoFlow` @@ -298,6 +301,7 @@ export const gridAutoColumns = style({ ``` +- Side effects - Declares: `gridAutoColumns` - Reads: `style` - Write: `gridAutoColumns` @@ -311,6 +315,7 @@ export const gridAutoRows = style({ ``` +- Side effects - Declares: `gridAutoRows` - Reads: `style` - Write: `gridAutoRows` @@ -324,6 +329,7 @@ export const gridTemplateColumns = style({ ``` +- Side effects - Declares: `gridTemplateColumns` - Reads: `style` - Write: `gridTemplateColumns` @@ -337,6 +343,7 @@ export const gridTemplateRows = style({ ``` +- Side effects - Declares: `gridTemplateRows` - Reads: `style` - Write: `gridTemplateRows` @@ -350,6 +357,7 @@ export const gridTemplateAreas = style({ ``` +- Side effects - Declares: `gridTemplateAreas` - Reads: `style` - Write: `gridTemplateAreas` @@ -363,6 +371,7 @@ export const gridArea = style({ ``` +- Side effects - Declares: `gridArea` - Reads: `style` - Write: `gridArea` @@ -374,6 +383,7 @@ const grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, ``` +- Side effects - Declares: `grid` - Reads: `compose`, `gap`, `columnGap`, `rowGap`, `gridColumn`, `gridRow`, `gridAutoFlow`, `gridAutoColumns`, `gridAutoRows`, `gridTemplateColumns`, `gridTemplateRows`, `gridTemplateAreas`, `gridArea` - Write: `grid` @@ -599,14 +609,149 @@ graph TD Item20 --> Item19; Item20 --> Item18; Item21 --> Item6; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item12; + Item21 --> Item13; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item18; + Item21 --> Item19; Item22 --> Item6; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item12; + Item22 --> Item13; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item21; Item23 --> Item6; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item12; + Item23 --> Item13; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item6; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item12; + Item24 --> Item13; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item21; + Item24 --> Item22; + Item24 --> Item23; Item25 --> Item6; + Item25 --> Item1; + Item25 --> Item2; + Item25 --> Item3; + Item25 --> Item4; + Item25 --> Item5; + Item25 --> Item12; + Item25 --> Item13; + Item25 --> Item15; + Item25 --> Item16; + Item25 --> Item18; + Item25 --> Item19; + Item25 --> Item21; + Item25 --> Item22; + Item25 --> Item23; + Item25 --> Item24; Item26 --> Item6; + Item26 --> Item1; + Item26 --> Item2; + Item26 --> Item3; + Item26 --> Item4; + Item26 --> Item5; + Item26 --> Item12; + Item26 --> Item13; + Item26 --> Item15; + Item26 --> Item16; + Item26 --> Item18; + Item26 --> Item19; + Item26 --> Item21; + Item26 --> Item22; + Item26 --> Item23; + Item26 --> Item24; + Item26 --> Item25; Item27 --> Item6; + Item27 --> Item1; + Item27 --> Item2; + Item27 --> Item3; + Item27 --> Item4; + Item27 --> Item5; + Item27 --> Item12; + Item27 --> Item13; + Item27 --> Item15; + Item27 --> Item16; + Item27 --> Item18; + Item27 --> Item19; + Item27 --> Item21; + Item27 --> Item22; + Item27 --> Item23; + Item27 --> Item24; + Item27 --> Item25; + Item27 --> Item26; Item28 --> Item6; + Item28 --> Item1; + Item28 --> Item2; + Item28 --> Item3; + Item28 --> Item4; + Item28 --> Item5; + Item28 --> Item12; + Item28 --> Item13; + Item28 --> Item15; + Item28 --> Item16; + Item28 --> Item18; + Item28 --> Item19; + Item28 --> Item21; + Item28 --> Item22; + Item28 --> Item23; + Item28 --> Item24; + Item28 --> Item25; + Item28 --> Item26; + Item28 --> Item27; Item29 --> Item6; + Item29 --> Item1; + Item29 --> Item2; + Item29 --> Item3; + Item29 --> Item4; + Item29 --> Item5; + Item29 --> Item12; + Item29 --> Item13; + Item29 --> Item15; + Item29 --> Item16; + Item29 --> Item18; + Item29 --> Item19; + Item29 --> Item21; + Item29 --> Item22; + Item29 --> Item23; + Item29 --> Item24; + Item29 --> Item25; + Item29 --> Item26; + Item29 --> Item27; + Item29 --> Item28; Item30 --> Item7; Item30 --> Item14; Item30 --> Item12; @@ -623,6 +768,14 @@ graph TD Item30 --> Item27; Item30 --> Item28; Item30 --> Item29; + Item30 --> Item1; + Item30 --> Item2; + Item30 --> Item3; + Item30 --> Item4; + Item30 --> Item5; + Item30 --> Item13; + Item30 --> Item16; + Item30 --> Item19; Item31 --> Item30; Item31 --> Item1; Item31 --> Item2; @@ -635,6 +788,15 @@ graph TD Item31 --> Item16; Item31 --> Item18; Item31 --> Item19; + Item31 --> Item21; + Item31 --> Item22; + Item31 --> Item23; + Item31 --> Item24; + Item31 --> Item25; + Item31 --> Item26; + Item31 --> Item27; + Item31 --> Item28; + Item31 --> Item29; Item33 --> Item14; Item33 --> Item12; Item34 --> Item17; @@ -788,14 +950,149 @@ graph TD Item20 --> Item19; Item20 --> Item18; Item21 --> Item6; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item12; + Item21 --> Item13; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item18; + Item21 --> Item19; Item22 --> Item6; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item12; + Item22 --> Item13; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item21; Item23 --> Item6; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item12; + Item23 --> Item13; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item6; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item12; + Item24 --> Item13; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item21; + Item24 --> Item22; + Item24 --> Item23; Item25 --> Item6; + Item25 --> Item1; + Item25 --> Item2; + Item25 --> Item3; + Item25 --> Item4; + Item25 --> Item5; + Item25 --> Item12; + Item25 --> Item13; + Item25 --> Item15; + Item25 --> Item16; + Item25 --> Item18; + Item25 --> Item19; + Item25 --> Item21; + Item25 --> Item22; + Item25 --> Item23; + Item25 --> Item24; Item26 --> Item6; + Item26 --> Item1; + Item26 --> Item2; + Item26 --> Item3; + Item26 --> Item4; + Item26 --> Item5; + Item26 --> Item12; + Item26 --> Item13; + Item26 --> Item15; + Item26 --> Item16; + Item26 --> Item18; + Item26 --> Item19; + Item26 --> Item21; + Item26 --> Item22; + Item26 --> Item23; + Item26 --> Item24; + Item26 --> Item25; Item27 --> Item6; + Item27 --> Item1; + Item27 --> Item2; + Item27 --> Item3; + Item27 --> Item4; + Item27 --> Item5; + Item27 --> Item12; + Item27 --> Item13; + Item27 --> Item15; + Item27 --> Item16; + Item27 --> Item18; + Item27 --> Item19; + Item27 --> Item21; + Item27 --> Item22; + Item27 --> Item23; + Item27 --> Item24; + Item27 --> Item25; + Item27 --> Item26; Item28 --> Item6; + Item28 --> Item1; + Item28 --> Item2; + Item28 --> Item3; + Item28 --> Item4; + Item28 --> Item5; + Item28 --> Item12; + Item28 --> Item13; + Item28 --> Item15; + Item28 --> Item16; + Item28 --> Item18; + Item28 --> Item19; + Item28 --> Item21; + Item28 --> Item22; + Item28 --> Item23; + Item28 --> Item24; + Item28 --> Item25; + Item28 --> Item26; + Item28 --> Item27; Item29 --> Item6; + Item29 --> Item1; + Item29 --> Item2; + Item29 --> Item3; + Item29 --> Item4; + Item29 --> Item5; + Item29 --> Item12; + Item29 --> Item13; + Item29 --> Item15; + Item29 --> Item16; + Item29 --> Item18; + Item29 --> Item19; + Item29 --> Item21; + Item29 --> Item22; + Item29 --> Item23; + Item29 --> Item24; + Item29 --> Item25; + Item29 --> Item26; + Item29 --> Item27; + Item29 --> Item28; Item30 --> Item7; Item30 --> Item14; Item30 --> Item12; @@ -812,6 +1109,14 @@ graph TD Item30 --> Item27; Item30 --> Item28; Item30 --> Item29; + Item30 --> Item1; + Item30 --> Item2; + Item30 --> Item3; + Item30 --> Item4; + Item30 --> Item5; + Item30 --> Item13; + Item30 --> Item16; + Item30 --> Item19; Item31 --> Item30; Item31 --> Item1; Item31 --> Item2; @@ -824,6 +1129,15 @@ graph TD Item31 --> Item16; Item31 --> Item18; Item31 --> Item19; + Item31 --> Item21; + Item31 --> Item22; + Item31 --> Item23; + Item31 --> Item24; + Item31 --> Item25; + Item31 --> Item26; + Item31 --> Item27; + Item31 --> Item28; + Item31 --> Item29; Item33 --> Item14; Item33 --> Item12; Item34 --> Item17; @@ -977,14 +1291,149 @@ graph TD Item20 --> Item19; Item20 --> Item18; Item21 --> Item6; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item12; + Item21 --> Item13; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item18; + Item21 --> Item19; Item22 --> Item6; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item12; + Item22 --> Item13; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item21; Item23 --> Item6; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item12; + Item23 --> Item13; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item6; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item12; + Item24 --> Item13; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item21; + Item24 --> Item22; + Item24 --> Item23; Item25 --> Item6; + Item25 --> Item1; + Item25 --> Item2; + Item25 --> Item3; + Item25 --> Item4; + Item25 --> Item5; + Item25 --> Item12; + Item25 --> Item13; + Item25 --> Item15; + Item25 --> Item16; + Item25 --> Item18; + Item25 --> Item19; + Item25 --> Item21; + Item25 --> Item22; + Item25 --> Item23; + Item25 --> Item24; Item26 --> Item6; + Item26 --> Item1; + Item26 --> Item2; + Item26 --> Item3; + Item26 --> Item4; + Item26 --> Item5; + Item26 --> Item12; + Item26 --> Item13; + Item26 --> Item15; + Item26 --> Item16; + Item26 --> Item18; + Item26 --> Item19; + Item26 --> Item21; + Item26 --> Item22; + Item26 --> Item23; + Item26 --> Item24; + Item26 --> Item25; Item27 --> Item6; + Item27 --> Item1; + Item27 --> Item2; + Item27 --> Item3; + Item27 --> Item4; + Item27 --> Item5; + Item27 --> Item12; + Item27 --> Item13; + Item27 --> Item15; + Item27 --> Item16; + Item27 --> Item18; + Item27 --> Item19; + Item27 --> Item21; + Item27 --> Item22; + Item27 --> Item23; + Item27 --> Item24; + Item27 --> Item25; + Item27 --> Item26; Item28 --> Item6; + Item28 --> Item1; + Item28 --> Item2; + Item28 --> Item3; + Item28 --> Item4; + Item28 --> Item5; + Item28 --> Item12; + Item28 --> Item13; + Item28 --> Item15; + Item28 --> Item16; + Item28 --> Item18; + Item28 --> Item19; + Item28 --> Item21; + Item28 --> Item22; + Item28 --> Item23; + Item28 --> Item24; + Item28 --> Item25; + Item28 --> Item26; + Item28 --> Item27; Item29 --> Item6; + Item29 --> Item1; + Item29 --> Item2; + Item29 --> Item3; + Item29 --> Item4; + Item29 --> Item5; + Item29 --> Item12; + Item29 --> Item13; + Item29 --> Item15; + Item29 --> Item16; + Item29 --> Item18; + Item29 --> Item19; + Item29 --> Item21; + Item29 --> Item22; + Item29 --> Item23; + Item29 --> Item24; + Item29 --> Item25; + Item29 --> Item26; + Item29 --> Item27; + Item29 --> Item28; Item30 --> Item7; Item30 --> Item14; Item30 --> Item12; @@ -1001,6 +1450,14 @@ graph TD Item30 --> Item27; Item30 --> Item28; Item30 --> Item29; + Item30 --> Item1; + Item30 --> Item2; + Item30 --> Item3; + Item30 --> Item4; + Item30 --> Item5; + Item30 --> Item13; + Item30 --> Item16; + Item30 --> Item19; Item31 --> Item30; Item31 --> Item1; Item31 --> Item2; @@ -1013,6 +1470,15 @@ graph TD Item31 --> Item16; Item31 --> Item18; Item31 --> Item19; + Item31 --> Item21; + Item31 --> Item22; + Item31 --> Item23; + Item31 --> Item24; + Item31 --> Item25; + Item31 --> Item26; + Item31 --> Item27; + Item31 --> Item28; + Item31 --> Item29; Item33 --> Item14; Item33 --> Item12; Item34 --> Item17; @@ -1040,6 +1506,16 @@ graph TD Item32 --> Item16; Item32 --> Item18; Item32 --> Item19; + Item32 --> Item21; + Item32 --> Item22; + Item32 --> Item23; + Item32 --> Item24; + Item32 --> Item25; + Item32 --> Item26; + Item32 --> Item27; + Item32 --> Item28; + Item32 --> Item29; + Item32 --> Item30; Item32 --> Item31; ``` # Final @@ -1047,39 +1523,39 @@ graph TD graph TD N0["Items: [ItemId(1, ImportBinding(0))]"]; N1["Items: [ItemId(0, ImportBinding(0))]"]; - N2["Items: [ItemId(22, VarDeclarator(0))]"]; - N3["Items: [ItemId(Export(("gridArea", #2), "gridArea"))]"]; - N4["Items: [ItemId(21, VarDeclarator(0))]"]; - N5["Items: [ItemId(Export(("gridTemplateAreas", #2), "gridTemplateAreas"))]"]; - N6["Items: [ItemId(20, VarDeclarator(0))]"]; - N7["Items: [ItemId(Export(("gridTemplateRows", #2), "gridTemplateRows"))]"]; - N8["Items: [ItemId(19, VarDeclarator(0))]"]; - N9["Items: [ItemId(Export(("gridTemplateColumns", #2), "gridTemplateColumns"))]"]; - N10["Items: [ItemId(18, VarDeclarator(0))]"]; - N11["Items: [ItemId(Export(("gridAutoRows", #2), "gridAutoRows"))]"]; - N12["Items: [ItemId(17, VarDeclarator(0))]"]; - N13["Items: [ItemId(Export(("gridAutoColumns", #2), "gridAutoColumns"))]"]; - N14["Items: [ItemId(16, VarDeclarator(0))]"]; - N15["Items: [ItemId(Export(("gridAutoFlow", #2), "gridAutoFlow"))]"]; - N16["Items: [ItemId(15, VarDeclarator(0))]"]; - N17["Items: [ItemId(Export(("gridRow", #2), "gridRow"))]"]; - N18["Items: [ItemId(14, VarDeclarator(0))]"]; - N19["Items: [ItemId(Export(("gridColumn", #2), "gridColumn"))]"]; - N20["Items: [ItemId(4, ImportBinding(0))]"]; - N21["Items: [ItemId(3, ImportBinding(0))]"]; - N22["Items: [ItemId(2, ImportBinding(1))]"]; - N23["Items: [ItemId(2, ImportBinding(0))]"]; - N24["Items: [ItemId(0, ImportOfModule)]"]; - N25["Items: [ItemId(1, ImportOfModule)]"]; - N26["Items: [ItemId(2, ImportOfModule)]"]; - N27["Items: [ItemId(3, ImportOfModule)]"]; - N28["Items: [ItemId(4, ImportOfModule)]"]; - N29["Items: [ItemId(5, VarDeclarator(0))]"]; - N30["Items: [ItemId(6, Normal)]"]; - N31["Items: [ItemId(8, VarDeclarator(0))]"]; - N32["Items: [ItemId(9, Normal)]"]; - N33["Items: [ItemId(11, VarDeclarator(0))]"]; - N34["Items: [ItemId(12, Normal)]"]; + N2["Items: [ItemId(4, ImportBinding(0))]"]; + N3["Items: [ItemId(3, ImportBinding(0))]"]; + N4["Items: [ItemId(2, ImportBinding(1))]"]; + N5["Items: [ItemId(2, ImportBinding(0))]"]; + N6["Items: [ItemId(0, ImportOfModule)]"]; + N7["Items: [ItemId(1, ImportOfModule)]"]; + N8["Items: [ItemId(2, ImportOfModule)]"]; + N9["Items: [ItemId(3, ImportOfModule)]"]; + N10["Items: [ItemId(4, ImportOfModule)]"]; + N11["Items: [ItemId(5, VarDeclarator(0))]"]; + N12["Items: [ItemId(6, Normal)]"]; + N13["Items: [ItemId(8, VarDeclarator(0))]"]; + N14["Items: [ItemId(9, Normal)]"]; + N15["Items: [ItemId(11, VarDeclarator(0))]"]; + N16["Items: [ItemId(12, Normal)]"]; + N17["Items: [ItemId(14, VarDeclarator(0))]"]; + N18["Items: [ItemId(Export(("gridColumn", #2), "gridColumn"))]"]; + N19["Items: [ItemId(15, VarDeclarator(0))]"]; + N20["Items: [ItemId(Export(("gridRow", #2), "gridRow"))]"]; + N21["Items: [ItemId(16, VarDeclarator(0))]"]; + N22["Items: [ItemId(Export(("gridAutoFlow", #2), "gridAutoFlow"))]"]; + N23["Items: [ItemId(17, VarDeclarator(0))]"]; + N24["Items: [ItemId(Export(("gridAutoColumns", #2), "gridAutoColumns"))]"]; + N25["Items: [ItemId(18, VarDeclarator(0))]"]; + N26["Items: [ItemId(Export(("gridAutoRows", #2), "gridAutoRows"))]"]; + N27["Items: [ItemId(19, VarDeclarator(0))]"]; + N28["Items: [ItemId(Export(("gridTemplateColumns", #2), "gridTemplateColumns"))]"]; + N29["Items: [ItemId(20, VarDeclarator(0))]"]; + N30["Items: [ItemId(Export(("gridTemplateRows", #2), "gridTemplateRows"))]"]; + N31["Items: [ItemId(21, VarDeclarator(0))]"]; + N32["Items: [ItemId(Export(("gridTemplateAreas", #2), "gridTemplateAreas"))]"]; + N33["Items: [ItemId(22, VarDeclarator(0))]"]; + N34["Items: [ItemId(Export(("gridArea", #2), "gridArea"))]"]; N35["Items: [ItemId(13, Normal)]"]; N36["Items: [ItemId(Export(("rowGap", #2), "rowGap"))]"]; N37["Items: [ItemId(10, Normal)]"]; @@ -1090,143 +1566,305 @@ graph TD N42["Items: [ItemId(24, Normal)]"]; N43["Items: [ItemId(ModuleEvaluation)]"]; N44["Items: [ItemId(Export(("__TURBOPACK__default__export__", #12), "default"))]"]; - N25 --> N24; - N26 --> N24; - N26 --> N25; - N27 --> N24; + N7 --> N6; + N8 --> N6; + N8 --> N7; + N9 --> N6; + N9 --> N7; + N9 --> N8; + N10 --> N6; + N10 --> N7; + N10 --> N8; + N10 --> N9; + N11 --> N5; + N11 --> N4; + N11 --> N3; + N11 --> N6; + N11 --> N7; + N11 --> N8; + N11 --> N9; + N11 --> N10; + N12 --> N11; + N12 --> N2; + N12 --> N6; + N12 --> N7; + N12 --> N8; + N12 --> N9; + N12 --> N10; + N39 --> N12; + N39 --> N11; + N13 --> N5; + N13 --> N4; + N13 --> N3; + N13 --> N6; + N13 --> N7; + N13 --> N8; + N13 --> N9; + N13 --> N10; + N13 --> N11; + N13 --> N12; + N14 --> N13; + N14 --> N2; + N14 --> N6; + N14 --> N7; + N14 --> N8; + N14 --> N9; + N14 --> N10; + N14 --> N11; + N14 --> N12; + N37 --> N14; + N37 --> N13; + N15 --> N5; + N15 --> N4; + N15 --> N3; + N15 --> N6; + N15 --> N7; + N15 --> N8; + N15 --> N9; + N15 --> N10; + N15 --> N11; + N15 --> N12; + N15 --> N13; + N15 --> N14; + N16 --> N15; + N16 --> N2; + N16 --> N6; + N16 --> N7; + N16 --> N8; + N16 --> N9; + N16 --> N10; + N16 --> N11; + N16 --> N12; + N16 --> N13; + N16 --> N14; + N35 --> N16; + N35 --> N15; + N17 --> N1; + N17 --> N6; + N17 --> N7; + N17 --> N8; + N17 --> N9; + N17 --> N10; + N17 --> N11; + N17 --> N12; + N17 --> N13; + N17 --> N14; + N17 --> N15; + N17 --> N16; + N19 --> N1; + N19 --> N6; + N19 --> N7; + N19 --> N8; + N19 --> N9; + N19 --> N10; + N19 --> N11; + N19 --> N12; + N19 --> N13; + N19 --> N14; + N19 --> N15; + N19 --> N16; + N19 --> N17; + N21 --> N1; + N21 --> N6; + N21 --> N7; + N21 --> N8; + N21 --> N9; + N21 --> N10; + N21 --> N11; + N21 --> N12; + N21 --> N13; + N21 --> N14; + N21 --> N15; + N21 --> N16; + N21 --> N17; + N21 --> N19; + N23 --> N1; + N23 --> N6; + N23 --> N7; + N23 --> N8; + N23 --> N9; + N23 --> N10; + N23 --> N11; + N23 --> N12; + N23 --> N13; + N23 --> N14; + N23 --> N15; + N23 --> N16; + N23 --> N17; + N23 --> N19; + N23 --> N21; + N25 --> N1; + N25 --> N6; + N25 --> N7; + N25 --> N8; + N25 --> N9; + N25 --> N10; + N25 --> N11; + N25 --> N12; + N25 --> N13; + N25 --> N14; + N25 --> N15; + N25 --> N16; + N25 --> N17; + N25 --> N19; + N25 --> N21; + N25 --> N23; + N27 --> N1; + N27 --> N6; + N27 --> N7; + N27 --> N8; + N27 --> N9; + N27 --> N10; + N27 --> N11; + N27 --> N12; + N27 --> N13; + N27 --> N14; + N27 --> N15; + N27 --> N16; + N27 --> N17; + N27 --> N19; + N27 --> N21; + N27 --> N23; N27 --> N25; - N27 --> N26; - N28 --> N24; - N28 --> N25; - N28 --> N26; - N28 --> N27; - N29 --> N23; - N29 --> N22; + N29 --> N1; + N29 --> N6; + N29 --> N7; + N29 --> N8; + N29 --> N9; + N29 --> N10; + N29 --> N11; + N29 --> N12; + N29 --> N13; + N29 --> N14; + N29 --> N15; + N29 --> N16; + N29 --> N17; + N29 --> N19; N29 --> N21; - N29 --> N24; + N29 --> N23; N29 --> N25; - N29 --> N26; N29 --> N27; - N29 --> N28; - N30 --> N29; - N30 --> N20; - N30 --> N24; - N30 --> N25; - N30 --> N26; - N30 --> N27; - N30 --> N28; - N39 --> N30; - N39 --> N29; - N31 --> N23; - N31 --> N22; + N31 --> N1; + N31 --> N6; + N31 --> N7; + N31 --> N8; + N31 --> N9; + N31 --> N10; + N31 --> N11; + N31 --> N12; + N31 --> N13; + N31 --> N14; + N31 --> N15; + N31 --> N16; + N31 --> N17; + N31 --> N19; N31 --> N21; - N31 --> N24; + N31 --> N23; N31 --> N25; - N31 --> N26; N31 --> N27; - N31 --> N28; N31 --> N29; - N31 --> N30; - N32 --> N31; - N32 --> N20; - N32 --> N24; - N32 --> N25; - N32 --> N26; - N32 --> N27; - N32 --> N28; - N32 --> N29; - N32 --> N30; - N37 --> N32; - N37 --> N31; - N33 --> N23; - N33 --> N22; + N33 --> N1; + N33 --> N6; + N33 --> N7; + N33 --> N8; + N33 --> N9; + N33 --> N10; + N33 --> N11; + N33 --> N12; + N33 --> N13; + N33 --> N14; + N33 --> N15; + N33 --> N16; + N33 --> N17; + N33 --> N19; N33 --> N21; - N33 --> N24; + N33 --> N23; N33 --> N25; - N33 --> N26; N33 --> N27; - N33 --> N28; N33 --> N29; - N33 --> N30; N33 --> N31; - N33 --> N32; - N34 --> N33; - N34 --> N20; - N34 --> N24; - N34 --> N25; - N34 --> N26; - N34 --> N27; - N34 --> N28; - N34 --> N29; - N34 --> N30; - N34 --> N31; - N34 --> N32; - N35 --> N34; - N35 --> N33; - N18 --> N1; - N16 --> N1; - N14 --> N1; - N12 --> N1; - N10 --> N1; - N8 --> N1; - N6 --> N1; - N4 --> N1; - N2 --> N1; N41 --> N0; N41 --> N39; - N41 --> N29; + N41 --> N11; N41 --> N37; - N41 --> N31; + N41 --> N13; N41 --> N35; + N41 --> N15; + N41 --> N17; + N41 --> N19; + N41 --> N21; + N41 --> N23; + N41 --> N25; + N41 --> N27; + N41 --> N29; + N41 --> N31; N41 --> N33; - N41 --> N18; - N41 --> N16; - N41 --> N14; - N41 --> N12; - N41 --> N10; - N41 --> N8; N41 --> N6; - N41 --> N4; - N41 --> N2; + N41 --> N7; + N41 --> N8; + N41 --> N9; + N41 --> N10; + N41 --> N12; + N41 --> N14; + N41 --> N16; N42 --> N41; - N42 --> N24; + N42 --> N6; + N42 --> N7; + N42 --> N8; + N42 --> N9; + N42 --> N10; + N42 --> N11; + N42 --> N12; + N42 --> N13; + N42 --> N14; + N42 --> N15; + N42 --> N16; + N42 --> N17; + N42 --> N19; + N42 --> N21; + N42 --> N23; N42 --> N25; - N42 --> N26; N42 --> N27; - N42 --> N28; N42 --> N29; - N42 --> N30; N42 --> N31; - N42 --> N32; N42 --> N33; - N42 --> N34; N40 --> N39; - N40 --> N29; + N40 --> N11; N38 --> N37; - N38 --> N31; + N38 --> N13; N36 --> N35; - N36 --> N33; - N19 --> N18; - N17 --> N16; - N15 --> N14; - N13 --> N12; - N11 --> N10; - N9 --> N8; - N7 --> N6; - N5 --> N4; - N3 --> N2; + N36 --> N15; + N18 --> N17; + N20 --> N19; + N22 --> N21; + N24 --> N23; + N26 --> N25; + N28 --> N27; + N30 --> N29; + N32 --> N31; + N34 --> N33; N44 --> N42; - N43 --> N24; + N43 --> N6; + N43 --> N7; + N43 --> N8; + N43 --> N9; + N43 --> N10; + N43 --> N11; + N43 --> N12; + N43 --> N13; + N43 --> N14; + N43 --> N15; + N43 --> N16; + N43 --> N17; + N43 --> N19; + N43 --> N21; + N43 --> N23; N43 --> N25; - N43 --> N26; N43 --> N27; - N43 --> N28; N43 --> N29; - N43 --> N30; N43 --> N31; - N43 --> N32; N43 --> N33; - N43 --> N34; + N43 --> N41; N43 --> N42; ``` # Entrypoints @@ -1239,41 +1877,41 @@ graph TD ): 40, Export( "gridTemplateColumns", - ): 9, + ): 28, Export( "gridAutoRows", - ): 11, + ): 26, Export( "columnGap", ): 38, Export( "gridArea", - ): 3, + ): 34, Exports: 45, Export( "gridAutoFlow", - ): 15, + ): 22, Export( "gridColumn", - ): 19, + ): 18, Export( "gridAutoColumns", - ): 13, + ): 24, Export( "rowGap", ): 36, Export( "gridTemplateRows", - ): 7, + ): 30, Export( "gridTemplateAreas", - ): 5, + ): 32, Export( "default", ): 44, Export( "gridRow", - ): 17, + ): 20, } ``` @@ -1297,72 +1935,39 @@ export { style as b } from "__TURBOPACK_VAR__" assert { ``` ## Part 2 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -const gridArea = style({ - prop: 'gridArea' -}); -export { gridArea as c } from "__TURBOPACK_VAR__" assert { +import responsivePropType from './responsivePropType'; +export { responsivePropType as c } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 3 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 -}; -import { c as gridArea } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { handleBreakpoints } from './breakpoints'; +export { handleBreakpoints as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { gridArea }; ``` ## Part 4 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -const gridTemplateAreas = style({ - prop: 'gridTemplateAreas' -}); -export { gridTemplateAreas as d } from "__TURBOPACK_VAR__" assert { +import { getValue } from './spacing'; +export { getValue as e } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 5 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { d as gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import { createUnaryUnit } from './spacing'; +export { createUnaryUnit as f } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { gridTemplateAreas }; ``` ## Part 6 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -const gridTemplateRows = style({ - prop: 'gridTemplateRows' -}); -export { gridTemplateRows as e } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; +import './style'; ``` ## Part 7 @@ -1370,1611 +1975,2565 @@ export { gridTemplateRows as e } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; -import { e as gridTemplateRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 -}; -export { gridTemplateRows }; +import './compose'; ``` ## Part 8 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 6 }; -const gridTemplateColumns = style({ - prop: 'gridTemplateColumns' -}); -export { gridTemplateColumns as f } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; +import './spacing'; ``` ## Part 9 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -import { f as gridTemplateColumns } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; -export { gridTemplateColumns }; +import './breakpoints'; ``` ## Part 10 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 6 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -const gridAutoRows = style({ - prop: 'gridAutoRows' -}); -export { gridAutoRows as g } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; +import './responsivePropType'; ``` ## Part 11 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 5 }; -import { g as gridAutoRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; -export { gridAutoRows }; - -``` -## Part 12 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 3 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -const gridAutoColumns = style({ - prop: 'gridAutoColumns' -}); -export { gridAutoColumns as h } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; - -``` -## Part 13 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 8 }; -import { h as gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -export { gridAutoColumns }; - -``` -## Part 14 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 10 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; -const gridAutoFlow = style({ - prop: 'gridAutoFlow' -}); -export { gridAutoFlow as i } from "__TURBOPACK_VAR__" assert { +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +const gap = (props)=>{ + if (props.gap !== undefined && props.gap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap'); + const styleFromPropValue = (propValue)=>({ + gap: getValue(transformer, propValue) + }); + return handleBreakpoints(props, props.gap, styleFromPropValue); + } + return null; +}; +export { gap as g } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 15 +## Part 12 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 -}; -import { i as gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 11 }; -export { gridAutoFlow }; - -``` -## Part 16 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 2 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -const gridRow = style({ - prop: 'gridRow' -}); -export { gridRow as j } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; - -``` -## Part 17 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 8 }; -import { j as gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -export { gridRow }; - -``` -## Part 18 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 10 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -const gridColumn = style({ - prop: 'gridColumn' -}); -export { gridColumn as k } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 }; +gap.propTypes = process.env.NODE_ENV !== 'production' ? { + gap: responsivePropType +} : {}; ``` -## Part 19 +## Part 13 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 5 }; -import { k as gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; -export { gridColumn }; - -``` -## Part 20 -```js -import responsivePropType from './responsivePropType'; -export { responsivePropType as l } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; - -``` -## Part 21 -```js -import { handleBreakpoints } from './breakpoints'; -export { handleBreakpoints as m } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 22 -```js -import { getValue } from './spacing'; -export { getValue as n } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 23 -```js -import { createUnaryUnit } from './spacing'; -export { createUnaryUnit as o } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 24 -```js -import './style'; - -``` -## Part 25 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import './compose'; - -``` -## Part 26 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 -}; -import './spacing'; - -``` -## Part 27 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 -}; -import './breakpoints'; - -``` -## Part 28 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 -}; -import './responsivePropType'; - -``` -## Part 29 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 12 }; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; -const gap = (props)=>{ - if (props.gap !== undefined && props.gap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap'); +const columnGap = (props)=>{ + if (props.columnGap !== undefined && props.columnGap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap'); const styleFromPropValue = (propValue)=>({ - gap: getValue(transformer, propValue) + columnGap: getValue(transformer, propValue) }); - return handleBreakpoints(props, props.gap, styleFromPropValue); + return handleBreakpoints(props, props.columnGap, styleFromPropValue); } return null; }; -export { gap as p } from "__TURBOPACK_VAR__" assert { +export { columnGap as h } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 30 +## Part 14 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 11 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -gap.propTypes = process.env.NODE_ENV !== 'production' ? { - gap: responsivePropType +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +columnGap.propTypes = process.env.NODE_ENV !== 'production' ? { + columnGap: responsivePropType } : {}; ``` -## Part 31 +## Part 15 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; -const columnGap = (props)=>{ - if (props.columnGap !== undefined && props.columnGap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap'); +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +const rowGap = (props)=>{ + if (props.rowGap !== undefined && props.rowGap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap'); const styleFromPropValue = (propValue)=>({ - columnGap: getValue(transformer, propValue) + rowGap: getValue(transformer, propValue) }); - return handleBreakpoints(props, props.columnGap, styleFromPropValue); + return handleBreakpoints(props, props.rowGap, styleFromPropValue); } return null; }; -export { columnGap as q } from "__TURBOPACK_VAR__" assert { +export { rowGap as i } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 32 +## Part 16 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 13 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 }; -columnGap.propTypes = process.env.NODE_ENV !== 'production' ? { - columnGap: responsivePropType +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +rowGap.propTypes = process.env.NODE_ENV !== 'production' ? { + rowGap: responsivePropType } : {}; ``` -## Part 33 +## Part 17 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 -}; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 16 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +const gridColumn = style({ + prop: 'gridColumn' +}); +export { gridColumn as j } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -const rowGap = (props)=>{ - if (props.rowGap !== undefined && props.rowGap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap'); - const styleFromPropValue = (propValue)=>({ - rowGap: getValue(transformer, propValue) - }); - return handleBreakpoints(props, props.rowGap, styleFromPropValue); - } - return null; + +``` +## Part 18 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; -export { rowGap as r } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { j as gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; +export { gridColumn }; ``` -## Part 34 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 15 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridRow = style({ + prop: 'gridRow' +}); +export { gridRow as k } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -rowGap.propTypes = process.env.NODE_ENV !== 'production' ? { - rowGap: responsivePropType -} : {}; ``` -## Part 35 +## Part 20 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 19 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import { k as gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -rowGap.filterProps = [ - 'rowGap' -]; +export { gridRow }; ``` -## Part 36 +## Part 21 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 35 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 6 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -export { rowGap }; - -``` -## Part 37 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 9 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -columnGap.filterProps = [ - 'columnGap' -]; - -``` -## Part 38 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 37 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 12 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -export { columnGap }; - -``` -## Part 39 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 15 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; -gap.filterProps = [ - 'gap' -]; - -``` -## Part 40 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 39 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 19 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridAutoFlow = style({ + prop: 'gridAutoFlow' +}); +export { gridAutoFlow as l } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { gap }; ``` -## Part 41 +## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 39 + __turbopack_part__: 21 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { l as gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; +export { gridAutoFlow }; + +``` +## Part 23 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 37 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 35 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 -}; -import { a as compose } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 17 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 -}; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -import { k as gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; -import { j as gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -import { i as gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 +const gridAutoColumns = style({ + prop: 'gridAutoColumns' +}); +export { gridAutoColumns as m } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -import { h as gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + +``` +## Part 24 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; -import { g as gridAutoRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 +import { m as gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; -import { f as gridTemplateColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 +export { gridAutoColumns }; + +``` +## Part 25 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -import { e as gridTemplateRows } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; -import { d as gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { c as gridArea } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -const grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea); -export { grid as s } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; - -``` -## Part 42 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 41 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 21 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 23 }; -import { s as grid } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 41 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -const __TURBOPACK__default__export__ = grid; -export { __TURBOPACK__default__export__ as t } from "__TURBOPACK_VAR__" assert { +const gridAutoRows = style({ + prop: 'gridAutoRows' +}); +export { gridAutoRows as n } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 43 +## Part 26 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 25 }; -import "__TURBOPACK_PART__" assert { +import { n as gridAutoRows } from "__TURBOPACK_PART__" assert { __turbopack_part__: 25 }; +export { gridAutoRows }; + +``` +## Part 27 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 42 + __turbopack_part__: 14 }; -"module evaluation"; - -``` -## Part 44 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 42 + __turbopack_part__: 15 }; -import { t as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 42 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; -export { __TURBOPACK__default__export__ as default }; - -``` -## Part 45 -```js -export { gridArea } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridArea" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; -export { gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateAreas" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -export { gridTemplateRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateRows" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; -export { gridTemplateColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateColumns" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; -export { gridAutoRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridAutoRows" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 }; -export { gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridAutoColumns" +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -export { gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridAutoFlow" +const gridTemplateColumns = style({ + prop: 'gridTemplateColumns' +}); +export { gridTemplateColumns as o } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridRow" + +``` +## Part 28 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 }; -export { gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridColumn" +import { o as gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 }; -export { rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export rowGap" +export { gridTemplateColumns }; + +``` +## Part 29 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -export { columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export columnGap" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -export { gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gap" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -export { default } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export default" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; - -``` -## Merged (module eval) -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 21 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 42 + __turbopack_part__: 23 }; -"module evaluation"; - -``` -# Entrypoints +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridTemplateRows = style({ + prop: 'gridTemplateRows' +}); +export { gridTemplateRows as p } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 30 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import { p as gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +export { gridTemplateRows }; + +``` +## Part 31 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridTemplateAreas = style({ + prop: 'gridTemplateAreas' +}); +export { gridTemplateAreas as q } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 32 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import { q as gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +export { gridTemplateAreas }; + +``` +## Part 33 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridArea = style({ + prop: 'gridArea' +}); +export { gridArea as r } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 34 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +import { r as gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +export { gridArea }; + +``` +## Part 35 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +rowGap.filterProps = [ + 'rowGap' +]; + +``` +## Part 36 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 35 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +export { rowGap }; + +``` +## Part 37 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +columnGap.filterProps = [ + 'columnGap' +]; + +``` +## Part 38 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 37 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +export { columnGap }; + +``` +## Part 39 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +gap.filterProps = [ + 'gap' +]; + +``` +## Part 40 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 39 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +export { gap }; + +``` +## Part 41 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 39 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 37 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 35 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import { a as compose } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import { j as gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import { k as gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import { l as gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import { m as gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import { n as gridAutoRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import { o as gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import { p as gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import { q as gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import { r as gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +const grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea); +export { grid as s } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 42 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 41 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +import { s as grid } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 41 +}; +const __TURBOPACK__default__export__ = grid; +export { __TURBOPACK__default__export__ as t } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 43 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 41 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 42 +}; +"module evaluation"; + +``` +## Part 44 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 42 +}; +import { t as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 42 +}; +export { __TURBOPACK__default__export__ as default }; + +``` +## Part 45 +```js +export { gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridColumn" +}; +export { gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridRow" +}; +export { gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridAutoFlow" +}; +export { gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridAutoColumns" +}; +export { gridAutoRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridAutoRows" +}; +export { gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateColumns" +}; +export { gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateRows" +}; +export { gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateAreas" +}; +export { gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridArea" +}; +export { rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export rowGap" +}; +export { columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export columnGap" +}; +export { gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gap" +}; +export { default } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export default" +}; + +``` +## Merged (module eval) +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 41 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 42 +}; +"module evaluation"; + +``` +# Entrypoints + +``` +{ + ModuleEvaluation: 43, + Export( + "gap", + ): 40, + Export( + "gridTemplateColumns", + ): 28, + Export( + "gridAutoRows", + ): 26, + Export( + "columnGap", + ): 38, + Export( + "gridArea", + ): 34, + Exports: 45, + Export( + "gridAutoFlow", + ): 22, + Export( + "gridColumn", + ): 18, + Export( + "gridAutoColumns", + ): 24, + Export( + "rowGap", + ): 36, + Export( + "gridTemplateRows", + ): 30, + Export( + "gridTemplateAreas", + ): 32, + Export( + "default", + ): 44, + Export( + "gridRow", + ): 20, +} +``` + + +# Modules (prod) +## Part 0 +```js +import compose from './compose'; +export { compose as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 1 +```js +import style from './style'; +export { style as b } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 2 +```js +import responsivePropType from './responsivePropType'; +export { responsivePropType as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 3 +```js +import { handleBreakpoints } from './breakpoints'; +export { handleBreakpoints as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 4 +```js +import { getValue } from './spacing'; +export { getValue as e } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 5 +```js +import { createUnaryUnit } from './spacing'; +export { createUnaryUnit as f } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 6 +```js +import './style'; + +``` +## Part 7 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import './compose'; + +``` +## Part 8 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import './spacing'; ``` -{ - ModuleEvaluation: 43, - Export( - "gap", - ): 40, - Export( - "gridTemplateColumns", - ): 9, - Export( - "gridAutoRows", - ): 11, - Export( - "columnGap", - ): 38, - Export( - "gridArea", - ): 3, - Exports: 45, - Export( - "gridAutoFlow", - ): 15, - Export( - "gridColumn", - ): 19, - Export( - "gridAutoColumns", - ): 13, - Export( - "rowGap", - ): 36, - Export( - "gridTemplateRows", - ): 7, - Export( - "gridTemplateAreas", - ): 5, - Export( - "default", - ): 44, - Export( - "gridRow", - ): 17, -} +## Part 9 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import './breakpoints'; + ``` +## Part 10 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import './responsivePropType'; +``` +## Part 11 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +const gap = (props)=>{ + if (props.gap !== undefined && props.gap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap'); + const styleFromPropValue = (propValue)=>({ + gap: getValue(transformer, propValue) + }); + return handleBreakpoints(props, props.gap, styleFromPropValue); + } + return null; +}; +export { gap as g } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; -# Modules (prod) -## Part 0 +``` +## Part 12 ```js -import compose from './compose'; -export { compose as a } from "__TURBOPACK_VAR__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +gap.propTypes = process.env.NODE_ENV !== 'production' ? { + gap: responsivePropType +} : {}; + +``` +## Part 13 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +const columnGap = (props)=>{ + if (props.columnGap !== undefined && props.columnGap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap'); + const styleFromPropValue = (propValue)=>({ + columnGap: getValue(transformer, propValue) + }); + return handleBreakpoints(props, props.columnGap, styleFromPropValue); + } + return null; +}; +export { columnGap as h } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 1 +## Part 14 ```js -import style from './style'; -export { style as b } from "__TURBOPACK_VAR__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +columnGap.propTypes = process.env.NODE_ENV !== 'production' ? { + columnGap: responsivePropType +} : {}; + +``` +## Part 15 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import { f as createUnaryUnit } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as getValue } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import { d as handleBreakpoints } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +const rowGap = (props)=>{ + if (props.rowGap !== undefined && props.rowGap !== null) { + const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap'); + const styleFromPropValue = (propValue)=>({ + rowGap: getValue(transformer, propValue) + }); + return handleBreakpoints(props, props.rowGap, styleFromPropValue); + } + return null; +}; +export { rowGap as i } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 2 +## Part 16 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 15 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 }; -const gridArea = style({ - prop: 'gridArea' -}); -export { gridArea as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; - -``` -## Part 3 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 }; -import { c as gridArea } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import { c as responsivePropType } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { gridArea }; +rowGap.propTypes = process.env.NODE_ENV !== 'production' ? { + rowGap: responsivePropType +} : {}; ``` -## Part 4 +## Part 17 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; import { b as style } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const gridTemplateAreas = style({ - prop: 'gridTemplateAreas' +const gridColumn = style({ + prop: 'gridColumn' }); -export { gridTemplateAreas as d } from "__TURBOPACK_VAR__" assert { +export { gridColumn as j } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 5 +## Part 18 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 17 }; -import { d as gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import { j as gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; -export { gridTemplateAreas }; +export { gridColumn }; ``` -## Part 6 +## Part 19 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; import { b as style } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const gridTemplateRows = style({ - prop: 'gridTemplateRows' +const gridRow = style({ + prop: 'gridRow' }); -export { gridTemplateRows as e } from "__TURBOPACK_VAR__" assert { +export { gridRow as k } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 7 +## Part 20 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 19 }; -import { e as gridTemplateRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 +import { k as gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -export { gridTemplateRows }; +export { gridRow }; ``` -## Part 8 +## Part 21 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -const gridTemplateColumns = style({ - prop: 'gridTemplateColumns' -}); -export { gridTemplateColumns as f } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; - -``` -## Part 9 -```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; -import { f as gridTemplateColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -export { gridTemplateColumns }; - -``` -## Part 10 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; import { b as style } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const gridAutoRows = style({ - prop: 'gridAutoRows' +const gridAutoFlow = style({ + prop: 'gridAutoFlow' }); -export { gridAutoRows as g } from "__TURBOPACK_VAR__" assert { +export { gridAutoFlow as l } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 11 +## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 21 }; -import { g as gridAutoRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 +import { l as gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; -export { gridAutoRows }; +export { gridAutoFlow }; ``` -## Part 12 +## Part 23 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; import { b as style } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; const gridAutoColumns = style({ prop: 'gridAutoColumns' }); -export { gridAutoColumns as h } from "__TURBOPACK_VAR__" assert { +export { gridAutoColumns as m } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 13 +## Part 24 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 23 }; -import { h as gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 +import { m as gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; export { gridAutoColumns }; ``` -## Part 14 +## Part 25 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -const gridAutoFlow = style({ - prop: 'gridAutoFlow' -}); -export { gridAutoFlow as i } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; - -``` -## Part 15 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 7 }; -import { i as gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -export { gridAutoFlow }; - -``` -## Part 16 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 9 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -const gridRow = style({ - prop: 'gridRow' -}); -export { gridRow as j } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; - -``` -## Part 17 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 12 }; -import { j as gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -export { gridRow }; - -``` -## Part 18 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 14 }; -import { b as style } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 }; -const gridColumn = style({ - prop: 'gridColumn' -}); -export { gridColumn as k } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; - -``` -## Part 19 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; -import { k as gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -export { gridColumn }; - -``` -## Part 20 -```js -import responsivePropType from './responsivePropType'; -export { responsivePropType as l } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; - -``` -## Part 21 -```js -import { handleBreakpoints } from './breakpoints'; -export { handleBreakpoints as m } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; - -``` -## Part 22 -```js -import { getValue } from './spacing'; -export { getValue as n } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; - -``` -## Part 23 -```js -import { createUnaryUnit } from './spacing'; -export { createUnaryUnit as o } from "__TURBOPACK_VAR__" assert { +const gridAutoRows = style({ + prop: 'gridAutoRows' +}); +export { gridAutoRows as n } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; -``` -## Part 24 -```js -import './style'; - -``` -## Part 25 -```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 -}; -import './compose'; - ``` ## Part 26 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 25 }; -import "__TURBOPACK_PART__" assert { +import { n as gridAutoRows } from "__TURBOPACK_PART__" assert { __turbopack_part__: 25 }; -import './spacing'; +export { gridAutoRows }; ``` ## Part 27 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 7 }; -import './breakpoints'; - -``` -## Part 28 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 11 }; -import './responsivePropType'; - -``` -## Part 29 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 21 }; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 23 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 -}; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 }; -const gap = (props)=>{ - if (props.gap !== undefined && props.gap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap'); - const styleFromPropValue = (propValue)=>({ - gap: getValue(transformer, propValue) - }); - return handleBreakpoints(props, props.gap, styleFromPropValue); - } - return null; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -export { gap as p } from "__TURBOPACK_VAR__" assert { +const gridTemplateColumns = style({ + prop: 'gridTemplateColumns' +}); +export { gridTemplateColumns as o } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 30 +## Part 28 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 27 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import { o as gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 }; +export { gridTemplateColumns }; + +``` +## Part 29 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 -}; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 9 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 -}; -gap.propTypes = process.env.NODE_ENV !== 'production' ? { - gap: responsivePropType -} : {}; - -``` -## Part 31 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 21 }; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 23 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 }; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 }; -const columnGap = (props)=>{ - if (props.columnGap !== undefined && props.columnGap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap'); - const styleFromPropValue = (propValue)=>({ - columnGap: getValue(transformer, propValue) - }); - return handleBreakpoints(props, props.columnGap, styleFromPropValue); - } - return null; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; -export { columnGap as q } from "__TURBOPACK_VAR__" assert { +const gridTemplateRows = style({ + prop: 'gridTemplateRows' +}); +export { gridTemplateRows as p } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 32 +## Part 30 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 29 +}; +import { p as gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 }; +export { gridTemplateRows }; + +``` +## Part 31 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -columnGap.propTypes = process.env.NODE_ENV !== 'production' ? { - columnGap: responsivePropType -} : {}; - -``` -## Part 33 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 21 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 23 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 25 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 27 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 29 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridTemplateAreas = style({ + prop: 'gridTemplateAreas' +}); +export { gridTemplateAreas as q } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; + +``` +## Part 32 +```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 31 }; +import { q as gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +export { gridTemplateAreas }; + +``` +## Part 33 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 1 }; -import { o as createUnaryUnit } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 23 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { n as getValue } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -import { m as handleBreakpoints } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -const rowGap = (props)=>{ - if (props.rowGap !== undefined && props.rowGap !== null) { - const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap'); - const styleFromPropValue = (propValue)=>({ - rowGap: getValue(transformer, propValue) - }); - return handleBreakpoints(props, props.rowGap, styleFromPropValue); - } - return null; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -export { rowGap as r } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; - -``` -## Part 34 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 25 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 31 +}; +import { b as style } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +const gridArea = style({ + prop: 'gridArea' +}); +export { gridArea as r } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { + +``` +## Part 34 +```js +import "__TURBOPACK_PART__" assert { __turbopack_part__: 33 }; -import { l as responsivePropType } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import { r as gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 }; -rowGap.propTypes = process.env.NODE_ENV !== 'production' ? { - rowGap: responsivePropType -} : {}; +export { gridArea }; ``` ## Part 35 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 15 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 }; rowGap.filterProps = [ 'rowGap' @@ -2987,10 +4546,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 35 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 15 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 }; export { rowGap }; @@ -2998,13 +4557,13 @@ export { rowGap }; ## Part 37 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 13 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; columnGap.filterProps = [ 'columnGap' @@ -3017,10 +4576,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 37 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 13 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; export { columnGap }; @@ -3028,13 +4587,13 @@ export { columnGap }; ## Part 39 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; gap.filterProps = [ 'gap' @@ -3047,10 +4606,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 39 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; export { gap }; @@ -3064,85 +4623,109 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 39 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 37 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 35 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 19 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 21 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 23 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 25 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; import { a as compose } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -import { p as gap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { g as gap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -import { q as columnGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 +import { h as columnGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 }; -import { r as rowGap } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import { i as rowGap } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 }; -import { k as gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import { j as gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 }; -import { j as gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 +import { k as gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 }; -import { i as gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 +import { l as gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 }; -import { h as gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 +import { m as gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; -import { g as gridAutoRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 +import { n as gridAutoRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 }; -import { f as gridTemplateColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 +import { o as gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 }; -import { e as gridTemplateRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 +import { p as gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 }; -import { d as gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import { q as gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 }; -import { c as gridArea } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { r as gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 33 }; const grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea); export { grid as s } from "__TURBOPACK_VAR__" assert { @@ -3156,37 +4739,64 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 41 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 33 }; import { s as grid } from "__TURBOPACK_PART__" assert { __turbopack_part__: 41 @@ -3200,37 +4810,67 @@ export { __TURBOPACK__default__export__ as t } from "__TURBOPACK_VAR__" assert { ## Part 43 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 25 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 33 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 41 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 42 @@ -3251,32 +4891,32 @@ export { __TURBOPACK__default__export__ as default }; ``` ## Part 45 ```js -export { gridArea } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridArea" +export { gridColumn } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridColumn" }; -export { gridTemplateAreas } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateAreas" +export { gridRow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridRow" }; -export { gridTemplateRows } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateRows" +export { gridAutoFlow } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridAutoFlow" }; -export { gridTemplateColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridTemplateColumns" +export { gridAutoColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridAutoColumns" }; export { gridAutoRows } from "__TURBOPACK_PART__" assert { __turbopack_part__: "export gridAutoRows" }; -export { gridAutoColumns } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridAutoColumns" +export { gridTemplateColumns } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateColumns" }; -export { gridAutoFlow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridAutoFlow" +export { gridTemplateRows } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateRows" }; -export { gridRow } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridRow" +export { gridTemplateAreas } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridTemplateAreas" }; -export { gridColumn } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export gridColumn" +export { gridArea } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export gridArea" }; export { rowGap } from "__TURBOPACK_PART__" assert { __turbopack_part__: "export rowGap" @@ -3295,37 +4935,67 @@ export { default } from "__TURBOPACK_PART__" assert { ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 25 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 15 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 17 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 21 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 23 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 25 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 27 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 29 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 31 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 33 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 41 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 42 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/multi-export/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/multi-export/output.md index b728501720d71..c420d4b4275d3 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/multi-export/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/multi-export/output.md @@ -120,7 +120,7 @@ import "__TURBOPACK_PART__" assert { import { a as cat } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { cat as cat }; +export { cat }; ``` ## Part 2 @@ -195,7 +195,7 @@ import "__TURBOPACK_PART__" assert { import { a as cat } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { cat as cat }; +export { cat }; ``` ## Part 2 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nanoid/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nanoid/output.md index 6f8d9d3b23160..5f6065bf68905 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nanoid/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nanoid/output.md @@ -592,7 +592,7 @@ import "__TURBOPACK_PART__" assert { import { g as customRandom } from "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; -export { customRandom as customRandom }; +export { customRandom }; ``` ## Part 11 @@ -632,7 +632,7 @@ import "__TURBOPACK_PART__" assert { import { h as random } from "__TURBOPACK_PART__" assert { __turbopack_part__: 11 }; -export { random as random }; +export { random }; ``` ## Part 13 @@ -688,7 +688,7 @@ import "__TURBOPACK_PART__" assert { import { a as urlAlphabet } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { urlAlphabet as urlAlphabet }; +export { urlAlphabet }; ``` ## Part 15 @@ -699,7 +699,7 @@ import "__TURBOPACK_PART__" assert { import { i as nanoid } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { nanoid as nanoid }; +export { nanoid }; ``` ## Part 16 @@ -730,7 +730,7 @@ import "__TURBOPACK_PART__" assert { import { j as customAlphabet } from "__TURBOPACK_PART__" assert { __turbopack_part__: 16 }; -export { customAlphabet as customAlphabet }; +export { customAlphabet }; ``` ## Part 18 @@ -952,7 +952,7 @@ import "__TURBOPACK_PART__" assert { import { g as customRandom } from "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; -export { customRandom as customRandom }; +export { customRandom }; ``` ## Part 11 @@ -992,7 +992,7 @@ import "__TURBOPACK_PART__" assert { import { h as random } from "__TURBOPACK_PART__" assert { __turbopack_part__: 11 }; -export { random as random }; +export { random }; ``` ## Part 13 @@ -1048,7 +1048,7 @@ import "__TURBOPACK_PART__" assert { import { a as urlAlphabet } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { urlAlphabet as urlAlphabet }; +export { urlAlphabet }; ``` ## Part 15 @@ -1059,7 +1059,7 @@ import "__TURBOPACK_PART__" assert { import { i as nanoid } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; -export { nanoid as nanoid }; +export { nanoid }; ``` ## Part 16 @@ -1090,7 +1090,7 @@ import "__TURBOPACK_PART__" assert { import { j as customAlphabet } from "__TURBOPACK_PART__" assert { __turbopack_part__: 16 }; -export { customAlphabet as customAlphabet }; +export { customAlphabet }; ``` ## Part 18 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nextjs-tracer/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nextjs-tracer/output.md index 8d7abd0178486..180ad1fad17b7 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nextjs-tracer/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/nextjs-tracer/output.md @@ -156,6 +156,7 @@ const rootSpanIdKey = api.createContextKey('next.rootSpanId'); ``` +- Side effects - Declares: `rootSpanIdKey` - Reads: `api` - Write: `api`, `rootSpanIdKey` @@ -356,6 +357,7 @@ const getTracer = (()=>{ ``` +- Side effects - Declares: `getTracer` - Reads: `NextTracerImpl` - Write: `getTracer` @@ -437,6 +439,9 @@ graph TD Item12 --> Item5; Item12 --> Item4; Item12 -.-> Item6; + Item12 --> Item1; + Item12 --> Item11; + Item12 -.-> Item8; Item14 --> Item13; Item16 --> Item6; Item16 --> Item15; @@ -448,6 +453,11 @@ graph TD Item16 --> Item10; Item16 --> Item7; Item17 --> Item16; + Item17 --> Item1; + Item17 --> Item5; + Item17 --> Item11; + Item17 --> Item12; + Item17 -.-> Item8; Item19 --> Item8; Item20 --> Item9; Item21 --> Item17; @@ -499,6 +509,9 @@ graph TD Item12 --> Item5; Item12 --> Item4; Item12 -.-> Item6; + Item12 --> Item1; + Item12 --> Item11; + Item12 -.-> Item8; Item14 --> Item13; Item16 --> Item6; Item16 --> Item15; @@ -510,6 +523,11 @@ graph TD Item16 --> Item10; Item16 --> Item7; Item17 --> Item16; + Item17 --> Item1; + Item17 --> Item5; + Item17 --> Item11; + Item17 --> Item12; + Item17 -.-> Item8; Item19 --> Item8; Item20 --> Item9; Item21 --> Item17; @@ -562,6 +580,9 @@ graph TD Item12 --> Item5; Item12 --> Item4; Item12 -.-> Item6; + Item12 --> Item1; + Item12 --> Item11; + Item12 -.-> Item8; Item14 --> Item13; Item16 --> Item6; Item16 --> Item15; @@ -573,6 +594,11 @@ graph TD Item16 --> Item10; Item16 --> Item7; Item17 --> Item16; + Item17 --> Item1; + Item17 --> Item5; + Item17 --> Item11; + Item17 --> Item12; + Item17 -.-> Item8; Item19 --> Item8; Item20 --> Item9; Item21 --> Item17; @@ -583,6 +609,8 @@ graph TD Item18 --> Item1; Item18 --> Item5; Item18 --> Item11; + Item18 --> Item12; + Item18 --> Item17; ``` # Final ```mermaid @@ -601,48 +629,58 @@ graph TD N11["Items: [ItemId(1, VarDeclarator(0))]"]; N12["Items: [ItemId(2, Normal)]"]; N13["Items: [ItemId(8, VarDeclarator(0))]"]; - N14["Items: [ItemId(ModuleEvaluation)]"]; - N15["Items: [ItemId(3, VarDeclarator(0))]"]; - N16["Items: [ItemId(Export(("SpanKind", #2), "SpanKind"))]"]; - N17["Items: [ItemId(9, VarDeclarator(0))]"]; - N18["Items: [ItemId(7, VarDeclarator(0))]"]; - N19["Items: [ItemId(Export(("SpanStatusCode", #2), "SpanStatusCode"))]"]; - N20["Items: [ItemId(13, Normal)]"]; - N21["Items: [ItemId(14, VarDeclarator(0))]"]; + N14["Items: [ItemId(3, VarDeclarator(0))]"]; + N15["Items: [ItemId(Export(("SpanKind", #2), "SpanKind"))]"]; + N16["Items: [ItemId(9, VarDeclarator(0))]"]; + N17["Items: [ItemId(7, VarDeclarator(0))]"]; + N18["Items: [ItemId(Export(("SpanStatusCode", #2), "SpanStatusCode"))]"]; + N19["Items: [ItemId(13, Normal)]"]; + N20["Items: [ItemId(14, VarDeclarator(0))]"]; + N21["Items: [ItemId(ModuleEvaluation)]"]; N22["Items: [ItemId(Export(("getTracer", #2), "getTracer"))]"]; N12 --> N11; N12 --> N10; - N15 --> N12; - N15 --> N11; - N18 --> N8; - N18 --> N15; + N14 --> N12; + N14 --> N11; + N17 --> N8; + N17 --> N14; N13 --> N10; N13 --> N12; N13 -.-> N6; - N17 --> N12; - N17 --> N11; - N17 -.-> N15; + N16 --> N12; + N16 --> N11; + N16 -.-> N14; + N16 --> N10; + N16 --> N13; + N16 -.-> N6; N5 --> N4; - N20 --> N15; - N20 --> N3; - N20 --> N2; - N20 --> N5; - N20 --> N17; + N19 --> N14; + N19 --> N3; + N19 --> N2; + N19 --> N5; + N19 --> N16; + N19 --> N13; + N19 --> N1; + N19 --> N17; + N19 --> N0; + N20 --> N19; + N20 --> N10; + N20 --> N12; N20 --> N13; - N20 --> N1; - N20 --> N18; - N20 --> N0; - N21 --> N20; + N20 --> N16; + N20 -.-> N6; N7 --> N6; N9 --> N8; - N22 --> N21; - N19 --> N18; - N19 --> N15; - N16 --> N15; + N22 --> N20; + N18 --> N17; + N18 --> N14; + N15 --> N14; N8 --> N6; - N14 --> N10; - N14 --> N12; - N14 --> N13; + N21 --> N10; + N21 --> N12; + N21 --> N13; + N21 --> N16; + N21 --> N20; ``` # Entrypoints @@ -651,14 +689,14 @@ graph TD Export( "isBubbledError", ): 9, - ModuleEvaluation: 14, Export( "SpanKind", - ): 16, + ): 15, + ModuleEvaluation: 21, Exports: 23, Export( "SpanStatusCode", - ): 19, + ): 18, Export( "BubbledError", ): 7, @@ -840,20 +878,6 @@ export { rootSpanAttributesStore as j } from "__TURBOPACK_VAR__" assert { ``` ## Part 14 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 13 -}; -"module evaluation"; - -``` -## Part 15 -```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; @@ -884,18 +908,18 @@ export { ROOT_CONTEXT as p } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 16 +## Part 15 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { o as SpanKind } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; -export { SpanKind as SpanKind }; +export { SpanKind }; ``` -## Part 17 +## Part 16 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 @@ -904,7 +928,16 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; import { i as api } from "__TURBOPACK_PART__" assert { __turbopack_part__: 11 @@ -915,19 +948,19 @@ export { rootSpanIdKey as q } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 18 +## Part 17 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { h as isBubbledError } from "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; import { n as SpanStatusCode } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; const closeSpanWithError = (span, error)=>{ if (isBubbledError(error) && error.bubble) { @@ -948,24 +981,24 @@ export { closeSpanWithError as r } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 19 +## Part 18 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { n as SpanStatusCode } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; -export { SpanStatusCode as SpanStatusCode }; +export { SpanStatusCode }; ``` -## Part 20 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 @@ -977,7 +1010,7 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 13 @@ -986,19 +1019,19 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; import { m as trace } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { k as context } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { l as propagation } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { d as clientTraceDataSetter } from "__TURBOPACK_PART__" assert { __turbopack_part__: 3 @@ -1007,13 +1040,13 @@ import { c as NextVanillaSpanAllowlist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; import { p as ROOT_CONTEXT } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 15 + __turbopack_part__: 14 }; import { f as getSpanId } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import { q as rootSpanIdKey } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 17 + __turbopack_part__: 16 }; import { j as rootSpanAttributesStore } from "__TURBOPACK_PART__" assert { __turbopack_part__: 13 @@ -1022,7 +1055,7 @@ import { b as LogSpanAllowList } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import { r as closeSpanWithError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import { a as isPromise } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -1170,13 +1203,28 @@ export { NextTracerImpl as s } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 21 +## Part 20 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; import { s as NextTracerImpl } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 19 }; const getTracer = (()=>{ const tracer = new NextTracerImpl(); @@ -1186,16 +1234,36 @@ export { getTracer as t } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; +``` +## Part 21 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +"module evaluation"; + ``` ## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 20 }; import { t as getTracer } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 20 }; -export { getTracer as getTracer }; +export { getTracer }; ``` ## Part 23 @@ -1228,6 +1296,12 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 13 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; "module evaluation"; ``` @@ -1238,20 +1312,20 @@ import "__TURBOPACK_PART__" assert { Export( "isBubbledError", ): 9, - ModuleEvaluation: 15, Export( "SpanKind", - ): 17, + ): 16, + ModuleEvaluation: 22, Exports: 23, Export( "SpanStatusCode", - ): 19, + ): 18, Export( "BubbledError", ): 7, Export( "getTracer", - ): 22, + ): 21, } ``` @@ -1410,23 +1484,6 @@ if (process.env.NEXT_RUNTIME === 'edge') { ``` ## Part 13 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 -}; -import { i as api } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 11 -}; -const rootSpanIdKey = api.createContextKey('next.rootSpanId'); -export { rootSpanIdKey as j } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 14 -```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; @@ -1434,26 +1491,35 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; const rootSpanAttributesStore = new Map(); -export { rootSpanAttributesStore as k } from "__TURBOPACK_VAR__" assert { +export { rootSpanAttributesStore as j } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 15 +## Part 14 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -"module evaluation"; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import { i as api } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +const rootSpanIdKey = api.createContextKey('next.rootSpanId'); +export { rootSpanIdKey as k } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` -## Part 16 +## Part 15 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 @@ -1485,30 +1551,30 @@ export { ROOT_CONTEXT as q } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 17 +## Part 16 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { p as SpanKind } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; -export { SpanKind as SpanKind }; +export { SpanKind }; ``` -## Part 18 +## Part 17 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { h as isBubbledError } from "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; import { o as SpanStatusCode } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; const closeSpanWithError = (span, error)=>{ if (isBubbledError(error) && error.bubble) { @@ -1529,24 +1595,24 @@ export { closeSpanWithError as r } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 19 +## Part 18 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { o as SpanStatusCode } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; -export { SpanStatusCode as SpanStatusCode }; +export { SpanStatusCode }; ``` -## Part 20 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 @@ -1558,28 +1624,28 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 13 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 13 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; import { n as trace } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { l as context } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { m as propagation } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { d as clientTraceDataSetter } from "__TURBOPACK_PART__" assert { __turbopack_part__: 3 @@ -1588,22 +1654,22 @@ import { c as NextVanillaSpanAllowlist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; import { q as ROOT_CONTEXT } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 15 }; import { f as getSpanId } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; -import { j as rootSpanIdKey } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 13 -}; -import { k as rootSpanAttributesStore } from "__TURBOPACK_PART__" assert { +import { k as rootSpanIdKey } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; +import { j as rootSpanAttributesStore } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; import { b as LogSpanAllowList } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import { r as closeSpanWithError } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 17 }; import { a as isPromise } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -1751,13 +1817,25 @@ export { NextTracerImpl as s } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 21 +## Part 20 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 19 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; import { s as NextTracerImpl } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 19 }; const getTracer = (()=>{ const tracer = new NextTracerImpl(); @@ -1768,15 +1846,35 @@ export { getTracer as t } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 22 +## Part 21 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 20 }; import { t as getTracer } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 21 + __turbopack_part__: 20 +}; +export { getTracer }; + +``` +## Part 22 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -export { getTracer as getTracer }; +"module evaluation"; ``` ## Part 23 @@ -1800,9 +1898,15 @@ export { getTracer } from "__TURBOPACK_PART__" assert { ``` ## Merged (module eval) ```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 13 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/node-fetch/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/node-fetch/output.md index 34508b6b64d0b..c298fb61a63d5 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/node-fetch/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/node-fetch/output.md @@ -29,6 +29,7 @@ const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; ``` +- Side effects - Declares: `streamDestructionSupported` - Reads: `Stream` - Write: `Stream`, `streamDestructionSupported` @@ -82,8 +83,10 @@ graph TD Item7; Item7["export default"]; Item3 --> Item2; + Item3 --> Item1; Item5 --> Item4; Item5 --> Item1; + Item5 --> Item3; Item7 --> Item5; ``` # Phase 3 @@ -99,8 +102,10 @@ graph TD Item7; Item7["export default"]; Item3 --> Item2; + Item3 --> Item1; Item5 --> Item4; Item5 --> Item1; + Item5 --> Item3; Item7 --> Item5; ``` # Phase 4 @@ -116,37 +121,43 @@ graph TD Item7; Item7["export default"]; Item3 --> Item2; + Item3 --> Item1; Item5 --> Item4; Item5 --> Item1; + Item5 --> Item3; Item7 --> Item5; Item6 --> Item1; + Item6 --> Item3; Item6 --> Item5; ``` # Final ```mermaid graph TD - N0["Items: [ItemId(0, ImportOfModule)]"]; - N1["Items: [ItemId(2, Normal)]"]; - N2["Items: [ItemId(3, Normal)]"]; - N3["Items: [ItemId(ModuleEvaluation)]"]; - N4["Items: [ItemId(Export(("__TURBOPACK__default__export__", #4), "default"))]"]; - N5["Items: [ItemId(0, ImportBinding(0))]"]; - N6["Items: [ItemId(1, VarDeclarator(0))]"]; - N6 --> N5; - N2 --> N1; - N2 --> N0; - N4 --> N2; - N3 --> N0; + N0["Items: [ItemId(2, Normal)]"]; + N1["Items: [ItemId(0, ImportOfModule)]"]; + N2["Items: [ItemId(0, ImportBinding(0))]"]; + N3["Items: [ItemId(1, VarDeclarator(0))]"]; + N4["Items: [ItemId(3, Normal)]"]; + N5["Items: [ItemId(ModuleEvaluation)]"]; + N6["Items: [ItemId(Export(("__TURBOPACK__default__export__", #4), "default"))]"]; N3 --> N2; + N3 --> N1; + N4 --> N0; + N4 --> N1; + N4 --> N3; + N6 --> N4; + N5 --> N1; + N5 --> N3; + N5 --> N4; ``` # Entrypoints ``` { - ModuleEvaluation: 3, + ModuleEvaluation: 5, Export( "default", - ): 4, + ): 6, Exports: 7, } ``` @@ -155,76 +166,85 @@ graph TD # Modules (dev) ## Part 0 ```js -import 'node:stream'; +function fetch() {} +export { fetch as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 1 ```js -function fetch() {} -export { fetch as a } from "__TURBOPACK_VAR__" assert { +import 'node:stream'; + +``` +## Part 2 +```js +import Stream from 'node:stream'; +export { Stream as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 2 +## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import { a as fetch } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const __TURBOPACK__default__export__ = fetch; -export { __TURBOPACK__default__export__ as b } from "__TURBOPACK_VAR__" assert { +import { b as Stream } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; +export { streamDestructionSupported as c } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 3 +## Part 4 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 1 }; -"module evaluation"; - -``` -## Part 4 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 3 }; -import { b as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { a as fetch } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +const __TURBOPACK__default__export__ = fetch; +export { __TURBOPACK__default__export__ as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { __TURBOPACK__default__export__ as default }; ``` ## Part 5 ```js -import Stream from 'node:stream'; -export { Stream as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; +"module evaluation"; ``` ## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; -import { c as Stream } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; -export { streamDestructionSupported as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { d as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; +export { __TURBOPACK__default__export__ as default }; ``` ## Part 7 @@ -237,10 +257,13 @@ export { default } from "__TURBOPACK_PART__" assert { ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; "module evaluation"; @@ -249,10 +272,10 @@ import "__TURBOPACK_PART__" assert { ``` { - ModuleEvaluation: 3, + ModuleEvaluation: 5, Export( "default", - ): 4, + ): 6, Exports: 7, } ``` @@ -261,76 +284,85 @@ import "__TURBOPACK_PART__" assert { # Modules (prod) ## Part 0 ```js -import 'node:stream'; +function fetch() {} +export { fetch as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 1 ```js -function fetch() {} -export { fetch as a } from "__TURBOPACK_VAR__" assert { +import 'node:stream'; + +``` +## Part 2 +```js +import Stream from 'node:stream'; +export { Stream as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 2 +## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import { a as fetch } from "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const __TURBOPACK__default__export__ = fetch; -export { __TURBOPACK__default__export__ as b } from "__TURBOPACK_VAR__" assert { +import { b as Stream } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; +export { streamDestructionSupported as c } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 3 +## Part 4 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 1 }; -"module evaluation"; - -``` -## Part 4 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 3 }; -import { b as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { a as fetch } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +const __TURBOPACK__default__export__ = fetch; +export { __TURBOPACK__default__export__ as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; -export { __TURBOPACK__default__export__ as default }; ``` ## Part 5 ```js -import Stream from 'node:stream'; -export { Stream as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +"module evaluation"; ``` ## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -import { c as Stream } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; -export { streamDestructionSupported as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { d as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; +export { __TURBOPACK__default__export__ as default }; ``` ## Part 7 @@ -343,10 +375,13 @@ export { default } from "__TURBOPACK_PART__" assert { ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; "module evaluation"; diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-2/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-2/output.md index 86277db4d3b0e..d1a4ab2bab400 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-2/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-2/output.md @@ -44,6 +44,7 @@ const shared = { ``` +- Side effects - Declares: `shared` - Reads: `random`, `order` - Write: `random`, `order`, `shared` @@ -212,6 +213,7 @@ graph TD Item11 --> Item7; Item8 --> Item2; Item8 --> Item3; + Item8 --> Item4; Item8 --> Item5; ``` # Final @@ -246,6 +248,7 @@ graph TD N7 --> N6; N9 --> N1; N9 --> N2; + N9 --> N3; N9 --> N8; ``` # Entrypoints @@ -411,6 +414,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -452,6 +458,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -621,6 +630,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -662,6 +674,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-and-side-effects/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-and-side-effects/output.md index d083ac09bfe53..4a933578294f8 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-and-side-effects/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-and-side-effects/output.md @@ -49,9 +49,7 @@ const value3 = externalFunction(); ``` -- Side effects - Declares: `value3` -- Write: `value3` ## Item 6: Stmt 5, `VarDeclarator(0)` @@ -149,10 +147,6 @@ graph TD Item4 --> Item1; Item4 --> Item2; Item4 --> Item3; - Item5 --> Item1; - Item5 --> Item2; - Item5 --> Item3; - Item5 --> Item4; Item6 --> Item2; Item6 --> Item3; Item6 --> Item5; @@ -161,7 +155,6 @@ graph TD Item7 --> Item2; Item7 --> Item3; Item7 --> Item4; - Item7 --> Item5; Item8 --> Item6; Item8 -.-> Item7; Item9 --> Item8; @@ -194,10 +187,6 @@ graph TD Item4 --> Item1; Item4 --> Item2; Item4 --> Item3; - Item5 --> Item1; - Item5 --> Item2; - Item5 --> Item3; - Item5 --> Item4; Item6 --> Item2; Item6 --> Item3; Item6 --> Item5; @@ -206,7 +195,6 @@ graph TD Item7 --> Item2; Item7 --> Item3; Item7 --> Item4; - Item7 --> Item5; Item8 --> Item6; Item8 -.-> Item7; Item9 --> Item8; @@ -239,10 +227,6 @@ graph TD Item4 --> Item1; Item4 --> Item2; Item4 --> Item3; - Item5 --> Item1; - Item5 --> Item2; - Item5 --> Item3; - Item5 --> Item4; Item6 --> Item2; Item6 --> Item3; Item6 --> Item5; @@ -251,7 +235,6 @@ graph TD Item7 --> Item2; Item7 --> Item3; Item7 --> Item4; - Item7 --> Item5; Item8 --> Item6; Item8 -.-> Item7; Item9 --> Item8; @@ -263,55 +246,48 @@ graph TD Item10 --> Item2; Item10 --> Item3; Item10 --> Item4; - Item10 --> Item5; Item10 --> Item7; ``` # Final ```mermaid graph TD - N0["Items: [ItemId(0, Normal)]"]; - N1["Items: [ItemId(1, VarDeclarator(0))]"]; - N2["Items: [ItemId(2, VarDeclarator(0))]"]; - N3["Items: [ItemId(3, Normal)]"]; - N4["Items: [ItemId(4, VarDeclarator(0))]"]; - N5["Items: [ItemId(5, VarDeclarator(0))]"]; + N0["Items: [ItemId(4, VarDeclarator(0))]"]; + N1["Items: [ItemId(0, Normal)]"]; + N2["Items: [ItemId(1, VarDeclarator(0))]"]; + N3["Items: [ItemId(2, VarDeclarator(0))]"]; + N4["Items: [ItemId(5, VarDeclarator(0))]"]; + N5["Items: [ItemId(3, Normal)]"]; N6["Items: [ItemId(6, Normal)]"]; N7["Items: [ItemId(ModuleEvaluation)]"]; N8["Items: [ItemId(7, VarDeclarator(0))]"]; N9["Items: [ItemId(Export(("a", #2), "a"))]"]; N10["Items: [ItemId(8, VarDeclarator(0))]"]; N11["Items: [ItemId(Export(("b", #2), "b"))]"]; - N1 --> N0; - N2 --> N0; N2 --> N1; - N3 --> N0; N3 --> N1; N3 --> N2; - N4 --> N0; - N4 --> N1; - N4 --> N2; - N4 --> N3; N5 --> N1; N5 --> N2; - N5 --> N4; - N6 --> N5; - N6 --> N0; + N5 --> N3; + N4 --> N2; + N4 --> N3; + N4 --> N0; + N6 --> N4; N6 --> N1; N6 --> N2; N6 --> N3; - N6 --> N4; - N8 --> N5; + N6 --> N5; + N8 --> N4; N8 -.-> N6; N10 --> N8; - N10 --> N5; + N10 --> N4; N10 -.-> N6; N9 --> N8; N11 --> N10; - N7 --> N0; N7 --> N1; N7 --> N2; N7 --> N3; - N7 --> N4; + N7 --> N5; N7 --> N6; ``` # Entrypoints @@ -333,64 +309,68 @@ graph TD # Modules (dev) ## Part 0 ```js -console.log("Hello"); +const value3 = externalFunction(); +export { value3 as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 1 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -const value = externalFunction(); -export { value as a } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; +console.log("Hello"); ``` ## Part 2 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const value2 = externalObject.propertyWithGetter; -export { value2 as b } from "__TURBOPACK_VAR__" assert { +const value = externalFunction(); +export { value as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 3 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -externalObject.propertyWithSetter = 42; +const value2 = externalObject.propertyWithGetter; +export { value2 as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 4 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import { b as value } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -import "__TURBOPACK_PART__" assert { +import { c as value2 } from "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; -const value3 = externalFunction(); -export { value3 as c } from "__TURBOPACK_VAR__" assert { +import { a as value3 } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +const shared = { + value, + value2, + value3 +}; +export { shared as d } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -404,34 +384,15 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { a as value } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as value2 } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 -}; -import { c as value3 } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -const shared = { - value, - value2, - value3 -}; -export { shared as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true + __turbopack_part__: 3 }; +externalObject.propertyWithSetter = 42; ``` ## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 @@ -443,19 +404,16 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 5 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; console.log(shared); ``` ## Part 7 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; @@ -466,7 +424,7 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 @@ -477,13 +435,13 @@ import "__TURBOPACK_PART__" assert { ## Part 8 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; const a = { shared, @@ -511,13 +469,13 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; const b = { shared, @@ -551,9 +509,6 @@ export { b } from "__TURBOPACK_PART__" assert { ``` ## Merged (module eval) ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; @@ -564,7 +519,7 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 @@ -580,10 +535,10 @@ import "__TURBOPACK_PART__" assert { Exports: 12, Export( "b", - ): 9, + ): 8, Export( "a", - ): 7, + ): 6, } ``` @@ -591,87 +546,61 @@ import "__TURBOPACK_PART__" assert { # Modules (prod) ## Part 0 ```js -console.log("Hello"); +const value3 = externalFunction(); +export { value3 as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 1 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -const value = externalFunction(); -export { value as a } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; +console.log("Hello"); ``` ## Part 2 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const value2 = externalObject.propertyWithGetter; -export { value2 as b } from "__TURBOPACK_VAR__" assert { +const value = externalFunction(); +export { value as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 3 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -externalObject.propertyWithSetter = 42; +const value2 = externalObject.propertyWithGetter; +export { value2 as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 4 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; -const value3 = externalFunction(); -export { value3 as c } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; - -``` -## Part 5 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 0 }; -import "__TURBOPACK_PART__" assert { +import { b as value } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { a as value } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; -import { b as value2 } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import { c as value2 } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; -import { c as value3 } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import { a as value3 } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 }; const shared = { value, @@ -683,13 +612,13 @@ export { shared as d } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 6 +## Part 5 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; const a = { shared, @@ -700,27 +629,27 @@ export { a as e } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 7 +## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 5 }; import { e as a } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 5 }; export { a }; ``` -## Part 8 +## Part 7 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; const b = { shared, @@ -731,24 +660,35 @@ export { b as f } from "__TURBOPACK_VAR__" assert { }; ``` -## Part 9 +## Part 8 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 7 }; import { f as b } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 7 }; export { b }; ``` -## Part 10 +## Part 9 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +externalObject.propertyWithSetter = 42; + +``` +## Part 10 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 @@ -760,10 +700,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 9 }; import { d as shared } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; console.log(shared); @@ -774,10 +714,7 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 @@ -807,10 +744,7 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-regression/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-regression/output.md index 86277db4d3b0e..d1a4ab2bab400 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-regression/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/shared-regression/output.md @@ -44,6 +44,7 @@ const shared = { ``` +- Side effects - Declares: `shared` - Reads: `random`, `order` - Write: `random`, `order`, `shared` @@ -212,6 +213,7 @@ graph TD Item11 --> Item7; Item8 --> Item2; Item8 --> Item3; + Item8 --> Item4; Item8 --> Item5; ``` # Final @@ -246,6 +248,7 @@ graph TD N7 --> N6; N9 --> N1; N9 --> N2; + N9 --> N3; N9 --> N8; ``` # Entrypoints @@ -411,6 +414,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -452,6 +458,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -621,6 +630,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; @@ -662,6 +674,9 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple-vars-1/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple-vars-1/output.md index 7e7a4569f4ac8..14b3cfa980ace 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple-vars-1/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/simple-vars-1/output.md @@ -120,7 +120,7 @@ import "__TURBOPACK_PART__" assert { import { a as b } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { b as b }; +export { b }; ``` ## Part 2 @@ -139,7 +139,7 @@ import "__TURBOPACK_PART__" assert { import { b as a } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { a as a }; +export { a }; ``` ## Part 4 @@ -195,7 +195,7 @@ import "__TURBOPACK_PART__" assert { import { a as b } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 }; -export { b as b }; +export { b }; ``` ## Part 2 @@ -214,7 +214,7 @@ import "__TURBOPACK_PART__" assert { import { b as a } from "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { a as a }; +export { a }; ``` ## Part 4 diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/template-pages/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/template-pages/output.md index d4815dccd5b38..07c84eba05001 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/template-pages/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/template-pages/output.md @@ -141,6 +141,7 @@ export const getStaticProps = hoist(userland, 'getStaticProps'); ``` +- Side effects - Declares: `getStaticProps` - Reads: `hoist`, `userland` - Write: `getStaticProps` @@ -152,6 +153,7 @@ export const getStaticPaths = hoist(userland, 'getStaticPaths'); ``` +- Side effects - Declares: `getStaticPaths` - Reads: `hoist`, `userland` - Write: `getStaticPaths` @@ -163,6 +165,7 @@ export const getServerSideProps = hoist(userland, 'getServerSideProps'); ``` +- Side effects - Declares: `getServerSideProps` - Reads: `hoist`, `userland` - Write: `getServerSideProps` @@ -174,6 +177,7 @@ export const config = hoist(userland, 'config'); ``` +- Side effects - Declares: `config` - Reads: `hoist`, `userland` - Write: `config` @@ -185,6 +189,7 @@ export const reportWebVitals = hoist(userland, 'reportWebVitals'); ``` +- Side effects - Declares: `reportWebVitals` - Reads: `hoist`, `userland` - Write: `reportWebVitals` @@ -196,6 +201,7 @@ export const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps' ``` +- Side effects - Declares: `unstable_getStaticProps` - Reads: `hoist`, `userland` - Write: `unstable_getStaticProps` @@ -207,6 +213,7 @@ export const unstable_getStaticPaths = hoist(userland, 'unstable_getStaticPaths' ``` +- Side effects - Declares: `unstable_getStaticPaths` - Reads: `hoist`, `userland` - Write: `unstable_getStaticPaths` @@ -218,6 +225,7 @@ export const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParam ``` +- Side effects - Declares: `unstable_getStaticParams` - Reads: `hoist`, `userland` - Write: `unstable_getStaticParams` @@ -229,6 +237,7 @@ export const unstable_getServerProps = hoist(userland, 'unstable_getServerProps' ``` +- Side effects - Declares: `unstable_getServerProps` - Reads: `hoist`, `userland` - Write: `unstable_getServerProps` @@ -240,6 +249,7 @@ export const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSi ``` +- Side effects - Declares: `unstable_getServerSideProps` - Reads: `hoist`, `userland` - Write: `unstable_getServerSideProps` @@ -264,6 +274,7 @@ export const routeModule = new PagesRouteModule({ ``` +- Side effects - Declares: `routeModule` - Reads: `PagesRouteModule`, `RouteKind`, `App`, `Document`, `userland` - Write: `RouteKind`, `App`, `Document`, `userland`, `routeModule` @@ -415,40 +426,161 @@ graph TD Item13 --> Item6; Item14 --> Item9; Item14 --> Item12; + Item14 --> Item1; + Item14 --> Item2; + Item14 --> Item3; + Item14 --> Item4; + Item14 --> Item5; + Item14 --> Item6; + Item14 --> Item13; Item15 --> Item9; Item15 --> Item12; + Item15 --> Item1; + Item15 --> Item2; + Item15 --> Item3; + Item15 --> Item4; + Item15 --> Item5; + Item15 --> Item6; + Item15 --> Item13; + Item15 --> Item14; Item16 --> Item9; Item16 --> Item12; + Item16 --> Item1; + Item16 --> Item2; + Item16 --> Item3; + Item16 --> Item4; + Item16 --> Item5; + Item16 --> Item6; + Item16 --> Item13; + Item16 --> Item14; + Item16 --> Item15; Item17 --> Item9; Item17 --> Item12; + Item17 --> Item1; + Item17 --> Item2; + Item17 --> Item3; + Item17 --> Item4; + Item17 --> Item5; + Item17 --> Item6; + Item17 --> Item13; + Item17 --> Item14; + Item17 --> Item15; + Item17 --> Item16; Item18 --> Item9; Item18 --> Item12; + Item18 --> Item1; + Item18 --> Item2; + Item18 --> Item3; + Item18 --> Item4; + Item18 --> Item5; + Item18 --> Item6; + Item18 --> Item13; + Item18 --> Item14; + Item18 --> Item15; + Item18 --> Item16; + Item18 --> Item17; Item19 --> Item9; Item19 --> Item12; + Item19 --> Item1; + Item19 --> Item2; + Item19 --> Item3; + Item19 --> Item4; + Item19 --> Item5; + Item19 --> Item6; + Item19 --> Item13; + Item19 --> Item14; + Item19 --> Item15; + Item19 --> Item16; + Item19 --> Item17; + Item19 --> Item18; Item20 --> Item9; Item20 --> Item12; + Item20 --> Item1; + Item20 --> Item2; + Item20 --> Item3; + Item20 --> Item4; + Item20 --> Item5; + Item20 --> Item6; + Item20 --> Item13; + Item20 --> Item14; + Item20 --> Item15; + Item20 --> Item16; + Item20 --> Item17; + Item20 --> Item18; + Item20 --> Item19; Item21 --> Item9; Item21 --> Item12; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item6; + Item21 --> Item13; + Item21 --> Item14; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item17; + Item21 --> Item18; + Item21 --> Item19; + Item21 --> Item20; Item22 --> Item9; Item22 --> Item12; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item6; + Item22 --> Item13; + Item22 --> Item14; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item17; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item20; + Item22 --> Item21; Item23 --> Item9; Item23 --> Item12; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item6; + Item23 --> Item13; + Item23 --> Item14; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item17; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item20; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item7; Item24 --> Item8; Item24 --> Item11; Item24 --> Item10; Item24 --> Item12; - Item24 -.-> Item13; - Item24 -.-> Item14; - Item24 -.-> Item15; - Item24 -.-> Item16; - Item24 -.-> Item17; - Item24 -.-> Item18; - Item24 -.-> Item19; - Item24 -.-> Item20; - Item24 -.-> Item21; - Item24 -.-> Item22; - Item24 -.-> Item23; + Item24 --> Item23; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item6; + Item24 --> Item13; + Item24 --> Item14; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item17; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item20; + Item24 --> Item21; + Item24 --> Item22; Item26 --> Item13; Item27 --> Item14; Item28 --> Item15; @@ -540,40 +672,161 @@ graph TD Item13 --> Item6; Item14 --> Item9; Item14 --> Item12; + Item14 --> Item1; + Item14 --> Item2; + Item14 --> Item3; + Item14 --> Item4; + Item14 --> Item5; + Item14 --> Item6; + Item14 --> Item13; Item15 --> Item9; Item15 --> Item12; + Item15 --> Item1; + Item15 --> Item2; + Item15 --> Item3; + Item15 --> Item4; + Item15 --> Item5; + Item15 --> Item6; + Item15 --> Item13; + Item15 --> Item14; Item16 --> Item9; Item16 --> Item12; + Item16 --> Item1; + Item16 --> Item2; + Item16 --> Item3; + Item16 --> Item4; + Item16 --> Item5; + Item16 --> Item6; + Item16 --> Item13; + Item16 --> Item14; + Item16 --> Item15; Item17 --> Item9; Item17 --> Item12; + Item17 --> Item1; + Item17 --> Item2; + Item17 --> Item3; + Item17 --> Item4; + Item17 --> Item5; + Item17 --> Item6; + Item17 --> Item13; + Item17 --> Item14; + Item17 --> Item15; + Item17 --> Item16; Item18 --> Item9; Item18 --> Item12; + Item18 --> Item1; + Item18 --> Item2; + Item18 --> Item3; + Item18 --> Item4; + Item18 --> Item5; + Item18 --> Item6; + Item18 --> Item13; + Item18 --> Item14; + Item18 --> Item15; + Item18 --> Item16; + Item18 --> Item17; Item19 --> Item9; Item19 --> Item12; + Item19 --> Item1; + Item19 --> Item2; + Item19 --> Item3; + Item19 --> Item4; + Item19 --> Item5; + Item19 --> Item6; + Item19 --> Item13; + Item19 --> Item14; + Item19 --> Item15; + Item19 --> Item16; + Item19 --> Item17; + Item19 --> Item18; Item20 --> Item9; Item20 --> Item12; + Item20 --> Item1; + Item20 --> Item2; + Item20 --> Item3; + Item20 --> Item4; + Item20 --> Item5; + Item20 --> Item6; + Item20 --> Item13; + Item20 --> Item14; + Item20 --> Item15; + Item20 --> Item16; + Item20 --> Item17; + Item20 --> Item18; + Item20 --> Item19; Item21 --> Item9; Item21 --> Item12; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item6; + Item21 --> Item13; + Item21 --> Item14; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item17; + Item21 --> Item18; + Item21 --> Item19; + Item21 --> Item20; Item22 --> Item9; Item22 --> Item12; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item6; + Item22 --> Item13; + Item22 --> Item14; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item17; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item20; + Item22 --> Item21; Item23 --> Item9; Item23 --> Item12; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item6; + Item23 --> Item13; + Item23 --> Item14; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item17; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item20; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item7; Item24 --> Item8; Item24 --> Item11; Item24 --> Item10; Item24 --> Item12; - Item24 -.-> Item13; - Item24 -.-> Item14; - Item24 -.-> Item15; - Item24 -.-> Item16; - Item24 -.-> Item17; - Item24 -.-> Item18; - Item24 -.-> Item19; - Item24 -.-> Item20; - Item24 -.-> Item21; - Item24 -.-> Item22; - Item24 -.-> Item23; + Item24 --> Item23; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item6; + Item24 --> Item13; + Item24 --> Item14; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item17; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item20; + Item24 --> Item21; + Item24 --> Item22; Item26 --> Item13; Item27 --> Item14; Item28 --> Item15; @@ -665,40 +918,161 @@ graph TD Item13 --> Item6; Item14 --> Item9; Item14 --> Item12; + Item14 --> Item1; + Item14 --> Item2; + Item14 --> Item3; + Item14 --> Item4; + Item14 --> Item5; + Item14 --> Item6; + Item14 --> Item13; Item15 --> Item9; Item15 --> Item12; + Item15 --> Item1; + Item15 --> Item2; + Item15 --> Item3; + Item15 --> Item4; + Item15 --> Item5; + Item15 --> Item6; + Item15 --> Item13; + Item15 --> Item14; Item16 --> Item9; Item16 --> Item12; + Item16 --> Item1; + Item16 --> Item2; + Item16 --> Item3; + Item16 --> Item4; + Item16 --> Item5; + Item16 --> Item6; + Item16 --> Item13; + Item16 --> Item14; + Item16 --> Item15; Item17 --> Item9; Item17 --> Item12; + Item17 --> Item1; + Item17 --> Item2; + Item17 --> Item3; + Item17 --> Item4; + Item17 --> Item5; + Item17 --> Item6; + Item17 --> Item13; + Item17 --> Item14; + Item17 --> Item15; + Item17 --> Item16; Item18 --> Item9; Item18 --> Item12; + Item18 --> Item1; + Item18 --> Item2; + Item18 --> Item3; + Item18 --> Item4; + Item18 --> Item5; + Item18 --> Item6; + Item18 --> Item13; + Item18 --> Item14; + Item18 --> Item15; + Item18 --> Item16; + Item18 --> Item17; Item19 --> Item9; Item19 --> Item12; + Item19 --> Item1; + Item19 --> Item2; + Item19 --> Item3; + Item19 --> Item4; + Item19 --> Item5; + Item19 --> Item6; + Item19 --> Item13; + Item19 --> Item14; + Item19 --> Item15; + Item19 --> Item16; + Item19 --> Item17; + Item19 --> Item18; Item20 --> Item9; Item20 --> Item12; + Item20 --> Item1; + Item20 --> Item2; + Item20 --> Item3; + Item20 --> Item4; + Item20 --> Item5; + Item20 --> Item6; + Item20 --> Item13; + Item20 --> Item14; + Item20 --> Item15; + Item20 --> Item16; + Item20 --> Item17; + Item20 --> Item18; + Item20 --> Item19; Item21 --> Item9; Item21 --> Item12; + Item21 --> Item1; + Item21 --> Item2; + Item21 --> Item3; + Item21 --> Item4; + Item21 --> Item5; + Item21 --> Item6; + Item21 --> Item13; + Item21 --> Item14; + Item21 --> Item15; + Item21 --> Item16; + Item21 --> Item17; + Item21 --> Item18; + Item21 --> Item19; + Item21 --> Item20; Item22 --> Item9; Item22 --> Item12; + Item22 --> Item1; + Item22 --> Item2; + Item22 --> Item3; + Item22 --> Item4; + Item22 --> Item5; + Item22 --> Item6; + Item22 --> Item13; + Item22 --> Item14; + Item22 --> Item15; + Item22 --> Item16; + Item22 --> Item17; + Item22 --> Item18; + Item22 --> Item19; + Item22 --> Item20; + Item22 --> Item21; Item23 --> Item9; Item23 --> Item12; + Item23 --> Item1; + Item23 --> Item2; + Item23 --> Item3; + Item23 --> Item4; + Item23 --> Item5; + Item23 --> Item6; + Item23 --> Item13; + Item23 --> Item14; + Item23 --> Item15; + Item23 --> Item16; + Item23 --> Item17; + Item23 --> Item18; + Item23 --> Item19; + Item23 --> Item20; + Item23 --> Item21; + Item23 --> Item22; Item24 --> Item7; Item24 --> Item8; Item24 --> Item11; Item24 --> Item10; Item24 --> Item12; - Item24 -.-> Item13; - Item24 -.-> Item14; - Item24 -.-> Item15; - Item24 -.-> Item16; - Item24 -.-> Item17; - Item24 -.-> Item18; - Item24 -.-> Item19; - Item24 -.-> Item20; - Item24 -.-> Item21; - Item24 -.-> Item22; - Item24 -.-> Item23; + Item24 --> Item23; + Item24 --> Item1; + Item24 --> Item2; + Item24 --> Item3; + Item24 --> Item4; + Item24 --> Item5; + Item24 --> Item6; + Item24 --> Item13; + Item24 --> Item14; + Item24 --> Item15; + Item24 --> Item16; + Item24 --> Item17; + Item24 --> Item18; + Item24 --> Item19; + Item24 --> Item20; + Item24 --> Item21; + Item24 --> Item22; Item26 --> Item13; Item27 --> Item14; Item28 --> Item15; @@ -718,6 +1092,17 @@ graph TD Item25 --> Item5; Item25 --> Item6; Item25 --> Item13; + Item25 --> Item14; + Item25 --> Item15; + Item25 --> Item16; + Item25 --> Item17; + Item25 --> Item18; + Item25 --> Item19; + Item25 --> Item20; + Item25 --> Item21; + Item25 --> Item22; + Item25 --> Item23; + Item25 --> Item24; ``` # Final ```mermaid @@ -728,158 +1113,290 @@ graph TD N3["Items: [ItemId(0, ImportBinding(0))]"]; N4["Items: [ItemId(5, ImportBinding(0))]"]; N5["Items: [ItemId(2, ImportBinding(0))]"]; - N6["Items: [ItemId(16, VarDeclarator(0))]"]; - N7["Items: [ItemId(Export(("unstable_getServerSideProps", #2), "unstable_getServerSideProps"))]"]; - N8["Items: [ItemId(15, VarDeclarator(0))]"]; - N9["Items: [ItemId(Export(("unstable_getServerProps", #2), "unstable_getServerProps"))]"]; - N10["Items: [ItemId(14, VarDeclarator(0))]"]; - N11["Items: [ItemId(Export(("unstable_getStaticParams", #2), "unstable_getStaticParams"))]"]; - N12["Items: [ItemId(13, VarDeclarator(0))]"]; - N13["Items: [ItemId(Export(("unstable_getStaticPaths", #2), "unstable_getStaticPaths"))]"]; - N14["Items: [ItemId(12, VarDeclarator(0))]"]; - N15["Items: [ItemId(Export(("unstable_getStaticProps", #2), "unstable_getStaticProps"))]"]; - N16["Items: [ItemId(11, VarDeclarator(0))]"]; - N17["Items: [ItemId(Export(("reportWebVitals", #2), "reportWebVitals"))]"]; - N18["Items: [ItemId(10, VarDeclarator(0))]"]; - N19["Items: [ItemId(Export(("config", #2), "config"))]"]; - N20["Items: [ItemId(9, VarDeclarator(0))]"]; - N21["Items: [ItemId(Export(("getServerSideProps", #2), "getServerSideProps"))]"]; - N22["Items: [ItemId(8, VarDeclarator(0))]"]; - N23["Items: [ItemId(Export(("getStaticPaths", #2), "getStaticPaths"))]"]; - N24["Items: [ItemId(7, VarDeclarator(0))]"]; - N25["Items: [ItemId(Export(("getStaticProps", #2), "getStaticProps"))]"]; - N26["Items: [ItemId(0, ImportOfModule)]"]; - N27["Items: [ItemId(1, ImportOfModule)]"]; - N28["Items: [ItemId(2, ImportOfModule)]"]; - N29["Items: [ItemId(3, ImportOfModule)]"]; - N30["Items: [ItemId(4, ImportOfModule)]"]; - N31["Items: [ItemId(5, ImportOfModule)]"]; - N32["Items: [ItemId(6, Normal)]"]; - N33["Items: [ItemId(ModuleEvaluation)]"]; - N34["Items: [ItemId(Export(("__TURBOPACK__default__export__", #3), "default"))]"]; - N35["Items: [ItemId(17, VarDeclarator(0))]"]; + N6["Items: [ItemId(0, ImportOfModule)]"]; + N7["Items: [ItemId(1, ImportOfModule)]"]; + N8["Items: [ItemId(2, ImportOfModule)]"]; + N9["Items: [ItemId(3, ImportOfModule)]"]; + N10["Items: [ItemId(4, ImportOfModule)]"]; + N11["Items: [ItemId(5, ImportOfModule)]"]; + N12["Items: [ItemId(6, Normal)]"]; + N13["Items: [ItemId(Export(("__TURBOPACK__default__export__", #3), "default"))]"]; + N14["Items: [ItemId(7, VarDeclarator(0))]"]; + N15["Items: [ItemId(Export(("getStaticProps", #2), "getStaticProps"))]"]; + N16["Items: [ItemId(8, VarDeclarator(0))]"]; + N17["Items: [ItemId(Export(("getStaticPaths", #2), "getStaticPaths"))]"]; + N18["Items: [ItemId(9, VarDeclarator(0))]"]; + N19["Items: [ItemId(Export(("getServerSideProps", #2), "getServerSideProps"))]"]; + N20["Items: [ItemId(10, VarDeclarator(0))]"]; + N21["Items: [ItemId(Export(("config", #2), "config"))]"]; + N22["Items: [ItemId(11, VarDeclarator(0))]"]; + N23["Items: [ItemId(Export(("reportWebVitals", #2), "reportWebVitals"))]"]; + N24["Items: [ItemId(12, VarDeclarator(0))]"]; + N25["Items: [ItemId(Export(("unstable_getStaticProps", #2), "unstable_getStaticProps"))]"]; + N26["Items: [ItemId(13, VarDeclarator(0))]"]; + N27["Items: [ItemId(Export(("unstable_getStaticPaths", #2), "unstable_getStaticPaths"))]"]; + N28["Items: [ItemId(14, VarDeclarator(0))]"]; + N29["Items: [ItemId(Export(("unstable_getStaticParams", #2), "unstable_getStaticParams"))]"]; + N30["Items: [ItemId(15, VarDeclarator(0))]"]; + N31["Items: [ItemId(Export(("unstable_getServerProps", #2), "unstable_getServerProps"))]"]; + N32["Items: [ItemId(16, VarDeclarator(0))]"]; + N33["Items: [ItemId(Export(("unstable_getServerSideProps", #2), "unstable_getServerSideProps"))]"]; + N34["Items: [ItemId(17, VarDeclarator(0))]"]; + N35["Items: [ItemId(ModuleEvaluation)]"]; N36["Items: [ItemId(Export(("routeModule", #2), "routeModule"))]"]; - N27 --> N26; + N7 --> N6; + N8 --> N6; + N8 --> N7; + N9 --> N6; + N9 --> N7; + N9 --> N8; + N10 --> N6; + N10 --> N7; + N10 --> N8; + N10 --> N9; + N11 --> N6; + N11 --> N7; + N11 --> N8; + N11 --> N9; + N11 --> N10; + N12 --> N5; + N12 --> N4; + N12 --> N6; + N12 --> N7; + N12 --> N8; + N12 --> N9; + N12 --> N10; + N12 --> N11; + N14 --> N5; + N14 --> N4; + N14 --> N6; + N14 --> N7; + N14 --> N8; + N14 --> N9; + N14 --> N10; + N14 --> N11; + N14 --> N12; + N16 --> N5; + N16 --> N4; + N16 --> N6; + N16 --> N7; + N16 --> N8; + N16 --> N9; + N16 --> N10; + N16 --> N11; + N16 --> N12; + N16 --> N14; + N18 --> N5; + N18 --> N4; + N18 --> N6; + N18 --> N7; + N18 --> N8; + N18 --> N9; + N18 --> N10; + N18 --> N11; + N18 --> N12; + N18 --> N14; + N18 --> N16; + N20 --> N5; + N20 --> N4; + N20 --> N6; + N20 --> N7; + N20 --> N8; + N20 --> N9; + N20 --> N10; + N20 --> N11; + N20 --> N12; + N20 --> N14; + N20 --> N16; + N20 --> N18; + N22 --> N5; + N22 --> N4; + N22 --> N6; + N22 --> N7; + N22 --> N8; + N22 --> N9; + N22 --> N10; + N22 --> N11; + N22 --> N12; + N22 --> N14; + N22 --> N16; + N22 --> N18; + N22 --> N20; + N24 --> N5; + N24 --> N4; + N24 --> N6; + N24 --> N7; + N24 --> N8; + N24 --> N9; + N24 --> N10; + N24 --> N11; + N24 --> N12; + N24 --> N14; + N24 --> N16; + N24 --> N18; + N24 --> N20; + N24 --> N22; + N26 --> N5; + N26 --> N4; + N26 --> N6; + N26 --> N7; + N26 --> N8; + N26 --> N9; + N26 --> N10; + N26 --> N11; + N26 --> N12; + N26 --> N14; + N26 --> N16; + N26 --> N18; + N26 --> N20; + N26 --> N22; + N26 --> N24; + N28 --> N5; + N28 --> N4; + N28 --> N6; + N28 --> N7; + N28 --> N8; + N28 --> N9; + N28 --> N10; + N28 --> N11; + N28 --> N12; + N28 --> N14; + N28 --> N16; + N28 --> N18; + N28 --> N20; + N28 --> N22; + N28 --> N24; N28 --> N26; - N28 --> N27; - N29 --> N26; - N29 --> N27; - N29 --> N28; + N30 --> N5; + N30 --> N4; + N30 --> N6; + N30 --> N7; + N30 --> N8; + N30 --> N9; + N30 --> N10; + N30 --> N11; + N30 --> N12; + N30 --> N14; + N30 --> N16; + N30 --> N18; + N30 --> N20; + N30 --> N22; + N30 --> N24; N30 --> N26; - N30 --> N27; N30 --> N28; - N30 --> N29; - N31 --> N26; - N31 --> N27; - N31 --> N28; - N31 --> N29; - N31 --> N30; N32 --> N5; N32 --> N4; + N32 --> N6; + N32 --> N7; + N32 --> N8; + N32 --> N9; + N32 --> N10; + N32 --> N11; + N32 --> N12; + N32 --> N14; + N32 --> N16; + N32 --> N18; + N32 --> N20; + N32 --> N22; + N32 --> N24; N32 --> N26; - N32 --> N27; N32 --> N28; - N32 --> N29; N32 --> N30; - N32 --> N31; - N24 --> N5; - N24 --> N4; - N22 --> N5; - N22 --> N4; - N20 --> N5; - N20 --> N4; - N18 --> N5; - N18 --> N4; - N16 --> N5; - N16 --> N4; - N14 --> N5; - N14 --> N4; - N12 --> N5; - N12 --> N4; - N10 --> N5; - N10 --> N4; - N8 --> N5; - N8 --> N4; - N6 --> N5; - N6 --> N4; - N35 --> N3; - N35 --> N2; - N35 --> N1; - N35 --> N0; - N35 --> N4; - N35 -.-> N32; - N35 -.-> N24; - N35 -.-> N22; - N35 -.-> N20; - N35 -.-> N18; - N35 -.-> N16; - N35 -.-> N14; - N35 -.-> N12; - N35 -.-> N10; - N35 -.-> N8; - N35 -.-> N6; + N34 --> N3; + N34 --> N2; + N34 --> N1; + N34 --> N0; + N34 --> N4; N34 --> N32; - N25 --> N24; - N23 --> N22; - N21 --> N20; - N19 --> N18; - N17 --> N16; - N15 --> N14; + N34 --> N6; + N34 --> N7; + N34 --> N8; + N34 --> N9; + N34 --> N10; + N34 --> N11; + N34 --> N12; + N34 --> N14; + N34 --> N16; + N34 --> N18; + N34 --> N20; + N34 --> N22; + N34 --> N24; + N34 --> N26; + N34 --> N28; + N34 --> N30; N13 --> N12; - N11 --> N10; - N9 --> N8; - N7 --> N6; - N36 --> N35; - N33 --> N26; - N33 --> N27; - N33 --> N28; - N33 --> N29; - N33 --> N30; - N33 --> N31; + N15 --> N14; + N17 --> N16; + N19 --> N18; + N21 --> N20; + N23 --> N22; + N25 --> N24; + N27 --> N26; + N29 --> N28; + N31 --> N30; N33 --> N32; + N36 --> N34; + N35 --> N6; + N35 --> N7; + N35 --> N8; + N35 --> N9; + N35 --> N10; + N35 --> N11; + N35 --> N12; + N35 --> N14; + N35 --> N16; + N35 --> N18; + N35 --> N20; + N35 --> N22; + N35 --> N24; + N35 --> N26; + N35 --> N28; + N35 --> N30; + N35 --> N32; + N35 --> N34; ``` # Entrypoints ``` { + Export( + "unstable_getStaticPaths", + ): 27, Export( "unstable_getServerSideProps", - ): 7, - ModuleEvaluation: 33, + ): 33, + ModuleEvaluation: 35, Export( - "default", - ): 34, + "reportWebVitals", + ): 23, Export( "unstable_getServerProps", - ): 9, - Export( - "reportWebVitals", - ): 17, + ): 31, Export( "routeModule", ): 36, Export( - "unstable_getStaticParams", - ): 11, + "getStaticProps", + ): 15, Export( "config", - ): 19, + ): 21, Export( - "getStaticProps", - ): 25, + "unstable_getStaticParams", + ): 29, Export( "unstable_getStaticProps", - ): 15, + ): 25, Exports: 37, Export( - "unstable_getStaticPaths", + "default", ): 13, - Export( - "getServerSideProps", - ): 21, Export( "getStaticPaths", - ): 23, + ): 17, + Export( + "getServerSideProps", + ): 19, } ``` @@ -935,22 +1452,7 @@ export { hoist as f } from "__TURBOPACK_VAR__" assert { ``` ## Part 6 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { f as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSideProps'); -export { unstable_getServerSideProps as g } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true -}; +import '../../server/future/route-modules/pages/module.compiled'; ``` ## Part 7 @@ -958,72 +1460,69 @@ export { unstable_getServerSideProps as g } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 }; -import { g as unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 -}; -export { unstable_getServerSideProps }; +import '../../server/future/route-kind'; ``` ## Part 8 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { f as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 -}; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -const unstable_getServerProps = hoist(userland, 'unstable_getServerProps'); -export { unstable_getServerProps as h } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true + __turbopack_part__: 7 }; +import './helpers'; ``` ## Part 9 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 6 }; -import { h as unstable_getServerProps } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 8 }; -export { unstable_getServerProps }; +import 'VAR_MODULE_DOCUMENT'; ``` ## Part 10 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { f as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 7 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParams'); -export { unstable_getStaticParams as i } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; +import 'VAR_MODULE_APP'; ``` ## Part 11 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -import { i as unstable_getStaticParams } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -export { unstable_getStaticParams }; +import 'VAR_USERLAND'; ``` ## Part 12 @@ -1034,14 +1533,32 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const unstable_getStaticPaths = hoist(userland, 'unstable_getStaticPaths'); -export { unstable_getStaticPaths as j } from "__TURBOPACK_VAR__" assert { +const __TURBOPACK__default__export__ = hoist(userland, 'default'); +export { __TURBOPACK__default__export__ as g } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -1051,10 +1568,10 @@ export { unstable_getStaticPaths as j } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -import { j as unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { +import { g as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { __turbopack_part__: 12 }; -export { unstable_getStaticPaths }; +export { __TURBOPACK__default__export__ as default }; ``` ## Part 14 @@ -1065,14 +1582,35 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps'); -export { unstable_getStaticProps as k } from "__TURBOPACK_VAR__" assert { +const getStaticProps = hoist(userland, 'getStaticProps'); +export { getStaticProps as h } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -1082,10 +1620,10 @@ export { unstable_getStaticProps as k } from "__TURBOPACK_VAR__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; -import { k as unstable_getStaticProps } from "__TURBOPACK_PART__" assert { +import { h as getStaticProps } from "__TURBOPACK_PART__" assert { __turbopack_part__: 14 }; -export { unstable_getStaticProps }; +export { getStaticProps }; ``` ## Part 16 @@ -1096,36 +1634,29 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { f as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -const reportWebVitals = hoist(userland, 'reportWebVitals'); -export { reportWebVitals as l } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; - -``` -## Part 17 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 9 }; -import { l as reportWebVitals } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -export { reportWebVitals }; - -``` -## Part 18 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1133,24 +1664,24 @@ import { f as hoist } from "__TURBOPACK_PART__" assert { import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const config = hoist(userland, 'config'); -export { config as m } from "__TURBOPACK_VAR__" assert { +const getStaticPaths = hoist(userland, 'getStaticPaths'); +export { getStaticPaths as i } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 19 +## Part 17 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 16 }; -import { m as config } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import { i as getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; -export { config }; +export { getStaticPaths }; ``` -## Part 20 +## Part 18 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1158,36 +1689,32 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { f as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -const getServerSideProps = hoist(userland, 'getServerSideProps'); -export { getServerSideProps as n } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; - -``` -## Part 21 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 9 }; -import { n as getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -export { getServerSideProps }; - -``` -## Part 22 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1195,24 +1722,24 @@ import { f as hoist } from "__TURBOPACK_PART__" assert { import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const getStaticPaths = hoist(userland, 'getStaticPaths'); -export { getStaticPaths as o } from "__TURBOPACK_VAR__" assert { +const getServerSideProps = hoist(userland, 'getServerSideProps'); +export { getServerSideProps as j } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 23 +## Part 19 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 18 }; -import { o as getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import { j as getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 }; -export { getStaticPaths }; +export { getServerSideProps }; ``` -## Part 24 +## Part 20 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1220,105 +1747,124 @@ import "__TURBOPACK_PART__" assert { import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const getStaticProps = hoist(userland, 'getStaticProps'); -export { getStaticProps as p } from "__TURBOPACK_VAR__" assert { +const config = hoist(userland, 'config'); +export { config as k } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 25 +## Part 21 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 20 }; -import { p as getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 +import { k as config } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 }; -export { getStaticProps }; - -``` -## Part 26 -```js -import '../../server/future/route-modules/pages/module.compiled'; +export { config }; ``` -## Part 27 +## Part 22 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 5 }; -import '../../server/future/route-kind'; - -``` -## Part 28 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 6 }; -import './helpers'; - -``` -## Part 29 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 9 }; -import 'VAR_MODULE_DOCUMENT'; - -``` -## Part 30 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 14 }; -import 'VAR_MODULE_APP'; - -``` -## Part 31 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 20 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const reportWebVitals = hoist(userland, 'reportWebVitals'); +export { reportWebVitals as l } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true }; + +``` +## Part 23 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 22 }; -import 'VAR_USERLAND'; +import { l as reportWebVitals } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +export { reportWebVitals }; ``` -## Part 32 +## Part 24 ```js import "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1327,22 +1873,40 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 }; import { f as hoist } from "__TURBOPACK_PART__" assert { __turbopack_part__: 5 @@ -1350,786 +1914,1564 @@ import { f as hoist } from "__TURBOPACK_PART__" assert { import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const __TURBOPACK__default__export__ = hoist(userland, 'default'); -export { __TURBOPACK__default__export__ as q } from "__TURBOPACK_VAR__" assert { +const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps'); +export { unstable_getStaticProps as m } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 33 +## Part 25 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 24 +}; +import { m as unstable_getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 }; +export { unstable_getStaticProps }; + +``` +## Part 26 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 9 }; -"module evaluation"; - -``` -## Part 34 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 10 }; -import { q as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -export { __TURBOPACK__default__export__ as default }; - -``` -## Part 35 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 20 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 22 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 24 }; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const unstable_getStaticPaths = hoist(userland, 'unstable_getStaticPaths'); +export { unstable_getStaticPaths as n } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 27 +```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 26 +}; +import { n as unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +export { unstable_getStaticPaths }; + +``` +## Part 28 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 6 + __turbopack_part__: 12 }; -import { d as PagesRouteModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -import { c as RouteKind } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; -import { b as App } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 }; -import { a as Document } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const routeModule = new PagesRouteModule({ - definition: { - kind: RouteKind.PAGES, - page: 'VAR_DEFINITION_PAGE', - pathname: 'VAR_DEFINITION_PATHNAME', - bundlePath: '', - filename: '' - }, - components: { - App, - Document - }, - userland -}); -export { routeModule as r } from "__TURBOPACK_VAR__" assert { +const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParams'); +export { unstable_getStaticParams as o } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 36 +## Part 29 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 35 + __turbopack_part__: 28 }; -import { r as routeModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 35 +import { o as unstable_getStaticParams } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 }; -export { routeModule }; +export { unstable_getStaticParams }; ``` -## Part 37 +## Part 30 ```js -export { unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getServerSideProps" -}; -export { unstable_getServerProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getServerProps" -}; -export { unstable_getStaticParams } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticParams" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; -export { unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticPaths" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; -export { unstable_getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticProps" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -export { reportWebVitals } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export reportWebVitals" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -export { config } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export config" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -export { getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getServerSideProps" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -export { getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getStaticPaths" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -export { getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getStaticProps" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -export { default } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export default" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 }; -export { routeModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export routeModule" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; - -``` -## Merged (module eval) -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 16 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 27 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 20 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 22 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 24 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 26 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 28 }; -"module evaluation"; - -``` -# Entrypoints - -``` -{ - Export( - "unstable_getServerSideProps", - ): 9, - Export( - "default", - ): 35, - ModuleEvaluation: 36, - Export( - "unstable_getServerProps", - ): 11, - Export( - "reportWebVitals", - ): 19, - Export( - "routeModule", - ): 6, - Export( - "unstable_getStaticParams", - ): 13, - Export( - "config", - ): 21, - Export( - "getStaticProps", - ): 27, - Export( - "unstable_getStaticProps", - ): 17, - Exports: 37, - Export( - "unstable_getStaticPaths", - ): 15, - Export( - "getServerSideProps", - ): 23, - Export( - "getStaticPaths", - ): 25, -} -``` - - -# Modules (prod) -## Part 0 -```js -import Document from 'VAR_MODULE_DOCUMENT'; -export { Document as a } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; - -``` -## Part 1 -```js -import App from 'VAR_MODULE_APP'; -export { App as b } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; - -``` -## Part 2 -```js -import { RouteKind } from '../../server/future/route-kind'; -export { RouteKind as c } from "__TURBOPACK_VAR__" assert { +const unstable_getServerProps = hoist(userland, 'unstable_getServerProps'); +export { unstable_getServerProps as p } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 3 +## Part 31 ```js -import { PagesRouteModule } from '../../server/future/route-modules/pages/module.compiled'; -export { PagesRouteModule as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 }; - -``` -## Part 4 -```js -import * as userland from 'VAR_USERLAND'; -export { userland as e } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { p as unstable_getServerProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 }; +export { unstable_getServerProps }; ``` -## Part 5 +## Part 32 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 8 }; -import { d as PagesRouteModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 3 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; -import { c as RouteKind } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 }; -import { b as App } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 }; -import { a as Document } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -const routeModule = new PagesRouteModule({ - definition: { - kind: RouteKind.PAGES, - page: 'VAR_DEFINITION_PAGE', - pathname: 'VAR_DEFINITION_PATHNAME', - bundlePath: '', - filename: '' - }, - components: { - App, - Document - }, - userland -}); -export { routeModule as f } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; - -``` -## Part 6 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 18 }; -import { f as routeModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 }; -export { routeModule }; - -``` -## Part 7 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSideProps'); +export { unstable_getServerSideProps as q } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 33 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import { q as unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +export { unstable_getServerSideProps }; + +``` +## Part 34 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import { d as PagesRouteModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import { c as RouteKind } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import { b as App } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import { a as Document } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const routeModule = new PagesRouteModule({ + definition: { + kind: RouteKind.PAGES, + page: 'VAR_DEFINITION_PAGE', + pathname: 'VAR_DEFINITION_PATHNAME', + bundlePath: '', + filename: '' + }, + components: { + App, + Document + }, + userland +}); +export { routeModule as r } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 35 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; +"module evaluation"; + +``` +## Part 36 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; +import { r as routeModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; +export { routeModule }; + +``` +## Part 37 +```js +export { default } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export default" +}; +export { getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getStaticProps" +}; +export { getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getStaticPaths" +}; +export { getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getServerSideProps" +}; +export { config } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export config" +}; +export { reportWebVitals } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export reportWebVitals" +}; +export { unstable_getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticProps" +}; +export { unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticPaths" +}; +export { unstable_getStaticParams } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticParams" +}; +export { unstable_getServerProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getServerProps" +}; +export { unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getServerSideProps" +}; +export { routeModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export routeModule" +}; + +``` +## Merged (module eval) +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; +"module evaluation"; + +``` +# Entrypoints + +``` +{ + Export( + "unstable_getStaticPaths", + ): 27, + Export( + "unstable_getServerSideProps", + ): 33, + ModuleEvaluation: 35, + Export( + "reportWebVitals", + ): 23, + Export( + "unstable_getServerProps", + ): 31, + Export( + "routeModule", + ): 36, + Export( + "getStaticProps", + ): 15, + Export( + "config", + ): 21, + Export( + "unstable_getStaticParams", + ): 29, + Export( + "unstable_getStaticProps", + ): 25, + Exports: 37, + Export( + "default", + ): 13, + Export( + "getStaticPaths", + ): 17, + Export( + "getServerSideProps", + ): 19, +} +``` + + +# Modules (prod) +## Part 0 +```js +import Document from 'VAR_MODULE_DOCUMENT'; +export { Document as a } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 1 +```js +import App from 'VAR_MODULE_APP'; +export { App as b } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 2 +```js +import { RouteKind } from '../../server/future/route-kind'; +export { RouteKind as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 3 +```js +import { PagesRouteModule } from '../../server/future/route-modules/pages/module.compiled'; +export { PagesRouteModule as d } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 4 +```js +import * as userland from 'VAR_USERLAND'; +export { userland as e } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 5 +```js +import { hoist } from './helpers'; +export { hoist as f } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 6 +```js +import '../../server/future/route-modules/pages/module.compiled'; + +``` +## Part 7 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import '../../server/future/route-kind'; + +``` +## Part 8 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import './helpers'; + +``` +## Part 9 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import 'VAR_MODULE_DOCUMENT'; + +``` +## Part 10 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import 'VAR_MODULE_APP'; + +``` +## Part 11 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import 'VAR_USERLAND'; + +``` +## Part 12 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const __TURBOPACK__default__export__ = hoist(userland, 'default'); +export { __TURBOPACK__default__export__ as g } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 13 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import { g as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +export { __TURBOPACK__default__export__ as default }; + +``` +## Part 14 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const getStaticProps = hoist(userland, 'getStaticProps'); +export { getStaticProps as h } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 15 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import { h as getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +export { getStaticProps }; + +``` +## Part 16 ```js -import { hoist } from './helpers'; -export { hoist as g } from "__TURBOPACK_VAR__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const getStaticPaths = hoist(userland, 'getStaticPaths'); +export { getStaticPaths as i } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 8 +## Part 17 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import { i as getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +export { getStaticPaths }; + +``` +## Part 18 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const getServerSideProps = hoist(userland, 'getServerSideProps'); +export { getServerSideProps as j } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 19 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import { j as getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +export { getServerSideProps }; + +``` +## Part 20 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const config = hoist(userland, 'config'); +export { config as k } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 21 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import { k as config } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +export { config }; + +``` +## Part 22 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 +}; +import { e as userland } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +const reportWebVitals = hoist(userland, 'reportWebVitals'); +export { reportWebVitals as l } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; + +``` +## Part 23 +```js +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import { l as reportWebVitals } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +export { reportWebVitals }; + +``` +## Part 24 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 5 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 22 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSideProps'); -export { unstable_getServerSideProps as h } from "__TURBOPACK_VAR__" assert { +const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps'); +export { unstable_getStaticProps as m } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 9 +## Part 25 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 + __turbopack_part__: 24 }; -import { h as unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 8 +import { m as unstable_getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 }; -export { unstable_getServerSideProps }; +export { unstable_getStaticProps }; ``` -## Part 10 +## Part 26 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -const unstable_getServerProps = hoist(userland, 'unstable_getServerProps'); -export { unstable_getServerProps as i } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; - -``` -## Part 11 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 10 + __turbopack_part__: 9 }; -import { i as unstable_getServerProps } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 10 }; -export { unstable_getServerProps }; - -``` -## Part 12 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 -}; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 12 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParams'); -export { unstable_getStaticParams as j } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; - -``` -## Part 13 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 + __turbopack_part__: 18 }; -import { j as unstable_getStaticParams } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 12 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 }; -export { unstable_getStaticParams }; - -``` -## Part 14 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 22 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 24 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; const unstable_getStaticPaths = hoist(userland, 'unstable_getStaticPaths'); -export { unstable_getStaticPaths as k } from "__TURBOPACK_VAR__" assert { +export { unstable_getStaticPaths as n } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 15 +## Part 27 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 + __turbopack_part__: 26 }; -import { k as unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 14 +import { n as unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 }; export { unstable_getStaticPaths }; ``` -## Part 16 +## Part 28 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 7 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps'); -export { unstable_getStaticProps as l } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; - -``` -## Part 17 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 16 + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 }; -import { l as unstable_getStaticProps } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 16 }; -export { unstable_getStaticProps }; - -``` -## Part 18 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 20 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const reportWebVitals = hoist(userland, 'reportWebVitals'); -export { reportWebVitals as m } from "__TURBOPACK_VAR__" assert { +const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParams'); +export { unstable_getStaticParams as o } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 19 +## Part 29 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 + __turbopack_part__: 28 }; -import { m as reportWebVitals } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 18 +import { o as unstable_getStaticParams } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 }; -export { reportWebVitals }; +export { unstable_getStaticParams }; ``` -## Part 20 +## Part 30 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 7 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -const config = hoist(userland, 'config'); -export { config as n } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; - -``` -## Part 21 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 20 + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 }; -import { n as config } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 20 }; -export { config }; - -``` -## Part 22 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 22 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 24 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 28 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const getServerSideProps = hoist(userland, 'getServerSideProps'); -export { getServerSideProps as o } from "__TURBOPACK_VAR__" assert { +const unstable_getServerProps = hoist(userland, 'unstable_getServerProps'); +export { unstable_getServerProps as p } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 23 +## Part 31 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 + __turbopack_part__: 30 }; -import { o as getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 22 +import { p as unstable_getServerProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 }; -export { getServerSideProps }; +export { unstable_getServerProps }; ``` -## Part 24 +## Part 32 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 5 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 6 +}; +import "__TURBOPACK_PART__" assert { __turbopack_part__: 7 }; -import { e as userland } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 8 }; -const getStaticPaths = hoist(userland, 'getStaticPaths'); -export { getStaticPaths as p } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 9 }; - -``` -## Part 25 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 + __turbopack_part__: 10 }; -import { p as getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 24 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 }; -export { getStaticPaths }; - -``` -## Part 26 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 26 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 28 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import { f as hoist } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 5 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const getStaticProps = hoist(userland, 'getStaticProps'); -export { getStaticProps as q } from "__TURBOPACK_VAR__" assert { +const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSideProps'); +export { unstable_getServerSideProps as q } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` -## Part 27 +## Part 33 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 + __turbopack_part__: 32 }; -import { q as getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 26 +import { q as unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 }; -export { getStaticProps }; - -``` -## Part 28 -```js -import '../../server/future/route-modules/pages/module.compiled'; +export { unstable_getServerSideProps }; ``` -## Part 29 +## Part 34 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 3 }; -import '../../server/future/route-kind'; - -``` -## Part 30 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 1 }; -import './helpers'; - -``` -## Part 31 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 0 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 32 }; -import 'VAR_MODULE_DOCUMENT'; - -``` -## Part 32 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 9 }; -import 'VAR_MODULE_APP'; - -``` -## Part 33 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 14 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 16 }; -import 'VAR_USERLAND'; - -``` -## Part 34 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 + __turbopack_part__: 18 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 20 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 28 + __turbopack_part__: 22 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 24 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 26 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 28 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 30 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 +import { d as PagesRouteModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; -import { g as hoist } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 7 +import { c as RouteKind } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import { b as App } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 1 +}; +import { a as Document } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 }; import { e as userland } from "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const __TURBOPACK__default__export__ = hoist(userland, 'default'); -export { __TURBOPACK__default__export__ as r } from "__TURBOPACK_VAR__" assert { +const routeModule = new PagesRouteModule({ + definition: { + kind: RouteKind.PAGES, + page: 'VAR_DEFINITION_PAGE', + pathname: 'VAR_DEFINITION_PATHNAME', + bundlePath: '', + filename: '' + }, + components: { + App, + Document + }, + userland +}); +export { routeModule as r } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -2137,103 +3479,169 @@ export { __TURBOPACK__default__export__ as r } from "__TURBOPACK_VAR__" assert { ## Part 35 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 6 }; -import { r as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 7 }; -export { __TURBOPACK__default__export__ as default }; - -``` -## Part 36 -```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 10 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 11 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 26 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 28 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; "module evaluation"; ``` -## Part 37 +## Part 36 ```js -export { routeModule } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export routeModule" +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 }; -export { unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getServerSideProps" +import { r as routeModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 }; -export { unstable_getServerProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getServerProps" +export { routeModule }; + +``` +## Part 37 +```js +export { default } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export default" }; -export { unstable_getStaticParams } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticParams" +export { getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getStaticProps" }; -export { unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticPaths" +export { getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getStaticPaths" }; -export { unstable_getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export unstable_getStaticProps" +export { getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export getServerSideProps" +}; +export { config } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export config" }; export { reportWebVitals } from "__TURBOPACK_PART__" assert { __turbopack_part__: "export reportWebVitals" }; -export { config } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export config" +export { unstable_getStaticProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticProps" }; -export { getServerSideProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getServerSideProps" +export { unstable_getStaticPaths } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticPaths" }; -export { getStaticPaths } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getStaticPaths" +export { unstable_getStaticParams } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getStaticParams" }; -export { getStaticProps } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export getStaticProps" +export { unstable_getServerProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getServerProps" }; -export { default } from "__TURBOPACK_PART__" assert { - __turbopack_part__: "export default" +export { unstable_getServerSideProps } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export unstable_getServerSideProps" +}; +export { routeModule } from "__TURBOPACK_PART__" assert { + __turbopack_part__: "export routeModule" }; ``` ## Merged (module eval) ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 34 + __turbopack_part__: 6 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 33 + __turbopack_part__: 7 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 32 + __turbopack_part__: 8 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 31 + __turbopack_part__: 9 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 30 + __turbopack_part__: 10 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 11 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 12 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 14 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 16 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 18 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 20 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 29 + __turbopack_part__: 22 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 24 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 26 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 28 }; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 30 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 32 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 34 +}; "module evaluation"; ``` diff --git a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md index 600d34e1f1c79..74733b899b426 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md +++ b/turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/write-order/output.md @@ -69,6 +69,7 @@ export const shared = { ``` +- Side effects - Declares: `shared` - Reads: `order` - Write: `order`, `shared` @@ -127,6 +128,8 @@ graph TD Item5 --> Item4; Item6 --> Item3; Item6 --> Item1; + Item6 --> Item4; + Item6 --> Item5; Item7 --> Item6; Item7 --> Item1; Item7 --> Item3; @@ -161,6 +164,8 @@ graph TD Item5 --> Item4; Item6 --> Item3; Item6 --> Item1; + Item6 --> Item4; + Item6 --> Item5; Item7 --> Item6; Item7 --> Item1; Item7 --> Item3; @@ -198,6 +203,8 @@ graph TD Item5 --> Item4; Item6 --> Item3; Item6 --> Item1; + Item6 --> Item4; + Item6 --> Item5; Item7 --> Item6; Item7 --> Item1; Item7 --> Item3; @@ -213,6 +220,7 @@ graph TD Item8 --> Item3; Item8 --> Item4; Item8 --> Item5; + Item8 --> Item6; Item8 --> Item7; ``` # Final @@ -220,36 +228,39 @@ graph TD graph TD N0["Items: [ItemId(0, VarDeclarator(0))]"]; N1["Items: [ItemId(2, Normal)]"]; - N2["Items: [ItemId(5, VarDeclarator(0))]"]; - N3["Items: [ItemId(Export(("shared", #2), "shared"))]"]; - N4["Items: [ItemId(3, VarDeclarator(0))]"]; - N5["Items: [ItemId(4, VarDeclarator(0))]"]; + N2["Items: [ItemId(3, VarDeclarator(0))]"]; + N3["Items: [ItemId(4, VarDeclarator(0))]"]; + N4["Items: [ItemId(5, VarDeclarator(0))]"]; + N5["Items: [ItemId(Export(("shared", #2), "shared"))]"]; N6["Items: [ItemId(6, Normal)]"]; N7["Items: [ItemId(ModuleEvaluation)]"]; N8["Items: [ItemId(Export(("order", #2), "order"))]"]; N9["Items: [ItemId(1, Normal)]"]; N10["Items: [ItemId(Export(("func", #2), "func"))]"]; N1 --> N0; - N4 --> N1; - N5 --> N1; - N5 --> N4; N2 --> N1; - N2 --> N0; - N6 --> N2; + N3 --> N1; + N3 --> N2; + N4 --> N1; + N4 --> N0; + N4 --> N2; + N4 --> N3; + N6 --> N4; N6 --> N0; N6 --> N1; - N6 --> N4; - N6 --> N5; + N6 --> N2; + N6 --> N3; N8 --> N6; N8 --> N0; N10 --> N9; - N3 --> N2; + N5 --> N4; N9 --> N6; N9 --> N0; N9 -.-> N8; N7 --> N1; + N7 --> N2; + N7 --> N3; N7 --> N4; - N7 --> N5; N7 --> N6; ``` # Entrypoints @@ -266,7 +277,7 @@ graph TD ): 10, Export( "shared", - ): 3, + ): 5, } ``` @@ -296,16 +307,8 @@ order.push("a"); import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import { a as order } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -const shared = { - effect: order.push("b") -}; -export { shared as b } from "__TURBOPACK_VAR__" assert { +const x1 = externalFunction(); +export { x1 as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -313,12 +316,15 @@ export { shared as b } from "__TURBOPACK_VAR__" assert { ## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 1 }; -import { b as shared } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { shared }; +const x2 = externalFunction(); +export { x2 as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 4 @@ -326,30 +332,41 @@ export { shared }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const x1 = externalFunction(); -export { x1 as c } from "__TURBOPACK_VAR__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import { a as order } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +const shared = { + effect: order.push("b") +}; +export { shared as d } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 5 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const x2 = externalFunction(); -export { x2 as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { d as shared } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; +export { shared }; ``` ## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -358,10 +375,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 3 }; import { a as order } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -375,10 +392,13 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 @@ -452,10 +472,13 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 6 @@ -477,7 +500,7 @@ import "__TURBOPACK_PART__" assert { ): 9, Export( "shared", - ): 3, + ): 5, } ``` @@ -507,16 +530,8 @@ order.push("a"); import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -import { a as order } from "__TURBOPACK_PART__" assert { - __turbopack_part__: 0 -}; -const shared = { - effect: order.push("b") -}; -export { shared as b } from "__TURBOPACK_VAR__" assert { +const x1 = externalFunction(); +export { x1 as b } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; @@ -524,12 +539,15 @@ export { shared as b } from "__TURBOPACK_VAR__" assert { ## Part 3 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 1 }; -import { b as shared } from "__TURBOPACK_PART__" assert { +import "__TURBOPACK_PART__" assert { __turbopack_part__: 2 }; -export { shared }; +const x2 = externalFunction(); +export { x2 as c } from "__TURBOPACK_VAR__" assert { + __turbopack_var__: true +}; ``` ## Part 4 @@ -537,30 +555,41 @@ export { shared }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; -const x1 = externalFunction(); -export { x1 as c } from "__TURBOPACK_VAR__" assert { +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 +}; +import { a as order } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 0 +}; +const shared = { + effect: order.push("b") +}; +export { shared as d } from "__TURBOPACK_VAR__" assert { __turbopack_var__: true }; ``` ## Part 5 ```js -import "__TURBOPACK_PART__" assert { - __turbopack_part__: 1 -}; import "__TURBOPACK_PART__" assert { __turbopack_part__: 4 }; -const x2 = externalFunction(); -export { x2 as d } from "__TURBOPACK_VAR__" assert { - __turbopack_var__: true +import { d as shared } from "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; +export { shared }; ``` ## Part 6 ```js import "__TURBOPACK_PART__" assert { - __turbopack_part__: 2 + __turbopack_part__: 4 }; import "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -569,10 +598,10 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 3 }; import { a as order } from "__TURBOPACK_PART__" assert { __turbopack_part__: 0 @@ -589,10 +618,13 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 3 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 4 }; "module evaluation"; @@ -663,10 +695,13 @@ import "__TURBOPACK_PART__" assert { __turbopack_part__: 1 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 4 + __turbopack_part__: 2 }; import "__TURBOPACK_PART__" assert { - __turbopack_part__: 5 + __turbopack_part__: 3 +}; +import "__TURBOPACK_PART__" assert { + __turbopack_part__: 4 }; "module evaluation"; diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_e521f1.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_e521f1.js index 310c3137706f8..5e8c8a7ace1d4 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_e521f1.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_e521f1.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -115,7 +115,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -141,7 +141,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "f": [ ()=>getDog, - (getDog_new_value)=>getDog = getDog_new_value + (new_getDog)=>getDog = new_getDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$dynamic$2d$import$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript) "); @@ -162,7 +162,7 @@ function getDog() { __turbopack_esm__({ "d": [ ()=>setDog, - (setDog_new_value)=>setDog = setDog_new_value + (new_setDog)=>setDog = new_setDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$dynamic$2d$import$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript) "); @@ -181,7 +181,7 @@ function setDog(newDog) { __turbopack_esm__({ "g": [ ()=>dogRef, - (dogRef_new_value)=>dogRef = dogRef_new_value + (new_dogRef)=>dogRef = new_dogRef ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$dynamic$2d$import$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript) "); @@ -223,7 +223,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "e": [ ()=>getChimera, - (getChimera_new_value)=>getChimera = getChimera_new_value + (new_getChimera)=>getChimera = new_getChimera ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$dynamic$2d$import$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript) "); @@ -260,7 +260,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "b": [ ()=>initialCat, - (initialCat_new_value)=>initialCat = initialCat_new_value + (new_initialCat)=>initialCat = new_initialCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$dynamic$2d$import$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_1823b4._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_1823b4._.js index d8c5986951ab0..a453e0167da3d 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_1823b4._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_1823b4._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -143,7 +143,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -169,7 +169,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"], - (cat_new_value)=>$expr = cat_new_value + (new_cat)=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"] = new_cat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$module__evaluation$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js [test] (ecmascript) "); @@ -198,7 +198,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__fakeCat$3e$__["fakeCat"], - (fakeCat_new_value)=>$expr = fakeCat_new_value + (new_fakeCat)=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__fakeCat$3e$__["fakeCat"] = new_fakeCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$named$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$module__evaluation$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/module.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_6b9ee3._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_6b9ee3._.js index b19c8e3245e25..3efd4c1fe0ba1 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_6b9ee3._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_6b9ee3._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -143,7 +143,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -169,7 +169,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "f": [ ()=>getDog, - (getDog_new_value)=>getDog = getDog_new_value + (new_getDog)=>getDog = new_getDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js [test] (ecmascript) "); @@ -190,7 +190,7 @@ function getDog() { __turbopack_esm__({ "d": [ ()=>setDog, - (setDog_new_value)=>setDog = setDog_new_value + (new_setDog)=>setDog = new_setDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js [test] (ecmascript) "); @@ -209,7 +209,7 @@ function setDog(newDog) { __turbopack_esm__({ "g": [ ()=>dogRef, - (dogRef_new_value)=>dogRef = dogRef_new_value + (new_dogRef)=>dogRef = new_dogRef ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js [test] (ecmascript) "); @@ -251,7 +251,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "e": [ ()=>getChimera, - (getChimera_new_value)=>getChimera = getChimera_new_value + (new_getChimera)=>getChimera = new_getChimera ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js [test] (ecmascript) "); @@ -288,7 +288,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "b": [ ()=>initialCat, - (initialCat_new_value)=>initialCat = initialCat_new_value + (new_initialCat)=>initialCat = new_initialCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js [test] (ecmascript) "); @@ -364,7 +364,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__lib$3e$__["lib"], - (lib_new_value)=>$expr = lib_new_value + (new_lib)=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__lib$3e$__["lib"] = new_lib ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$export$2d$namespace$2f$input$2f$module$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$module__evaluation$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/module.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_84a6ca._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_84a6ca._.js index d57488854c7a7..47086000ed855 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_84a6ca._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_84a6ca._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -124,7 +124,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -150,7 +150,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2d$all$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"], - (cat_new_value)=>$expr = cat_new_value + (new_cat)=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2d$all$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"] = new_cat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2d$all$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$module__evaluation$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_4f48a0._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_4f48a0._.js index 4d45b3cc1c43a..4a2ab3854824e 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_4f48a0._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_4f48a0._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -124,7 +124,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -150,7 +150,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"], - (cat_new_value)=>$expr = cat_new_value + (new_cat)=>__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$export__cat$3e$__["cat"] = new_cat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$named$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$module__evaluation$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_519014._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_519014._.js index 2ace48a463b8f..5b12aa879eff8 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_519014._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_519014._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -124,7 +124,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -150,7 +150,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "f": [ ()=>getDog, - (getDog_new_value)=>getDog = getDog_new_value + (new_getDog)=>getDog = new_getDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js [test] (ecmascript) "); @@ -171,7 +171,7 @@ function getDog() { __turbopack_esm__({ "d": [ ()=>setDog, - (setDog_new_value)=>setDog = setDog_new_value + (new_setDog)=>setDog = new_setDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js [test] (ecmascript) "); @@ -190,7 +190,7 @@ function setDog(newDog) { __turbopack_esm__({ "g": [ ()=>dogRef, - (dogRef_new_value)=>dogRef = dogRef_new_value + (new_dogRef)=>dogRef = new_dogRef ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js [test] (ecmascript) "); @@ -232,7 +232,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "e": [ ()=>getChimera, - (getChimera_new_value)=>getChimera = getChimera_new_value + (new_getChimera)=>getChimera = new_getChimera ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js [test] (ecmascript) "); @@ -269,7 +269,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "b": [ ()=>initialCat, - (initialCat_new_value)=>initialCat = initialCat_new_value + (new_initialCat)=>initialCat = new_initialCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$import$2d$namespace$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-side-effect_input_55cb06._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-side-effect_input_55cb06._.js index e8b75428ea5fc..c52c380f4ebaa 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-side-effect_input_55cb06._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-side-effect_input_55cb06._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_c7b81e._.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_c7b81e._.js index 8e35ab57566fa..5114e34d53066 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_c7b81e._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_c7b81e._.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -115,7 +115,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -141,7 +141,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "f": [ ()=>getDog, - (getDog_new_value)=>getDog = getDog_new_value + (new_getDog)=>getDog = new_getDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$require$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript) "); @@ -162,7 +162,7 @@ function getDog() { __turbopack_esm__({ "d": [ ()=>setDog, - (setDog_new_value)=>setDog = setDog_new_value + (new_setDog)=>setDog = new_setDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$require$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript) "); @@ -181,7 +181,7 @@ function setDog(newDog) { __turbopack_esm__({ "g": [ ()=>dogRef, - (dogRef_new_value)=>dogRef = dogRef_new_value + (new_dogRef)=>dogRef = new_dogRef ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$require$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript) "); @@ -223,7 +223,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "e": [ ()=>getChimera, - (getChimera_new_value)=>getChimera = getChimera_new_value + (new_getChimera)=>getChimera = new_getChimera ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$require$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript) "); @@ -260,7 +260,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "b": [ ()=>initialCat, - (initialCat_new_value)=>initialCat = initialCat_new_value + (new_initialCat)=>initialCat = new_initialCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$require$2d$side$2d$effect$2f$input$2f$lib$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js [test] (ecmascript) "); diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_950e23.js b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_950e23.js index 62b16f5e1eeb3..78d41adf09427 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_950e23.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_950e23.js @@ -6,7 +6,7 @@ __turbopack_esm__({ "c": [ ()=>dog, - (dog_new_value)=>dog = dog_new_value + (new_dog)=>dog = new_dog ] }); let dog = "dog"; @@ -115,7 +115,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "a": [ ()=>cat, - (cat_new_value)=>cat = cat_new_value + (new_cat)=>cat = new_cat ] }); let cat = "cat"; @@ -141,7 +141,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "f": [ ()=>getDog, - (getDog_new_value)=>getDog = getDog_new_value + (new_getDog)=>getDog = new_getDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$tree$2d$shake$2d$test$2d$1$2f$input$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript) "); @@ -162,7 +162,7 @@ function getDog() { __turbopack_esm__({ "d": [ ()=>setDog, - (setDog_new_value)=>setDog = setDog_new_value + (new_setDog)=>setDog = new_setDog ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$tree$2d$shake$2d$test$2d$1$2f$input$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript) "); @@ -181,7 +181,7 @@ function setDog(newDog) { __turbopack_esm__({ "g": [ ()=>dogRef, - (dogRef_new_value)=>dogRef = dogRef_new_value + (new_dogRef)=>dogRef = new_dogRef ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$tree$2d$shake$2d$test$2d$1$2f$input$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__8$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript) "); @@ -223,7 +223,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "e": [ ()=>getChimera, - (getChimera_new_value)=>getChimera = getChimera_new_value + (new_getChimera)=>getChimera = new_getChimera ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$tree$2d$shake$2d$test$2d$1$2f$input$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__4$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript) "); @@ -260,7 +260,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo __turbopack_esm__({ "b": [ ()=>initialCat, - (initialCat_new_value)=>initialCat = initialCat_new_value + (new_initialCat)=>initialCat = new_initialCat ] }); var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2d$tree$2d$shake$2f$tree$2d$shake$2d$test$2d$1$2f$input$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__$3c$internal__part__0$3e$__ = __turbopack_import__("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js [test] (ecmascript) "); From dd85346b4b156dc29054c7ecda011000b57f0243 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Mon, 16 Sep 2024 12:15:33 +0200 Subject: [PATCH 16/43] Ensure individual Server References are inlined and DCE'd properly (#70103) Co-authored-by: Jiachi Liu --- .../build/analysis/get-page-static-info.ts | 8 +- packages/next/src/build/webpack-config.ts | 12 +++ .../webpack/loaders/get-module-build-info.ts | 1 + .../next-flight-client-module-loader.ts | 22 +++-- ...xt-flight-server-reference-proxy-loader.ts | 27 ++++++ .../app/actions.js | 9 ++ .../client-actions-tree-shaking/app/layout.js | 8 ++ .../app/route-1/page.js | 13 +++ .../app/route-2/page.js | 13 +++ .../client-actions-tree-shaking.test.ts | 85 +++++++++++++++++++ test/turbopack-build-tests-manifest.json | 9 ++ 11 files changed, 193 insertions(+), 14 deletions(-) create mode 100644 packages/next/src/build/webpack/loaders/next-flight-server-reference-proxy-loader.ts create mode 100644 test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/actions.js create mode 100644 test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/layout.js create mode 100644 test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-1/page.js create mode 100644 test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-2/page.js create mode 100644 test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts diff --git a/packages/next/src/build/analysis/get-page-static-info.ts b/packages/next/src/build/analysis/get-page-static-info.ts index 0728bcd7a2579..ef8a8fb642e44 100644 --- a/packages/next/src/build/analysis/get-page-static-info.ts +++ b/packages/next/src/build/analysis/get-page-static-info.ts @@ -81,8 +81,11 @@ export function getRSCModuleInformation( isReactServerLayer: boolean ): RSCMeta { const actionsJson = source.match(ACTION_MODULE_LABEL) - const actions = actionsJson - ? (Object.values(JSON.parse(actionsJson[1])) as string[]) + const parsedActionsMeta = actionsJson + ? (JSON.parse(actionsJson[1]) as Record) + : undefined + const actions = parsedActionsMeta + ? (Object.values(parsedActionsMeta) as string[]) : undefined const clientInfoMatch = source.match(CLIENT_MODULE_LABEL) const isClientRef = !!clientInfoMatch @@ -91,6 +94,7 @@ export function getRSCModuleInformation( return { type: RSC_MODULE_TYPES.client, actions, + actionIds: parsedActionsMeta, isClientRef, } } diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 9b12bf14ce0bb..b49f30e760180 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1182,6 +1182,7 @@ export default async function getBaseWebpackConfig( 'next-flight-client-entry-loader', 'next-flight-action-entry-loader', 'next-flight-client-module-loader', + 'next-flight-server-reference-proxy-loader', 'empty-loader', 'next-middleware-loader', 'next-edge-function-loader', @@ -1680,6 +1681,17 @@ export default async function getBaseWebpackConfig( test: /[\\/]next[\\/]dist[\\/](esm[\\/])?server[\\/]og[\\/]image-response\.js/, sideEffects: false, }, + // Mark the action-client-wrapper module as side-effects free to make sure + // the individual transformed module of client action can be tree-shaken. + // This will make modules processed by `next-flight-server-reference-proxy-loader` become side-effects free, + // then on client side the module ids will become tree-shakable. + // e.g. the output of client action module will look like: + // `export { a } from 'next-flight-server-reference-proxy-loader?id=idOfA&name=a! + // `export { b } from 'next-flight-server-reference-proxy-loader?id=idOfB&name=b! + { + test: /[\\/]next[\\/]dist[\\/](esm[\\/])?build[\\/]webpack[\\/]loaders[\\/]next-flight-loader[\\/]action-client-wrapper\.js/, + sideEffects: false, + }, { // This loader rule should be before other rules, as it can output code // that still contains `"use client"` or `"use server"` statements that diff --git a/packages/next/src/build/webpack/loaders/get-module-build-info.ts b/packages/next/src/build/webpack/loaders/get-module-build-info.ts index e455baf6dd30d..fc7d3a5174b17 100644 --- a/packages/next/src/build/webpack/loaders/get-module-build-info.ts +++ b/packages/next/src/build/webpack/loaders/get-module-build-info.ts @@ -29,6 +29,7 @@ export function getModuleBuildInfo(webpackModule: webpack.Module) { export interface RSCMeta { type: RSCModuleType actions?: string[] + actionIds?: Record clientRefs?: string[] clientEntryType?: 'cjs' | 'auto' isClientRef?: boolean diff --git a/packages/next/src/build/webpack/loaders/next-flight-client-module-loader.ts b/packages/next/src/build/webpack/loaders/next-flight-client-module-loader.ts index b1f02bdbb2c99..d699af1133d0e 100644 --- a/packages/next/src/build/webpack/loaders/next-flight-client-module-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-flight-client-module-loader.ts @@ -16,18 +16,16 @@ const flightClientModuleLoader: webpack.LoaderDefinitionFunction = const buildInfo = getModuleBuildInfo(this._module) buildInfo.rsc = getRSCModuleInformation(source, false) - // This is a server action entry module in the client layer. We need to attach - // noop exports of `callServer` wrappers for each action. - if (buildInfo.rsc.actions) { - return ` -import { callServer } from 'next/dist/client/app-call-server' - -function __build_action__(action, args) { - return callServer(action.$$id, args) -} - -${source} -` + // This is a server action entry module in the client layer. We need to create + // re-exports of "virtual modules" to expose the reference IDs to the client + // separately so they won't be always in the same one module which is not + // splittable. + if (buildInfo.rsc.actionIds) { + return Object.entries(buildInfo.rsc.actionIds) + .map(([id, name]) => { + return `export { ${name} } from 'next-flight-server-reference-proxy-loader?id=${id}&name=${name}!'` + }) + .join('\n') } return this.callback(null, source, sourceMap) diff --git a/packages/next/src/build/webpack/loaders/next-flight-server-reference-proxy-loader.ts b/packages/next/src/build/webpack/loaders/next-flight-server-reference-proxy-loader.ts new file mode 100644 index 0000000000000..91757845a6249 --- /dev/null +++ b/packages/next/src/build/webpack/loaders/next-flight-server-reference-proxy-loader.ts @@ -0,0 +1,27 @@ +import type { webpack } from 'next/dist/compiled/webpack/webpack' + +// This is a virtual proxy loader that takes a Server Reference ID and a name, +// creates a module that just re-exports the reference as that name. + +const flightServerReferenceProxyLoader: webpack.LoaderDefinitionFunction<{ + id: string + name: string +}> = function transformSource(this) { + const { id, name } = this.getOptions() + + // Both the import and the `createServerReference` call are marked as side + // effect free: + // - private-next-rsc-action-client-wrapper is matched as `sideEffects: false` in + // the Webpack loader + // - createServerReference is marked as /*#__PURE__*/ + // + // Because of that, Webpack is able to concatenate the modules and inline the + // reference IDs recursively directly into the module that uses them. + return `\ +import { createServerReference } from 'private-next-rsc-action-client-wrapper' +export ${ + name === 'default' ? 'default' : `const ${name} =` + } /*#__PURE__*/createServerReference(${JSON.stringify(id)})` +} + +export default flightServerReferenceProxyLoader diff --git a/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/actions.js b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/actions.js new file mode 100644 index 0000000000000..cf76b6752a016 --- /dev/null +++ b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/actions.js @@ -0,0 +1,9 @@ +'use server' + +export async function foo() { + console.log('This is action foo') +} + +export async function bar() { + console.log('This is action bar') +} diff --git a/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/layout.js b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/layout.js new file mode 100644 index 0000000000000..6d7e1ed585862 --- /dev/null +++ b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/layout.js @@ -0,0 +1,8 @@ +export default function RootLayout({ children }) { + return ( + + + {children} + + ) +} diff --git a/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-1/page.js b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-1/page.js new file mode 100644 index 0000000000000..14ba077b246a8 --- /dev/null +++ b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-1/page.js @@ -0,0 +1,13 @@ +'use client' + +import { foo } from '../actions' + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-2/page.js b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-2/page.js new file mode 100644 index 0000000000000..5d7baa7626fa4 --- /dev/null +++ b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/app/route-2/page.js @@ -0,0 +1,13 @@ +'use client' + +import { bar } from '../actions' + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts new file mode 100644 index 0000000000000..0dfeef25932da --- /dev/null +++ b/test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts @@ -0,0 +1,85 @@ +import { promises as fs } from 'fs' +import { join } from 'path' +import { nextTestSetup } from 'e2e-utils' +import { retry } from 'next-test-utils' + +function getServerReferenceIdsFromBundle(source: string): string[] { + // Reference IDs are strings with [0-9a-f] that are at least 32 characters long. + // We use RegExp to find them in the bundle. + const referenceIds = source.matchAll(/"([0-9a-f]{32,})"/g) || [] + return [...referenceIds].map(([, id]) => id) +} + +describe('app-dir - client-actions-tree-shaking', () => { + const { next } = nextTestSetup({ + files: __dirname, + }) + + const logs: string[] = [] + + beforeAll(() => { + const onLog = (log: string) => { + logs.push(log.trim()) + } + next.on('stdout', onLog) + next.on('stderr', onLog) + }) + + afterEach(async () => { + logs.length = 0 + }) + + it('should not bundle unused server reference id in client bundles', async () => { + const appDir = next.testDir + const route1Files = await fs.readdir( + join(appDir, '.next/static/chunks/app/route-1') + ) + const route2Files = await fs.readdir( + join(appDir, '.next/static/chunks/app/route-2') + ) + + const route1Bundle = await fs.readFile( + join( + appDir, + '.next/static/chunks/app/route-1', + route1Files.find((file) => file.endsWith('.js')) + ) + ) + const route2Bundle = await fs.readFile( + join( + appDir, + '.next/static/chunks/app/route-2', + route2Files.find((file) => file.endsWith('.js')) + ) + ) + + const bundle1Ids = getServerReferenceIdsFromBundle(route1Bundle.toString()) + const bundle2Ids = getServerReferenceIdsFromBundle(route2Bundle.toString()) + + // Each should only have one ID. + expect(bundle1Ids).toHaveLength(1) + expect(bundle2Ids).toHaveLength(1) + expect(bundle1Ids[0]).not.toEqual(bundle2Ids[0]) + }) + + // Test the application + it('should trigger actions correctly', async () => { + const browser = await next.browser('/route-1') + await browser.elementById('submit').click() + + await retry(() => { + expect(logs).toEqual( + expect.arrayContaining([expect.stringContaining('This is action foo')]) + ) + }) + + const browser2 = await next.browser('/route-2') + await browser2.elementById('submit').click() + + await retry(() => { + expect(logs).toEqual( + expect.arrayContaining([expect.stringContaining('This is action bar')]) + ) + }) + }) +}) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 11f144d3e7244..34122f616a179 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -15688,6 +15688,15 @@ "flakey": [], "runtimeError": false }, + "test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts": { + "passed": [], + "failed": [ + "app-dir - client-actions-tree-shaking should not bundle unused server reference id in client bundles" + ], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/production/app-dir/app-edge-middleware/app-edge-middleware.test.ts": { "passed": [ "app edge middleware without node.js modules should not have any errors about using Node.js modules if not present in middleware" From 5c5ea40df5e0f4b8853f64891347a6bfad587a0c Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 16 Sep 2024 12:21:16 +0200 Subject: [PATCH 17/43] Improve the transform and re-enable optimizeServerReact (#70101) --- crates/napi/src/minify.rs | 7 +++ .../src/transforms/optimize_server_react.rs | 47 ++++++++++++++++--- .../fixture/optimize_server_react/1/output.js | 17 +++++-- .../fixture/optimize_server_react/2/output.js | 22 ++++++++- .../fixture/optimize_server_react/4/output.js | 9 +++- .../fixture/optimize_server_react/6/output.js | 2 +- .../fixture/optimize_server_react/7/output.js | 13 ++++- .../minify-webpack-plugin/src/index.ts | 6 ++- packages/next/src/server/config-shared.ts | 2 +- .../use-effect-actions/app/mixed/page.tsx | 6 +-- 10 files changed, 111 insertions(+), 20 deletions(-) diff --git a/crates/napi/src/minify.rs b/crates/napi/src/minify.rs index 64ab767bda512..4856c7d6f942f 100644 --- a/crates/napi/src/minify.rs +++ b/crates/napi/src/minify.rs @@ -110,6 +110,13 @@ impl Task for MinifyTask { fn patch_opts(opts: &mut JsMinifyOptions) { opts.compress = BoolOrDataConfig::from_obj(TerserCompressorOptions { inline: Some(TerserInlineOption::Num(2)), + global_defs: [( + "process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE".into(), + "production".into(), + )] + .iter() + .cloned() + .collect(), ..Default::default() }); opts.mangle = BoolOrDataConfig::from_obj(MangleOptions { diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index 43c778e89626a..64590d3631974 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -60,6 +60,39 @@ fn effect_has_side_effect_deps(call: &CallExpr) -> bool { false } +fn wrap_expr_with_env_prod_condition(call: CallExpr) -> Expr { + // Wrap the call expression with the condition + // turn it into `process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE` && . + // And `process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE`` will be treated as `false` in + // minification. In this way the expression and dependencies are still available in + // compilation during bundling, but will be removed in the final DEC. + Expr::Bin(BinExpr { + span: DUMMY_SP, + left: Box::new(Expr::Member(MemberExpr { + obj: (Box::new(Expr::Member(MemberExpr { + obj: (Box::new(Expr::Ident(Ident { + sym: "process".into(), + span: DUMMY_SP, + ..Default::default() + }))), + + prop: MemberProp::Ident(IdentName { + sym: "env".into(), + span: DUMMY_SP, + }), + span: DUMMY_SP, + }))), + prop: (MemberProp::Ident(IdentName { + sym: "__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE".into(), + span: DUMMY_SP, + })), + span: DUMMY_SP, + })), + op: op!("&&"), + right: Box::new(Expr::Call(call)), + }) +} + impl Fold for OptimizeServerReact { fn fold_module_items(&mut self, items: Vec) -> Vec { let mut new_items = vec![]; @@ -101,16 +134,17 @@ impl Fold for OptimizeServerReact { fn fold_expr(&mut self, expr: Expr) -> Expr { if let Expr::Call(call) = &expr { if let Callee::Expr(box Expr::Ident(f)) = &call.callee { - // Remove `useEffect` call + // Mark `useEffect` as DCE'able if let Some(use_effect_ident) = &self.use_effect_ident { if &f.to_id() == use_effect_ident && !effect_has_side_effect_deps(call) { - return Expr::Lit(Lit::Null(Null { span: DUMMY_SP })); + // return Expr::Lit(Lit::Null(Null { span: DUMMY_SP })); + return wrap_expr_with_env_prod_condition(call.clone()); } } - // Remove `useLayoutEffect` call + // Mark `useLayoutEffect` as DCE'able if let Some(use_layout_effect_ident) = &self.use_layout_effect_ident { if &f.to_id() == use_layout_effect_ident && !effect_has_side_effect_deps(call) { - return Expr::Lit(Lit::Null(Null { span: DUMMY_SP })); + return wrap_expr_with_env_prod_condition(call.clone()); } } } else if let Some(react_ident) = &self.react_ident { @@ -118,9 +152,10 @@ impl Fold for OptimizeServerReact { if let box Expr::Ident(f) = &member.obj { if &f.to_id() == react_ident { if let MemberProp::Ident(i) = &member.prop { - // Remove `React.useEffect` and `React.useLayoutEffect` calls + // Mark `React.useEffect` and `React.useLayoutEffect` as DCE'able + // calls in production if i.sym == "useEffect" || i.sym == "useLayoutEffect" { - return Expr::Lit(Lit::Null(Null { span: DUMMY_SP })); + return wrap_expr_with_env_prod_condition(call.clone()); } } } diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js index 3774f05f643a1..9e46707814434 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js @@ -1,8 +1,17 @@ import { useEffect, useLayoutEffect, useMemo } from 'react'; import React from 'react'; export default function App() { - null; - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + console.log('Hello World'); + }, []); + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + function foo() {} + return ()=>{}; + }, [ + 1, + 2, + App + ]); useLayoutEffect(()=>{}, [ runSideEffect() ]); @@ -15,7 +24,9 @@ export default function App() { const a = useMemo(()=>{ return 1; }, []); - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && React.useEffect(()=>{ + console.log('Hello World'); + }); return

Hello World

; diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js index 7168bec29c03e..a45bed4f4b8e5 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js @@ -16,8 +16,26 @@ export default function FilterItemDropdown({ list }) { ()=>null ]; const ref = useRef(null); - null; - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + const handleClickOutside = (event)=>{ + if (ref.current && !ref.current.contains(event.target)) { + setOpenSelect(false); + } + }; + window.addEventListener('click', handleClickOutside); + return ()=>window.removeEventListener('click', handleClickOutside); + }, []); + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + list.forEach((listItem)=>{ + if ('path' in listItem && pathname === listItem.path || 'slug' in listItem && searchParams.get('sort') === listItem.slug) { + setActive(listItem.title); + } + }); + }, [ + pathname, + list, + searchParams + ]); return
{ setOpenSelect(!openSelect); diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js index ff5560e63f3e2..835aae43cfbab 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js @@ -5,7 +5,14 @@ export default function App() { useEffect(()=>{ console.log('Hello World'); }, []); - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + function foo() {} + return ()=>{}; + }, [ + 1, + 2, + App + ]); const a = useMemo(()=>{ return 1; }, []); diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js index d9a42787a5722..0d05a9dd34bd0 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js @@ -5,7 +5,7 @@ const Component = ({ children, fallback })=>{ false, ()=>null ]; - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>setMounted(true), []); if (!mounted) { return fallback ?? /* @__PURE__ */ jsx(Fragment, {}); } diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js index d53bae0a0cded..372b80ad7fbdd 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js @@ -1,8 +1,17 @@ import { useEffect, useLayoutEffect, useMemo } from 'react'; import * as React from 'react'; export default function App() { - null; - null; + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + console.log('Hello World'); + }, []); + process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + function foo() {} + return ()=>{}; + }, [ + 1, + 2, + App + ]); useLayoutEffect(()=>{}, [ runSideEffect() ]); diff --git a/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts b/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts index 0973145ba271b..8c731879a323b 100644 --- a/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts +++ b/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts @@ -109,7 +109,11 @@ export class MinifyPlugin { }, } : {}), - compress: true, + compress: { + global_defs: { + 'process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE': false, + }, + }, mangle: true, module: 'unknown', output: { diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index 279fadcd633e5..e24637c181fa5 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -1072,7 +1072,7 @@ export const defaultConfig: NextConfig = { ), webpackBuildWorker: undefined, webpackMemoryOptimizations: false, - optimizeServerReact: false, + optimizeServerReact: true, useEarlyImport: false, staleTimes: { dynamic: 0, diff --git a/test/production/app-dir/actions-tree-shaking/use-effect-actions/app/mixed/page.tsx b/test/production/app-dir/actions-tree-shaking/use-effect-actions/app/mixed/page.tsx index e0656de1b90ac..5a3604da44cb4 100644 --- a/test/production/app-dir/actions-tree-shaking/use-effect-actions/app/mixed/page.tsx +++ b/test/production/app-dir/actions-tree-shaking/use-effect-actions/app/mixed/page.tsx @@ -12,10 +12,10 @@ export default function Page() { // calling action1 fails!! useEffect(() => { + action1().then((obj) => { + console.log('action1 returned:', obj) + }) if (globalThis.DO_NOT_TREE_SHAKE) { - action1().then((obj) => { - console.log('action1 returned:', obj) - }) } }, []) From 6015b3107f592254dd93bc65582f7de1787cc4c8 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:09:49 +0200 Subject: [PATCH 18/43] Turbopack: add unknown into analysis for mutable for-of loops (#70080) Closes PACK-3249 Closes #70056 Array indexing always inserts `unknown` into the result for mutable arrays (because the array might have been mutated somehow in the meantime). The same wasn't done for `Iterated` (for-of loops). --- .../src/analyzer/builtin.rs | 8 +++++-- .../graph/array/graph-explained.snapshot | 4 ++++ .../tests/analyzer/graph/array/graph.snapshot | 23 +++++++++++++++++++ .../tests/analyzer/graph/array/input.js | 6 +++++ .../graph/array/resolved-explained.snapshot | 8 +++++++ .../graph/pack-2521/resolved-effects.snapshot | 3 +++ .../pack-2521/resolved-explained.snapshot | 6 +++++ .../unreachable/resolved-explained.snapshot | 4 +++- 8 files changed, 59 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs index c7bb34db1f156..574aeb93f88b6 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs @@ -637,8 +637,12 @@ pub fn replace_builtin(value: &mut JsValue) -> bool { }, JsValue::Iterated(_, iterable) => { - if let JsValue::Array { items, .. } = &mut **iterable { - *value = JsValue::alternatives(take(items)); + if let JsValue::Array { items, mutable, .. } = &mut **iterable { + let mut new_value = JsValue::alternatives(take(items)); + if *mutable { + new_value.add_unknown_mutations(true); + } + *value = new_value; true } else { false diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph-explained.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph-explained.snapshot index 0c164c5adf3c0..9ad72ba1fdad7 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph-explained.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph-explained.snapshot @@ -11,3 +11,7 @@ d2 = d1[FreeVar(global)["index"]] d3 = d1[1] d4 = d1[2] + +value#3 = Iterated(d1) + +value#5 = Iterated([]) diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph.snapshot index aa0d060bcf325..955516aee1b5e 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/graph.snapshot @@ -144,4 +144,27 @@ ), ), ), + ( + "value#3", + Iterated( + 2, + Variable( + ( + "d1", + #2, + ), + ), + ), + ), + ( + "value#5", + Iterated( + 2, + Array { + total_nodes: 1, + items: [], + mutable: true, + }, + ), + ), ] diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/input.js b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/input.js index 7c89fbf41e02f..fa407cb7d722e 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/input.js +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/input.js @@ -6,3 +6,9 @@ const d1 = [1, "foo"]; const d2 = d1[global.index]; const d3 = d1[1]; const d4 = d1[2]; + +for (const value of d1){ +} + +for (const value of []){ +} diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/resolved-explained.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/resolved-explained.snapshot index f9f84f2b349e6..3f5f5474fcb65 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/resolved-explained.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/array/resolved-explained.snapshot @@ -31,3 +31,11 @@ d3 = ("foo" | ???*0*) d4 = ???*0* - *0* [1, "foo"][2] ⚠️ invalid index + +value#3 = (1 | "foo" | ???*0*) +- *0* unknown mutation + ⚠️ This value might have side effects + +value#5 = ???*0* +- *0* unknown mutation + ⚠️ This value might have side effects diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-effects.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-effects.snapshot index 56249e323237e..d84dfc985d3ae 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-effects.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-effects.snapshot @@ -20,6 +20,7 @@ | "../src/build/Release/sharp-wasm32.node" | `@img/sharp-${???*2*}/sharp.node` | "@img/sharp-wasm32/sharp.node" + | ???*3* ) ) - *0* require: The require method from CommonJS @@ -27,6 +28,8 @@ ⚠️ nested operation - *2* module<./libvips, {}>["runtimePlatformArch"]() ⚠️ nested operation +- *3* unknown mutation + ⚠️ This value might have side effects 0 -> 10 member call = []["push"](???*0*) - *0* err diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-explained.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-explained.snapshot index 7c2fa11a18886..f69d05bde6e32 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-explained.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/pack-2521/resolved-explained.snapshot @@ -9,11 +9,14 @@ path = ( | "../src/build/Release/sharp-wasm32.node" | `@img/sharp-${???*1*}/sharp.node` | "@img/sharp-wasm32/sharp.node" + | ???*2* ) - *0* module<./libvips, {}>["runtimePlatformArch"]() ⚠️ nested operation - *1* module<./libvips, {}>["runtimePlatformArch"]() ⚠️ nested operation +- *2* unknown mutation + ⚠️ This value might have side effects paths = [ `../src/build/Release/sharp-${???*0*}.node`, @@ -39,6 +42,7 @@ sharp = (???*0* | ???*1*) | "../src/build/Release/sharp-wasm32.node" | `@img/sharp-${???*4*}/sharp.node` | "@img/sharp-wasm32/sharp.node" + | ???*5* ) ) ⚠️ only constant argument is supported @@ -48,3 +52,5 @@ sharp = (???*0* | ???*1*) ⚠️ nested operation - *4* module<./libvips, {}>["runtimePlatformArch"]() ⚠️ nested operation +- *5* unknown mutation + ⚠️ This value might have side effects diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable/resolved-explained.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable/resolved-explained.snapshot index 26c71fdcc1a17..6aea3f0342c17 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable/resolved-explained.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/unreachable/resolved-explained.snapshot @@ -26,4 +26,6 @@ x#10 = ???*0* x#17 = (...) => (undefined | FreeVar(undefined)) -y = () +y = ???*0* +- *0* unknown mutation + ⚠️ This value might have side effects From ecc3094c1390d693b100cc628de78821898246bf Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 19/43] Bump vendored sass-loader version (#70067) Bump sass-loader to include https://github.com/webpack-contrib/sass-loader/pull/1141. Closes PACK-2447 Previously sass-loader called `this.async()()` when failing to load the dependency, which meant that the following Webpack loaders still run (because that call is passes `error = undefined` and `content = undefined`). That PR changes it to `this.async()(err)`. This in turn changes the **Turbopack** error message in this case from ``` resolve-url-loader: PostCSS error PostCSS received undefined instead of string ``` to ``` Error evaluating Node.js code Error: Cannot find module 'sass' ``` I upgraded to sass-loader 15 because 16 has a pretty breaking change regarding options: https://github.com/webpack-contrib/sass-loader/releases/tag/v16.0.0 [Breaking sass-loader changes between 12.6.0 and 15.0.0](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md): - 15.0.0 (2024-07-23) - prefer sass-embedded over sass by default - 14.0.0 (2024-01-15) - removed `fibers` support - minimum supported Node.js version is 18.12.0 - 13.0.0 - minimum supported Node.js version is 14.15.0 - emit `@warn` at-rules as webpack warnings by default, if you want to revert behavior please use the warnRuleAsWarning option --- packages/next/package.json | 2 +- packages/next/src/compiled/sass-loader/cjs.js | 2 +- pnpm-lock.yaml | 29 ++++++++----------- .../scss/scss-mixins/app/page.module.scss | 1 + .../src/compiled/stacktrace-parser/index.d.ts | 2 +- .../js/src/transforms/webpack-loaders.ts | 2 +- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/packages/next/package.json b/packages/next/package.json index 55052817e2d0d..383f0507333ba 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -295,7 +295,7 @@ "raw-body": "2.4.1", "react-refresh": "0.12.0", "regenerator-runtime": "0.13.4", - "sass-loader": "12.6.0", + "sass-loader": "15.0.0", "schema-utils2": "npm:schema-utils@2.7.1", "schema-utils3": "npm:schema-utils@3.0.0", "semver": "7.3.2", diff --git a/packages/next/src/compiled/sass-loader/cjs.js b/packages/next/src/compiled/sass-loader/cjs.js index 793f2064475a2..515902f0e440d 100644 --- a/packages/next/src/compiled/sass-loader/cjs.js +++ b/packages/next/src/compiled/sass-loader/cjs.js @@ -1 +1 @@ -(function(){var __webpack_modules__={12:function(e,t){function set(e,t,s){if(typeof s.value==="object")s.value=klona(s.value);if(!s.enumerable||s.get||s.set||!s.configurable||!s.writable||t==="__proto__"){Object.defineProperty(e,t,s)}else e[t]=s.value}function klona(e){if(typeof e!=="object")return e;var t=0,s,r,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){n=Object.create(e.__proto__||null)}else if(o==="[object Array]"){n=Array(e.length)}else if(o==="[object Set]"){n=new Set;e.forEach((function(e){n.add(klona(e))}))}else if(o==="[object Map]"){n=new Map;e.forEach((function(e,t){n.set(klona(t),klona(e))}))}else if(o==="[object Date]"){n=new Date(+e)}else if(o==="[object RegExp]"){n=new RegExp(e.source,e.flags)}else if(o==="[object DataView]"){n=new e.constructor(klona(e.buffer))}else if(o==="[object ArrayBuffer]"){n=e.slice(0)}else if(o.slice(-6)==="Array]"){n=new e.constructor(e)}if(n){for(r=Object.getOwnPropertySymbols(e);t{const t=r.default.fileURLToPath(e);if(n.default.isAbsolute(t)){this.addDependency(t)}}))}else if(typeof f.stats!=="undefined"&&typeof f.stats.includedFiles!=="undefined"){f.stats.includedFiles.forEach((e=>{const t=n.default.normalize(e);if(n.default.isAbsolute(t)){this.addDependency(t)}}))}s(null,f.css.toString(),_)}var c=loader;t["default"]=c},208:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getCompileFn=getCompileFn;exports.getModernWebpackImporter=getModernWebpackImporter;exports.getSassImplementation=getSassImplementation;exports.getSassOptions=getSassOptions;exports.getWebpackImporter=getWebpackImporter;exports.getWebpackResolver=getWebpackResolver;exports.isSupportedFibers=isSupportedFibers;exports.normalizeSourceMap=normalizeSourceMap;var _url=_interopRequireDefault(__nccwpck_require__(310));var _path=_interopRequireDefault(__nccwpck_require__(17));var _full=__nccwpck_require__(12);var _neoAsync=_interopRequireDefault(__nccwpck_require__(175));var _SassWarning=_interopRequireDefault(__nccwpck_require__(390));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getDefaultSassImplementation(){let sassImplPkg="sass";try{eval("require").resolve("sass")}catch(ignoreError){try{eval("require").resolve("node-sass");sassImplPkg="node-sass"}catch(e){try{require.resolve("sass-embedded");sassImplPkg="sass-embedded"}catch(e){sassImplPkg="sass"}}}return __nccwpck_require__(438)}function getSassImplementation(e,t){let s=t;if(!s){try{s=getDefaultSassImplementation()}catch(t){e.emitError(t);return}}if(typeof s==="string"){try{s=require(s)}catch(t){e.emitError(t);return}}const{info:r}=s;if(!r){e.emitError(new Error("Unknown Sass implementation."));return}const n=r.split("\t");if(n.length<2){e.emitError(new Error(`Unknown Sass implementation "${r}".`));return}const[o]=n;if(o==="dart-sass"){return s}else if(o==="node-sass"){return s}else if(o==="sass-embedded"){return s}e.emitError(new Error(`Unknown Sass implementation "${o}".`))}function isProductionLikeMode(e){return e.mode==="production"||!e.mode}function proxyCustomImporters(e,t){return[].concat(e).map((e=>function proxyImporter(...s){const r={...this,webpackLoaderContext:t};return e.apply(r,s)}))}function isSupportedFibers(){const[e]=process.versions.node.split(".");return Number(e)<16}async function getSassOptions(e,t,s,r,n){const o=(0,_full.klona)(t.sassOptions?typeof t.sassOptions==="function"?t.sassOptions(e)||{}:t.sassOptions:{});const i=r.info.includes("dart-sass");const a=t.api==="modern";o.data=t.additionalData?typeof t.additionalData==="function"?await t.additionalData(s,e):`${t.additionalData}\n${s}`:s;if(!o.logger){const s=t.warnRuleAsWarning===true;const r=e.getLogger("sass-loader");const formatSpan=e=>`${e.url||"-"}:${e.start.line}:${e.start.column}: `;o.logger={debug(e,t){let s="";if(t.span){s=formatSpan(t.span)}s+=e;r.debug(s)},warn(t,n){let o="";if(n.deprecation){o+="Deprecation "}if(n.span&&!n.stack){o=formatSpan(n.span)}o+=t;if(n.stack){o+=`\n\n${n.stack}`}if(s){e.emitWarning(new _SassWarning.default(o,n))}else{r.warn(o)}}}}const{resourcePath:c}=e;if(a){o.url=_url.default.pathToFileURL(c);if(!o.style&&isProductionLikeMode(e)){o.style="compressed"}if(n){o.sourceMap=true}if(typeof o.syntax==="undefined"){const e=_path.default.extname(c);if(e&&e.toLowerCase()===".scss"){o.syntax="scss"}else if(e&&e.toLowerCase()===".sass"){o.syntax="indented"}else if(e&&e.toLowerCase()===".css"){o.syntax="css"}}o.importers=o.importers?proxyCustomImporters(Array.isArray(o.importers)?o.importers:[o.importers],e):[]}else{o.file=c;if(i&&isSupportedFibers()){const e=!o.fiber&&o.fiber!==false;if(e){let e;try{e=require.resolve("fibers")}catch(e){}if(e){o.fiber=require(e)}}else if(o.fiber===false){delete o.fiber}}else{delete o.fiber}if(!o.outputStyle&&isProductionLikeMode(e)){o.outputStyle="compressed"}if(n){o.sourceMap=true;o.outFile=_path.default.join(e.rootContext,"style.css.map");o.sourceMapContents=true;o.omitSourceMapUrl=true;o.sourceMapEmbed=false}const t=_path.default.extname(c);if(t&&t.toLowerCase()===".sass"&&typeof o.indentedSyntax==="undefined"){o.indentedSyntax=true}else{o.indentedSyntax=Boolean(o.indentedSyntax)}o.importer=o.importer?proxyCustomImporters(Array.isArray(o.importer)?o.importer:[o.importer],e):[];o.includePaths=[].concat(process.cwd()).concat((o.includePaths||[]).map((e=>_path.default.isAbsolute(e)?e:_path.default.join(process.cwd(),e)))).concat(process.env.SASS_PATH?process.env.SASS_PATH.split(process.platform==="win32"?";":":"):[]);if(typeof o.charset==="undefined"){o.charset=true}}return o}const MODULE_REQUEST_REGEX=/^[^?]*~/;const IS_MODULE_IMPORT=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;function getPossibleRequests(e,t=false,s=false){let r=e;if(t){if(MODULE_REQUEST_REGEX.test(e)){r=r.replace(MODULE_REQUEST_REGEX,"")}if(IS_MODULE_IMPORT.test(e)){r=r[r.length-1]==="/"?r:`${r}/`;return[...new Set([r,e])]}}const n=_path.default.extname(r).toLowerCase();if(n===".css"){return[]}const o=_path.default.dirname(r);const i=o==="."?"":`${o}/`;const a=_path.default.basename(r);const c=_path.default.basename(r,n);return[...new Set([].concat(s?[`${i}_${c}.import${n}`,`${i}${c}.import${n}`]:[]).concat([`${i}_${a}`,`${i}${a}`]).concat(t?[e]:[]))]}function promiseResolve(e){return(t,s)=>new Promise(((r,n)=>{e(t,s,((e,t)=>{if(e){n(e)}else{r(t)}}))}))}async function startResolving(e){if(e.length===0){return Promise.reject()}const[{possibleRequests:t}]=e;if(t.length===0){return Promise.reject()}const[{resolve:s,context:r}]=e;try{return await s(r,t[0])}catch(s){const[,...r]=t;if(r.length===0){const[,...t]=e;return startResolving(t)}e[0].possibleRequests=r;return startResolving(e)}}const IS_SPECIAL_MODULE_IMPORT=/^~[^/]+$/;const IS_NATIVE_WIN32_PATH=/^[a-z]:[/\\]|^\\\\/i;function getWebpackResolver(e,t,s=[]){const r=t&&t.info.includes("dart-sass");const n=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const o=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index.import","_index","index.import","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const i=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const a=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index.import","_index","index.import","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));return(e,t,c)=>{if(!r&&!_path.default.isAbsolute(e)){return Promise.reject()}const l=t;const u=l.slice(0,5).toLowerCase()==="file:";if(u){try{t=_url.default.fileURLToPath(l)}catch(e){t=t.slice(7)}}let p=[];const d=!IS_SPECIAL_MODULE_IMPORT.test(t)&&!u&&!l.startsWith("/")&&!IS_NATIVE_WIN32_PATH.test(l);if(s.length>0&&d){const i=getPossibleRequests(t,false,c);if(!r){p=p.concat({resolve:c?o:n,context:_path.default.dirname(e),possibleRequests:i})}p=p.concat(s.map((e=>({resolve:c?o:n,context:e,possibleRequests:i}))))}const f=getPossibleRequests(t,true,c);p=p.concat({resolve:c?a:i,context:_path.default.dirname(e),possibleRequests:f});return startResolving(p)}}const MATCH_CSS=/\.css$/i;function getModernWebpackImporter(){return{async canonicalize(){return null},load(){}}}function getWebpackImporter(e,t,s){const r=getWebpackResolver(e.getResolve,t,s);return function importer(t,s,n){const{fromImport:o}=this;r(s,t,o).then((t=>{e.addDependency(_path.default.normalize(t));n({file:t.replace(MATCH_CSS,"")})})).catch((()=>{n({file:t})}))}}let nodeSassJobQueue=null;function getCompileFn(e,t){const s=e.info.includes("dart-sass")||e.info.includes("sass-embedded");if(s){if(t.api==="modern"){return t=>{const{data:s,...r}=t;return e.compileStringAsync(s,r)}}return t=>new Promise(((s,r)=>{e.render(t,((e,t)=>{if(e){r(e);return}s(t)}))}))}if(t.api==="modern"){throw new Error("Modern API is not supported for 'node-sass'")}if(nodeSassJobQueue===null){const t=Number(process.env.UV_THREADPOOL_SIZE||4);nodeSassJobQueue=_neoAsync.default.queue(e.render.bind(e),t-1)}return e=>new Promise(((t,s)=>{nodeSassJobQueue.push.bind(nodeSassJobQueue)(e,((e,r)=>{if(e){s(e);return}t(r)}))}))}const ABSOLUTE_SCHEME=/^[A-Za-z0-9+\-.]+:/;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(IS_NATIVE_WIN32_PATH.test(e)){return"path-absolute"}return ABSOLUTE_SCHEME.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){const s=e;if(typeof s.file!=="undefined"){delete s.file}s.sourceRoot="";s.sources=s.sources.map((e=>{const s=getURLType(e);if(s==="absolute"&&/^file:/i.test(e)){return _url.default.fileURLToPath(e)}else if(s==="path-relative"){return _path.default.resolve(t,_path.default.normalize(e))}return e}));return s}},175:function(e){"use strict";e.exports=require("next/dist/compiled/neo-async")},17:function(e){"use strict";e.exports=require("path")},438:function(e){"use strict";e.exports=require("sass")},310:function(e){"use strict";e.exports=require("url")},26:function(e){"use strict";e.exports=JSON.parse('{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack-contrib/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"api":{"description":"Switch between old and modern API for `sass` (`Dart Sass`) and `Sass Embedded` implementations.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","enum":["legacy","modern"]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack-contrib/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack-contrib/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var s=__webpack_module_cache__[e]={exports:{}};var r=true;try{__webpack_modules__[e](s,s.exports,__nccwpck_require__);r=false}finally{if(r)delete __webpack_module_cache__[e]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(283);module.exports=__webpack_exports__})(); \ No newline at end of file +(function(){"use strict";var __webpack_modules__={243:function(e,t,s){const n=s(543);e.exports=n.default},543:function(e,t,s){Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(s(310));var o=_interopRequireDefault(s(17));var r=_interopRequireDefault(s(429));var a=s(362);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}async function loader(e){const t=this.getOptions(r.default);const s=this.async();let i;try{i=(0,a.getSassImplementation)(this,t.implementation)}catch(e){s(e);return}const c=typeof t.sourceMap==="boolean"?t.sourceMap:this.sourceMap;const l=await(0,a.getSassOptions)(this,t,e,i,c);const p=typeof t.webpackImporter==="boolean"?t.webpackImporter:true;if(p){const e=t.api==="modern"||t.api==="modern-compiler";if(!e){const{includePaths:e}=l;l.importer.push((0,a.getWebpackImporter)(this,i,e))}else{l.importers.push((0,a.getModernWebpackImporter)(this,i,[]))}}let u;try{u=(0,a.getCompileFn)(this,i,t)}catch(e){s(e);return}let d;try{d=await u(l)}catch(e){if(e.span&&typeof e.span.url!=="undefined"){this.addDependency(n.default.fileURLToPath(e.span.url))}else if(typeof e.file!=="undefined"){this.addDependency(o.default.normalize(e.file))}s((0,a.errorFactory)(e));return}let f=d.sourceMap?d.sourceMap:d.map?JSON.parse(d.map):null;if(f&&c){f=(0,a.normalizeSourceMap)(f,this.rootContext)}if(typeof d.loadedUrls!=="undefined"){d.loadedUrls.filter((e=>e.protocol==="file:")).forEach((e=>{const t=n.default.fileURLToPath(e);if(o.default.isAbsolute(t)){this.addDependency(t)}}))}else if(typeof d.stats!=="undefined"&&typeof d.stats.includedFiles!=="undefined"){d.stats.includedFiles.forEach((e=>{const t=o.default.normalize(e);if(o.default.isAbsolute(t)){this.addDependency(t)}}))}s(null,d.css.toString(),f)}var i=t["default"]=loader},362:function(__unused_webpack_module,exports,__nccwpck_require__){Object.defineProperty(exports,"__esModule",{value:true});exports.errorFactory=errorFactory;exports.getCompileFn=getCompileFn;exports.getModernWebpackImporter=getModernWebpackImporter;exports.getSassImplementation=getSassImplementation;exports.getSassOptions=getSassOptions;exports.getWebpackImporter=getWebpackImporter;exports.getWebpackResolver=getWebpackResolver;exports.normalizeSourceMap=normalizeSourceMap;var _url=_interopRequireDefault(__nccwpck_require__(310));var _path=_interopRequireDefault(__nccwpck_require__(17));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getDefaultSassImplementation(){let sassImplPkg="sass";try{require.resolve("sass-embedded");sassImplPkg="sass-embedded"}catch(ignoreError){try{eval("require").resolve("sass")}catch(_ignoreError){try{eval("require").resolve("node-sass");sassImplPkg="node-sass"}catch(e){sassImplPkg="sass"}}}return __nccwpck_require__(438)}function getSassImplementation(e,t){let s=t;if(!s){s=getDefaultSassImplementation()}if(typeof s==="string"){s=require(s)}const{info:n}=s;if(!n){throw new Error("Unknown Sass implementation.")}const o=n.split("\t");if(o.length<2){throw new Error(`Unknown Sass implementation "${n}".`)}const[r]=o;if(r==="dart-sass"){return s}else if(r==="node-sass"){return s}else if(r==="sass-embedded"){return s}throw new Error(`Unknown Sass implementation "${r}".`)}function isProductionLikeMode(e){return e.mode==="production"||!e.mode}function proxyCustomImporters(e,t){return[].concat(e).map((e=>function proxyImporter(...s){const n={...this,webpackLoaderContext:t};return e.apply(n,s)}))}async function getSassOptions(e,t,s,n,o){const r=t.sassOptions?typeof t.sassOptions==="function"?t.sassOptions(e)||{}:t.sassOptions:{};const a={...r,data:t.additionalData?typeof t.additionalData==="function"?await t.additionalData(s,e):`${t.additionalData}\n${s}`:s};if(!a.logger){const s=t.warnRuleAsWarning!==false;const n=e.getLogger("sass-loader");const formatSpan=e=>`Warning on line ${e.start.line}, column ${e.start.column} of ${e.url||"-"}:${e.start.line}:${e.start.column}:\n`;const formatDebugSpan=e=>`[debug:${e.start.line}:${e.start.column}] `;a.logger={debug(e,t){let s="";if(t.span){s=formatDebugSpan(t.span)}s+=e;n.debug(s)},warn(t,o){let r="";if(o.deprecation){r+="Deprecation "}if(o.span){r+=formatSpan(o.span)}r+=t;if(o.span&&o.span.context){r+=`\n\n${o.span.start.line} | ${o.span.context}`}if(o.stack&&o.stack!=="null"){r+=`\n\n${o.stack}`}if(s){const t=new Error(r);t.name="SassWarning";t.stack=null;e.emitWarning(t)}else{n.warn(r)}}}}const i=t.api==="modern"||t.api==="modern-compiler";const{resourcePath:c}=e;if(i){a.url=_url.default.pathToFileURL(c);if(!a.style&&isProductionLikeMode(e)){a.style="compressed"}if(o){a.sourceMap=true}if(typeof a.syntax==="undefined"){const e=_path.default.extname(c);if(e&&e.toLowerCase()===".scss"){a.syntax="scss"}else if(e&&e.toLowerCase()===".sass"){a.syntax="indented"}else if(e&&e.toLowerCase()===".css"){a.syntax="css"}}a.loadPaths=[].concat((a.loadPaths?a.loadPaths.slice():[]).map((e=>_path.default.isAbsolute(e)?e:_path.default.join(process.cwd(),e)))).concat(process.env.SASS_PATH?process.env.SASS_PATH.split(process.platform==="win32"?";":":"):[]);a.importers=a.importers?Array.isArray(a.importers)?a.importers.slice():[a.importers]:[]}else{a.file=c;if(!a.outputStyle&&isProductionLikeMode(e)){a.outputStyle="compressed"}if(o){a.sourceMap=true;a.outFile=_path.default.join(e.rootContext,"style.css.map");a.sourceMapContents=true;a.omitSourceMapUrl=true;a.sourceMapEmbed=false}const s=_path.default.extname(c);if(s&&s.toLowerCase()===".sass"&&typeof a.indentedSyntax==="undefined"){a.indentedSyntax=true}else{a.indentedSyntax=Boolean(a.indentedSyntax)}a.importer=a.importer?proxyCustomImporters(Array.isArray(a.importer)?a.importer.slice():[a.importer],e):[];if(t.webpackImporter===false&&a.importer.length===0){a.importer=undefined}a.includePaths=[].concat(process.cwd()).concat((a.includePaths?a.includePaths.slice():[]).map((e=>_path.default.isAbsolute(e)?e:_path.default.join(process.cwd(),e)))).concat(process.env.SASS_PATH?process.env.SASS_PATH.split(process.platform==="win32"?";":":"):[]);if(typeof a.charset==="undefined"){a.charset=true}}return a}const MODULE_REQUEST_REGEX=/^[^?]*~/;const IS_MODULE_IMPORT=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;const IS_PKG_SCHEME=/^pkg:/i;function getPossibleRequests(e,t=false,s=false){let n=e;if(t){if(MODULE_REQUEST_REGEX.test(e)){n=n.replace(MODULE_REQUEST_REGEX,"")}if(IS_PKG_SCHEME.test(e)){n=`${n.slice(4)}`;return[...new Set([n,e])]}if(IS_MODULE_IMPORT.test(e)||IS_PKG_SCHEME.test(e)){n=n[n.length-1]==="/"?n:`${n}/`;return[...new Set([n,e])]}}const o=_path.default.extname(n).toLowerCase();if(o===".css"){return[]}const r=_path.default.dirname(n);const a=r==="."?"":`${r}/`;const i=_path.default.basename(n);const c=_path.default.basename(n,o);return[...new Set([].concat(s?[`${a}_${c}.import${o}`,`${a}${c}.import${o}`]:[]).concat([`${a}_${i}`,`${a}${i}`]).concat(t?[e]:[]))]}function promiseResolve(e){return(t,s)=>new Promise(((n,o)=>{e(t,s,((e,t)=>{if(e){o(e)}else{n(t)}}))}))}async function startResolving(e){if(e.length===0){return Promise.reject()}const[{possibleRequests:t}]=e;if(t.length===0){return Promise.reject()}const[{resolve:s,context:n}]=e;try{return await s(n,t[0])}catch(s){const[,...n]=t;if(n.length===0){const[,...t]=e;return startResolving(t)}e[0].possibleRequests=n;return startResolving(e)}}const IS_SPECIAL_MODULE_IMPORT=/^~[^/]+$/;const IS_NATIVE_WIN32_PATH=/^[a-z]:[/\\]|^\\\\/i;function getWebpackResolver(e,t,s=[]){const n=t&&(t.info.includes("dart-sass")||t.info.includes("sass-embedded"));const o=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const r=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index.import","_index","index.import","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const a=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style","..."],mainFields:["sass","style","main","..."],mainFiles:["_index","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const i=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style","..."],mainFields:["sass","style","main","..."],mainFiles:["_index.import","_index","index.import","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));return(e,t,c)=>{if(!n&&!_path.default.isAbsolute(e)){return Promise.reject()}const l=t;const p=l.slice(0,5).toLowerCase()==="file:";if(p){try{t=_url.default.fileURLToPath(l)}catch(e){t=t.slice(7)}}let u=[];const d=!IS_SPECIAL_MODULE_IMPORT.test(t)&&!IS_PKG_SCHEME.test(t)&&!p&&!l.startsWith("/")&&!IS_NATIVE_WIN32_PATH.test(l);if(s.length>0&&d){const a=getPossibleRequests(t,false,c);if(!n){u=u.concat({resolve:c?r:o,context:_path.default.dirname(e),possibleRequests:a})}u=u.concat(s.map((e=>({resolve:c?r:o,context:e,possibleRequests:a}))))}const f=getPossibleRequests(t,true,c);u=u.concat({resolve:c?i:a,context:_path.default.dirname(e),possibleRequests:f});return startResolving(u)}}const MATCH_CSS=/\.css$/i;function getModernWebpackImporter(e,t,s){const n=getWebpackResolver(e.getResolve,t,s);return{async canonicalize(t,s){const{fromImport:o}=s;const r=s.containingUrl?_url.default.fileURLToPath(s.containingUrl.toString()):e.resourcePath;let a;try{a=await n(r,t,o)}catch(e){return null}e.addDependency(_path.default.normalize(a));return _url.default.pathToFileURL(a)},async load(t){const s=_path.default.extname(t.pathname);let n;if(s&&s.toLowerCase()===".scss"){n="scss"}else if(s&&s.toLowerCase()===".sass"){n="indented"}else if(s&&s.toLowerCase()===".css"){n="css"}else{n="scss"}try{const s=await new Promise(((s,n)=>{const o=_url.default.fileURLToPath(t);e.fs.readFile(o,"utf8",((e,t)=>{if(e){n(e);return}s(t)}))}));return{contents:s,syntax:n}}catch(e){return null}}}}function getWebpackImporter(e,t,s){const n=getWebpackResolver(e.getResolve,t,s);return function importer(t,s,o){const{fromImport:r}=this;n(s,t,r).then((t=>{e.addDependency(_path.default.normalize(t));o({file:t.replace(MATCH_CSS,"")})})).catch((()=>{o({file:t})}))}}let nodeSassJobQueue=null;const sassModernCompilers=new WeakMap;function getCompileFn(e,t,s){const n=t.info.includes("dart-sass")||t.info.includes("sass-embedded");if(n){if(s.api==="modern"){return e=>{const{data:s,...n}=e;return t.compileStringAsync(s,n)}}if(s.api==="modern-compiler"){return async s=>{const n=e._compiler;const{data:o,...r}=s;if(n){if(!sassModernCompilers.has(n)){const e=await t.initAsyncCompiler();if(!sassModernCompilers.has(n)){sassModernCompilers.set(n,e);n.hooks.shutdown.tap("sass-loader",(()=>{e.dispose()}))}}return sassModernCompilers.get(n).compileStringAsync(o,r)}return t.compileStringAsync(o,r)}}return e=>new Promise(((s,n)=>{t.render(e,((e,t)=>{if(e){n(e);return}s(t)}))}))}if(s.api==="modern"||s.api==="modern-compiler"){throw new Error("Modern API is not supported for 'node-sass'")}if(nodeSassJobQueue===null){const e=Number(process.env.UV_THREADPOOL_SIZE||4);const s=__nccwpck_require__(175);nodeSassJobQueue=s.queue(t.render.bind(t),e-1)}return e=>new Promise(((t,s)=>{nodeSassJobQueue.push.bind(nodeSassJobQueue)(e,((e,n)=>{if(e){s(e);return}t(n)}))}))}const ABSOLUTE_SCHEME=/^[A-Za-z0-9+\-.]+:/;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(IS_NATIVE_WIN32_PATH.test(e)){return"path-absolute"}return ABSOLUTE_SCHEME.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){const s=e;if(typeof s.file!=="undefined"){delete s.file}s.sourceRoot="";s.sources=s.sources.map((e=>{const s=getURLType(e);if(s==="absolute"&&/^file:/i.test(e)){return _url.default.fileURLToPath(e)}else if(s==="path-relative"){return _path.default.resolve(t,_path.default.normalize(e))}return e}));return s}function errorFactory(e){let t;if(e.formatted){t=e.formatted.replace(/^Error: /,"")}else{({message:t}=e)}const s=new Error(t,{cause:e});s.stack=null;return s}},175:function(e){e.exports=require("next/dist/compiled/neo-async")},17:function(e){e.exports=require("path")},438:function(e){e.exports=require("sass")},310:function(e){e.exports=require("url")},429:function(e){e.exports=JSON.parse('{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack-contrib/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"api":{"description":"Switch between old and modern API for `sass` (`Dart Sass`) and `Sass Embedded` implementations.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","enum":["legacy","modern","modern-compiler"]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack-contrib/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack-contrib/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var s=__webpack_module_cache__[e]={exports:{}};var n=true;try{__webpack_modules__[e](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete __webpack_module_cache__[e]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(243);module.exports=__webpack_exports__})(); \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5eea524905d4..2d8e388d1c72f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1383,8 +1383,8 @@ importers: specifier: 0.13.4 version: 0.13.4 sass-loader: - specifier: 12.6.0 - version: 12.6.0(sass@1.77.8)(webpack@5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13))) + specifier: 15.0.0 + version: 15.0.0(sass@1.77.8)(webpack@5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13))) schema-utils2: specifier: npm:schema-utils@2.7.1 version: schema-utils@2.7.1 @@ -10034,10 +10034,6 @@ packages: resolution: {integrity: sha512-H1tr8QP2PxFTNwAFM74Mui2b6ovcY9FoxJefgrwxY+OCJcq01k5nvhf4M/KnizzrJvLRap5STUy7dgDV35iUBw==} engines: {node: '>=6'} - klona@2.0.4: - resolution: {integrity: sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==} - engines: {node: '>= 8'} - koalas@1.0.2: resolution: {integrity: sha512-RYhBbYaTTTHId3l6fnMZc3eGQNW6FVCqMG6AMwA5I1Mafr6AflaXeoi6x3xQuATRotGYRLk6+1ELZH4dstFNOA==} engines: {node: '>=0.10.0'} @@ -13229,17 +13225,17 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass-loader@12.6.0: - resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==} - engines: {node: '>= 12.13.0'} + sass-loader@15.0.0: + resolution: {integrity: sha512-mbXAL7sI/fgt3skXR6xHxtKkaGyxRrGf7zrU4hLLWxBDJEcAe0QsoNy92qKttCb3zfMniTkU2kD9yakUKtW7vQ==} + engines: {node: '>= 18.12.0'} peerDependencies: - fibers: '>= 3.1.0' - node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + '@rspack/core': 0.x || 1.x + node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 sass: ^1.3.0 sass-embedded: '*' webpack: 5.90.0 peerDependenciesMeta: - fibers: + '@rspack/core': optional: true node-sass: optional: true @@ -13247,6 +13243,8 @@ packages: optional: true sass-embedded: optional: true + webpack: + optional: true sass@1.54.0: resolution: {integrity: sha512-C4zp79GCXZfK0yoHZg+GxF818/aclhp9F48XBu/+bm9vXEVAYov9iU3FBVRMq3Hx3OA4jfKL+p2K9180mEh0xQ==} @@ -25875,8 +25873,6 @@ snapshots: kleur@4.1.3: {} - klona@2.0.4: {} - koalas@1.0.2: {} ky-universal@0.6.0(encoding@0.1.13)(ky@0.19.1): @@ -29729,13 +29725,12 @@ snapshots: safer-buffer@2.1.2: {} - sass-loader@12.6.0(sass@1.77.8)(webpack@5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13))): + sass-loader@15.0.0(sass@1.77.8)(webpack@5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13))): dependencies: - klona: 2.0.4 neo-async: 2.6.2 - webpack: 5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13)) optionalDependencies: sass: 1.77.8 + webpack: 5.90.0(@swc/core@1.7.0-nightly-20240714.1(@swc/helpers@0.5.13)) sass@1.54.0: dependencies: diff --git a/test/e2e/app-dir/scss/scss-mixins/app/page.module.scss b/test/e2e/app-dir/scss/scss-mixins/app/page.module.scss index c40830b9590c5..8e32315a410d8 100644 --- a/test/e2e/app-dir/scss/scss-mixins/app/page.module.scss +++ b/test/e2e/app-dir/scss/scss-mixins/app/page.module.scss @@ -1,4 +1,5 @@ @mixin body { + // This test was specifically added to test the calc deprecation message caused by the following line z-index: (100/2); } diff --git a/turbopack/crates/turbopack-node/js/src/compiled/stacktrace-parser/index.d.ts b/turbopack/crates/turbopack-node/js/src/compiled/stacktrace-parser/index.d.ts index 59cb13c617d30..53ac47b729d08 100644 --- a/turbopack/crates/turbopack-node/js/src/compiled/stacktrace-parser/index.d.ts +++ b/turbopack/crates/turbopack-node/js/src/compiled/stacktrace-parser/index.d.ts @@ -1,2 +1,2 @@ export type StackFrame = any; -export const parse: any; +export function parse(stackString: string): StackFrame[]; diff --git a/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts b/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts index e4640aba1dea6..efa20c36d7c55 100644 --- a/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts +++ b/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts @@ -497,7 +497,7 @@ function makeErrorEmitter( ? { name: error.name, message: error.message, - stack: parseStackTrace(error.stack), + stack: error.stack ? parseStackTrace(error.stack) : [], } : { name: "Error", From 05bcd01c29fe564d53b1bdf806e829724742bced Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 16 Sep 2024 16:51:44 +0200 Subject: [PATCH 20/43] Use rs minify to replace the optimize cond and fix typo (#70151) --- crates/napi/src/minify.rs | 4 ++-- .../src/transforms/optimize_server_react.rs | 7 +++---- .../fixture/optimize_server_react/1/output.js | 6 +++--- .../fixture/optimize_server_react/2/output.js | 4 ++-- .../fixture/optimize_server_react/4/output.js | 2 +- .../fixture/optimize_server_react/6/output.js | 2 +- .../fixture/optimize_server_react/7/output.js | 4 ++-- .../minify-webpack-plugin/src/index.ts | 6 +----- .../optimize-server-react.test.ts | 19 +++++++++++++++++++ .../optimize-server-react/pages/index.tsx | 13 +++++++++++++ 10 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 test/production/optimize-server-react/optimize-server-react.test.ts create mode 100644 test/production/optimize-server-react/pages/index.tsx diff --git a/crates/napi/src/minify.rs b/crates/napi/src/minify.rs index 4856c7d6f942f..9fd04e41576d1 100644 --- a/crates/napi/src/minify.rs +++ b/crates/napi/src/minify.rs @@ -111,8 +111,8 @@ fn patch_opts(opts: &mut JsMinifyOptions) { opts.compress = BoolOrDataConfig::from_obj(TerserCompressorOptions { inline: Some(TerserInlineOption::Num(2)), global_defs: [( - "process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE".into(), - "production".into(), + "process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE".into(), + false.into(), )] .iter() .cloned() diff --git a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs index 64590d3631974..7209e6d5ea9f9 100644 --- a/crates/next-custom-transforms/src/transforms/optimize_server_react.rs +++ b/crates/next-custom-transforms/src/transforms/optimize_server_react.rs @@ -62,8 +62,8 @@ fn effect_has_side_effect_deps(call: &CallExpr) -> bool { fn wrap_expr_with_env_prod_condition(call: CallExpr) -> Expr { // Wrap the call expression with the condition - // turn it into `process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE` && . - // And `process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE`` will be treated as `false` in + // turn it into `process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && `. + // And `process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE` will be treated as `false` in // minification. In this way the expression and dependencies are still available in // compilation during bundling, but will be removed in the final DEC. Expr::Bin(BinExpr { @@ -75,7 +75,6 @@ fn wrap_expr_with_env_prod_condition(call: CallExpr) -> Expr { span: DUMMY_SP, ..Default::default() }))), - prop: MemberProp::Ident(IdentName { sym: "env".into(), span: DUMMY_SP, @@ -83,7 +82,7 @@ fn wrap_expr_with_env_prod_condition(call: CallExpr) -> Expr { span: DUMMY_SP, }))), prop: (MemberProp::Ident(IdentName { - sym: "__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE".into(), + sym: "__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE".into(), span: DUMMY_SP, })), span: DUMMY_SP, diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js index 9e46707814434..11df359cceb27 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/1/output.js @@ -1,10 +1,10 @@ import { useEffect, useLayoutEffect, useMemo } from 'react'; import React from 'react'; export default function App() { - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ console.log('Hello World'); }, []); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useLayoutEffect(()=>{ function foo() {} return ()=>{}; }, [ @@ -24,7 +24,7 @@ export default function App() { const a = useMemo(()=>{ return 1; }, []); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && React.useEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && React.useEffect(()=>{ console.log('Hello World'); }); return
diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js index a45bed4f4b8e5..3593e7f866d69 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/2/output.js @@ -16,7 +16,7 @@ export default function FilterItemDropdown({ list }) { ()=>null ]; const ref = useRef(null); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ const handleClickOutside = (event)=>{ if (ref.current && !ref.current.contains(event.target)) { setOpenSelect(false); @@ -25,7 +25,7 @@ export default function FilterItemDropdown({ list }) { window.addEventListener('click', handleClickOutside); return ()=>window.removeEventListener('click', handleClickOutside); }, []); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ list.forEach((listItem)=>{ if ('path' in listItem && pathname === listItem.path || 'slug' in listItem && searchParams.get('sort') === listItem.slug) { setActive(listItem.title); diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js index 835aae43cfbab..a46a22bda4cbd 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/4/output.js @@ -5,7 +5,7 @@ export default function App() { useEffect(()=>{ console.log('Hello World'); }, []); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useLayoutEffect(()=>{ function foo() {} return ()=>{}; }, [ diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js index 0d05a9dd34bd0..24149bef2a20f 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/6/output.js @@ -5,7 +5,7 @@ const Component = ({ children, fallback })=>{ false, ()=>null ]; - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>setMounted(true), []); + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>setMounted(true), []); if (!mounted) { return fallback ?? /* @__PURE__ */ jsx(Fragment, {}); } diff --git a/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js b/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js index 372b80ad7fbdd..161635a819760 100644 --- a/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js +++ b/crates/next-custom-transforms/tests/fixture/optimize_server_react/7/output.js @@ -1,10 +1,10 @@ import { useEffect, useLayoutEffect, useMemo } from 'react'; import * as React from 'react'; export default function App() { - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ console.log('Hello World'); }, []); - process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE && useLayoutEffect(()=>{ + process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useLayoutEffect(()=>{ function foo() {} return ()=>{}; }, [ diff --git a/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts b/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts index 8c731879a323b..0973145ba271b 100644 --- a/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts +++ b/packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts @@ -109,11 +109,7 @@ export class MinifyPlugin { }, } : {}), - compress: { - global_defs: { - 'process.env.__NEXT_PRIVATE_MINIMIZE_MARCO_FALSE': false, - }, - }, + compress: true, mangle: true, module: 'unknown', output: { diff --git a/test/production/optimize-server-react/optimize-server-react.test.ts b/test/production/optimize-server-react/optimize-server-react.test.ts new file mode 100644 index 0000000000000..f59792e0889a6 --- /dev/null +++ b/test/production/optimize-server-react/optimize-server-react.test.ts @@ -0,0 +1,19 @@ +import { nextTestSetup } from 'e2e-utils' +;(process.env.TURBOPACK ? describe.skip : describe)( + 'optimize-server-react', + () => { + const { next } = nextTestSetup({ + files: __dirname, + }) + + it('should work with useEffect', async () => { + const browser = await next.browser('/') + expect(await browser.elementByCss('p').text()).toBe('hello world') + }) + + it('should optimize useEffect call on server side', async () => { + const file = await next.readFile('.next/server/pages/index.js') + expect(file).not.toContain('useEffect') + }) + } +) diff --git a/test/production/optimize-server-react/pages/index.tsx b/test/production/optimize-server-react/pages/index.tsx new file mode 100644 index 0000000000000..8eccd43edf4ed --- /dev/null +++ b/test/production/optimize-server-react/pages/index.tsx @@ -0,0 +1,13 @@ +import { useEffect } from 'react' + +export default function Page() { + useEffect(() => { + console.log('use-effect-call-log') + }, []) + return

hello world

+} + +// Mark as dynamic +export function getServerSideProps() { + return { props: {} } +} From ca488d889534ceae8a32d3882e109859757e900a Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Mon, 16 Sep 2024 19:58:37 +0200 Subject: [PATCH 21/43] Only build Linux in automated preview builds (#70157) This is the only build we use in automated deploy tests and when doing ad-hoc syncs. The full matrix is still available by just re-running the workflow or manually starting one. Apple resources are scarce and scaling them up is not trivial at the moment. --- .github/workflows/build_and_deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index f2fdd16af2bd2..9b4954bd78e77 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -106,16 +106,20 @@ jobs: fail-fast: false matrix: exclude: - # only build the binaries we usually test with - # darwin arm64, windows x64, linux GNU x64 + # only build the binaries we run automated tests against + # linux GNU x64 - settings: target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'i686-pc-windows-msvc' }} + - settings: + target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-apple-darwin' }} - settings: target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-pc-windows-msvc' }} - settings: target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-unknown-linux-gnu' }} - settings: target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'aarch64-unknown-linux-musl' }} + - settings: + target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'x86_64-pc-windows-msvc' }} - settings: target: ${{ needs.deploy-target.outputs.value == 'automated-preview' && 'x86_64-unknown-linux-musl' }} - settings: From 6a69c358ecfc6f293676b2110a88fe3004166ea8 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 16 Sep 2024 11:12:10 -0700 Subject: [PATCH 22/43] Fix eslint root dirs test on Windows (#70160) The root dirs tests have been failing on Windows since https://github.com/vercel/next.js/pull/68773 so this fixes to ensure we normalize the slashes passed to `fast-glob` so it looks up as expected. x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=98629&view=logs&j=8af7cf9c-43a1-584d-6f5c-57bad8880974&t=7ae70e63-3625-50f4-6764-5b3e72b4bd7a --- packages/eslint-plugin-next/src/utils/get-root-dirs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin-next/src/utils/get-root-dirs.ts b/packages/eslint-plugin-next/src/utils/get-root-dirs.ts index 186684b4b1b27..941687bd803df 100644 --- a/packages/eslint-plugin-next/src/utils/get-root-dirs.ts +++ b/packages/eslint-plugin-next/src/utils/get-root-dirs.ts @@ -5,7 +5,7 @@ import type { Rule } from 'eslint' * Process a Next.js root directory glob. */ const processRootDir = (rootDir: string): string[] => { - return globSync(rootDir, { + return globSync(rootDir.replace(/\\/g, '/'), { onlyDirectories: true, }) } From b1fad8009ab33ee92fffc59261dcf02dfbab4003 Mon Sep 17 00:00:00 2001 From: Md Rejoyan Islam Date: Tue, 17 Sep 2024 00:58:33 +0600 Subject: [PATCH 23/43] Remove non-null assertion operator for compatibility with JavaScript (#70104) Remove TypeScript-specific non-null assertion operator (`!`) from URL parsing The non-null assertion operator (`!`) is used in TypeScript to assert that a value is not `null` or `undefined`. In plain JavaScript, this operator is not valid and can cause issues. Replaced `req.url!` with a safer approach for handling potential `null` or `undefined` values to ensure compatibility with JavaScript environments. Co-authored-by: JJ Kasper --- .../07-configuring/10-custom-server.mdx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/02-app/01-building-your-application/07-configuring/10-custom-server.mdx b/docs/02-app/01-building-your-application/07-configuring/10-custom-server.mdx index 5c90c8e22629b..fee7dfe676b70 100644 --- a/docs/02-app/01-building-your-application/07-configuring/10-custom-server.mdx +++ b/docs/02-app/01-building-your-application/07-configuring/10-custom-server.mdx @@ -40,27 +40,27 @@ app.prepare().then(() => { ``` ```js filename="server.js" switcher -import { createServer } from "http"; -import { parse } from "url"; -import next from "next"; +import { createServer } from 'http' +import { parse } from 'url' +import next from 'next' -const port = parseInt(process.env.PORT || "3000", 10); -const dev = process.env.NODE_ENV !== "production"; -const app = next({ dev }); -const handle = app.getRequestHandler(); +const port = parseInt(process.env.PORT || '3000', 10) +const dev = process.env.NODE_ENV !== 'production' +const app = next({ dev }) +const handle = app.getRequestHandler() app.prepare().then(() => { createServer((req, res) => { - const parsedUrl = parse(req.url!, true); - handle(req, res, parsedUrl); - }).listen(port); + const parsedUrl = parse(req.url, true) + handle(req, res, parsedUrl) + }).listen(port) console.log( `> Server listening at http://localhost:${port} as ${ - dev ? "development" : process.env.NODE_ENV - }`, - ); -}); + dev ? 'development' : process.env.NODE_ENV + }` + ) +}) ``` > `server.js` does not run through the Next.js Compiler or bundling process. Make sure the syntax and source code this file requires are compatible with the current Node.js version you are using. [View an example](https://github.com/vercel/next.js/tree/canary/examples/custom-server). From a6e1dcbeebad43022378bad3f6140513b9d7cfb3 Mon Sep 17 00:00:00 2001 From: Kartheesan Date: Tue, 17 Sep 2024 00:34:20 +0530 Subject: [PATCH 24/43] Fix useFormStatus import in authentication doc (#70138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated docs, authentication section: useFormStatus and useFormState should be imported from 'react-dom' instead of 'react', or else the compiler gives the following error: ⨯ src/components/LoginForm.jsx (19:40) @ login ⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_6__.useFormState) is not a function or its return value is not iterable at LoginForm (./src/components/LoginForm.jsx:23:80) at stringify () at stringify () digest: "258431019" 17 | 18 | export function LoginForm() { 19 | const [state, action] = useFormState(login, undefined); Co-authored-by: JJ Kasper --- .../01-building-your-application/09-authentication/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/09-authentication/index.mdx b/docs/02-app/01-building-your-application/09-authentication/index.mdx index 5f0ab3f847483..a8afdb17df4e1 100644 --- a/docs/02-app/01-building-your-application/09-authentication/index.mdx +++ b/docs/02-app/01-building-your-application/09-authentication/index.mdx @@ -205,7 +205,7 @@ Back in your ``, you can use React's `useFormState` hook to displa ```tsx filename="app/ui/signup-form.tsx" switcher highlight={7,15,21,27-39} 'use client' -import { useFormState, useFormStatus } from 'react' +import { useFormState, useFormStatus } from 'react-dom' import { signup } from '@/app/actions/auth' export function SignupForm() { @@ -258,7 +258,7 @@ function SubmitButton() { ```jsx filename="app/ui/signup-form.js" switcher highlight={7,15,21,27-39} 'use client' -import { useFormState, useFormStatus } from 'react' +import { useFormState, useFormStatus } from 'react-dom' import { signup } from '@/app/actions/auth' export function SignupForm() { From 9e15451e990cfeb7ebae2c45f1e7616f36125953 Mon Sep 17 00:00:00 2001 From: Natt Nguyen Date: Mon, 16 Sep 2024 12:05:58 -0700 Subject: [PATCH 25/43] docs: fix button server action example (#70131) When following the example for server actions for button onClick, developers will see the error below. ``` Error: Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported. ``` That is because the server action function is taking in the button onClick `event` in the action. Co-authored-by: JJ Kasper --- .../02-data-fetching/03-server-actions-and-mutations.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx index 08fe962496ee4..4c6b797f3407a 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx @@ -66,7 +66,7 @@ export async function create() {} import { create } from '@/app/actions' export function Button() { - return + return } ``` @@ -76,7 +76,7 @@ export function Button() { import { create } from '@/app/actions' export function Button() { - return + return } ``` From 25c114e50758190b46eefa60d2685d1eab0d25fb Mon Sep 17 00:00:00 2001 From: sekai <15361554+s-ekai@users.noreply.github.com> Date: Tue, 17 Sep 2024 04:08:35 +0900 Subject: [PATCH 26/43] fix: button className in with_supabase example (#70121) fix: https://github.com/vercel/next.js/issues/69525 ## What I fixed an issue in the with-supabase example where duplicate className in deploy-button.tsx was causing a Tailwind CSS error. Co-authored-by: JJ Kasper --- examples/with-supabase/components/deploy-button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-supabase/components/deploy-button.tsx b/examples/with-supabase/components/deploy-button.tsx index 249a5a6a79ee8..8a5a192093d3f 100644 --- a/examples/with-supabase/components/deploy-button.tsx +++ b/examples/with-supabase/components/deploy-button.tsx @@ -10,7 +10,7 @@ export default function DeployButton() { > From 18faa9f1148b7ad97416f6fd38f883fb35152828 Mon Sep 17 00:00:00 2001 From: Brekk Date: Mon, 16 Sep 2024 09:35:21 -1000 Subject: [PATCH 33/43] Update examples/github-pages/README.md (#70057) Hi there, I was trying to understand how to use [examples/github-pages](https://github.com/vercel/next.js/tree/canary/examples/github-pages) and when I followed the instructions my page was rendering without stylesheets. I found the extant README content to be clear, but after I found https://github.com/vercel/next.js/discussions/38777 I was able to understand what the current content meant, so I thought it would be helpful to add this to the original example. Open to edits on content or clarity. Thanks! --------- Co-authored-by: JJ Kasper --- examples/github-pages/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/github-pages/README.md b/examples/github-pages/README.md index 4fab024138b5a..ac413d4ef46fa 100644 --- a/examples/github-pages/README.md +++ b/examples/github-pages/README.md @@ -19,7 +19,8 @@ pnpm create next-app --example github-pages nextjs-github-pages ### Deploy to GitHub Pages 1. Create a new public GitHub repository. -1. Edit `next.config.js` to match your GitHub repository name. +1. Edit `next.config.js` to match your GitHub repository name: + - Given the pattern `https://github.com//`, update your `basePath` config to `/repo`. 1. Push the starter code to the `main` branch. 1. Run the `deploy` script (e.g. `npm run deploy`) to create the `gh-pages` branch. 1. On GitHub, go to **Settings** > **Pages** > **Branch**, and choose `gh-pages` as the branch with the `/root` folder. Hit **Save**. From e005cb54c841308da94a8c1b4e654f3fc5dbadfe Mon Sep 17 00:00:00 2001 From: Joshua Francis <61574468+Francoscopic@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:40:25 +0100 Subject: [PATCH 34/43] Update authentication example accessing state.errors (#70028) 1. `useFormState` can't be found in the current react version, for some reason. Picking it from `react-dom` works just fine. 2. Reading `state.errors.name` from the `state` object before it becomes defined returns a **TypeError**. Checking if it's defined first before calling its children works just fine. --------- Co-authored-by: JJ Kasper --- .../09-authentication/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/02-app/01-building-your-application/09-authentication/index.mdx b/docs/02-app/01-building-your-application/09-authentication/index.mdx index a8afdb17df4e1..13b2c1765b16e 100644 --- a/docs/02-app/01-building-your-application/09-authentication/index.mdx +++ b/docs/02-app/01-building-your-application/09-authentication/index.mdx @@ -270,19 +270,19 @@ export function SignupForm() {
- {state.errors.name &&

{state.errors.name}

} + {state?.errors?.name &&

{state.errors.name}

}
- {state.errors.email &&

{state.errors.email}

} + {state?.errors?.name &&

{state.errors.email}

}
- {state.errors.password && ( + {state.errors?.password && (

Password must:

    From 3842680adb00b7737913cf66efea424367f7ad33 Mon Sep 17 00:00:00 2001 From: B33fb0n3 <65173484+B33fb0n3@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:47:22 +0200 Subject: [PATCH 35/43] Update 01-fetching.mdx - use available endpoint (#69559) ### Improving Documentation Changed example endpoint to available endpoint Co-authored-by: JJ Kasper --- .../02-data-fetching/01-fetching.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx index 99a1dfca41614..cd2e5c1fac785 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx @@ -275,14 +275,14 @@ interface Post { } async function getPost(id: string) { - let res = await fetch(`https://api.example.com/posts/${id}`) + let res = await fetch(`https://api.vercel.app/blog/${id}`) let post: Post = await res.json() if (!post) notFound() return post } export async function generateStaticParams() { - let posts = await fetch('https://api.example.com/posts').then((res) => + let posts = await fetch('https://api.vercel.app/blog').then((res) => res.json() ) @@ -315,14 +315,14 @@ export default async function Page({ params }: { params: { id: string } }) { import { notFound } from 'next/navigation' async function getPost(id) { - let res = await fetch(`https://api.example.com/posts/${id}`) + let res = await fetch(`https://api.vercel.app/blog/${id}`) let post = await res.json() if (!post) notFound() return post } export async function generateStaticParams() { - let posts = await fetch('https://api.example.com/posts').then((res) => + let posts = await fetch('https://api.vercel.app/blog').then((res) => res.json() ) From 02f886a082f6cc8c550a7bee090dd0302fbb88bd Mon Sep 17 00:00:00 2001 From: Dinesh Rawat Date: Tue, 17 Sep 2024 01:17:44 +0530 Subject: [PATCH 36/43] fix: rsc content-type header not matching with charset (#70033) `charset` can be included in the `content-type` header which currently causes `RSC` detection to fail when it shouldn't so this relaxes the check to just ensure the RSC `content-type` includes the expected type not an exact match. --------- Co-authored-by: JJ Kasper --- .../components/router-reducer/fetch-server-response.ts | 2 +- .../router-reducer/reducers/server-action-reducer.ts | 2 +- packages/next/src/server/app-render/action-handler.ts | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/next/src/client/components/router-reducer/fetch-server-response.ts b/packages/next/src/client/components/router-reducer/fetch-server-response.ts index 3e0034ff935fc..d98698a16da19 100644 --- a/packages/next/src/client/components/router-reducer/fetch-server-response.ts +++ b/packages/next/src/client/components/router-reducer/fetch-server-response.ts @@ -178,7 +178,7 @@ export async function fetchServerResponse( const interception = !!res.headers.get('vary')?.includes(NEXT_URL) const isPrerender = !!res.headers.get(NEXT_IS_PRERENDER_HEADER) const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER) - let isFlightResponse = contentType === RSC_CONTENT_TYPE_HEADER + let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER) if (process.env.NODE_ENV === 'production') { if (process.env.__NEXT_CONFIG_OUTPUT === 'export') { diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index 9b49a5f6ee51f..a65adaf756efc 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -113,7 +113,7 @@ async function fetchServerAction( const contentType = res.headers.get('content-type') - if (contentType === RSC_CONTENT_TYPE_HEADER) { + if (contentType?.startsWith(RSC_CONTENT_TYPE_HEADER)) { const response: ActionFlightResponse = await createFromFetch( Promise.resolve(res), { diff --git a/packages/next/src/server/app-render/action-handler.ts b/packages/next/src/server/app-render/action-handler.ts index ee2b44021976d..6c1bffa84dd56 100644 --- a/packages/next/src/server/app-render/action-handler.ts +++ b/packages/next/src/server/app-render/action-handler.ts @@ -218,7 +218,9 @@ async function createForwardedActionResponse( }, }) - if (response.headers.get('content-type') === RSC_CONTENT_TYPE_HEADER) { + if ( + response.headers.get('content-type')?.startsWith(RSC_CONTENT_TYPE_HEADER) + ) { // copy the headers from the redirect response to the response we're sending for (const [key, value] of response.headers) { if (!actionsForbiddenHeaders.includes(key)) { @@ -340,7 +342,11 @@ async function createRedirectRenderResult( }, }) - if (response.headers.get('content-type') === RSC_CONTENT_TYPE_HEADER) { + if ( + response.headers + .get('content-type') + ?.startsWith(RSC_CONTENT_TYPE_HEADER) + ) { // copy the headers from the redirect response to the response we're sending for (const [key, value] of response.headers) { if (!actionsForbiddenHeaders.includes(key)) { From e5a123e2545aaa8e5d80395e80271ecad0a9f7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nurullah=20Sevin=C3=A7tekin?= Date: Mon, 16 Sep 2024 22:53:32 +0300 Subject: [PATCH 37/43] Docs: fixed useFormStatus import error in the example. (#69565) I got the error below when I tried to use the [Pending States example](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#pending-states) in the documentation. After I changed the import source to react-dom, the problem was fixed. ![useFormStatus-example-warning](https://github.com/user-attachments/assets/a7ae113a-d7b4-4118-9ab7-cbd43dfd8cb1) Co-authored-by: JJ Kasper --- .../02-data-fetching/03-server-actions-and-mutations.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx index 4c6b797f3407a..1c0abc01d116f 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx @@ -450,7 +450,7 @@ The [`useFormStatus`](https://react.dev/reference/react-dom/hooks/useFormStatus) ```tsx filename="app/submit-button.tsx" highlight={6} switcher 'use client' -import { useFormStatus } from 'react' +import { useFormStatus } from 'react-dom' export function SubmitButton() { const { pending } = useFormStatus() @@ -466,7 +466,7 @@ export function SubmitButton() { ```jsx filename="app/submit-button.js" highlight={6} switcher 'use client' -import { useFormStatus } from 'react' +import { useFormStatus } from 'react-dom' export function SubmitButton() { const { pending } = useFormStatus() From 2bdc984ecb68e3b19c223a0621ea47fc35b27688 Mon Sep 17 00:00:00 2001 From: Hristiyan Dodov Date: Mon, 16 Sep 2024 22:55:29 +0300 Subject: [PATCH 38/43] Update middleware supported runtimes docs (#69510) Fixes the confusion from #69503. Co-authored-by: JJ Kasper --- .../01-building-your-application/01-routing/14-middleware.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-app/01-building-your-application/01-routing/14-middleware.mdx b/docs/02-app/01-building-your-application/01-routing/14-middleware.mdx index ddb35521794e5..4749d7a87b0cc 100644 --- a/docs/02-app/01-building-your-application/01-routing/14-middleware.mdx +++ b/docs/02-app/01-building-your-application/01-routing/14-middleware.mdx @@ -573,7 +573,7 @@ export default async function middleware(req) { ## Runtime -Middleware currently only supports the [Edge runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes). The Node.js runtime can not be used. +Middleware currently only supports APIs compatible with the [Edge runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes). APIs exclusive to Node.js are [unsupported](/docs/app/api-reference/edge#unsupported-apis). ## Version History From 8b03244e4c93e09d1cc83b8b03ac8bf16f63c64e Mon Sep 17 00:00:00 2001 From: ebCrypto <44279886+ebCrypto@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:07:45 -0700 Subject: [PATCH 39/43] remove unsafe-inline from with-strict-csp (#69497) ### What? Remove unsafe-inline from with-strict-csp example in the script-src ### Why? The main purpose of having strict CSP headers is to improve the web app security posture. On securityheaders.com the grade is capped to A if script-src contains 'unsafe-inline'. In order to reach A+. it needs to be removed. ### How? Edit the script-src in the with-strict-csp-app example Co-authored-by: JJ Kasper --- examples/with-strict-csp/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-strict-csp/middleware.js b/examples/with-strict-csp/middleware.js index 5c2d444fddce0..88fc0266788c6 100644 --- a/examples/with-strict-csp/middleware.js +++ b/examples/with-strict-csp/middleware.js @@ -4,7 +4,7 @@ export function middleware(request) { const nonce = Buffer.from(crypto.randomUUID()).toString("base64"); const cspHeader = ` default-src 'self'; - script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: 'unsafe-inline' ${ + script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: ${ process.env.NODE_ENV === "production" ? "" : `'unsafe-eval'` }; style-src 'self' 'nonce-${nonce}'; From 9bf014809419d3c725bea7a3f4fd9c620480a5ee Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Mon, 16 Sep 2024 21:10:48 +0100 Subject: [PATCH 40/43] chore/ examples use-supabase | update rate limit note (#69423) - update rate limit note Co-authored-by: JJ Kasper --- examples/with-supabase/app/(auth-pages)/smtp-message.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/with-supabase/app/(auth-pages)/smtp-message.tsx b/examples/with-supabase/app/(auth-pages)/smtp-message.tsx index d0e2324e37e2b..84c21fce29ba5 100644 --- a/examples/with-supabase/app/(auth-pages)/smtp-message.tsx +++ b/examples/with-supabase/app/(auth-pages)/smtp-message.tsx @@ -7,8 +7,8 @@ export function SmtpMessage() {
    - Note: Emails are limited to 4 per hour. Enable a - custom SMTP endpoint to increase the rate limit. + Note: Emails are rate limited. Enable Custom SMTP to + increase the rate limit.
    Date: Mon, 16 Sep 2024 21:13:03 +0100 Subject: [PATCH 41/43] examples(with-supabase): typo on env file name (#69291) ### What? Minor typo on the env file name Co-authored-by: JJ Kasper --- examples/with-supabase/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-supabase/README.md b/examples/with-supabase/README.md index cad5094929bad..53c555a6ed94e 100644 --- a/examples/with-supabase/README.md +++ b/examples/with-supabase/README.md @@ -64,7 +64,7 @@ If you wish to just develop locally and not deploy to Vercel, [follow the steps cd name-of-new-app ``` -4. Rename `.env.local.example` to `.env.local` and update the following: +4. Rename `.env.example` to `.env.local` and update the following: ``` NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL] From cc6d8181311540f2142072852c550efea4ea924a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Go=C3=9Fe?= Date: Mon, 16 Sep 2024 22:18:48 +0200 Subject: [PATCH 42/43] fix(examples/with-docker): remove not needed files from docker context (#68668) Co-authored-by: JJ Kasper --- examples/with-docker/.dockerignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/with-docker/.dockerignore b/examples/with-docker/.dockerignore index 3e578def39e44..c5500558baf2e 100644 --- a/examples/with-docker/.dockerignore +++ b/examples/with-docker/.dockerignore @@ -4,6 +4,4 @@ node_modules npm-debug.log README.md .next -!.next/static -!.next/standalone .git From aa66ee4df13f467d0fd3831d1342fd11d835f7af Mon Sep 17 00:00:00 2001 From: Joe_Z <43297139+Tim-Zj@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:26:51 -0400 Subject: [PATCH 43/43] fixes #68228 Clarify width and height properties in Image component docs (#68248) ### Clarify width and height properties in Image component docs This PR updates the documentation for the `width` and `height` properties of the Image component to clarify that these attributes represent the intrinsic dimensions of the image and do not determine the rendered size, which is controlled by CSS. This clarification aligns the documentation with the behavior of the HTML `` tag. Fixes issue #68228. Closes https://github.com/vercel/next.js/issues/68228 --------- Co-authored-by: JJ Kasper Co-authored-by: Willem-Jaap <67187467+Willem-Jaap@users.noreply.github.com> --- docs/02-app/02-api-reference/01-components/image.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/02-api-reference/01-components/image.mdx b/docs/02-app/02-api-reference/01-components/image.mdx index 195a199189d11..ca60b53ef18b2 100644 --- a/docs/02-app/02-api-reference/01-components/image.mdx +++ b/docs/02-app/02-api-reference/01-components/image.mdx @@ -93,13 +93,13 @@ When using an external URL, you must add it to [remotePatterns](#remotepatterns) ### `width` -The `width` property represents the _intrinsic_ image width in pixels. +The `width` property represents the _intrinsic_ image width in pixels. This property is used to infer the correct aspect ratio of the image and avoid layout shift during loading. It does not determine the rendered size of the image, which is controlled by CSS, similar to the `width` attribute in the HTML `` tag. Required, except for [statically imported images](/docs/app/building-your-application/optimizing/images#local-images) or images with the [`fill` property](#fill). ### `height` -The `height` property represents the _intrinsic_ image height in pixels. +The `height` property represents the _intrinsic_ image height in pixels. This property is used to infer the correct aspect ratio of the image and avoid layout shift during loading. It does not determine the rendered size of the image, which is controlled by CSS, similar to the `height` attribute in the HTML `` tag. Required, except for [statically imported images](/docs/app/building-your-application/optimizing/images#local-images) or images with the [`fill` property](#fill).