- 01 Dec, 2023 5 commits
-
-
vercel-release-bot authored
-
Christian Vuerings authored
**Note**: this is a 1-to-1 copy of #48969 by @danieltott with all the merge conflicts fixed. ## Checklist * Fixes https://github.com/vercel/next.js/issues/48966 * Tests added to `test/production/app-dir/subresource-integrity/subresource-integrity.test.ts` ## Description Currently `renderToHTMLOrFlight` in app-render pulls out a nonce value from a `content-security-policy` header for use in generating script tags: https://github.com/vercel/next.js/blob/e7c9d3c051e6027cf187e0d70565417d6037e37c/packages/next/src/server/app-render/app-render.tsx#L1204 That misses the ability to use a [content-security-policy-report-only header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only). Many times this is a required step to enabling a CSP - by shipping a CSP with report-only and collecting reports before actually blocking resources. ## Changes * Added ability to check `content-security-policy-report-only` header in `renderToHTMLOrFlight()` * Added test to verify `nonce` is correctly applied when `content-security-policy-report-only` header exists Co-authored-by:
Dan Ott <dan@dtott.com> Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Michael Diodone authored
If a manual signal handler is registered, SIGINT and SIGTERM should not be handled by Next.js. This was already the case in the standalone server.js but was missing here, rendering the env flag useless. With this fix, the example given in https://nextjs.org/docs/pages/building-your-application/deploying#manual-graceful-shutdowns is working (again). Fixes #56810. Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Zack Tanner authored
When using `experimental.typedRoutes` in conjunction with `experimental.webpackBuildWorker`, type errors would be erroneously thrown during build. This is because the build workers are parallelized between multiple runtimes (edge, server, client), but the `typedRoutes` is unique to each `webpackBuild`. The state needs to shared between the different compile steps for each instance of the types plugin. This leverages plugin state to keep share the `typedRoutes` state amongst the different workers. Closes NEXT-1734 Fixes #58369
-
Vercel Release Bot authored
This auto-generated PR updates font data with latest available
-
- 30 Nov, 2023 14 commits
-
-
vercel-release-bot authored
-
Zack Tanner authored
Follow up to https://github.com/vercel/next.js/pull/59134
-
vercel-release-bot authored
-
Zack Tanner authored
Prevents publishing canaries if there are no changes Closes NEXT-1748
-
vercel-release-bot authored
-
Meril authored
Remove deprecated option passed to nextjs server when running in standalone mode. Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
JJ Kasper authored
This ensures we don't spam build logs with dynamic usage errors or similar unexpectedly as they can be caught by this worker process listener but shouldn't be logged. Closes NEXT-1763
-
Will Binns-Smith authored
This: - Sends an hmr sync event so that errors that occur after the initial hmr connection are sent to the client - Aligns on `path/to/file.js:line:column` format across error overlay implementations in the cli and on the web - Adapts "Module not found" errors from Turbopack to include Next.js-relevant formatting and documentation links to align with webpack Test Plan: Passes 3 tests that were previously failing Closes PACK-1974 --------- Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by:
Leah <github.leah@hrmny.sh> Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Jiachi Liu authored
-
Jiachi Liu authored
-
Leah authored
### Why? For some reason the retry action can be triggered if there's a PR from the canary branch of a fork. https://github.com/vercel/next.js/actions/runs/7040561852/attempts/3 Closes PACK-2062
-
Zack Tanner authored
### What? When using interception routes & rewrites, on first interception the router will properly handle the request. But when using the back button and attempting another interception, it won't work ### Why? Intercepting routes rely on the accuracy of `nextUrl` -- but when `ACTION_RESTORE` is dispatched (in the `popstate` event), `nextUrl` is restored from `url.pathname` rather than the flight router state. ### How? This uses the `extractPathFromFlightRouterState` util which will properly handle setting `nextUrl`. This util is also used when creating the initial router state. Closes NEXT-1747 Fixes #56072
-
Dylan700 authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Luke Schlangen authored
-
- 29 Nov, 2023 21 commits
-
-
vercel-release-bot authored
-
Delba de Oliveira authored
Closing: https://github.com/vercel/feedback/issues/47083 This example no longer exists in the Next.js repo.
-
vercel-release-bot authored
-
Zack Tanner authored
### What? When handling a server action, in the non-progressive enhanced case, React will attempt to parse the request body before verifying if a valid server action is received. This results in an "Error: Connection Closed" error being thrown, rather than ignoring the action and failing more gracefully ### Why? To support progressive enhancement with form actions, the `actionId` value is added as a hidden input in the form, so the action ID from the header shouldn't be verified until determining that we've reached the non-PE case. ([React ref](https://github.com/facebook/react/pull/26774)). However, in https://github.com/vercel/next.js/pull/49187, support was added for a URL encoded form (which is not currently used, as indicated on the PR). Despite it not being used for server actions, it's currently possible to trigger this codepath, ie by calling redirect in an action handler with a 307/308 status code with some data in the URL. This would result in a 500 error. ### How? React should not attempt to parse the URL encoded form data until after we've verified the server action header for the non-PE case. x-ref NEXT-1733 [Slack context](https://vercel.slack.com/archives/C03S8ED1DKM/p1700674895218399?thread_ts=1700060786.749079&cid=C03S8ED1DKM)
-
Zack Tanner authored
### What? A `redirect` that occurs during a fetch action will get a status code of 200, while the redirection logic is handled client-side. ### Why? In this scenario, the redirect is handled by the client router, so no `Location` is set on the action response. However for debugging / logging purposes, it'd be useful to still return the same status code used in other cases (see #58885) ### How? Rather than selectively setting the status to 303 in the non-fetch action case, this always applies it. Closes NEXT-1745
-
Zack Tanner authored
This copies over the E2E tests that were added to `vercel/vercel` in https://github.com/vercel/vercel/pull/10808 and https://github.com/vercel/vercel/pull/10823, with some minor adjustments to reflect the differences in cache behavior between start & deploy.
-
Tobias Koppers 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 # --> Closes PACK-2057
-
Jimmy Lai authored
We don't need the auto merging from kodiak since Github has one. <!-- 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-1753
-
vercel-release-bot authored
-
Leah authored
-
JJ Kasper authored
When jobs are cancelled we can end up with a bad `.git` tree so this updates to have a fresh checkout step to avoid this x-ref: https://github.com/vercel/next.js/actions/runs/7036193103/job/19148358339?pr=59076
-
JJ Kasper authored
If a build time fetch cache is present from a previous build we don't want to unexpectedly use it when flush to disk is set to false in a successive build as it can leverage stale data unexpectedly. x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1701266754905909) Closes NEXT-1750 Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Jimmy Lai authored
Disabling the auto merging behaviour from kodiak. You can queue stuff up by adding an automerge label though. <!-- 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-1751
-
Leah authored
-
Balázs Orbán authored
### What? Bumping the issue validator action [`nissuer`](https://github.com/balazsorban44/nissuer) ### Why? It introduces two new features: - Comments made by members of the Vercel organization are never hidden to avoid hiding useful information. Example: https://github.com/vercel/next.js/actions/runs/6780069984/job/18428144215 - A new option was added to do not allow `https://github.com/vercel/next.js.*` URLs as valid reproductions, as they are non-modified versions. We should require the reporter to go through the process of creating an isolated reproduction that we can clone and verify easily. ### How? See https://github.com/balazsorban44/nissuer/releases/tag/1.8.0
-
Zack Tanner authored
### What? Calling `redirect` or `permanentRedirect` with a route handler used by a server action will result in that POST request following the redirect. This could result in unexpected behavior, such as re-submitting an action (in the case where the redirected URL makes use of the same server action). ### Why? By spec, 307 and 308 status codes will attempt to reuse the original request method & body on the redirected URL. ### How? In all cases when calling a `redirect` handler inside of an action, we'll return a `303 See Other` response which is a typical status code when redirecting to a success / confirmation page as a result of a POST/PUT. The other option would be to use 301 / 302 status codes, but since we're already doing a 303 status code [here](https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/action-handler.ts#L603), this aligns the behavior for the route handler case. Closes NEXT-1733 See also: https://github.com/vercel/next.js/issues/51592#issuecomment-1810212676 [Slack x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1700060786749079)
-
Lee Robinson authored
Closes https://github.com/vercel/feedback/issues/47076.
-
Vercel Release Bot authored
This auto-generated PR updates font data with latest available
-
Zack Tanner authored
Cherry-picks #58708 without the dependency on https://github.com/vercel/next.js/pull/58779Co-authored-by:
Wyatt Johnson <633002+wyattjoh@users.noreply.github.com>
-
Tore Lervik authored
fixes: #58909 x-ref: #58321, #56472, #56231 Removed the Math.round of age since it can cause stale fetch data to be considered not stale if the age rounds downwards. (5.49 is rounded to 5) Note: This most likely also fixes some bugs with revalidateTag/revalidatePath. Tested some tag/path issues that got fixed with this change. I think this is because revalidatetag/path sets [data.revalidatedAt = Date.now()](https://github.com/vercel/next.js/blob/canary/packages/next/src/server/lib/incremental-cache/file-system-cache.ts#L120) for file-system-cache. And with the current code that value would continue to be "not stale" for up to 0.499 ms. Co-authored-by:
JJ Kasper <jj@jjsweb.site> Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Jiachi Liu authored
Providing better feedback loop for next bindary. Some users with old node.js version are seeing `performance` is not defined in #57385, we should check the version first. For compilation, `performace.mark` will also be compiled after those imports since they're hoisted as ESM. This PR moves performance profiling after the `--help` and `--version` processures and node.js version check. So users can see the "upgrade node.js" hint if the node.js version is too old instead of "performance is not defined"
-