Commit graph

15802 commits

Author SHA1 Message Date
vercel-release-bot
10af8c80ca v13.3.5-canary.11 2023-05-04 13:53:41 +00:00
Tobias Koppers
e96fce41c4
render app pages with original url (#49198)
### What?

Use pre-rewrite URL for rendering

### Why?

Rendering app pages needs the original user facing URL.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4818 <!-- Tobias Koppers - pass
original url with content source data -->
* https://github.com/vercel/turbo/pull/4817 <!-- Tobias Koppers - avoid
errors in computing issue details -->
2023-05-04 15:46:36 +02:00
Tobias Koppers
aabc1d9cc3
disable optimistic_updates (#49211)
### What?

disable optimistic_updates

So it no longer does that:

> If Kodiak is merging an out-of-date pull request that has running
status checks, update the pull request's branch without waiting for the
running status checks to finish.

The problem with that is that it cancels running checks and restarts
them.

Instead it waits for all running status checks before updating the PR.

### Why?

This should avoid the case where a PR is updated again and again without
yielding a result.

It also saves some CI cost

And it allows CI to finish and fill up the turborepo cache, which can
potentially used for the next run.
2023-05-04 15:45:53 +02:00
Tobias Koppers
b7e2a28d44
add missing alias for next/dynamic in app dir (#49199)
### What?

RSC also needs a different next/dynamic on client side

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 15:45:35 +02:00
Jimmy Lai
310407d331
action: add Readable.toWeb "polyfill" for node 16 (#49201)
<!-- 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-05-04 15:17:59 +02:00
Shu Ding
17597c24db
Add SWC test cases (#49189)
Reorganize the test cases a bit by separating server/client graphs. And
make sure that using `'use server'` inside a Client Component will
result in a compilation error.
2023-05-04 15:11:32 +02:00
vercel-release-bot
83e7d6be8e v13.3.5-canary.10 2023-05-04 12:57:28 +00:00
Shu Ding
83e46fd0ab
Fix incorrect React env in particular case (#49202)
The value of `__NEXT_PRIVATE_PREBUNDLED_REACT` has to be a correct React
channel.
2023-05-04 14:52:38 +02:00
Tobias Koppers
d908bd89bf
update turbopack (#49196)
* https://github.com/vercel/turbo/pull/4815 <!-- Tobias Koppers - fix
CSS HMR -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 14:24:36 +02:00
Jimmy Lai
aec49ec65d
actions: fix redirect on the edge (#49197)
- enables redirect for the edge
- enables production tests



link NEXT-1086
2023-05-04 11:32:50 +00:00
vercel-release-bot
dc99c18ef1 v13.3.5-canary.9 2023-05-04 10:32:05 +00:00
Jiachi Liu
bf09c65e53
Allow override icon rel (#49194)
Fixes #48392

When passing down `Array<IconDescriptor>`, it should allow overriding `rel` prop of icon instead of always picking the default one
fix NEXT-1085
2023-05-04 09:03:57 +00:00
Jiachi Liu
7fd97b8b32
Add warning for missing metadataBase in social images (#49180)
We picked `VERCEL_URL` env for `metadataBase` in preview mode, but also picking that on production, this could potentially use the unique build url for social images if you didn't set `metadataBase`

We recommend to set the major/preferred domain to `metadataBase` if you're using social images, this PR help warn you in every env if you're missing that

[slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1683150633962539?thread_ts=1683144147.664059&cid=C03KAR5DCKC)
2023-05-04 08:17:00 +00:00
Shu Ding
11f2fd4d4f
Use special annotation for $$bound if no closure argument is attached (#49188)
Currently we are always use an array for the `.$$bound` field of an action even if it's empty. This PR updates the transform to generate `null` in that case so we can do further optimizations. Note that `[]` and `null` are slightly different here similar to `f.bind`.
2023-05-04 05:35:16 +00:00
Sebastian Markbåge
b877de1442
Enable progressive enhanced form actions through decodeAction (#49187)
This uses the new built-in progressive enhancement features of React.
These always use `multipart/form-data` atm. When one comes in that's not
a fetch, we can use `decodeAction` to get a resolved function.

This also ensures that we can test this by passing disableJavaScript to
tests. This disables JS for the context.
2023-05-04 05:03:09 +00:00
Shu Ding
83b774eeb6
Fix standalone mode with appDir running in a single process (#49116)
Fixes #49055, fixes #48918. 

App dir will always require the server to run in the workers mode, so it
can keep a separate Node.js process for pages. This PR updates the
standalone server to initialize a "standalone server" (which works
similar to `start-server`), and changes the tracked files to include
Jest worker.
2023-05-04 05:55:05 +02:00
vercel-release-bot
c5406fc67e v13.3.5-canary.8 2023-05-04 01:58:22 +00:00
Justin Ridgewell
a919e4a309
Add test case for App Route cookies (#49124)
A simple test case to ensure `cookies()` is usable inside App Routes,
based on a prior bug report.

Closes WEB-627

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-04 03:52:16 +02:00
Tobias Koppers
f2e6d4207c
add test case for bindings in member props (#49134)
### What?

test case for https://github.com/vercel/turbo/pull/4787

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 03:51:29 +02:00
Tobias Koppers
0a9afce9a2
remove startup message by default (#49157)
### What?

removes the 

```
event - startup 3.643ms
```

message

### Why?

no useful information in this message since it's just too fast

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 03:50:49 +02:00
Andrew Clark
d543fd19db
Upgrade React to 18.3.0-canary-aef7ce554-20230503 (#49181)
Includes the following upstream changes:

- [aef7ce554](https://github.com/facebook/react/commits/aef7ce554)
[Flight] Progressively Enhanced Server Actions
([#26774](https://github.com/facebook/react/pull/26774)) (Sebastian
Markbåge)
- [c10010a6a](https://github.com/facebook/react/commits/c10010a6a)
[Fizz] Gracefully handle suspending in DOM configs
([#26768](https://github.com/facebook/react/pull/26768)) (Sebastian
Markbåge)
- [f533cee8c](https://github.com/facebook/react/commits/f533cee8c) Add
useFormStatus to Flight fixture
([#26773](https://github.com/facebook/react/pull/26773)) (Andrew Clark)
- [2c1117a8d](https://github.com/facebook/react/commits/2c1117a8d) Reuse
request so that a ReabableStream body does not become disturbed
([#26771](https://github.com/facebook/react/pull/26771)) (Andrew Gadzik)
- [fa7a447b9](https://github.com/facebook/react/commits/fa7a447b9)
[Fizz] Check for nullish values on ReactCustomFormAction
([#26770](https://github.com/facebook/react/pull/26770)) (Sebastian
Markbåge)

<!-- 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-05-04 01:48:40 +00:00
Shu Ding
0aac86ea82
Fix multipart/form-data handling in the Edge runtime (#49177)
Adds proper `multipart/form-data` handling in the Edge runtime and fixes a bug (previously we are always using `serverActionsManifest.node`). For the form data, we just use `await webRequest.request.formData()` for now and will handle streaming later.
2023-05-03 23:59:30 +00:00
Shu Ding
e7a233293a
Fix flaky test (#49178)
Found this one being a bit random during dev, but it's trivial. See discussions: https://github.com/vercel/next.js/pull/49168#issuecomment-1533788373
2023-05-03 23:25:46 +00:00
Jimmy Lai
2dc0ba4bd9
app router: support side effects on server requests (#48939)
<!-- 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 #

-->

link NEXT-920

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-05-04 01:01:40 +02:00
Shu Ding
248f2defc2
Fix React channel env missing in custom server (#49168)
Fixes #48948
([repro](https://github.com/vercel/next.js/issues/48948#issuecomment-1533542001)).
When running inside a custom server with app dir, we should always opt
into the prebundled React with correct channels.

Thanks @karlhorky for help testing it!

Fixes #49169 too.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 00:40:23 +02:00
Steven
39654fd4bb
chore(docs): update next-image-unconfigured-host.md (#49175)
We have reports of users scrolling down the the bottom to copy/paste `domains` configuration, instead of using the safer `remotePatterns` configuration at the top.

This PR collapses the older `domains` configuration behind a details toggle since it is only needed for older versions of Next.js prior to 12.3.0
2023-05-03 22:10:57 +00:00
Shu Ding
d957327d71
Fix server component transforms (#49135)
This makes sure that we are treating a module as in the server layer, if
it's under the client layer but with file-level `"use server"`. Also
makes sure we're catching errors like having both `"use server"` and
`"use client"` directives presented.
2023-05-03 23:20:32 +02:00
Andrew Clark
e659653e48
Upgrade React to 18.3.0-canary-b7972822b-20230503 (#49158)
Includes the following upstream changes:

- [b7972822b](https://github.com/facebook/react/commits/b7972822b)
useOptimisticState -> useOptimistic
([#26772](https://github.com/facebook/react/pull/26772)) (Andrew Clark)
- [388686f29](https://github.com/facebook/react/commits/388686f29) Add
"canary" to list of allowed npm dist tags
([#26767](https://github.com/facebook/react/pull/26767)) (Andrew Clark)
- [8a25302c6](https://github.com/facebook/react/commits/8a25302c6)
fix[dynamic-scripts-injection]: unregister content scripts before
registration ([#26765](https://github.com/facebook/react/pull/26765))
(Ruslan Lesiutin)
- [2c2476834](https://github.com/facebook/react/commits/2c2476834)
Rename "next" prerelease channel to "canary"
([#26761](https://github.com/facebook/react/pull/26761)) (Andrew Clark)
- [fa4314841](https://github.com/facebook/react/commits/fa4314841)
Remove deprecated workflow key from Circle config
([#26762](https://github.com/facebook/react/pull/26762)) (Andrew Clark)
- [5dd90c562](https://github.com/facebook/react/commits/5dd90c562) Use
content hash for react-native builds
([#26734](https://github.com/facebook/react/pull/26734)) (Samuel Susla)
- [559e83aeb](https://github.com/facebook/react/commits/559e83aeb)
[Fizz] Allow an action provide a custom set of props to use for
progressive enhancement
([#26749](https://github.com/facebook/react/pull/26749)) (Sebastian
Markbåge)
- [67f4fb021](https://github.com/facebook/react/commits/67f4fb021) Allow
forms to skip hydration of hidden inputs
([#26735](https://github.com/facebook/react/pull/26735)) (Sebastian
Markbåge)
- [8ea96ef84](https://github.com/facebook/react/commits/8ea96ef84)
[Fizz] Encode external fizz runtime into chunks eagerly
([#26752](https://github.com/facebook/react/pull/26752)) (Josh Story)
- [491aec5d6](https://github.com/facebook/react/commits/491aec5d6)
Implement experimental_useOptimisticState
([#26740](https://github.com/facebook/react/pull/26740)) (Andrew Clark)
- [9545e4810](https://github.com/facebook/react/commits/9545e4810) Add
nonce support to bootstrap scripts and external runtime
([#26738](https://github.com/facebook/react/pull/26738)) (Dan Ott)
- [86b0e9199](https://github.com/facebook/react/commits/86b0e9199) Gate
DevTools test to fix CI
([#26742](https://github.com/facebook/react/pull/26742)) (Andrew Clark)
- [b12bea62d](https://github.com/facebook/react/commits/b12bea62d)
Preinits should support a nonce option
([#26744](https://github.com/facebook/react/pull/26744)) (Josh Story)
- [efbd68511](https://github.com/facebook/react/commits/efbd68511)
Remove unused `initialStatus` parameter from `useHostTransitionStatus`
([#26743](https://github.com/facebook/react/pull/26743)) (Sebastian
Silbermann)
- [18282f881](https://github.com/facebook/react/commits/18282f881) Fix:
Update while suspended fails to interrupt
([#26739](https://github.com/facebook/react/pull/26739)) (Andrew Clark)
- [540bab085](https://github.com/facebook/react/commits/540bab085)
Implement experimental_useFormStatus
([#26722](https://github.com/facebook/react/pull/26722)) (Andrew Clark)

---------
2023-05-03 14:03:19 -07:00
Francis Gulotta
2ba4dec18b
Add a generic type for unstable_cache (#49166)
## For Contributors

I know it's an unstable api but this just makes it easier to test with.
This uses the type of the callback to `unstable_cache` as the return
type of `unstable_cache`.
2023-05-03 13:44:49 -07:00
Maia Teegarden
bc5164feb7
Allow webpack config, but warn if no turbo config (#49170)
Allows webpack config so Turbopack can be used for dev and webpack can
be used for production. Also warns if there is no corresponding
Turbopack config (only a warning since webpack config could be prod
specific)

Closes WEB-984

<img width="647" alt="Screenshot 2023-05-03 at 12 32 08 PM"
src="https://user-images.githubusercontent.com/2865858/236027314-4c762b4d-ebe4-486a-bd64-5215dcf60db6.png">
2023-05-03 13:42:35 -07:00
Maia Teegarden
92405d24a5
Search for lockfiles to find Turbopack root (#49110)
Search for package manager lockfiles to find Turbopack root since
`turbo.json` files can be nested now.

---------
2023-05-03 13:31:36 -07:00
JJ Kasper
e4beb85b49
Update cache methods for app dir (#49165)
This ensures we match behavior local and deployed and also cleans up
naming of the methods.

---------
2023-05-03 13:21:58 -07:00
vercel-release-bot
b7c213fc8e v13.3.5-canary.7 2023-05-03 20:18:25 +00:00
Sebastian Silbermann
5b4506c073
Ensure latest react-dom types for experimental release channel are used (#49049)
Same as https://github.com/vercel/next.js/pull/48641 but for `react-dom`.

Required to get types new form hooks, Float etc.
2023-05-03 20:04:27 +00:00
Alex Kirszenberg
9555ad9123
Tests for Sass warnings (#49151)
See https://github.com/vercel/turbo/pull/4789
2023-05-03 19:24:52 +00:00
Alex Kirszenberg
7092266076
Add support for app global and segment 404 pages (#49085)
See https://github.com/vercel/turbo/pull/4776

This adds support for:

* Default and custom global app 404 pages (`app/not-found`).
* Segment-level 404 pages (`app/segment/not-found`).

This also updates Turbopack:

* https://github.com/vercel/turbo/pull/4787 <!-- Tobias Koppers -
Bugfixes for free var and binding replacement -->
* https://github.com/vercel/turbo/pull/4789 <!-- Alex Kirszenberg -
Print a warning when importing Sass files -->
* https://github.com/vercel/turbo/pull/4776 <!-- Alex Kirszenberg -
Leave pathname formatting up to the caller -->
* https://github.com/vercel/turbo/pull/4790 <!-- Tobias Koppers - remove
inital compilation message by default -->

## TODO:

- [ ] ~~The dev overlay shows up when `notFound()` is called, it should
be hidden~~ (moved to WEB-980)
- [ ] ~~Navigating to the global 404 page doesn't work~~ (this is a bug
in Next.js, see NEXT-963)
- [x] Tests.

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-03 18:10:17 +00:00
Jimmy Lai
1905d14d77
app-router: fix stale cache handling (#49160)
There was a bug reported in https://github.com/vercel/next.js/issues/42991#issuecomment-1532967037 that would hang on load. 

After investigation, I noticed that it was because the cache node never applied the flight payload. It was because the requested flight payload was too deep into the tree whereas it should have been fetched from higher up in the tree because we specifically discarded that branch of the tree because it was stale.
2023-05-03 17:23:15 +00:00
Shu Ding
1e75beada2
Fix CSS module imports not included in root not-found file (#49155)
When using the `not-found.js` file to match missed routes, `serverCSSForEntries` will always be empty as the `ComponentMod.pages` itself doesn't contain any actual entry. We need to handle that as a special case.

Closes #48133.
2023-05-03 16:45:12 +00:00
Shu Ding
d62755a533
Update compilation target of @next/react-dev-overlay (#49153)
Closes #48627.
2023-05-03 16:20:43 +00:00
Shu Ding
2ebc724dba
Polyfill Blob for Node.js < 18 (#49156)
Since `react-server-dom-webpack-server.node` uses `Blob`, we need to polyfill it for Node.js 16.
2023-05-03 15:56:48 +00:00
vercel-release-bot
467539c19e v13.3.5-canary.6 2023-05-03 15:08:15 +00:00
Jiachi Liu
a623653e16
Forward response to edge runtime for response modification (#49145)
For edge runtime, we're modifying `res.statusCode` in actions handler, but we didn't forward the `res` object to it, previously we're using a fake `res` `{}`. This PR fixes it so that the propery status code will be returned to the client

[slack-thread](https://vercel.slack.com/archives/C052S77L05C/p1682988777740609)
2023-05-03 14:04:31 +00:00
Jimmy Lai
c5468474d0
app-router: update prefetch heuristic to traverse until until we hit a loading boundary (#49077)
This PR changes the router behaviour during prefetching.

- before: the router would prefetch the router tree + return the loading state of new router node if there were any
- after: the router will prefetch the router tree + prefetch the content of the new page up until the nearest loading boundaries

Example:

Note: `prefetched` here implies React content prefetching

```
.
└── app/
    ├── page.ts <- the page you're on, has links to /about and /post/[id]
    ├── layout.ts
    ├── post/
    │   └── [id]/
    │       ├── (comments)/
    │       │   ├── loading.ts <- not prefetched
    │       │   └── page.ts <- not prefetched
    │       ├── layout.ts
    │       └── page.ts <- not prefetched
    └── about/
        └── page.ts <- not prefetched
```


After
```
.
└── app/
    ├── page.ts <- the page you're on, has links to /about and /post/[id]
    ├── layout.ts
    ├── post/
    │   └── [id]/
    │       ├── (comments)/
    │       │   ├── loading.ts <- prefetched
    │       │   └── page.ts <- not prefetched
    │       ├── layout.ts
    │       └── page.ts <- prefetched
    └── about/
        └── page.ts <- prefetched
```


link NEXT-1078
2023-05-03 13:24:57 +00:00
Balázs Orbán
8d9658c680
chore: simplify repo templates (#49073)
[Slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1682414178536089)

Closes NEXT-1076
2023-05-03 14:42:31 +02:00
Balázs Orbán
79ef1d69ac
fix(ts): make ReadonlyHeaders more compatible with Headers (#49075)
### What?

Make it possible to pass `headers()` where the `Headers` type is
expected. An example would be `fetch`:

```ts
import { headers } from "next/headers"
// ...
fetch("https://example.com", {
  headers: headers()
})
```

### Why?

`ReadonlyHeaders` _currently omits_ some mutating methods which make
sense since they don't make sense. 🙃. However, it makes
it necessary to pass the result anywhere where `Headers` is expected.
Since we already throw errors when these methods are called illegally,
we can make the type constraint a bit looser to avoid `as any` or
`Object.fromEntries(headers())` or similar.

### How?

Mark the unavailable methods as `@deprecated` which will visually mark
them in IDEs:


![image](https://user-images.githubusercontent.com/18369201/235621140-3df8b10a-b90f-4ec3-b218-066303bfbc73.png)


Closes NEXT-1075
2023-05-03 14:33:51 +02:00
Shu Ding
70c6f94d95
Revert "Revert "Fix cross-worker revalidate API" (#49138)" (#49141)
Revert #49138 and split the server-ipc file into smaller modules.
2023-05-03 11:42:21 +00:00
Tobias Koppers
1e9e8b2666
Revert "Fix cross-worker revalidate API" (#49138)
Reverts vercel/next.js#49101

It breaks Turbopack
2023-05-03 12:53:58 +02:00
Tim Neutkens
cfd27e96a4
Remove writing vscode config (#49133)
## What?

Removes writing the `.vscode/settings.json` config. This config is
needed in order to leverage the new Next.js TypeScript plugin.
What we'll do instead is add a message in the docs on how to enable it.
We'll also explore a VSCode extension that warns when you don't have the
TypeScript plugin set up.

## How?

Removed the code related to writing `.vscode`.


Closes #42213

<!-- 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-05-03 12:15:59 +02:00
Jiachi Liu
c09b0a0890
Static generate dynamic sitemaps (#49114)
Follow up of #48867 

- Statically optimize dynamic generated sitemap routes
- Previously the generated sitemap urls looks bit off
(`/route/sitemap.xml/[id]`), we polish it into `/route/sitemap/[id].xml`
in this PR
2023-05-03 12:11:57 +02:00
Tim Neutkens
ffa23d28d4
Only read digest from error instance (#49132)
## What?

Changes onRecoverableError to no longer read `errorInfo.digest`. In an
earlier version of react@next the digest was provided on the errorInfo
object but this is no longer the case and triggers a warning when read.


Fixes https://twitter.com/devcassa/status/1653505341194137600

<!-- 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-05-03 11:21:13 +02:00