It makes more sense to use the `FormData` from `@edge-runtime/primitives` to ensure the version and implementation are aligned, and avoid importing extra modules (as we always import the Edge Runtime).
Part of #47759 (which had been reverted twice so here we only land a part of the change), relates to NEXT-926. Thanks to #48506 we can soon switch between these two channels during runtime.
Also fixes a problem of `renderKind` (only revealed after upgrading React), it should be also based on the `match` kind.
This is currently an overhead, that we check a module's layer (`mod.buildInfo.rsc?.type === RSC_MODULE_TYPES.client`) and put all client modules in the client reference manifest, but the manifest is only used for accessing these entry modules. So here we change the util to check if it's an client entry instead.
With this change the client manifest of a test app decreased from 177 KB to 70 KB.
Ref: 5b609e264f/packages/next/src/build/analysis/get-page-static-info.ts (L50-L64)
### What?
Mux reported that their website does not scroll to hash when clicking a search result. Found it's related to `server-patch` triggering and overriding the hashFragment. That should be preserved similarly to `apply`.
### How?
handleMutable had a default of `null` instead of using the existing value. It should use the existing value.
### What?
Update `@swc/helpers` to `v0.5.1`.
### Why?
Webpack merges `@swc/helpers@v0.4.x` and `@swc/helpers@v0.5.x`, due to `resolve.alias` config in 2f6ff0dab3/packages/next/src/build/webpack-config.ts (L1070-L1072)
To workaround it, `@swc/helpers@v0.5.1` reexports from entries just like `v0.4`.
### How?
Closes WEB-948
Fixes#48593
A change here: (#48202) 958150d
Caused a URL to be joined with `path.join`, which on Windows inserts a backslash character. Changing to `path.posix.join` fixes this.
Breaks next build on Windows when paths like `favicon.ico` are in the source dir.
Fixes#48603
When you're using `config` object with `runtime` we'll show a warning and recomment you to move to `export const runtime = ...` for runtime property as it's documented as recommended. This PR adds a error for `next build` to avoid logs are truncated during multi-workers build and you're aware of the config which doesn't take effect with seeing the error
Follow up for #48630
link [NEXT-426](https://linear.app/vercel/issue/NEXT-426)
We currently use `URLSearchParams` to represent `FormData` but it's not really the same thing. And in Node.js 16 there's no `FormData` available so we can polyfill it via Undici.
Updates the name of Next.js Analytics to Next.js Speed Insights
closes ALY-579
---------
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
### What?
Compiles Next.js core files using the same default target as client-side
files, ensuring that `async`/`await` and such are not turned into
generators.
The client-side files are all opted into compilation during dev/build
already so if you create a browserslist config that will still apply in
the same way. This change only changes the output of the core files.
### How?
Moved the default we use in Next.js into a separate `.js` file so that
it can be imported from the taskfile-swc plugin, this way we're using
the same defaults.
<!-- 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 #
-->
Draft Mode is very similar to Preview Mode but doesn't include any
additional data.
This PR implements support for Draft Mode in `pages` and a future PR
will implement support in `app`.
fix NEXT-992
Hey! Hope this can help anyone dealing with this in the future.
I'm also using the `TinaMarkdown` provider to generate my MDX and one of the things that I've found helpful so that the image was better handled in the browser was to set position to `undefined`, as it was the only way to unset it from `absolute`, which was affecting the visual aspect of the page.
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
When sending a multipart form data, we currently wait until the entire update finishes before we decode it via `decodeReply`. This way is universal in both runtimes (as we don't have `decodeReplyFromBusboy` in Edge), but also not efficient.
This PR changes it to use `decodeReplyFromBusboy` in the Node runtime, which can decode the payload during streaming as well as file update support.
Same purpose as #48297, but without the React channel branching logic to
make it easier to land. Since we have #48478 reverted, we only need to
consider `pages` and `app` inside the require hook.
> This PR aims to improve the current require hook by implementing two
key changes. Firstly, it ensures that the initialization occurs at the
top of the module level for correctness. Secondly, we now set the
NEXT_PREBUNDLED_REACT environment variable at the process level to
ensure that we don't mix the two types of rendering processes and we
always resolve the correct React package.
>
> These improvements are made possible by the changes introduced in PR
https://github.com/vercel/next.js/pull/47857.
>
> Closes [NEXT-231](https://linear.app/vercel/issue/NEXT-231).
This will likely fix#45258 too.
---------
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Wait for the prompt to show up then enter the cursor change or "y" for
prompt to avoid write to child process too early
Example
```
Running pnpm release-stable...
Releasing patch: cursor stay
Enter newline
Enter y
Await child process...
> nextjs-project@0.0.0 release-stable /home/runner/work/next.js/next.js
> lerna version --force-publish
lerna notice cli v4.0.0
lerna info ci enabled
lerna info current version 13.3.1-canary.19
lerna WARN force-publish all packages
lerna info Assuming all packages changed
? Select a new version (currently 13.3.1-canary.19) (Use arrow keys)
❯ Patch (13.3.1)
Minor (13.4.0)
Major (14.0.0)
Prepatch (13.3.2-canary.0)
Preminor (13.4.0-canary.0)
Premajor (14.0.0-canary.0)
Custom Prerelease
Custom Version ? Select a new version (currently 13.3.1-canary.19) Patch (13.3.1)
Changes:
```
### What?
Fix snapshots that were no longer fulfilling the original purpose after
prettier had its way.
The `.prettierignore` also had the old `target/` directory (prior to the
`Cargo.toml` move in #48198) so running `pnpm prettier-fix` formatted
files in the `target/` directory