- 06 Apr, 2023 25 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
-
Wyatt Johnson authored
On some runtimes, `Reflect` is not available. This creates a new "naive" implementation.
-
JJ Kasper authored
x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1680804950611789?thread_ts=1680791613.468109&cid=C04DUD7EB1B) Reverts vercel/next.js#47759 fix NEXT-926
-
Nabeel Sulieman authored
### What? Change the caching logic for fetch-cache to only cache successful responses. ### Why? Currently fetch-cache will cache any response, without checking the http status code. But situations like 500 and 304 and others should not be cached, because we want to re-fetch from the origin. ### How? Add an extra check before deciding to call `incrementalCache.set()` --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Tobias Koppers authored
### What? Add a error message when using "use server". * https://github.com/vercel/turbo/pull/4477 <!-- Tobias Koppers - add ServerDirective transform which reports unsupported --> ### Why? Turbopack doesn't support "use server" yet. ### Other turbopack updates * https://github.com/vercel/turbo/pull/4464 <!-- Justin Ridgewell - Better dotenv error messages --> * https://github.com/vercel/turbo/pull/4485 <!-- Justin Ridgewell - Add ServerAddr::hostname method -->
-
Steven authored
fix NEXT-929
-
JJ Kasper authored
This ensures the prefix for route params is stripped when pulled from the revalidate headers. Also updates tests accordingly. x-ref: https://github.com/vercel/next.js/pull/47930
-
Jimmy Lai authored
parallel routes: return a 404 when a parallel route does not have a default page/do not match (#47872) <!-- 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 NEXT-918 --------- Co-authored-by:
Wyatt Johnson <accounts+github@wyattjoh.ca>
-
Tobias Koppers authored
### What? More power for the CI to build the native binary for testing ### Why? Waiting 1 hour for the tests is just too slow ### How? More Cores
-
Jimmy Lai authored
The first implementation had limitation wrt to static routes so this is a "simpler" approach to making interception work. This also fixes a few bugs. In this PR: - changed the computation of the referrer route to now live on the client state, since it's the only place where you can accurately keep track of that. One router state was not sufficient, we needed a delta of two states to guess which route had changed when having parallel routes in the tree. - uses rewrites as the basis for interception now instead of route handlers, this means that we have to do some sketchy logic to make the rules work since they only handle regexes whereas we have `path/like/[this]` - dev server now reloads rewrites as well when needed <!-- 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 # -->
-
Tobias Koppers authored
### What Docs changes need to be linted for language
-
JJ Kasper authored
-
Shu Ding authored
It's a common word we use in our docs, e.g.: https://github.com/vercel/next.js/blob/e35710f71f8e0f2844add1a97513a65a54a6f2a3/docs/advanced-features/open-telemetry.md#L105
-
Jan Kaifer authored
- remove vscode folder from example - recommend `@poentelemetry/api` over `@vercel/otel` <!-- 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 NEXT-959
-
Jan Kaifer authored
- Removed duplicate information - Add links into official docs to explain `http.*` attributes - Properly explain what `next.page` means. fix NEXT-945 --------- Co-authored-by:Lee Robinson <me@leerob.io>
-
Tobias Koppers authored
### What? Fix missing `,` in loader tree code. also adds `unsupported` as category of implicit metadata issue ### Why? The loader tree to JS generated invalid code when there there where two non-page files in a directory. fixes WEB-861
-
Jiachi Liu authored
### What This issue is introduced in #47688, we need to do the same work for rendering single component which collecting the assets and then render with root layout + root not found Fix #47970 Related #47862 (partially fix the css issue but not link issue) ### How This PR encapsulates the preload and stylesheets assets collection and rendering process, and move them into a helper, and share between the component rendering and the root not found rendering
-
Tobias Koppers authored
see #47994
-
JJ Kasper authored
-
JJ Kasper authored
Looks like this is failing to build the native dev binary Reverts vercel/next.js#47994
-
Tobias Koppers authored
* https://github.com/vercel/turbo/pull/4480 <!-- Tobias Koppers - fix CSS HMR for pages --> * https://github.com/vercel/turbo/pull/4473 <!-- Tobias Koppers - use error pretty printer for code gen errors --> * https://github.com/vercel/turbo/pull/4476 <!-- Tobias Koppers - handle module evaluation errors in the runtime correctly --> * https://github.com/vercel/turbo/pull/4471 <!-- Justin Ridgewell - Add ServerAddr ip/port methods --> * https://github.com/vercel/turbo/pull/4475 <!-- Tobias Koppers - ignore external chunks --> * https://github.com/vercel/turbo/pull/4474 <!-- Tobias Koppers - avoid panic in EsmModuleItem --> * https://github.com/vercel/turbo/pull/4443 <!-- OJ Kwon - test(turbopack): add one more test for flaky subsets --> * https://github.com/vercel/turbo/pull/4424 <!-- OJ Kwon - ci(workflow): apply latest turbopack when build next-swc -->
-
Shu Uesugi authored
### Fixing a bug Follow-up to https://github.com/vercel/next.js/pull/47761: It seems that `handleHardNavigation` needs to take `as` instead of `url`, in order to be consistent with the rest of the code. Without this, it seems to cause an issue if you are using a link that uses legacy `as` prop which matches the bloom filter (and therefore `__appRouter` is set as `true`). However, I spent couple hours trying to come up with a failing test case without this change but unfortunately couldn't come up with one. x-ref: [Slack Thread](https://vercel.slack.com/archives/C017QMYC5FB/p1680668865572729?thread_ts=1680225393.243459&cid=C017QMYC5FB) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Shu Ding authored
This pull request extends the type checking functionality of the `typedRoutes` feature, which is currently available in the `<Link href={Route}>` component, to the following `router` APIs: `router.push()`, `router.prefetch()`, and `router.replace()`. The implementation leverages the existing work done for the `<Link>` component, allowing for a straightforward integration of type checking into the aforementioned `router` APIs. fix NEXT-501 -
Leah authored
-
- 05 Apr, 2023 15 commits
-
-
JJ Kasper authored
-
Jiachi Liu authored
### What When using dynamic metadata image rouets (such as `opengraph-image.js`) under group routes, the generated urls were still normalized. In this case it might have conflicts with those ones not under group routes. For instance `app/(post)/opengraph-image.js` could have same url with `/app/opengraph-image.js`. In reality we want them to be different route, unlike layout or pages. ### How So when we found `()` or `@` signs from the metadata image urls, we'll generate a unqiue suffix (`-\d{6}`) and append to the generated url. So they can be isolated from the ones are not under special convention routes. Closes NEXT-937 -
Jiachi Liu authored
For twitter and og image nested properties we should render them as snake case according to [og spec](https://ogp.me/) and [twitter card docs](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started). For typing we keep them as camel case and then convert them to snake case during render This issue is reported in #47960 that user thinks the types are incorrect, but turns out twitter metadata didn't render it correctly Closes #47960
-
Tim Neutkens authored
Ensures the `null` value is checked instead of destructuring the value as it caused an error. Also added a test to check for `useParams` in `pages`. <!-- 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>
-
Justin Ridgewell authored
Next.js adds a `Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch` to app routes for both rendering and flight requests. Without this, the browser can mistakenly serve the flight request to the app render, and vice versa. This only adds `Vary: RSC` for the moment, I'm not sure what the others are used for. We also don't add a `Cache-Control: max-age=0` header, but I'm not sure if that's necessary either. Fixes NEXT-657 fix #45595
-
JJ Kasper authored
This ensures we prefix the dynamic route params in the query so that they can be kept separate from actual query params from the initial request. Fixes: https://github.com/vercel/next.js/issues/43139 -
Wyatt Johnson authored
This serves to start the transition of replacing the following: - Replace `BaseNextRequest`, `WebNextRequest`, and `NodeNextRequest` with `NextRequest` - Replace `BaseNextResponse`, `WebNextResponse`, and `NodeNextResponse` with `Response` This will currently only apply to app routes, enabling the following: ```ts //////////////////////////////////////////////////////////////////////////////// // Use `Request` and `Response` //////////////////////////////////////////////////////////////////////////////// import { NextRequest, NextResponse } from 'next/server' export function GET(request: Request): Response { return new Response( JSON.stringify({ hello: request.headers.get('user-agent'), }), { headers: { 'content-type': 'application/json' } } ) } //////////////////////////////////////////////////////////////////////////////// // Use `NextRequest` and `NextResponse` //////////////////////////////////////////////////////////////////////////////// import { NextRequest, NextResponse } from 'next/server' export function GET(request: NextRequest): NextResponse { return NextResponse.json({ hello: request.headers.get('user-agent') }) } //////////////////////////////////////////////////////////////////////////////// // Use `NextRequest` and `Response` //////////////////////////////////////////////////////////////////////////////// import { NextRequest, NextResponse } from 'next/server' // `NextRequest` extends `Request`. export function GET(request: NextRequest): Response { return new Response( JSON.stringify({ hello: request.headers.get('user-agent') }), { headers: { 'content-type': 'application/json' } } ) } //////////////////////////////////////////////////////////////////////////////// // Use `NextRequest`, `NextResponse`, and `Response` //////////////////////////////////////////////////////////////////////////////// import { NextRequest, NextResponse } from 'next/server' export function GET(request: NextRequest): Response { // `NextResponse` extends `Response`. return NextResponse.json({ hello: request.headers.get('user-agent') }) } //////////////////////////////////////////////////////////////////////////////// // Use `Request` and `NextResponse` //////////////////////////////////////////////////////////////////////////////// import { NextRequest, NextResponse } from 'next/server' export function GET(request: Request): NextResponse { return NextResponse.json({ hello: request.headers.get('user-agent') }) } ``` fix NEXT-713 -
Jan Kaifer authored
This is a follow-up PR on https://github.com/vercel/next.js/pull/46577 after it got nasty conflicts. Basically, just restart `dev` when `next.config.ts` it will just restart instead of printing that message asking you to restart. fix NEXT-639
-
JJ Kasper authored
Seems edge runtime started failing for app paths from `path` being added in https://github.com/vercel/next.js/pull/47829 so this updates to use the isomorphic version instead and adds a regression test. Fixes NEXT-866
-
JJ Kasper authored
Seems builds in CI have been timing out with the 90s limit and with the shared concurrency of the limited CPUs additional time may be needed to avoid retrying un-necessarily. x-ref: https://github.com/vercel/next.js/actions/runs/4620023451/jobs/8170530943 x-ref: https://github.com/vercel/next.js/actions/runs/4619675493/jobs/8168849370
-
Jiachi Liu authored
[slack thread](https://vercel.slack.com/archives/C04G5LHAVAR/p1680106437791819?thread_ts=1680013412.588999&cid=C04G5LHAVAR) When `metadataBase` is missing and used for resolving og/tw image urls, we'll fallback to localhost for it to always safely resolve the url instead of erroring. Instead, we give a warning in console for which url is resolved but with fallback `metadataBase`. Once they found the warning and it's not expected, they need to update the `metadataBase` to a proper URL for giving the right domain. Another minor change is always resolve canonical with current pathname if it's a URL instance. Remove `resolveStringUrl` as it's not required anymore, the default `pathname` for `resolveUrl` is '', so no trailing slash needs to be removed
-
Tobias Koppers authored
### What? add a warning until it's supported ### Why? to avoid unexpected behavior for the user when things are not working fixes WEB-840
-
Tobias Koppers authored
### What? avoid including the error twice in the output ### Why? `.context()` already keeps the previous error, no need to include in the error message again
-
Tobias Koppers authored
### What? enables the benchmark tests from turbopack again ### Why? It tests common scenarios like HMR fixes WEB-792 --------- Co-authored-by:Alex Kirszenberg <alex.kirszenberg@vercel.com>
-
Shu Ding authored
Next.js includes various feature sets that depend on specific release channels of React. However, our current setup only includes the `next` channel of React, which restricts our ability to integrate with features available on the `experimental` channel. To address this limitation, this pull request introduces the following changes: - Vendors the `react@experimental` version, along with the corresponding `react-dom` and `scheduler` packages. - Modifies the `sync-react` script to also update the `experimental` channel and removes `--version` as they're always synced to the latest now. - Retains the default behavior of using the `next` channel in the `appDir` directory. - Adds an option to switch to the `experimental` channel by setting `experimental.experimentalReact: true` in the configuration. fix NEXT-926 ([link](https://linear.app/vercel/issue/NEXT-926))
-