- 02 Apr, 2023 8 commits
-
-
JJ Kasper authored
-
Tim Neutkens authored
### What / why? Currently there is a bug because the `subTreeData` can only be applied once, however, we reuse the same response when a url was prefetched. During the first render of the response we apply the cacheNodes and then these should be reused for subsequent navigations. There's currently a bug because `fillLazyItemsTillLeafWithHead` creates `LAZY_INITIALIZED` cache nodes that don't copy the previous cache node `parallelRoutes` and `subTreeData` value, causing the cache nodes below where the `subTreeData` is applied to be deleted from the cache, even when they're not affected by the navigation. ### How? This PR adds copying of the cache node when it exists already, I've added a marker for `wasPrefetched` to trigger that behavior but in talking to @feedthejim about this it seems we can swap to this behavior always when applying the server response, that needs to be discussed further though, this is temporary implementation with the fix for routes that were prefetched. Fixes NEXT-402 <!-- 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 or adding/fixing 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:
JJ Kasper <jj@jjsweb.site>
-
nivak-monarch authored
-
vinay 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 or adding/fixing 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 # --> Fix Typo In Unit Testing
-
Parbez 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 or adding/fixing 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 Closes NEXT- Fixes # --> ### What? This pr removes `ParamCheck` type for `page` or `layout` files ### Why? typescript throws error for unused vars with `"noUnusedLocals": true` config ### How? Check for `route` before defining the route
-
Shu Ding authored
Since both `exportPage` and `isPageStatic` methods in the static optimization worker involve loading the actual page component, it's better to assign the same page to the same worker for these 2 tasks to avoid unnecessary memory allocation. Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
JJ Kasper authored
This ensures we properly honor the `export const fetchCache` config and also ensures we properly bypass fetch-cache when an On-Demand Revalidation is occurring. The `export const dynamic` handling is not changed here as that was behaving correctly and should not influence fetch cache handling only whether a page is prerendered fully or treated as SSR. Fixes: https://github.com/vercel/next.js/issues/47273 x-ref: [slack thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1679078572123979)
-
Jiachi Liu authored
Fix the module resolving error found during development, because now few app route code is bundled into RSC server layer, it can't resolve opentelementry properly and will throw the error blow due to the check of `require('@opentelemetry/api')` to see if it's installed. ``` Module not found: Can't resolve '@opentelemetry/api' ``` Thus I alias it to default `next/dist/compiled/@opentelemetry/api` when it doesn't have external module ---------
-
- 01 Apr, 2023 18 commits
-
-
Jiachi Liu authored
* use `check` to wait for css change * remove unused swr deps and update them to latest * remove swr esm test in `app-dir/app/` since it's already covered in `app-dir/app-external/` ---------
-
Jiachi Liu authored
For backward compatibility, we only handle `favicon.ico` file to generate `/favicon.ico` route and link tag. If you want to use other extension such as `png`, use `icon(\d)?.[ext]`
-
JJ Kasper authored
Avoids accidentally running the CLI install twice at the same time due to concurrency by pre-installing it before starting tests. x-ref: https://github.com/vercel/next.js/actions/runs/4581102424/jobs/8090565967 x-ref: https://github.com/vercel/next.js/blob/canary/test/lib/next-modes/next-deploy.ts#L27
-
Vishal Jagtap authored
Updated the old react doc link
-
Vishal Jagtap authored
Updated the react error boundary doc link. old one is depricated <!-- 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 or adding/fixing 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:
JJ Kasper <jj@jjsweb.site>
-
Sukka authored
Fixes #46993. The issue is introduced in #46705 by @ijjk Next.js uses `jest-worker` for multiprocessing. `jest-worker` supports both `child_process` and `worker_threads` modes. Next.js use `child_process` mode by default, but can also switch to using `worker_threads` mode with an experimental flag `config.experimental.workerThreads`. In #46705, @ijjk applies a fix that works for the `child_process` mode, which breaks the `worker_threads` mode (`jest-worker`'s `NodeThreadWorker` interface doesn't have the private property `_child`), causing static HTML export to fail with the following error (#46993): ``` > Build error occurred TypeError: Cannot read properties of undefined (reading 'on') at createWorker (/Users/[redacted]/node_modules/next/dist/lib/worker.js:32:31) at new Worker (/Users/[redacted]/node_modules/next/dist/lib/worker.js:42:9) at /Users/[redacted]/node_modules/next/dist/build/index.js:629:35 at async Span.traceAsyncFn (/Users/[redacted]/node_modules/next/dist/trace/trace.js:79:20) at async Object.build [as default] (/Users/[redacted]/node_modules/next/dist/build/index.js:74:29) ``` The PR fixes that. -
Justin Ridgewell authored
Pending https://github.com/vercel/turbo/pull/4392 landing in Turbopack (and https://github.com/vercel/next.js/pull/47476 landing here), this removes `BodyError` and switches to `SharedError`. That should allow us to preserve the source chain of errors for when we finally display it to the dev, aiding debugging.
-
Tobias Koppers authored
### What? see also https://github.com/vercel/turbo/pull/4415 We need a full process polyfill to fix some edge cases Also disables SourceMap for edge chunks, since they are not used ### Why? Some packages do weird things, e. g. ``` var isBrowser = process.title === 'browser' ```
-
JJ Kasper authored
-
-
Maia Teegarden 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 or adding/fixing 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 # -->
-
JJ Kasper authored
x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1680313038895799?thread_ts=1680303743.811339&cid=C04DUD7EB1B)
-
OJ Kwon 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 or adding/fixing 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 WEB-766. This PR enables a new job for running tests, against turbopack. Since we have observed some flakiness across turbopack test execution, it starts from absolute minimum set of tests to not block any CI due to unexpected failure. Ran manual workflow roughly ~50 times and looks like these set of tests are fine to make it as blocking check for the PR. In the future, depends on the stability we'll increase number of test gradually.
-
Shu Ding authored
Check the test case for more details.
-
JJ Kasper authored
This ensures we don't normalize locales in the URL with the skipMiddlewareUrlNormalize flag enabled so that casing redirects can be applied correctly for locales.
-
Justin Ridgewell authored
Turbopack starts up the router process with all ENV values, but the edge function definition didn't list any `env` keys for the function invocation. So, middleware couldn't access any ENV values. Turbopack doesn't currently have a way to determine what ENV keys are actually used by the source program, so I'm just passing everything defined. I'm not sure if that's an issue during dev (I could see it being one for the build process, but that doesn't matter for this case). Fixes #47766 Fixes WEB-831 Fixes WEB-834
-
- 31 Mar, 2023 14 commits
-
-
Tobias Koppers authored
### What? Better auto format ### Why? imports are inconsistently grouped and ordered ### How? configure cargo fmt
-
JJ Kasper authored
-
Steven authored
fix NEXT-928 ([link](https://linear.app/vercel/issue/NEXT-928))
-
Javi Velasco authored
-
JJ Kasper authored
This ensures we check if a path is `appRouter` during prefetching so that we can trigger hard navigations quicker when routing from pages -> app. An additional config is also exposed to allow configuring the potential false positive rate for the client filter. x-ref: [slack thread](https://vercel.slack.com/archives/C017QMYC5FB/p1680225393243459)
-
Justin Ridgewell authored
Paired with https://github.com/vercel/turbo/pull/4329, this implements streaming responses for App and API renders. This is accomplished by sending an initial `headers` message (carrying the status code and headers list), N `body-chunk` messages of bytes, and a final `body-end` message to signal completion. Once sent to Turbopack, these chunk messages will be streamed out of the node rendering process directly into the HTTP server's response. Closes WEB-27 --------- Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Steven authored
Fixes an issue with newer app directory usage: ``` Failed to compile. ../../node_modules/next/dist/server/future/route-handlers/app-route-route-handler.d.ts:11:15 Type error: ',' expected. ``` ---------
-
Hofer Ivan 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 or adding/fixing 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 # -->
-
Shu Ding authored
Noticed this optimization when debugging something else - we restart this worker if it's not fresh, to make sure module instances are new created. This has some perf overhead and it happens right before running the task and it's blocking the request. This PR changes that to be after the old task, and the difference is noticeable on dev (~20ms). Before: <img width="1363" alt="CleanShot-2023-03-30-jTT9W48H@2x" src="https://user-images.githubusercontent.com/3676859/228965542-e0d6892f-3989-4da5-96a4-5fc8b4155041.png"> After: <img width="1363" alt="CleanShot-2023-03-30-PRrYQMg7@2x" src="https://user-images.githubusercontent.com/3676859/228965566-42e04f8d-0cc3-447c-adc8-3840b23b9fa5.png">
-
Jay authored
Updating the SST link to a Next.js tutorial: https://docs.sst.dev/start/nextjs
-
Leah authored
Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Jiachi Liu authored
Allow to use relative paths which starting with dot (e.g. `./[paths]`) for urls under `metadata.alternates`. This allow user to simplify setting `canonical` or other such like `languages` once in root layout with `metadataBase` and a simple relative path, then next.js will resolve it with current pathname of the page. For example ```js export const metadata = { metadataBase: new URL('https://mydomain.com'), alternates: { canonical: './' } } ``` Then: for page `/` it will generate `https://mydomain.com`; for page `/about` it will generate `https://mydomain.com/about` as your cononical url Closes NEXT-897 ### Minor changes - always remove trailing slash for `URL.href` -
Wyatt Johnson authored
## What This fix serves to address issues where multiple `Set-Cookie` headers were combined in some runtimes. ## Why This is because `set-cookie` behaves differently than other headers in some cases. Eg. when iterating on a `Headers` instance, multiple set-cookie headers are folded. To set them correctly, we need to split them. But it'd not be enough to naively split on the first occurrence, because `,` is a valid cookie value when for example it's used in `Expires` in a date string. So we use a method to correctly detect where to split the cookie. This should fix all runtimes. Note, the spec now has `Headers#getSetCookie` which should be preferred if it's present. https://github.com/whatwg/fetch/pull/1346. We are using the [`edge-runtime`](https://github.com/vercel/edge-runtime), so this should be fixed upstream and then reused in Next.js in the future. ## How Wherever we can, we reuse the `fromNodeHeaders` and `toNodeHeaders` methods that have the correct implementation. This should be preferred in the future in other parts of the codebase. We fixed some related TS issues as well. Fixes #46579, supersedes #40579 fix NEXT-735 ([link](https://linear.app/vercel/issue/NEXT-735)) --------- Co-authored-by:
Balázs Orbán <info@balazsorban.com>
-
JJ Kasper authored
-