forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] canary from vercel:canary #122
Open
pull
wants to merge
10,000
commits into
majacQ:canary
Choose a base branch
from
vercel:canary
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atomist
bot
added
auto-branch-delete:on-close
Delete branch when pull request gets closed
auto-merge-method:merge
Auto-merge with merge commit
auto-merge:on-bpr-success
Auto-merge on passed branch protection rule
labels
Jun 9, 2021
pull
bot
added
merge-conflict
Resolve conflicts manually
and removed
auto-branch-delete:on-close
Delete branch when pull request gets closed
auto-merge-method:merge
Auto-merge with merge commit
auto-merge:on-bpr-success
Auto-merge on passed branch protection rule
labels
Jun 9, 2021
ijjk
force-pushed
the
canary
branch
5 times, most recently
from
October 25, 2022 16:15
df8579c
to
47e5ebe
Compare
ijjk
force-pushed
the
canary
branch
3 times, most recently
from
December 2, 2022 05:49
e078ebe
to
6b863fe
Compare
Follow up from #69695.
…ment (#69691) While investigating #65614 I found that in Next.js with webpack we mark this dependency as external but in Turbopack we didn't do that yet, causing it to be bundled and then fail at runtime because the path didn't match exactly. This PR ensures it's marked as external. Didn't add an additional test as we still have some Turbopack build test failures related to opengraph images so potentially this change also fixes those 💯 Fixes PACK-3058 Fixes #65614 <!-- 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 # -->
Similar to #68969, skips a few more tests that are checking features that we don't have to report on. <!-- 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 # -->
### What? Pass `resourceQuery` to loaders correctly. ### Why? To be consistent with webpack ### How? Closes #69502 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
## What? Implements `--experimental-app-only` for Turbopack build. <!-- 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 # -->
This re-adds internal env variables to allow providing page paths directly for debugging purposes. This is NOT a public API and should not be leveraged outside of internal Next.js debugging. x-ref: #67134 x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1726519130567199)
### Why? Since `URL.canParse` is incompatible with older browsers like Safari 16, we added `canParseUrl` util at #70215. x-ref: https://caniuse.com/?search=URL.canParse To improve maintenance, we decided to add polyfill for `URL.canParse`. x-ref: [slack thread](https://vercel.slack.com/archives/C07BVA6HM17/p1726664071636899?thread_ts=1726620161.450109&cid=C07BVA6HM17) Closes NDX-302 --------- Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Remove the dependency `graceful-fs` and types. I have looked at the project and it is only used in one file, inside this file only `fs` is imported but not the functionality provided by the library, finally it uses the native one through `graceful-fs`, I have simplified the logic and removed the unnecessary library. The retry functionality is implemented in the file and is not used from the dependency Co-authored-by: torresgol10.it <torresgol10.itd@gmail.com> Co-authored-by: JJ Kasper <jj@jjsweb.site>
Pathfinder is only needed if [the `allsorts` `outline` feature](https://docs.rs/allsorts/latest/allsorts/#cargo-features) is enabled, but it looks like we don't actually use the `outline` feature? This should avoid breakages for us whenever the nightly rust simd APIs change.
### Why? As the file paths to the build outputs of `@next/polyfill-module` & `@next/polyfill-nomodule` may not be intuitive without context, added comments that describes it.
### What? The previous approach was not completely correct and had a race condition when data was propagated by the edge was being balanced. This caused aggregated data to be incorrect. This caused some issues to stick around while they shouldn't do that. ### How? Now it locks both node at the same time to make sure to balance them in a single lockstep.
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
### What? Adds Nitrogen AIO custom image loader to docs. ### Why? Help folks find Nitrogen AIO as an option for Image @leerob --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
When calling `redirect` in a server action, the action handler will invoke a worker to fetch the RSC payload from the URL being redirected to, and will return it in the action request. This allows the redirect to be handled in a single request rather than requiring a second request to fetch the RSC payload on the URL being redirected to. As part of this special redirection handling, no action result is returned, so the action promise is resolved with `undefined`. As a result of this behavior, if your server action redirects to a page that has the same form that was just submitted, and you're leveraging `useActionState`, the updated state value will be undefined rather than being reset to the initial state. **More generally, redirect errors are handled by the client currently by simply resolving the promise with undefined, which isn't the correct behavior.** This PR will reject the server action promise with a redirect error, so that it'll be caught by our `RedirectBoundary`. Since React will remount the tree as part of the error boundary recovery, this effectively resets the form to it's initial state. If the action is rejected in a global `startTransition`, then it'll be handled by a global `error` handler, which will perform the redirect. And if it occurs outside of a transition, the redirect will be handled by a `unhandledrejection` handler. Because we're not able to apply the flight data as-is in the server action reducer (and instead defer to the navigation action), we seed the prefetch cache for the target page with the flight data from the action result so that we do not need to make another server roundtrip. We apply the same static/dynamic cache staleTime heuristics for these cache entries. Fixes #68549 Closes NDX-229
This whole test suite was disabled but only 2 tests rely on runtime logs, so this refactors the test to remove the runtime log dependency in favor of returning the output from the action and reading from the DOM.
This removes an inaccurate check that doesn't set a revalidate value if revalidate is `undefined` which can be the case for SSR app route pages. Also adds a regression test to ensure this doesn't break again. Fixes: #70213
This auto-generated PR updates the development integration test manifest used when testing Turbopack.
### What? This fixes file path encoding differences between build and serve. Currently, file paths that get encoded via `encodeURIPath` (which uses `encodeURIComponent`): https://github.com/vercel/next.js/blob/c3475da0686eecbf9acc9b004e579a8e67288d70/packages/next/src/server/app-render/create-component-styles-and-scripts.tsx#L59-L61 But when matching files to serve, we use `encodeURI`: https://github.com/vercel/next.js/blob/c3475da0686eecbf9acc9b004e579a8e67288d70/packages/next/src/server/lib/router-utils/filesystem.ts#L191 This means that any file which contains reserved characters according to [RFC2396](https://datatracker.ietf.org/doc/html/rfc2396) will not match correctly. ``` reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," ``` Closes PACK-3266
This is a pure refactoring in preparation for introducing an `app_route_loader_tree` in a future PR. The `app_page_loader_tree` collects information from the app directory for app _page_ entries, whereas the upcoming `app_route_loader_tree` will collect information from the app directory tailored to app _route_ entries.
This is a pure refactoring in preparation for introducing an `app_route_loader_tree` in a future PR. It enables reusing common logic for injecting imported modules from the app directory into both page and route entries.
This is a pure refactoring. Not every reserved file in the app directory represents a component module. Currently, `route` is the only exception, but a future PR will introduce another one.
Fixes #70216 ### What? The `redirect` function from `next/navigation` does not honor the redirect type when used in server actions. When setting `type` to `replace`, the server action pushes to history instead of replacing the route. This stems from #54458 ### Why? The server action should honor the redirect type. ### How? By setting `x-action-redirect` header to `<url>;<redirectType>`, we extract the type of redirect to be performed on the client. This is handled in a way that if the type is absent, we fallback to `push`. Demo: https://github.com/user-attachments/assets/3c84c6e3-2b08-4df3-89b2-5f9d290cc5ff Observe that once the form is submitted and the action replaced the URL with `/`, we didn't go back to the `/child` route. --------- Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
…69992) Without these APIs, the only way to construct a `ResolvedVc` was: ``` Vc::cell(my_value).to_resolved().await? ``` However, we know when calling `Vc::cell` that the `Vc` must be resolved (since we just assigned it to a cell), so we can shortcut that and provide a better API: ``` ResolvedVc::cell(my_value) ``` For `#[turbo_tasks::value]`s, there's an equivalent `.resolved_cell` method.
<!-- 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 git ### 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 # --> docs: fix the signature of CacheHandler#revalidateTag My tests shows that the `tags` could be an array. I have traced it back to the code: https://github.com/vercel/next.js/blob/af9b229074e39617bdd32d390fdc8f6a36d7bcde/packages/next/src/server/lib/incremental-cache/index.ts#L246-L248 --------- Co-authored-by: malewis5 <matthew.a.lewis7@gmail.com> Co-authored-by: JJ Kasper <jj@jjsweb.site>
This collects the few different isThenable and isPromise definitions into one shared function
This PR updates the with-three-js example to use the App Router. Here are the changes that have been made: - Renamed the pages folder to the app folder. - Updated the routing for `/`, `/birds` & `/boxes` files to align with the App Router. - Added the `layout.tsx` & `tsconfig.json` file as part of the App Router. - Updated the package.json file. The following actions were performed as part of this PR: - Ran `pnpm prettier-check `with no issues found. - Executed the `pnpm check-examples` script. CC: @samcx --------- Co-authored-by: samcx <sam@vercel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )