- 18 Jan, 2024 27 commits
-
-
vercel-release-bot authored
-
Ethan Arrowood authored
Add @Ethan-Arrowood to labeler list
-
vercel-release-bot authored
-
Jiachi Liu authored
`experimental.missingSuspenseWithCSRBailout` should be enabled by default to help users to disciver unwrapped suspense boundaries. Add more notes in the error doc about deprecation and temporary workaround to disable it. Closes NEXT-2157 --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
vercel-release-bot authored
-
Jiachi Liu authored
Follow up for #57953 for DX, give better warnings x-ref: https://github.com/vercel/next.js/pull/60828#discussion_r1457736645 Closes NEXT-2156
-
Jiachi Liu authored
Follow up for #57953 for turbopack side Closes NEXT-2153
-
Steven authored
Revert "Fix: Throw an error for empty array return in `generateStaticParams` with `output:export`" (#60831) Reverts vercel/next.js#57053 per this comment: https://github.com/vercel/next.js/pull/57053#issuecomment-1892747474 Instead of erroring, we should warn (and only in dev mode). That can be added in a future PR. Closes NEXT-2155
-
Jiachi Liu authored
When there’s a request input instance and init object present the same time, we should respect init as preferred Closes NEXT-2149
-
JJ Kasper authored
This ensures we add params for `unstable_cache` so it can be identified the same was as fetches instead of being unlabeled. Closes NEXT-2143
-
JJ Kasper authored
This ensures our in memory cache leveraged for the `fetch-cache` interface is reset per-request instead of using an arbitrary timeout so that we are always pulling the revalidate state from upstream correctly on new requests. Before: https://vercel-revalidate-3zi8wpexo-vtest314-ijjk-testing.vercel.app/ After: https://vercel-revalidate-70y5a8dbh-vtest314-ijjk-testing.vercel.app/ Closes: https://github.com/vercel/next.js/issues/60680 Closes NEXT-2144
-
Lee Robinson authored
-
Leah authored
### What? We were missing the alias (and config field) for custom image loaders. Closes PACK-2190 Fixes #60097
-
Steven authored
Closes #57872 Closes NEXT-2152
-
Delba de Oliveira authored
Co-authored-by:Stephanie Dietz <49788645+StephDietz@users.noreply.github.com>
-
Jiachi Liu authored
x-ref: https://github.com/vercel/next.js/pull/60820/files#r1457566492 Closes NEXT-2151
-
Steven authored
This PR fixes a few typos in the docs from https://github.com/vercel/next.js/pull/60739
-
Jiachi Liu authored
Drop the warning of build worker due to the common usage of custom webpack Closes NEXT-2148
-
Stephanie Dietz authored
I've updated the Next.js documentation to include a new page covering the best practices for implementing authentication. This doc covers the essential concepts of authentication in Next.js, focusing on practical strategies, effective session management, and robust authorization techniques. Key aspects of the update: - Core Authentication Concepts: Introduced foundational concepts of authentication, detailing their relevance and application in Next.js projects. - Diverse Authentication Strategies: Expanded on various authentication strategies, providing insights on when and how to use them effectively in different scenarios. - Implementing Authentication in Next.js: Guided through the implementation process, illustrating the use of middleware, server actions, and route handlers to create a secure and user-friendly authentication system. - Session Management Techniques: Discussed different approaches to session management, highlighting their pros and cons to aid in choosing the most suitable method for specific project needs. - Securing Application Access: Detailed how to protect routes and manage user permissions, ensuring that access is granted appropriately based on user roles and authentication status. - Next.js Compatible Solutions: Included references to several compatible authentication solutions for Next.js, facilitating easy integration and setup. --------- Co-authored-by:
Balázs Orbán <info@balazsorban.com> Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Balázs Orbán authored
### What? Add support for auto-importing `headers()` and `cookies()` ### Why? Improve the auto-import experience in IDEs like VScode ### How? Re-export the `next/headers` type references Closes NEXT-2146
-
vercel-release-bot authored
-
Jiachi Liu authored
### What Follow up for #59852 , now you can use `next/og` if your nextjs app is marked as ESM with `"type": "module"` in package.json. ### How It's a bug in external handling, we shouldn't ESM import error for local requests. Previously you'll see the below error but the og import shouldn't be errored as it's not external package ``` Module not found: ESM packages (/.../app/opengraph-image.js) need to be imported. Use 'import' to reference the package instead https://nextjs.org/docs/messages/import-esm-externals ``` Closes NEXT-2147
-
Tim Neutkens authored
### What? Follow-up to #60579 and #60750. Checking `startsWith` is not enough because it hides the rest of the stack. Changed the test to check the snapshot for Turbopack and webpack. Fixes a bug where the stack lines showed `http (NaN:NaN)` as the source lines. Added support for source lines that don't have a open in editor. <!-- 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-2128
-
Tim Neutkens authored
## What? While looking at some tests that use this helper I noticed we have the helper duplicated currently. This ensures the session uses the same helper. <!-- 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-2127
-
Willi#m ⬣ authored
### Fixed a Test Case - Tests fixed: `packages/next/src/build/normalize-catchall-routes.test.ts`, the function call `normalizeCatchAllRoutes(appPaths)` was removed by accident in this [merged commit ](https://github.com/vercel/next.js/commit/efebba80a7ca06b0fdcd619563f13945eb22508a#diff-e3c0d3c6e15d8b035a3252a1ada2b04d5dd33010885fed8f6d689f75aa80bff5) rendering the test case pointless REF NEXT-1984
-
Dima Voytenko authored
The original dev server implementation records globals in the server constructor and thus overwrites the values initialized in the instrumentation hook. This is a major delta from the `next start` where the instrumentation values are preserved. Fixes: https://github.com/vercel/next.js/issues/47596 Fixes: https://github.com/vercel/next.js/issues/53407
-
Shu Ding authored
This PR fixes the issue where an inline Server Action gets exported. As this isn't the designed use case for inline Server Actions (they're supposed to be defined and used inside another closure, such as components), we are not handling the export cases currently: ```ts export async function action() { "use server" ... } <form action={action}/> ``` ...which gets compiled into: ```ts export async function action() {} // No-op function <form action={...actionReference...}/> ``` Note that everything works inside this module until you `import` that action and use it in another module. To tackle that, this PR changes how that works as described in `server/27/output.js`. Closes NEXT-2140
-
- 17 Jan, 2024 13 commits
-
-
Steven authored
This PR renames `unstable_getImgProps` to `getImageProps()` (originally introduced in PR #51205). Most feedback [after announcing](https://twitter.com/leeerob/status/1674250190432116736) looks positive so it seems like we can safely stabilize this API now. Its unlikely to change. I also added documentation with example usage. Closes NEXT-2120 Fixes https://github.com/vercel/next.js/issues/56009
-
vercel-release-bot authored
-
Lee Robinson authored
This PR stabilizes the previously introduced experimental config options for providing a custom cache handler (for both ISR as well as the Data Cache) and for disabling or configuring the in-memory cache size. The example usage would be as follows: ```js // next.config.js module.exports = { cacheHandler: require.resolve('./cache-handler.js'), cacheMaxMemorySize: 0 // disable default in-memory caching } ``` This PR also updates the documentation to better reflect how to use the custom cache handler when self-hosting. Further information will be added in a following PR that also includes a full example of a custom cache handler that implements `revalidateTag` as well as passing in custom cache tags. The API reference docs have been updated here, as well as a version history added. I also noticed that we currently have two duplicated versions of the ISR docs in the Pages Router docs: both for rendering and for data fetching. Data Fetching is the correct location for this page. There were no other references to the rendering version in the docs, so that must have been an accident. I'll need to a get a redirect going for that regardless. Tests have been updated for `cacheHandler` and I added a new test for `cacheMaxMemorySize`. --------- Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
JJ Kasper authored
This ensures we properly handle serving public files when routing via a locale domain and adds regression tests for this case. Closes: https://github.com/vercel/next.js/issues/54765 Closes: https://github.com/vercel/next.js/pull/59773 Closes: https://github.com/vercel/next.js/pull/55137 Closes NEXT-2123
-
vercel-release-bot authored
-
Tobias Koppers authored
### What? When webpack loaders are applied on a page file and it's renamed with the `as` key, layout segment key no longer matches. This fixes that ### Why? ### How? Closes NEXT- Fixes # --> Closes PACK-2251
-
JJ Kasper authored
This ensures we don't allow a following exit condition to override a previous as async work is done before the `process.exit` actually occurs so a follow-up one could override the first giving a false negative. Closes NEXT-1911
-
vercel-release-bot authored
-
Tobias Koppers authored
### What? apply page transforms only on pages as intended ### Why? Before they were applied on all files Closes PACK-2250
-
Tim Neutkens authored
## What? Skip postcss config resolving in node_modules for Turbopack. This matches current Next.js on webpack closer as that only resolves the postcss config from the project root. The additional feature Turbopack has is that it can find a postcss config relative to the css being compiled. This is useful for e.g. reducing the amount of overhead certain postcss plugins that only have to run against a single file take (i.e. Tailwindcss). Depends on github.com/vercel/turbo/pull/7012 landing first. <!-- 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-2109 --------- Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com>
-
vercel-release-bot authored
-
Wyatt Johnson authored
Reapply "feat(app-router): introduce `experimental.missingSuspenseWithCSRBailout` flag" (#60508) (#60751) This reapplies the `experimental.missingSuspenseWithCSRBailout` option to bail out during build if there was a missing suspense boundary when using something that bails out to client side rendering (like `useSearchParams()`). See #57642 Closes [NEXT-1770](https://linear.app/vercel/issue/NEXT-1770)
-
vercel-release-bot authored
-