- 07 Jan, 2024 4 commits
-
-
vercel-release-bot authored
-
Lee Robinson authored
-
Christopher Krogh authored
https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/624 was merged and released in 4.10.0 and I'd like to leverage this change in `@next/bundle-analyzer`
-
Vercel Release Bot authored
This auto-generated PR updates the integration test manifest used when testing Turbopack.
-
- 06 Jan, 2024 16 commits
-
-
rmathew8-gh 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:
Roy Mathew <rmathew8@gmail.com> Co-authored-by:
Sam Ko <sam@vercel.com>
-
vercel-release-bot authored
-
Sam Ko authored
This link → [/docs/02-app/01-building-your-application/09-upgrading/index.mdx](https://github.com/vercel/next.js/blob/21452921c055421ec8a44dae6e0e5f311c503337/docs/02-app/01-building-your-application/09-upgrading/index.mdx) doesn't exist. Fixing it to link to the correct directory. Closes NEXT-2006
-
David Thorand authored
This fixes a typo in the Next.js documentation.
-
Tobias authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Luke Schlangen authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Niklas Ziermann authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Lee Robinson authored
Closes https://github.com/vercel/next.js/issues/42095. Closes https://github.com/vercel/next.js/issues/59215.
-
Steven authored
This PR migrates the `image-component` example from Pages Router to App Router. It also upgrades a couple dependencies and regenerates tsconfig.json
-
Dongho Kim authored
-
Sjoerd van Bommel authored
Closes https://github.com/vercel/next.js/issues/60235
-
Lee Robinson authored
Full example of one with GitHub: https://raw.githubusercontent.com/leerob/on-demand-isr/main/app/api/webhook/route.ts
-
Jyan authored
-
Zack Tanner authored
### What? Our [docs](https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#convention) point out that `app/page.js` is equivalent to `app/@children/page.js`, however in practice this is not the case, and causes type errors when using `@children` slots as well as incorrect behavior when matching catch-all routes. ### Why? - When typechecking, `@children` slots would be added to the typeguard file for the associated layout, resulting in duplicate identifiers for the `children` prop - When determining where to insert catchall slots, the `hasMatchedSlots` check wasn't considering that the `@children` slot corresponds with the page component, so matching another page would clobber the previous one. ### How? - Filters out the `@children` slot when collecting slots for typechecking - Filters out the `@children` slot when running the `hasMatchedSlots` function in the catch-all normalizer Closes NEXT-1984
-
Sam Ko authored
Update <picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" width="20" height="auto" src="https://emoji.slack-edge.com/T0CAQ00TU/pnpm/49b40aec15de9c17.png" alt=":pnpm:" align="absmiddle"></picture> to the latest (v8.14.0). Closes NEXT-2003
-
Alexander Savelyev authored
### Fixing a bug I'm sorry, I have no idea how I managed to delete this, as I just copied the code. However, I had to figure out why the tests passed. When I test the running application locally, it works as expected. So, when a route is first used in a running production application in a test, `ctx.fetchCache` is `undefined`. Therefore, the error rule does not trigger on the first request, and the cache is successfully written. This may result in artifacts in FetchCache in Vercel and possibly in other parts of the code. ```ts if ( ctx.fetchCache && // <- Undefined on first request // we don't show this error/warning when a custom cache handler is being used // as it might not have this limit !this.hasCustomCacheHandler && JSON.stringify(data).length > 2 * 1024 * 1024 ) { if (this.dev) { throw new Error(`fetch for over 2MB of data can not be cached`) } return } ``` I'm 95% sure that this is a bug and it shouldn't work like this. I'll look into this later and if there is an error, I'll put it into a task and try to figure it out later. Unfortunately, the [test](https://github.com/vordgi/next.js/blob/7e028fb6d8598cfcca8de514e4608374f931c973/test/e2e/app-dir/app-static/app-static.test.ts#L3080) from [previous PR](https://github.com/vercel/next.js/pull/59976) is not working yet, although it is correct from my point of view. I think it should be kept and the problem above should be fixed. Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
- 05 Jan, 2024 16 commits
-
-
JJ Kasper authored
x-ref: https://github.com/vercel/next.js/actions/runs/7427293982/job/20213797689 Closes NEXT-2002
-
vercel-release-bot authored
-
Zack Tanner authored
### What? When relying on a `default` route as a fallback, greedier catch-all segments in the application hierarchy would take precedence, causing unexpected errors/matching behavior. ### Why? When performing parallel route catch-all normalization, we push potential catch-all matches to paths without considering that a path might instead be matched by a `default` page. Because of this, the catch-all take precedence and the app will not try and load the default. For example, given this structure: ``` { "/": ["/page"], "/[[...catchAll]]": ["/[[...catchAll]]/page"], "/nested/[foo]/[bar]": ["/nested/[foo]/[bar]/@slot/page"], "/nested/[foo]/[bar]/[baz]": ["/nested/[foo]/[bar]/@slot/[baz]/page"], } ``` (Where there's a `/nested/[foo]/[bar]/default.tsx`) The route normalization logic would produce: ``` { "/": ["/page"], "/[[...catchAll]]": ["/[[...catchAll]]/page"], "/nested/[foo]/[bar]": [ "/nested/[foo]/[bar]/@slot/page", "/[[...catchAll]]/page", ], "/nested/[foo]/[bar]/[baz]": [ "/nested/[foo]/[bar]/@slot/[baz]/page", "/[[...catchAll]]/page", ], } ``` This means that when building the `LoaderTree`, it won't ever try to find the default for that segment. **This solution operates under the assumption that if you defined a `default` at a particular layout segment, you intend for that to render in place of a greedier catch-all.** (Let me know if this is an incorrect assumption) ### How? We can't safely normalize catch-all parallel routes without having context about where the `default` segments are, so this updates `appPaths` to be inclusive of default segments and then filters them when doing anything relating to build/export to maintain existing behavior. We use this information to check if an existing default exists at the same segment level that we'd push the catch-all to. If one exists, we don't push the catch-all. Otherwise we proceed as normal. Closes NEXT-1987 -
Ahmed Abdelbaset authored
Some corrections to #59304
-
Steven authored
We used to have docs but it was lost in the rewrite (as seen in this comment https://github.com/vercel/next.js/pull/30060#discussion_r732243330) This PR adds back the documentation for Custom Type Declarations. Closes NEXT-1999
-
Jordan Newland authored
Add missing bun command from Vitest page. Co-authored-by:Steven <steven@ceriously.com>
-
Gaspar Garcia Jr authored
Clarify searchParams is not passed to Layouts Followup to https://github.com/vercel/next.js/pull/60257/files#r1443175387 <!-- 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 # -->
-
Tim Neutkens authored
## What? Small refactor to allow moving this logic in the future. <!-- 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-1949
-
vercel-release-bot authored
-
OJ Kwon authored
### What? Turbopack does not apply same transform for the react server components, which makes missing lot of compilation error validation and custom comments. PR refactors transform to be used in next-swc / turbopack both, then apply it into turbopack. There are still some of test cases are not passing, might need further digging for the transform condition. Closes PACK-2155 --------- Co-authored-by:Tim Neutkens <tim@timneutkens.nl>
-
Hamir Mahal authored
- fixes #58844 Co-authored-by:Steven <steven@ceriously.com>
-
Delba de Oliveira authored
- Add note on how to disable Next.js compression, to use a different algorithm. --------- Co-authored-by:Lee Robinson <me@leerob.io>
-
Delba de Oliveira authored
- `useSearchParams` opts the client component subtree out of static rendering (pre-rendering), not dynamic rendering. We recommend wrapping the component that uses `useSearchParams` in a Suspense boundary to allow client components above it to be statically rendered (part of the initial HTML). Closes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1704398859737719
-
Delba de Oliveira authored
-
Stephanie Dietz authored
- Add **Going to Prod** docs for `app` - Add bundle-analyzer page - Merge `app` and `pages` docs --------- Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl> Co-authored-by:
Michael Novotny <manovotny@gmail.com> Co-authored-by:
Delba de Oliveira <delbabrown@gmail.com> Co-authored-by:
Rich Haines <hello@richardhaines.dev> Co-authored-by:
Lee Robinson <me@leerob.io>
-
Tim Neutkens authored
## What? Moves images-manifest.json related code to a separate function `writeImagesManifest` <!-- 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-1979
-
- 04 Jan, 2024 4 commits
-
-
Andrew Clark authored
This fixes a case in the PPR navigations implementation where page data was not being applied. During a navigation, we compare the route trees of the old and new pages to determine which layouts are shared. If the segment keys of two layouts are the same, they are reused. However, the server doesn't bother to assign segment keys to the leaf segments (which we refer to as "page" segments) because they are never part of a shared layout. It assigns all of them a special constant (`__PAGE__`). In the PPR implementation, I overlooked this and compared the segment keys of all segments, including pages, not just shared layouts. So if the only thing that changed during a navigation was the page data, and not any parent layout, the client would fail to apply the navigation. The fix is to add a special case for page segments before comparing nested layouts. I also moved an existing special case for default pages, since those are also leaf segments and are conceptually similar.
-
vercel-release-bot authored
-
Alexander Savelyev authored
### Fixing a bug ### What? Disable 2MB limit for custom incrementalCacheHandler ### Why? The limit is necessary because `FetchCache` has a 2MB limit, but it seems there was a miscommunication regarding the key coincidence, where `fetchCache` is a flag indicating that the method is called from fetch, rather than indicating that the `FetchCache` Provider is currently being used. We do not use Vercel, and as I understand it, we do not have the opportunity to use this functionality. In any case, it is more important for us to increase the limits, and in some cases, using a file storage is even preferable. ### How? I have created a flag that determines whether the use of `FetchCache` is possible at least in theory - if no custom provider is passed, and additionally configured it so that it is not an implementation of `FetchCache` as a protection against special individuals (*like me :)*). If everything is fine, I will write proper tests. Also, I would like to recommend making `FileSystemCache` public (_i.e. support it as public functionality_) so that it can be imported and extended or simply used to fix only it. Fixes #48324 (partially) --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Steven authored
In the future, we should make this automatically fetch the json
-