- 07 Apr, 2023 11 commits
-
-
JJ Kasper authored
-
Shu Ding authored
### What? Our current logic of detecting if a route allows dynamic params or not (`fallback`) is flawed, and this PR fixes it. ### Why? Right now, if no `generateStaticParams` is specified we return `fallback: undefined` during dev. However, for an app with multiple params, it may have multiple `generateStaticParams` defined in different levels. If some level isn't covered by any `generateStaticParams`, we still can't determine the fallback value. ### How? I added a naive implementation to check if all params are covered by `generateStaticParams` in the current or inner layers. Closes NEXT-946
-
Shu Ding authored
### What? Add `.vscode` to `.eslintignore`. ### Why? We ignore `.vscode` folder in our tests, but Next.js itself creates it so manually running tests locally will causing them to be added. That causes ESLint to fail because it checks JSON files inside `.vscode` folder.
-
Chandrajeet Maurya authored
Since the code above is referring to `package.json` it should be `npm run build` and `npm run start` instead of running `next build` and `next start` directly <!-- 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>
-
JJ Kasper authored
-
Jimmy Lai authored
### What? This PR makes the parent layout of parallel routes re-render when the parallel route segments are different or when either of them has a refetch marker. Example: ``` . └── app/ ├── page.ts ├── layout.ts ├── foo/ │ └── page.ts └── @modal/ ├── default.js └── foo/ └── page.ts ``` Here if you navigated to `/foo` from `/`, `@modal/foo/page` would never get re-rendered because the tree would only re-render from `foo/page.ts`. This PR adds a check that checks the router state on navigation to see if the parallel route segments diverge on navigation. Here we would be checking that `@modal/default` is different from `@modal/page` so we would re-render. Also added some logic to make sure that refetch routes are processed first when handling parallel routes. ### Why? See example Closes NEXT-966 Fixes # <!-- 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
-
Justin Ridgewell authored
Same as https://github.com/vercel/next.js/pull/47767, we need to pass the full list of `process.env` keys to the edge invocation so that the ENV vars are available to the route handlers. Fixes https://github.com/vercel/turbo/issues/4489 Fixes https://github.com/vercel/next.js/issues/48036 Fixes WEB-869 Fixes NEXT-961 fix #48036 Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Justin Ridgewell authored
This accomplishes 2 things: 1. binds the turbopack dev server to the IPv6 unspecified address 2. initializes our router with the same hostname/port of the turobpack server The first matches the behavior of the Node.js dev server. The IPv6 unspecified address is similar to IPv4's `0.0.0.0` address, allowing us to accept connection from anywhere. Importantly, it _also_ allows accepting IPv4 connections, making this address truly universal. The second means the `request` parameter to any middleware will have the correct origin, and the request's URL can be used to craft fetch requests to API endpoints. `new URL(req.url).origin` will be the origin of the turbopack dev server. Fixes https://github.com/vercel/turbo/issues/4456 Fixes WEB-855
-
JJ Kasper authored
With the addition of the query prefix we can hit the max length for PCRE named matches so this reduces the prefix length and ensures we go through the param name validation still x-ref: https://twitter.com/simonecervini/status/1644123851003928579
-
Steven authored
fix #47334 fix NEXT-861
-
- 06 Apr, 2023 28 commits
-
-
Jiachi Liu authored
Follow up of #47985 Change `-\d{6}` to `-[a-z0-9]{6}` which reduces the chance of hash collision -
-
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 1 commit
-
-
JJ Kasper authored
-