-
Notifications
You must be signed in to change notification settings - Fork 28k
Comparing changes
Open a pull request
base repository: vercel/next.js
base: v14.1.3
head repository: vercel/next.js
compare: f1fc35730c7aeb0ff39513f91ab2b9ed876393fe
- 13 commits
- 159 files changed
- 8 contributors
Commits on Mar 18, 2024
-
fix: x-forwarded-port header is 'undefined' when no port in url (#60484)
### What? See this issue - #61133 following this change #57815 `x-forwarded-port` header value is 'undefined' if the URL has no port ### Why? x-forwarded-port 'undefined' makes other http-proxy throw 405 error for the invalid header value ### How? Give default 80 port if the URL has no port --------- Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
Configuration menu - View commit details
-
Copy full SHA for 5b16b59 - Browse repository at this point
Copy the full SHA 5b16b59View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e99811 - Browse repository at this point
Copy the full SHA 9e99811View commit details -
fix: bump
@vercel/nft@0.26.3
(#61538)- Release notes https://github.com/vercel/nft/releases/tag/0.26.3 - Fixes #59346 - Related to lovell/sharp#3967 Closes NEXT-2334
Configuration menu - View commit details
-
Copy full SHA for f904dcd - Browse repository at this point
Copy the full SHA f904dcdView commit details -
feat: add
deploymentId
config (#63198)This PR stabilizes an experimental feature that was added in a previous PR #50470 It allows the user to set `deploymentId` in `next.config.js`, which is a unique identifier for a deployment that will be included in each request's query string or header. This PR is easier to review with whitespace hidden: https://github.com/vercel/next.js/pull/63198/files?w=1 Closes NEXT-2789
Configuration menu - View commit details
-
Copy full SHA for a3707f5 - Browse repository at this point
Copy the full SHA a3707f5View commit details -
Fix metadata url cases should not append with trailing slash (#63050)
### What Exclude the cases like external urls and relative urls with query from appending trailing slash when it's needed. The process is: - If it's a uncertain string path (relative url, could start with `'./'` or `/`), convert to relative that starts with `/`; - then we covert the url (string or URL) to string url - We do the check if we need to append the trailing slash ### Why In #62109 we added functionality that can only append trailing slash when we appended trailing slash to some metadata url like `canonical` url and open graph url when the config is enabled. For urls with queries, the trailing slash can also be omitted. For the external urls (different origin comparing to `metadataBase`) we don't need to append trailing slash as they're not the same web app. x-ref: [slack thread](https://vercel.slack.com/archives/C0676QZBWKS/p1709845946033929) Closes NEXT-2762 Closes NEXT-2753
Configuration menu - View commit details
-
Copy full SHA for 531cdb5 - Browse repository at this point
Copy the full SHA 531cdb5View commit details -
Ensure PromiseLikeOfReactNode is not included in .d.ts files (#63185)
Fixes the compile error on all test runs currently: https://github.com/vercel/next.js/actions/runs/8243077904/job/22543375810?pr=63167#step:27:345 The root cause is that `.d.ts` files automatically include inferred return types automatically, in this case `tsc` included React class component `render()` return types in the `.d.ts` for e.g. error-boundary.tsx / redirect-boundary.tsx. This is a problem because yesterday that return type was changed: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/bf659aefa780a8b61b1636bd0296e0723c96d780#diff-1d64e275d9755825ba[…]520436dbd8e1f1fd9fc66a9 and that change also removes one of the previous types that the `.d.ts` in Next.js automatically included. This PR changes the `render()` return type to be explicit instead of inferred, this makes sure that the `.d.ts` file includes only `: React.ReactNode` instead of the many types of return values allowed. The reason I went with the explicit type instead of e.g. upgrading `@types/react` is that upgrading the types would cause existing applications that use older versions of `@types/react` would break. The current change ensures it works in both cases. <!-- 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-2787
Configuration menu - View commit details
-
Copy full SHA for 21e11f1 - Browse repository at this point
Copy the full SHA 21e11f1View commit details -
ensure mpa navigations to the same URL work after restoring from bfca…
…che (#63155) ### What When triggering an MPA navigation (also commonly referred to as a "hard navigation"), and then restoring the previous page via the browser's bfcache, subsequent requests to the same link wouldn't navigate until reloading the page or performing a different navigation. ### Why MPA navigations in app router are handled in a fairly unconventional way: the router state is updated with an indication that an external URL was clicked, and once the router sees the pending navigation, it kicks off a `location.replace` or `location.push` with the specified URL **in render**. The router then suspends indefinitely to prevent committing the render. However, the router will only make the `replace`/`push` request if there's not already a pending navigation to that same URL. The pending check is needed to avoid continuously calling `push`/`replace` when unrelated router state changes occur (for example, if I hover over a link and trigger a prefetch action and the router re-renders, it shouldn't make another `location.push` call to the same URL that's pending) However, the source of the bug is that the variable that holds this pending state is also restored by the browser's cache, since it takes a snapshot prior to exiting the page. This means that when clicking the browser back button, `pendingMpaPath` would still be set to the URL we just came from. When clicking the link again, it would see that the requested URL is the same as the pending URL, and not perform any history actions. ### How This clears the pending value when the router is restored from bfcache. <!-- 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 # --> [slack x-ref](https://vercel.slack.com/archives/C0676QZBWKS/p1710169967246929) Closes NEXT-2781 Closes NEXT-2776
Configuration menu - View commit details
-
Copy full SHA for 944a84c - Browse repository at this point
Copy the full SHA 944a84cView commit details -
fix revalidation issue with route handlers (#63213)
### What When a route handler uses an API that opts it into dynamic rendering (such as `no-store` on a fetch), and also specifies a `revalidate` time, the `revalidate` time is ignored and route is treated as fully static. ### Why `revalidate: 0` and `revalidate: false` have different semantic meanings: `false` essentially means cache forever, whereas `0` means it's dynamic. Since `0` is also falsey, the code we have to fallback with a default `revalidate` value for route handlers is incorrectly not marking the route as dynamic, and as a result, caching the route without an expiration time. ### How This updates the fallback handling for app routes respect a revalidation value of `0`, so that the page can properly be marked dynamic. ### Test Explanation This adds 2 new routes handlers: both have a revalidation time specified & use `no-store` on a fetch, but only one of them specifies `export const dynamic = 'force-static'`. The one that doesn't specify `force-static` is correctly omitted from the prerender manifest. The one that is `force-static` is correctly in the prerender manifest with the right expiration time. An additional test case was added to verify that this data refreshes after the specified interval. Closes NEXT-2764
Configuration menu - View commit details
-
Copy full SHA for 81114f3 - Browse repository at this point
Copy the full SHA 81114f3View commit details
Commits on Mar 19, 2024
-
fix broken create-next-app tests (#63019)
#62980 migrated `examples/basic-css` to use app router. A handful of our create-next-app tests use this example when asserting the correct project files are created, so we were asserting on a pages file existing rather than an app dir page. This PR updates those 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 # --> Closes NEXT-2754
Configuration menu - View commit details
-
Copy full SHA for 4804982 - Browse repository at this point
Copy the full SHA 4804982View commit details -
test: switch order of tests to avoid flakniess (#63482)
x-ref: https://github.com/vercel/next.js/actions/runs/8344655954/job/22838765632?pr=63476 We saw the playwright execution was broken while accessing url in turbopack tests. Switching the order to check the content first solve the problem Closes NEXT-2867
Configuration menu - View commit details
-
Copy full SHA for 3aae252 - Browse repository at this point
Copy the full SHA 3aae252View commit details -
Configuration menu - View commit details
-
Copy full SHA for c227315 - Browse repository at this point
Copy the full SHA c227315View commit details -
(backport) Update React from 60a927d04 to 4b84f1161 (#63476)
Updates React from 60a927d04 to 4b84f1161. ### React upstream changes - facebook/react#28585 Closes NEXT-2865
Configuration menu - View commit details
-
Copy full SHA for e6a117b - Browse repository at this point
Copy the full SHA e6a117bView commit details
Commits on Mar 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f1fc357 - Browse repository at this point
Copy the full SHA f1fc357View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v14.1.3...f1fc35730c7aeb0ff39513f91ab2b9ed876393fe