Commit graph

15355 commits

Author SHA1 Message Date
Hannes Bornö
8b791737e1
Update next/font/google data (#48195)
Updates the `next/font/google` data with
`scripts/update-google-fonts.js`.

Co-authored-by: Hannes Bornö <hannesborno@Hanness-MacBook-Pro.local>
2023-04-10 20:14:28 +02:00
Hannes Bornö
2cb5876b7b
Enable opening source file in build error overlay (#48194)
It's only possible to open the source file in the editor on runtime
errors:
<img width="951" alt="image"
src="https://user-images.githubusercontent.com/25056922/230925905-b6741246-90f3-4c5a-8211-f3b85cc63275.png">

For build errors, the source file is just part of the error message, and
not clickable:
<img width="934" alt="image"
src="https://user-images.githubusercontent.com/25056922/230926579-ba803272-90f5-4366-aec0-176ea6489c3e.png">

This PR makes the source file clickable on build errors as well:
<img width="947" alt="image"
src="https://user-images.githubusercontent.com/25056922/230926886-4ba18f54-be52-49b4-9421-1c6282d823a9.png">

---------

Co-authored-by: Hannes Bornö <hannesborno@Hanness-MacBook-Pro.local>
2023-04-10 20:13:34 +02:00
JJ Kasper
b896a12867 v13.3.1-canary.4 2023-04-10 17:07:34 +00:00
Lucas
9c9fdabbd4
Fix next-flight-loader resourcePath in Windows (#48152)
### What?
It's path backslash and string escape bug at
[next-flight-loader](https://linear.app/vercel/issue/NEXT-flight-loader),
in Windows

### Why?

### How?

Closes NEXT-940
Fixes #47704
2023-04-10 19:01:20 +02:00
Shu Ding
772f3e7509
Add experimental React related warning (#47986)
For now, this isn't a strong requirement as normal `fetch` requests will
still work with `react@next`. But in the future, form related props e.g.
`action=` and `formAction=` requires the experimental build.

Fixes NEXT-954.
2023-04-10 14:37:23 +02:00
Shu Ding
9c0e520896
Re-land "Vendor react@experimental under an experimentalReact flag" (#48041)
Reverts vercel/next.js#48038

fix NEXT-926

---

The root cause was that when copying the package.json, I removed all
fields except for a few (such as `exports`) but missed the `browser`
field. That caused the client bundle to resolve to the Node.js version
of React DOM, and then we had the `async_hooks` error. Added it back in
99c9b9e51f8b0d4e4503ece9d07bce09161f3341.

I reproduced the error with next-site earlier and confirmed that this
fix is good.
2023-04-08 17:16:24 +02:00
JJ Kasper
2bcdfbb6ab v13.3.1-canary.3 2023-04-08 01:47:09 +00:00
JJ Kasper
1caa58962f
Add flag to control app document preloading (#48115)
x-ref: [slack
thread](https://vercel.slack.com/archives/C02EU7CEVB7/p1680910556362999?thread_ts=1680906129.293849&cid=C02EU7CEVB7)
2023-04-07 17:58:47 -07:00
JJ Kasper
4e3f135fd6
Update flakey tests (#48113)
x-ref:
https://github.com/vercel/next.js/actions/runs/4642101338/jobs/8215704290
x-ref:
https://github.com/vercel/next.js/actions/runs/4641810347/jobs/8215208356
x-ref:
https://github.com/vercel/next.js/actions/runs/4640288495/jobs/8212579666
x-ref:
https://github.com/vercel/next.js/actions/runs/4640288495/jobs/8212653308
2023-04-07 17:54:17 -07:00
Jiachi Liu
71a29a17b8
Support og image with edge (#48086)
Fixing edge runtime doesn't work with exports from dynamic metaddata
image routes. If there's a match, don't do extra matching.

Fixes NEXT-866
2023-04-07 16:27:32 -07:00
JJ Kasper
db7b3bdbcf
Remove change leftover from experimental precompiled server (#48107)
This is no longer needed as the experimental precompiled server was
removed.

Closes: https://github.com/vercel/next.js/issues/46588
2023-04-07 15:24:59 -07:00
Nabeel Sulieman
5ea70b85c1
Next Cache Telemetry (#47939)
### What?

Report additional telemetry related to cached fetches:

- Fetch Index number to group related fetches (cache-get, cache-set,
origin)
- Origin URL map cache key to original upstream URL

### Why?

This is needed for fetch cache telemetry on the Vercel platform.

### How?

Telemetry is provided through optional parameters added to the fetch
call configuration. It is similar to the `next: {revalidate: X}` and
`{next: { internal: true }}` fields.

The origin URL and fetch index are calculated in the patch-fetch
function and are passed down to the caching classes as needed. These
fields are optional and ignored by the `FileSystemCache`.
2023-04-07 12:06:04 -07:00
JJ Kasper
b5f785aab1 v13.3.1-canary.2 2023-04-07 18:04:26 +00:00
Shu Ding
6b9af3e0d1
Fix fallback detection logic when multiple generateStaticParams are needed (#47982)
### 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
2023-04-07 19:56:40 +02:00
Shu Ding
98dfbc0775
chore: Add .vscode to eslintignore (#48020)
### 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.
2023-04-07 15:51:26 +00:00
Chandrajeet Maurya
536b4dca8c
Update deployment.md (#48062)
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>
2023-04-07 08:38:59 -07:00
JJ Kasper
0097c12a92 v13.3.1-canary.1 2023-04-07 13:29:08 +00:00
Jimmy Lai
a71227a40f
parallel routes: fix layout not re-rendering (#48066)
### 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 #

-->
2023-04-07 15:23:08 +02:00
JJ Kasper
883933b6c5 v13.3.1-canary.0 2023-04-07 03:15:57 +00:00
Justin Ridgewell
10b9355781
turbopack: pass ENV vars to route handlers (#48048)
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>
2023-04-06 19:33:55 -07:00
Justin Ridgewell
8d3e42e556
turbopack: bind server to IPv6 loopback (#47948)
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
2023-04-06 17:58:26 -07:00
JJ Kasper
40687daed2
Update query param prefix to reduce length (#48051)
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
2023-04-06 17:52:24 -07:00
Steven
690208b11f
fix: show error when "next start" is used with "output" config (#47989)
fix #47334
fix NEXT-861
2023-04-06 17:28:27 -07:00
Jiachi Liu
1e81af047d
Change metadata routes suffix to number and chars (#48026)
Follow up of #47985 

Change `-\d{6}` to `-[a-z0-9]{6}` which reduces the chance of hash
collision
2023-04-06 16:38:02 -07:00
JJ Kasper
fc29a13ad2
Fix query normalize on edge deploy (#48045)
Fixes:
https://github.com/vercel/next.js/actions/runs/4632507508/jobs/8196861461#step:6:464
2023-04-06 15:01:04 -07:00
JJ Kasper
2a68ecf509
Fix stable release start (#48044)
x-ref:
https://github.com/vercel/next.js/actions/runs/4632849191/jobs/8197395820
2023-04-06 14:52:56 -07:00
JJ Kasper
79031e608a
v13.3.0 2023-04-06 13:47:03 -07:00
JJ Kasper
b8e7646fdc v13.2.5-canary.34 2023-04-06 19:48:01 +00:00
Wyatt Johnson
045ad0d133
Replaced Reflect with ReflectAdapter (#48000)
On some runtimes, `Reflect` is not available. This creates a new "naive"
implementation.
2023-04-06 21:18:42 +02:00
JJ Kasper
9448913149
Revert "Vendor react@experimental under an experimentalReact flag" (#48038)
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
2023-04-06 11:48:09 -07:00
Nabeel Sulieman
76ad58b0c8
Only cache successful fetches (#48033)
### 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>
2023-04-06 11:41:15 -07:00
Tobias Koppers
95e46f73e4
report error when using "use server" on module level (#47967)
### 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 -->
2023-04-06 17:23:37 +00:00
Steven
86cb8ec8e2
fix: handle error case for output: export in next dev (#47768)
fix NEXT-929
2023-04-06 19:20:47 +02:00
JJ Kasper
4fbbb626b9
Update normalize revalidate params for named matches (#48032)
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
2023-04-06 19:20:05 +02:00
Jimmy Lai
946424efb3
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>
2023-04-06 19:19:35 +02:00
Tobias Koppers
bd8d7c61f7
Speed up native dev build (#48028)
### 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
2023-04-06 18:50:27 +02:00
Jimmy Lai
1cf1198cab
interception routes: re-implementation (#48027)
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 #

-->
2023-04-06 15:59:45 +00:00
Tobias Koppers
dec037a421
fix lint issue (#48023)
### What

Docs changes need to be linted for language
2023-04-06 17:16:29 +02:00
JJ Kasper
200e83245c v13.2.5-canary.33 2023-04-06 14:52:28 +00:00
Shu Ding
63e0a2a1b1
docs: Add "special" to the Alex allowlist (#48021)
It's a common word we use in our docs, e.g.:


e35710f71f/docs/advanced-features/open-telemetry.md (L105)
2023-04-06 16:32:06 +02:00
Jan Kaifer
e35710f71f
Recommend @opentelemetry/api instead of @vercel/otel reexport (#48013)
- 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
2023-04-06 14:17:47 +02:00
Jan Kaifer
dd959251e6
Docs: Improve Open Telemetry documentation (#47955)
- 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>
2023-04-06 11:41:19 +00:00
Tobias Koppers
ad75394a22
fix code generation for loader tree (#47987)
### 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
2023-04-06 10:31:34 +00:00
Jiachi Liu
e4e5c1674a
Fix css applying for root not found (#47992)
### 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
2023-04-06 13:37:55 +02:00
Tobias Koppers
9b0af04649
update turbopack (#48006)
see #47994
2023-04-06 09:50:04 +00:00
JJ Kasper
5eec452f78 v13.2.5-canary.32 2023-04-06 06:23:44 +00:00
JJ Kasper
3b78c683ad
Revert "update turbopack" (#48001)
Looks like this is failing to build the native dev binary 

Reverts vercel/next.js#47994
2023-04-05 22:40:48 -07:00
Tobias Koppers
ebdc8903cf
update turbopack (#47994)
* 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 -->
2023-04-05 21:42:45 -07:00
Shu Uesugi
3a49a29a70
If prefetching detected as app route, pass "as" to handleHardNavigation instead of "url" (#47949)
### 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>
2023-04-05 18:32:51 -07:00
Shu Ding
89e30409b0
Implement Route type for router APIs (#47931)
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
2023-04-06 00:30:58 +00:00