### 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.
### 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>
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.
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
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)
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`.
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.
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.
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>
### 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>
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.
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>
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
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.
## 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`.
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>
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.
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.
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)
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
### 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
## 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 #
-->
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