forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] canary from vercel:canary #567
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## What? These tests checked for an invalid module that webpack somehow resolves but is actually invalid. Made sure it's in a valid folder. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
## What? Updates the snapshot so that the Turbopack version can be slightly different. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
## What? Fixes `should have <head> containing <meta name=\"viewport\"> followed by <link rel=\"preload\"> for priority image` and `should add a blur placeholder a statically imported x` (where x is a file format) in Turbopack. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2216
Fixes flaky test of version checker display when local version is greater than latest canary, but not published yet Closes NEXT-2216
- Share new **Redirecting** docs with /pages - Add equivalent example for API routes in /pages
### What Fixes the string id that broken when sitemap is optimized to static route. ### Why When sitemap is optimized to static route in production, the route argument is changed from `[[...__metadata_id__]]` to `[__metadata_id__]`, so the type of it is also changed from array to string that should reflect in the loader code. Fixes #60894 Closes NEXT-2154
## What? Ensures this test can pass with Turbopack, which only mismatches on hash. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2217
…#61059) ### What? Interception routes on dynamic paths don't currently work when PPR is turned on, and instead trigger an MPA navigation to the full route. ### Why? Route interception relies on the `Next-Flight-Router-State` header to extract the dynamic params necessary to convert something like `[locale]`, which would correspond with a URL of `/en`, to something like `["locale", "en", "d"]`. (See [this function](https://github.com/vercel/next.js/blob/fbfd7b5f81397fc6500e3c3a25bfd6627e9abb8f/packages/next/src/server/app-render/app-render.tsx#L129-L137) for more info). When PPR is turned on, we currently ignore this request header and don't provide it to the functions that render the component tree. Without the flight router state, this function bails out and instead will leave the segment key as `[locale]`. When the client router goes to diff the current tree on the client with the response from the server, it will detect a mismatch between the current segment and the incoming segment, and trigger an MPA navigation in [this block](https://github.com/vercel/next.js/blob/fbfd7b5f81397fc6500e3c3a25bfd6627e9abb8f/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts#L414-L416). ### How? This special-cases interception routes to not strip this header. Closes NEXT-2215
This PR improves the Server Actions SWC transform to make it able to handle nested Action declarations (check `fixture/server-actions/server/28/input.js` for more details). It is also a simplification of that transform's internal states and methods, with the removal of an extra AST pass (`stmts.visit_mut_with(&mut ClosureActionReplacer { replaced_action_proxies: &self.replaced_action_proxies, })`). The generated code is also smaller in some cases. So overall I'd expect the compilation and runtime performance to improve as well. ## Details With this change, we're now using `self.declared_idents` and `self.names` to track closure arguments. `declared_idents` keeps the identifiers **declared** in the current closure and above. `names` keeps identifiers **appeared** in the current closure and above. In an example of the following cursor: ```ts let x async function foo() { "use server" let y async function bar() { "use server" let z console.log(x, y, z) } // <- cursor } ``` `declared_idents` would be `y` (`x` isn't in a closure), and `names` would be `x, y, z`. By manipulating these two states we're able to track closure closed-up variables recursively. Closes NEXT-2189
### What When users're using nextjs server API that break the build, and error with incorrect client components usage. Instrument should be treated as server components or server-only build target, instead of being treated as client components. ### How We added a new layer `instrument` for instrument hook bundling, and apply it with the rsc server webpack loaders Fixes #57563 Closes NEXT-2181 Closes NEXT-1994
### Turbopack Updates * vercel/turborepo#7091 <!-- Tobias Koppers - lock reqwest to 0.11.17 due to build issues --> * vercel/turborepo#7080 <!-- Tobias Koppers - reduce work and tasks during module analysis --> * vercel/turborepo#7093 <!-- Leah - fix: don't escape base path in ecmascript runtime to allow for URLs --> Closes PACK-2282 Fixes #60891 via vercel/turborepo#7093
## Changes - Update description for issue-popular workflow to 90 days Closes NEXT-2192
## What? Ensures this test passes with Turbopack. Only the file hash mismatches. Similar to #61096. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2218
While traces are never uploaded without an explicit opt-in, this option prevents them from being sent even when one is provided. Closes PACK-2289
This PR adds the `optimizeServerReact` experimental flag to the shared config and defaults it to `false`. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2219
…1-vitest.mdx' (#61087) Hello, This PR resolves a file extension inconsistency in the 'Setting up Vitest with Next.js' section of the Next.js documentation (`01-vitest.mdx`). When using next.js with JavaScript, following the documentation(`01-vitest.mdx`) leads to issues during testing because of the jsx extension. This PR corrects an example code that wrongly uses a '.js' extension for a React component, which is against Vitest's requirement for '.jsx' extensions. - vitest-dev/vitest#1564 Thank you. Co-authored-by: Sam Ko <[email protected]>
### What Closes PACK-2284 This PR upgrades `upload/download-artifact` action to the latest version. Per its claim, it can be faster 90% compare to the current in worst case use case. Below's comparision between this PR vs. current branch for the datadog report ![image](https://github.com/vercel/next.js/assets/1210596/f3db6f4d-e137-4013-9745-b8fa55ba1014) ![image](https://github.com/vercel/next.js/assets/1210596/08734620-8530-4b6e-bd09-a5414c703c06) Cuts download time meaningfully different. Since we use upload/download in other places as well (i.e download next-swc binary) overall CI time would be improved. The challenage is artifact@v4 introduced breaking changes to not to allow implicitly merge upload / download with duplicated name. PR introduced unique key for those, then apply download with pattern & merge.
## What? Noticed this test suite accidentally does not have a root layout, which is required for App Router. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2226
## What? `exportPathMap` didn't work when Turbopack was enabled because the `serializeNextConfig` function mutates the original values, overriding `exportPathMap`. This PR changes the serialization to copy the object and mutate only the copied object. Also refactored the test that was checking `_next`, the better way to test that is to have the page render something dynamically, which is what is added in this PR. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2225
## What? The first version of Turbopack won't support the `composes` keyword. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2228
## What? This test consistently passes locally. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2227
### What? * decode magic identifiers when printing compile errors to the console * Error Overlay * decode magic identifiers in the error message * decode magic identifiers in source frame * decode magic identifiers in call stack ![image](https://github.com/vercel/next.js/assets/1365881/836ba497-84dd-4958-8341-4207fc6d860f) ![image](https://github.com/vercel/next.js/assets/1365881/f03d5c9e-0b2f-4699-b7c3-56c38b0eba51) ![image](https://github.com/vercel/next.js/assets/1365881/49a65991-92d8-47b4-863c-961536d98d13) ### Why? ### How? PACK-2008 Closes PACK-2387
### What #### Core This PR respect the error's digest when recieves new error occurred from server side, and it will be logged into client on production with the same `digest` property. If we discover the original RSC error in SSR error handler, retrieve the original error #### Tests * Move the errors related tests from `test/e2e/app-dir/app` to a separate test suite `test/e2e/app-dir/errors` * Add a new test case for logging the original RSC error * Add a new test case for logging the original Server Action error ### Why This will help associate the `digest` property of the errors logged from client with the actual generated server errors. Previously they're different as we might re-compute the digest proper in handler that react server renderer thinks it's a new error, which causes we have 2 different errors logged on server side, and 1 logged on client side. The one on client side can associate to the server errors but it's from react renderer which is not the original error. Closes NEXT-2094 Fixes #60684
### Turbopack Updates * vercel/turborepo#7240 <!-- OJ Kwon - refactor(turbopack): remove deprecated options --> * vercel/turborepo#7241 <!-- Will Binns-Smith - Turbopack: Fix Next.js in cross-bundler benchmarks --> * vercel/turborepo#7274 <!-- Leah - fix(turbopack): support reloading typescript tailwind config --> Fixes #61607
This auto-generated PR updates the integration test manifest used when testing Turbopack.
### What Client-side transitioning to a page that triggered a loading boundary with async metadata would cause the transition to stall, potentially getting stuck in a refetch loop. ### Why In layout-router, we trigger a "lazy fetch" when we encounter a segment that we don't have cache nodes for. This calls out to the server and suspends until the data fetch is resolved, and applied to the router tree. However after suspending but before updating the client router, we set `childNode.lazyData` to null. When we unsuspend from the server patch action, `childNode.rsc` might still be missing and clearing `lazyData` means we've blown away the reference to the fetch we already had pending, triggering a refetch loop. ### How This removes the logic that mutates the cache node in render, as this is not concurrent safe, and doesn't appear to be needed for anything. Fixes #61117 Closes NEXT-2361 --------- Co-authored-by: Jiachi Liu <[email protected]>
…61419) ### What? Let the developer check the instance of `ReadonlyURLSearchParams` to match against `URLSearchParams` ### Why? `useSearchParams()`'s return type is `ReadonlyURLSearchParams` which implements all the methods of `URLSearchParams`, therefore its type should be extended from `URLSearchParams` as well. Deprecated methods are also implemented to throw an error, so no runtime behavior is being changed ### How? Mark the unavailable methods as `@deprecated` which will visually mark them in IDEs: ![image](https://github.com/vercel/next.js/assets/18369201/f3de2858-14ac-4021-981d-b0267610faa7) This is similar how `ReadonlyHeaders` extends `Headers`, added in: #49075 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706628877916779) Closes NEXT-2305
### What When navigating to a page with dynamic params using a certain casing, and then following a link to another page using _different_ casing for the same param, the router would get stuck in an infinite suspense cycle. ### Why On the client we normalize cache keys by lowercasing the values for dynamic segments. However the RSC data for each segment wouldn't have this same casing logic applied. This is causing the router to not recognize that there is already RSC data available for that segment, resulting in an infinite suspense cycle. ### How The `toLowerCase()` logic shouldn't be needed here. Technically we could leave this in place and update `matchSegment` to also apply the lowercase logic, but currently there are too many utility functions that parse segments to comfortably make that change. I confirmed that the bug related to why we lowercased these router cache keys is no longer present after making this change. Fixes #61722 Closes NEXT-2377
### What & Why We have a modularize imports config for `next/server` before, which will transform the `next/server` imports to directly import from the actual file, for instance: `import { NextRequest } from 'next/server'` will become `import { NextRequest } from 'next/dist/server/web/exports/next-request'`, where the NextRequest is exported as default export. This is fine in most case until you're using a ESM pkg, then it will be resolved as `{ default: NextRequest }` according to the spec. Since it's a ESM import to a CJS module in `next/dist`. Since we already have the ESM alias introduced in #59852 , this can handle the case more properly. ### How Remove the modularize imports config for `next/server`, use the ESM api alias instead. Migrate the cjs optimizer tests from middleware to a separate endpoint `/cjs/server`. As now ESM imports for next/server are not going to get tree-shaken in dev, but since we don't have image response there it's still fine. Closes NEXT-2376 Closes NEXT-2374
…61231) ### What? This PR wraps up supporting rsc transforms (mostly for the assertion) in Turbopack. PR contains a few changes to support it, including: - adjust / expand transform rules for the corresponding contexts - fix file name / node_modules check - extract visitors for the assertion / transforms This change enables most of the rsc-build* tests and some more other tests. The only failing tests in the rsc-build-errors is due to Turbopack not triggering hmr with empty file. Closes PACK-2303
This alters the behavior of the subrequest check to allow for 5 recursive calls to match Vercel production, ref [Slack thread](https://pinglabsworkspace.slack.com/archives/C052S77L05C/p1694729495655489). > [!NOTE] > Currently limited by fetches having to forward the subrequest header for each request which isn't ideal. Need some assistant on how to access the request in the module context fetch override. > No forwarding: ![CleanShot 2024-02-05 at 22 52 10@2x](https://github.com/vercel/next.js/assets/51714798/8ae79f00-f987-4919-946c-d8363d540cef) > With forwarding: ![CleanShot 2024-02-05 at 22 51 31@2x](https://github.com/vercel/next.js/assets/51714798/32bd4072-9373-4cb0-ab05-f862a818e0d7) --------- Co-authored-by: JJ Kasper <[email protected]>
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target. ### Why? We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only. This'll makes our `next-swc` simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings. #### Good - Async napi binding fn works transparently (`transform`, `minify`...) - (Experimental) thread supports depends on node.js runtime - Wasi support: i.e it can even read filesystem directly! #### Things to consider - node.js's wasi support is experimental yet - napi-rs's wasm support is in beta yet, specifically `packaging` generated wasm output. Due to `things to consider` reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later. **What happens to the turbopack api in napi bindings?** Simply put, this **does not support turbopack in wasm**. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately. Closes PACK-2367 There is a branch at #61586 shows quick demo for importing, running sync / async / read external files.
Our tag values are case-sensitive so this ensures we properly document this so users are aware of this caveat. x-ref: #61392 (comment) Closes NEXT-2379
- parsed stack traces (and error stack locations in js) have 1-based lines and 1-based columns - source map tokens have 0-based lines and 0-based columns - babel code frames use 1-based lines and 0-based columns This was not always respected. This preserves the 1-based lines and columns in anything called a stack frame, 0-based lines and columns for source map apis, and converts to babel’s format as needed. Closes PACK-2341 --------- Co-authored-by: Tobias Koppers <[email protected]>
…ep (#61696) ## History Previously, we added support for `squoosh` because it was a wasm implementation that "just worked" on all platforms when running `next dev` for the first time. However, it was slow so we always recommended manually installing `sharp` for production use cases running `next build` and `next start`. Now that [`sharp` supports webassembly](https://sharp.pixelplumbing.com/install#webassembly), we no longer need to maintain `squoosh`, so it can be removed. We also don't need to make the user install sharp manually because it can be installed under `optionalDependencies`. I left it optional in case there was some platform that still needed to manually install the wasm variant with `npm install --cpu=wasm32 sharp` such as codesandbox/stackblitz (I don't believe sharp has any fallback built in yet). Since we can guarantee `sharp`, we can also remove `get-orientation` dep and upgrade `image-size` dep. I also moved an [existing `sharp` test](#56674) into its own fixture since it was unrelated to image optimization. ## Related Issues - Fixes #41417 - Closes #54670 - Related #54708 - Related #44804 - Related #48820
### What This adds support for navigation signals like `notFound()` and `redirect(url)` when Partial Prerendering has been enabled. ### Why Navigation API's like `notFound()` and `redirect(url)` throw errors in order to interrupt the rendering of components. When a page both invokes API's that cause the render to be marked as dynamic (like `unstable_noStore()`) and also a navigation API, these errors may race to the end. In the case where the navigation error does not beat out the error emitted by dynamic API's will still trigger the detection warning that's present to warn you about situations where you may have accidentally caught the error. ### How This resolves this issue by explicitly checking for navigation signals (errors) thrown during the render, and not displaying the "caught dynamic API" error and console warning. Closes NEXT-2037
### What? change filename to `app/dashboard/@analytics/layout.js` in example ### Why? It was written incorrect i.e. `app/layout.js` <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? change filename to app/dashboard/@analytics/layout.js ### Why? It was written incorrect i.e. app/layout.js ### How? Closes NEXT- Fixes # -->
#48717 duplicated the /learn course link in README.md
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? Code example in docs was invalid ### Why? Missing comma, causing command `npm run dev` to break. ### How? Closes NEXT- Fixes # --> --------- Co-authored-by: Sam Ko <[email protected]>
## Description Remove unused directory. The `create-next-app` tests are active here → https://github.com/vercel/next.js/tree/canary/test/integration/create-next-app. - Closes NEXT-2382 - Closes #57888
Closes NEXT- Fixes #17274 Error Fetching _devpagesmanfest.json --------- Co-authored-by: JJ Kasper <[email protected]>
In #61649 the paragraph `"This function allows you to redirect the user to another URL. It can be used in..."` describing `notFound` was copied as is from the `redirect` jsDoc --------- Co-authored-by: JJ Kasper <[email protected]>
### What? fixes unexpected use client build warning in some applications. We've consolidated all the ecmaplugins into custom rules. It behaves different for the ecma inputs, while plugin runs any ecmascript inputs rules only runs with matching target. The culprit module in question was published as `.mjs`, so the necessary transform didn't ran. Closes PACK-2419
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Simple cleanup of duplicative import of `react-dom` in add form example. Some editors, linters, or bundlers take issue with this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )