- 23 May, 2024 21 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
-
JJ Kasper authored
-
Sebastian Silbermann authored
This reverts commit https://github.com/vercel/next.js/commit/637033c41054ee1d50107b1fd63a91a2051e1653. What wasn't clear originally is that we require that required packages have their `package.json` resolvable. So either they don't have an `exports` field, or their `package.json` is listed in the `exports` field. The React beta types didn't have `package.json` entry in `exports` so we accidentally thought they weren't installed. I published [`19.0.0-beta.2` that has `package.json` in `exports`](https://github.com/eps1lon/DefinitelyTyped/pull/31/commits/13879ee571bd3996ad2dffd58a288e9762bf31d1#diff-81cc573aa0c2bd0e13f9463499747741704aabccd7474f544db710befd7bcfc4R44) so we can restore the old behavior. It's still questionable IMO to do all that I/O work just for a nicer error message that may contain false-positive but that's for another time.
-
JJ Kasper authored
-
JJ Kasper authored
-
JJ Kasper authored
-
JJ Kasper authored
Alternative to https://github.com/vercel/next.js/pull/65867 this stabilizes our `swrDelta` config that allows customizing the `stale-while-revalidate` period that is included in the `Cache-Control` header for ISR enabled routes. This is not a breaking change itself as no default value is provided as is the case already.
-
Delba de Oliveira authored
React 19 - [x] React Compiler - [x] Check all examples for new API usage e.g.`useActionState`, `use` - [x] Review Server Actions page and link to React docs. Next.js 15 - [x] PPR incremental adoption and placeholder page - for SEO - [x] `next/after` - [x] Package bundling - [x] Upgrade guide - [x] Clarify new `fetch` behavior - [x] Route handlers - dynamic - [x] Client-side router cache - [x] Add "Good to know" about metadata route handlers being cached 15 and beyond - [x] Remove recommendations for `revalidate = low value` - [x] Review and consolidate data fetching section - [ ] Client-side data fetching patterns - [ ] Streaming data pattern with React `use` - [ ] Seeding initial data from the server Redirects and blog post: https://github.com/vercel/front/pull/32249 --------- Co-authored-by:Ahmed Abdelbaset <A7med3bdulBaset@gmail.com> Co-authored-by:
Anthony Shew <anthonyshew@gmail.com> Co-authored-by:
Michael Novotny <manovotny@gmail.com> Co-authored-by:
Ethan Arrowood <ethan@arrowood.dev> Co-authored-by:
StephDietz <steph.dietz@vercel.com> Co-authored-by:
Stephanie Dietz <49788645+StephDietz@users.noreply.github.com> Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
Sebastian Silbermann authored
Co-authored-by:Alessio Gravili <alessio@gravili.de>
-
Janka Uryga authored
This PR changes the `getWaitUntil` logic to always check if the platform provided a request context with a `waitUntil` implementation (via [the `@next/request-context` symbol](https://github.com/vercel/next.js/blob/05e6b825768355372dcdfff06dfcd264f78507d3/packages/next/src/server/after/wait-until-builtin.ts#L12)) , regardless of minimalMode or runtime. Previously, we wouldn't check the context at all unless `minimalMode` was set, and defaulted `waitUntil` to a noop otherwise. This would make integration more difficult for providers who don't use `minimalMode`, because they'd have no way to inject their `waitUntil` implementation.
-
Jimmy Lai authored
<!-- 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:
Wyatt Johnson <accounts+github@wyattjoh.ca>
-
Wyatt Johnson authored
Ensures that app routes (like the `favicon.ico` added in the test case in this PR which is represented as an app route) do not have a prefetch RSC also attached.
-
Wyatt Johnson authored
This removes the canary requirement for using PPR in a project, and now enables use on stable releases.
-
JJ Kasper authored
-
JJ Kasper authored
This adds support for a new `rc` publish tag to our start release workflow.
-
tokkiyaa authored
Co-authored-by:Sam Ko <sam@vercel.com>
-
vercel-release-bot authored
-
Sebastian Silbermann authored
<details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/29219 - https://github.com/facebook/react/pull/29007 - https://github.com/facebook/react/pull/29207 </details>
-
JJ Kasper authored
## Background Previously we introduced automatic caching for `fetch` based on certain heuristics that were a bit tricky to grasp all scenarios. The scenarios we would automatically cache were no dynamic data access before the fetch call e.g. `headers()` or `cookies()`, the fetch call is inside of a dynamic page e.g. `POST` method or `export const revalidate = 0` page and the fetch is a non-`GET` request or has `Authorization` or `Cookie` headers, or the fetch had `cache: 'no-store' | 'no-cache'` or `revalidate: 0`. ## New Behavior By default fetches will no longer automatically be cached. Instead they need to be opted-in to caching via `export const fetchCache = 'default-cache' | 'force-cache',` `next: { revalidate: false or value > 0 }` or `cache: 'force-cache' | 'default-cache'`. When the fetch call is automatically skipping the cache it won't impact the page level ISR cacheability although if a fetch call manually specifies `cache: 'no-store'` or `revalidate: 0` it will still bail from the page being statically generated as it was before. To achieve the previous behavior of automatic fetch caching all that needs to be added is `export const fetchCache = 'default-cache'` in the root layout(s) of your project. -
Wyatt Johnson authored
When PPR is enabled, we should always write the prefetch RSC routes to ensure that the builder and FS cache can use it.
-
- 22 May, 2024 15 commits
-
-
vercel-release-bot authored
-
Janka Uryga authored
When hot-reloading an edge runtime page, sometimes we randomly get this: ``` [InvariantError: Invariant: Cannot call onClose on a response that is already sent. This is a bug in Next.js.] { name: 'InvariantError' } ``` and since `unstable_after` relies on `onClose`, no callbacks are called. I believe this is because `web-server` [calls `res.send()` pretty early for streaming responses](https://github.com/vercel/next.js/blob/b9817f83519fdaa7a7fcd4711dfb80aa1e1a2434/packages/next/src/server/web-server.ts#L311), so `res.sent` becomes `true` even though we're still streaming, and prevents us from calling `onClose` in the streaming render. It makes more sense to check the CloseController's `isClosed` instead -- when that becomes `true`, we _really_ shouldn't call onClose anymore (points to a bug), but before that it's fine. -
mknichel authored
<!-- 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:
JJ Kasper <jj@jjsweb.site>
-
Sebastian Silbermann authored
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/65825 this ensures we don't skip the static optimization specifically for metadata routes as this most often should be static as they aren't dynamic content and are requested very frequently.
-
Sebastian Silbermann authored
-
mknichel authored
This PR adds a flag to Next.js to enable Webpack options to improve memory usage. See https://github.com/webpack/webpack-sources/pull/155 for a full description of the changes and impact on memory. This PR adds a patch to `webpack-sources` temporarily that contains the fixes as the real changes are iterated on to merge upstream in the `webpack/webpack-sources` repository. After that is done, the patch will be reverted and the latest `webpack-sources` version will be updated in Next.js.
-
JJ Kasper authored
To avoid extra network hops we can compare existing cache entries we've already fetched and see if the revalidated value matches and if it does we can avoid sending the set request with the identical data.
-
Benjamin Woodruff authored
Use updated API suggested by sokra in review on #65223: https://github.com/vercel/next.js/pull/65223#discussion_r1587157258 Depends on https://github.com/vercel/turbo/pull/8075
-
Benjamin Woodruff authored
As noted in (https://github.com/vercel/nextpack/pull/103), by not having this as a default feature, when running the `build-native` script it's not able to re-use any cargo caches that might already exist from a default build. Because this feature impacts the swc crate, everything dependent on it can be forced to rebuild. By making this a default feature, the hope/theory is that the number of different ways we potentially build our dependency graph reduces, and cargo cache hits will improve. ## Changes - Add `plugin` to the default set of features for `next-swc-napi`. - Consolidate `build-native-no-plugin-woa` with `build-native-no-plugin`. Given the lack of any other default features, these are equivalent. - `i686-pc-windows-msvc`: Switch to `build-native-no-plugin-release` in CI instead of just supplying the `--release` flag. This has the benefit of also enabling `tracing/release_max_level_info`, which might reduce the size of or speed up these builds. - `x86_64-apple-darwin`: Remove a redundant `--release` flag in the CI config (no expected changes). ## Testing I've tested this locally on Linux (`pnpm run build-native`) and Windows-on-ARM (`pnpm run build-native-no-plugin`) by making sure things still build. I'll also make sure CI passes.
-
Steven authored
This parameter was previously used for a warning message, but we no longer print that warning since https://github.com/vercel/next.js/pull/63321 so now we can remove the unused parameter.
-
Zack Tanner authored
This implements an API to re-throw errors that are intended to be caught by Next.js, so that they are not caught by your code. RFC: https://github.com/vercel/next.js/discussions/64076 <!-- 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:
JJ Kasper <jj@jjsweb.site> Co-authored-by:
Ahmed Abdelbaset <A7med3bdulBaset@gmail.com> Co-authored-by:
Janka Uryga <lolzatu2@gmail.com>
-
Theo Todorov authored
Co-authored-by:Steven <steven@ceriously.com>
-
Sebastian Silbermann authored
-
JJ Kasper authored
Seems we weren't grabbing the latest cli output inside of `check` so if it wasn't ready by the time the first check successive checks wouldn't have it either. x-ref: https://github.com/vercel/next.js/actions/runs/9182806177/job/25253023758 x-ref: https://github.com/vercel/next.js/actions/runs/9182324607/job/25254072867
-
- 21 May, 2024 4 commits
-
-
vercel-release-bot authored
-
Will Binns-Smith authored
Previously with Turbopack, we would attempt to establish a websocket connection to the HMR server, even when running production builds. This adds `next-turbopack.ts`, which includes the necessary runtime code for Turbopack, but does not include HMR code. Test Plan: `TURBOPACK=1 TURBOPACK_BUILD=1 pnpm next build test/e2e/app-dir/app-middleware` --------- Co-authored-by:Tim Neutkens <tim@timneutkens.nl>
-
vercel-release-bot authored
-
Sebastian Silbermann authored
-