- 11 Jun, 2024 3 commits
-
-
vercel-release-bot authored
-
Zack Tanner authored
<details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/29835 </details>
-
Zack Tanner authored
This is causing unexpected errors. Reverts vercel/next.js#66286
-
- 10 Jun, 2024 23 commits
-
-
Ivan Torres authored
Update DevDependecy to the last version: @types/node@20.14.2 Co-authored-by:torresgol10.itd <torresgol10.itd@gmail.com>
-
Zack Tanner authored
This test flakes a _lot_ ([ref](https://github.com/vercel/next.js/actions/runs/9456072960/job/26048162244), [ref](https://github.com/vercel/next.js/actions/runs/9456072960/attempts/2), [ref](https://github.com/vercel/next.js/actions/runs/9456076941/job/26048598801)) likely due to all of the `context` mutation and sharing between tests. This updates the test that fails the most with locally scoped context to flakes introduced by other tests. <!-- 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 # -->
-
vercel-release-bot authored
-
Delba de Oliveira authored
-
Sam Ko authored
## Why? Adding types to test—building on this [PR](https://github.com/vercel/next.js/pull/65722).
-
Wyatt Johnson authored
This fixes some tests so that they can run on macOS that previously had some issues with IPv6 during testing as well as updated some of the tests to use `retry` over `check`.
-
Wyatt Johnson authored
To allow us to incrementally adopt more comprehensive linting rules, this pull request disables the previous behaviour of failing CI when any warnings were discovered. Instead, this modifies the previous warnings to be errors which will preserve the previous linting behaviour. As we enable new lint rules, they can be added as warnings which will gently nudge us towards fixing in related pull requests.
-
JJ Kasper authored
While investigating unexpected stale responses when leveraging `getStaticProps` on the 404 page noticed we have an inconsistency between local and deployed due to `Cache-Control` being set to `no-store, must-revalidate` even though a revalidate period is provided. The inconsistency also differs between the HTML response and the data response `_next/data` which causes even more unexpected behavior. To avoid this behavior, this replaces the handling to ensure we honor the originally provided revalidate period during `notFound: true` for the `Cache-Control` header. Validated against provided reproduction here https://github.com/fusdev0/next-notfound-revalidate Deployment: https://vercel.live/link/next-notfound-revalidate-govzskknf-vtest314-ijjk-testing.vercel.app/fallback-blocking/fasdf Prior PR for prior context that introduced this https://github.com/vercel/next.js/pull/19165 x-ref: [slack thread](https://vercel.slack.com/archives/C0676QZBWKS/p1717492459342109)
-
JJ Kasper authored
As discussed this adds handling to timeout at a max of 500ms for fetch cache request and retries a max of 3 times due to network instability. This also adds cache service tests and fixes a case we've been trying to track down where we were seeing `undefined` cache URL values which made debugging fetches tricky.
-
Sebastian Silbermann authored
-
Wyatt Johnson authored
To assist with the development and testing of the new partial prerendering (PPR) paradigm, this introduces a stop-gap solution to let us verify issues with pages in preview and production environments if enabled. When a Next.js app is built and ran with the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING=1` environment variable, pages that have PPR enabled in production and preview environments can have only their static shell served when accessed with a `?__nextppronly=1` query parameter. If your project is not using PPR, it will not change anything. If a page is accessed in production or development with the query parameter but PPR is not enabled, it will not change anything. Tests have been added to validate that going forward.
-
Karl Keefer authored
The _requirement_ to export a `generateStaticParams` to get static cache behavior _after_ build time was _really_ surprising behavior for me, and I think others: * https://github.com/vercel/next.js/issues/62195#issuecomment-1952091312 * https://github.com/vercel/next.js/discussions/57961#discussioncomment-8491488 Potentially this is a bug, and not something that should be fixed with documentation? I don't understand next.js caching enough to make that determination, so instead I'm proposing these changes to docs which might be encountered by folks who are surprised by this cache behavior. One point in favor of this being a bug: The CLI reports that a route is `SSG` enabled in the build output, but doesn't actually cache post-build page renders if this export is missing. @awinogrodzki made a demo repo showing this behavior, as described [here](https://github.com/vercel/next.js/discussions/57961#discussioncomment-7468144). --------- Co-authored-by:
Delba de Oliveira <delbabrown@gmail.com> Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Co-authored-by:
samcx <sam@vercel.com>
-
hrmny authored
### What? This is a fix for a bundle potentially referring to two different external modules (e.g. `react` because it gets invalided from the require cache) See https://github.com/vercel/turbo/pull/7988 ### Turbopack Updates * https://github.com/vercel/turbo/pull/8376 <!-- Tim Neutkens - Rename ChunkLoading::None to ChunkLoading::Edge --> * https://github.com/vercel/turbo/pull/8371 <!-- Donny/강동윤 - test: Add an execution test for `paren_remover` --> * https://github.com/vercel/turbo/pull/8370 <!-- Tobias Koppers - Tree Shaking shared state and side effects --> * https://github.com/vercel/turbo/pull/7988 <!-- hrmny - feat(turbopack-ecmascript): cache external modules with wrapper --> Closes PACK-2622
-
Jiachi Liu authored
### What Optimizing the static generation for dynamic metadata routes If you're not using `generateSitemaps()` or `generateSitemaps()`, you don't need to change any file conventions. If you're using multi sitemap routes, make sure the returned `id` properties from `generateSitemaps()` don't need to contain `.xml`, since we'll always append one for you. Analyzing the exports of metadata routes and determine if we need to make them as dynamic routes. ### Why Previously, users are struggling with the multi routes of sitemap or images. For sitemap, the `.xml` extension in url doesn't get appended consistently to the multi sitemap route between dev and prod. For image routes, the generated image routes are always dynamic routes which cannot get static optimized. The reason is that we need to always generate a catch-all route (such as `/icon/[[...id]]` to handle both single route case (e.g. without `generateImageMetadata`, representing url `/icon`) or multi route (e.g. with `generateImageMetadata`, representing url `/icon/[id]`), only catch-all routes can do it. This approach fail the static optimization and make mapping url pretty difficult as parsing the file to check the module exports has to be done before it. #### Benifits For image routes urls, this approach could help on static generation such as single `/opengraph-image` route can be treated as static, and then it can get static optimized if possible. **Before**: `/opengraph-image/[[...id]]` cannot be optimized **After**: single route `/opengraph-image` and multi-route `/opengraph-image/[id]` are both possible to be statically optimized For sitemap, since we removed appending `.xml` for dynamic routes, it’s hard for users to have `/sitemap.xml` url with dynamic route convention `sitemap.js` . But users desire smooth migration and flexibility. **Before**: In v15 rc we removed the `.xml` appending that `sitemap.js` will generate url `/sitemap` makes users hard to migrate, as users need to re-submit the new sitemap url. **After**: Now we'll consistently generate the `.xml`. Single route will become `/sitemap.xml`, and multi route will become `/sitemap/[id].xml`. It's still better than v15 as the urls generation is consistent, no difference between dev and prod. Here's the url generation comparsion #### Before All the routes are dynamic which cannot be optimized, we only had a hacky optimization for prodution build multi-routes sitemap routes | | only default export | `export generateImageMetadata()` | `export generateSitemaps()` | | -- | -- | -- | -- | | opengraph-image.js | /opengraph-image/[[...id]] | /opengraph-image[[...id]]/ | /opengraph-image/[[...id]] | | sitemap.js | /sitemap/[[...id]] | /sitemap/[[...id]] | dev: `/sitemap/[[...id]]` prod: `/sitemap/[id]` | #### After Most of the single route will are to get statically optimized now, and the multi-routes sitemap are able to get SSG now | | only default export | `export generateImageMetadata()` | `export generateSitemaps()` | | -- | -- | -- | -- | | opengraph-image.js | /opengraph-image | /opengraph-image/[id] | - | | sitemap.js | /sitemap.xml | - | /sitemap/[id].xml | Next.js will have less overhead of mapping urls, we can easily multiply the urls generation simply based on file conventions. x-ref: feedback from #65507 Closes #66232
-
Mayank authored
-
hrmny authored
### Why? Importing `tailwind/tailwind.css` is not possible right now with turbopack, and there's no reason it needs to be marked as external. ### How? Closes PACK-3013 Fixes #64837
-
mratlamwala authored
wording changes. <!-- 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 # --> --------- Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
vercel-release-bot authored
-
Sebastian Silbermann authored
Co-authored-by:Hendrik Liebau <mail@hendrik-liebau.de>
-
Jiachi Liu authored
### What Keep `test/e2e/app-dir/metadata-dynamic-routes/index.test.ts` with successful build cases, move the dev error tests into separate test ### Why x-ref: https://github.com/vercel/next.js/actions/runs/9429301722/job/25975574075?pr=66286 Before the moving the tests, the error is flaky with turbopack since the error will fail the hmr. Error observed with turbopack when seeing build failed cases. So I moved the tests into the separate dev tests, running inside sandboxes. Then each error test doesn't effect each other. ``` ⨯ ./app/metadata-base/unset/icon--metadata.js:1:1 Module not found: Can't resolve './icon.tsx' > 1 | import { generateImageMetadata } from "./icon.tsx" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | import { fillMetadataSegment } from 'next/dist/lib/metadata/get-metadata-route' 3 | 4 | const imageModule = { generateImageMetadata } ```
-
vercel-release-bot authored
-
Jiachi Liu authored
### What Remove creating client proxy for each ESM export, instead for ESM we create a CJS module proxy for itself and access the property with export name as the actual export. ### Why `proxy` is the module proxy that we treat the module as a client boundary. For ESM, we access the property of the module proxy directly for each export. This is bit hacky that treating using a CJS like module proxy for ESM's exports, but this will avoid creating nested proxies for each export. It will be improved in the future. Notice that for `next/dynamic`, if you're doing a dynamic import of client component in server component, and trying to access the named export directly, it will error. Instead you need to align the dynamic import resolved value wrapping with a `default:` property (e.g. `{ default: resolved }`) like what `React.lazy` accepted. Revert #57301 Fixes #66212 x-ref: [slack](https://vercel.slack.com/archives/C04DUD7EB1B/p1716897764858829) -
Ivan Torres authored
Update devdependecies tar and type. I have only imported the necessary function, maybe it is a little unverbose, we can use instead of ‘x’ => ‘extract’. --------- Co-authored-by:
torresgol10.itd <torresgol10.itd@gmail.com> Co-authored-by:
Sam Ko <sam@vercel.com>
-
- 09 Jun, 2024 2 commits
-
-
vercel-release-bot authored
-
Zack Tanner authored
During navigations, the `FlightDataPath` property from the server response can be an array if there are multiple parallel routes (eg, `children` and `slot`). When we apply server response to the router cache, we might call `applyFlightData` for each segment path, which will copy existing cache values and insert new ones depending on what changed. However, the `existingCache` argument that we pass to this function is the cache at the start of the navigation. That means subsequent calls to `applyFlightData` will reference the cache _before_ updates are made to it. This will cause it to erroneously think it needs to lazy fetch for missing data. <!-- 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 # -->
-
- 08 Jun, 2024 3 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
As discussed this updates the URL value provided from `unstable_cache` to include the current pathname and sorted search params so that it's easier to identify where the call is being done for using debug metrics. x-ref: [slack thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1717012449080709?thread_ts=1716942410.700499&cid=C042LHPJ1NX)
-
Zack Tanner authored
When checking which segment(s) need to be refreshed, we currently compare the current page URL with the segment's refresh marker. We should inspect the `mutable.canonicalUrl` value first since that's the URL we're changing to, followed by `state.canonicalUrl` as a fallback (indicating that there's no URL change pending). This is because the server action handler will receive a redirect URL prior to `location.pathname` being updated, so the router will incorrectly think it needs to refresh the data for the page we're going to. Closes NEXT-3500
-
- 07 Jun, 2024 8 commits
-
-
Zack Tanner authored
This flag remained experimental because the IPC implementation didn't play nicely with requests containing large payloads, due to it being stringified as GET parameters. This branching logic also poses challenges for some upcoming work related to detecting IO. This removes the handling for the `experimental.staticWorkerRequestDeduping` flag which we can revisit in the future with a sounder approach. This also cleans up some of the IPC server utilities as it wasn't in use anywhere else. <!-- 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 # -->
-
vercel-release-bot authored
-
Tobias Koppers authored
Reverts vercel/next.js#66521
-
Zack Tanner authored
This change introduced some unexpected behavior when prefetching pages that were statically generated on-demand. We currently conditionally strip flight headers in base-server to opt into special rendering behavior ([ref](https://github.com/vercel/next.js/blob/71153eaa3b1d1a72f99e080f432e234d3c1f5fb5/packages/next/src/server/base-server.ts#L2153)) but this doesn't apply to "request meta" properties. This reverts that change specifically and adds a comment clarifying why it's there, and adds a test-case. <!-- 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 # -->
-
vercel-release-bot authored
-
Tobias Koppers authored
### What? * [allow to re-run the action that publishes the release](https://github.com/vercel/next.js/commit/ce4f629d73115a6cb61f17d6554b0ddf667171d4) * [allow to force trigger a new release](https://github.com/vercel/next.js/commit/7e26cd7794aaa0afc62169127edb09394692014e) ### Why? On failure we might want to re-run the whole action or publish a new release without changes
-
vercel-release-bot authored
-
Tobias Koppers authored
* https://github.com/vercel/turbo/pull/8347 <!-- Tobias Koppers - Small tree shaking fix and test case update --> * https://github.com/vercel/turbo/pull/8348 <!-- Donny/강동윤 - fix: Apply `paren-remover` while minifying -->
-
- 06 Jun, 2024 1 commit
-
-
vercel-release-bot authored
-