Commit graph

12273 commits

Author SHA1 Message Date
vercel-release-bot
ce6ce9b04b v15.0.0-canary.45 2024-06-26 14:10:16 +00:00
Wyatt Johnson
08793dd911
[ppr] Handle corrupted postponed state (#67021)
Previously, when the provided postponed state was corrupted, the render
failed which resulted in a hydration error. Instead, when the postponed
state is corrupted, we send the resume stream just for the hydration
where it'll attempt to render client side with the data that's already
available.
2024-06-26 06:52:49 -07:00
Tim Neutkens
5999c78a4b
Upgrade Turbopack (#67209)
* https://github.com/vercel/turbo/pull/8546 <!-- Benjamin Woodruff -
Decrease default scope_stress test size, add env var config -->
* https://github.com/vercel/turbo/pull/8563 <!-- Donny/강동윤 - Update
`swc_core` to `v0.95.4` -->
* https://github.com/vercel/turbo/pull/8556 <!-- Tobias Koppers - avoid
cloning the source code -->
* https://github.com/vercel/turbo/pull/8562 <!-- Will Binns-Smith - HMR:
handle non-Latin characters in text through base64-encoded sourcemaps
-->
* https://github.com/vercel/turbo/pull/8530 <!-- Benjamin Woodruff -
Support turbo tasks inside of `mod` blocks -->
* https://github.com/vercel/turbo/pull/8542 <!-- Benjamin Woodruff -
Handle `#[cfg(...)]` attributes on turbo tasks -->
* https://github.com/vercel/turbo/pull/8529 <!-- Benjamin Woodruff -
Deduplicate persistent task get_function_name logic -->
* https://github.com/vercel/turbo/pull/8547 <!-- Benjamin Woodruff - Add
new ExitHandler API as an alternative to ExitGuard -->
* https://github.com/vercel/turbo/pull/8604 <!-- Benjamin Woodruff -
Delete unused TASK_ID_MAPPING support -->
* https://github.com/vercel/turbo/pull/8605 <!-- Benjamin Woodruff -
Remove nohash-hasher dependency -->
* https://github.com/vercel/turbo/pull/8559 <!-- Tobias Koppers - move
stateful flag into Done state -->
* https://github.com/vercel/turbo/pull/8598 <!-- Tim Neutkens - MDX
support: Ensure development transform is only used in development -->
* https://github.com/vercel/turbo/pull/8557 <!-- Tobias Koppers - reduce
size of task output struct -->
* https://github.com/vercel/turbo/pull/8558 <!-- Tobias Koppers - remove
prepared task type -->


<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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 #

-->
2024-06-26 14:11:23 +02:00
Joseph
c839d589ab
fix: Narrow down from string | undefined to string (#65248)
Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2024-06-26 12:42:55 +02:00
Sebastian Silbermann
a832c91ae4
Make synced react-is version more obvious (#67189) 2024-06-26 11:16:47 +02:00
Tobias Koppers
d4e349f79b
make next/dynamic visit more incremental and cacheable (#66912)
### What?

This makes extracting next/dynamic cheaper when modules have been visited before

### Why?

improved HMR and page transitions

### How?

All steps for visiting a module are extracted into a single cached function. VIsiting already visited modules costs only a single cache lookup
2024-06-26 11:11:13 +02:00
vercel-release-bot
90f564d376 v15.0.0-canary.44 2024-06-25 23:22:44 +00:00
Ivan Torres
0d9c89bf81
Remove devdependency uuid (#67190)
Co-authored-by: torresgol10.it <torresgol10.itd@gmail.com>
Co-authored-by: eps1lon <sebastian.silbermann@vercel.com>
2024-06-25 20:50:39 +00:00
Jiachi Liu
1a04d94aae
Remove extra suspense boundary for default next/dynamic (#67014)
### What

Reland #64716 

Removing the Suspense boundary on top of `next/dynamic` by default, make
it as `React.lazy` component with preloading CSS feature.

* Remove `suspense` option in `next/dynamic` since it's already
deprecated for a while
* Remove the default loading in app router implmentation of
`next/dynamic`

### Why

Extra Suspense boundary is causing extra useless rendering. For SSR, it
shouldn't render `loading` by default

Related: #64060
Related: #64687
Closes
[NEXT-3074](https://linear.app/vercel/issue/NEXT-3074/app-router-content-flickering-with-reactcreatecontext-and-nextdynamic)

This is sort of a breaking change, since removing the Suspense boundary
on top of `next/dynamic` by default. If there's error happening in side
the dynamic component you need to wrap an extra Suspense boundary on top
of it
2024-06-25 20:40:09 +02:00
Corbin Crutchley
cfacca5fad
chore: fix react-is RC version pinning (#66676) 2024-06-25 18:00:15 +02:00
Hendrik Liebau
d824059439
Create React aliases for SVG components (#67104) 2024-06-25 14:29:32 +02:00
Jiachi Liu
c8925c36db
codemod: add next/dynamic imports codemod (#67126)
### What

Provide a codemod to transform the promise of the access to named export
properties in dynamic import `next/dynamic`, this codemod transform all
the `next/dynamic` imports to ensure returning an object value with
`default` property, aligning with what `React.lazy` is returning

### Why

Follow up for #66990 

It's not allowed to do dynamic import and access it's named export while
using `next/dynamic` in server component, and the dynamic import module
is from a client component. It's like accessing the nested client side
property of a module
2024-06-25 12:17:44 +00:00
vercel-release-bot
ea8020158e v15.0.0-canary.43 2024-06-24 23:23:43 +00:00
Jiachi Liu
d8a60e3476
chore: turbopack metadata routes normalizing (#67159) 2024-06-25 00:57:16 +02:00
Jiachi Liu
7f72971039
Fix server action edge redirect with middleware rewrite (#67148)
### What

Add isEdgeRendering check condition for rewrite logic in edge adpator 

Fixes #66837 
Closes NEXT-3545

### Why

From headers `x-middleware-rewrite`, it's still relative url `/rewrite`,
reconstructing the url will lead to crash as it doesn't contain host.
2024-06-24 13:17:44 +00:00
vercel-release-bot
6604c187ec v15.0.0-canary.42 2024-06-23 23:22:39 +00:00
Shu Ding
3fb72dc658
Refactor code (#64429)
Small code refactoring to make the server do fewer work.

Closes NEXT-3096
2024-06-23 20:16:13 +00:00
Jiachi Liu
fc7f62dc4e
Fix noindex is missing on static not-found page (#67135)
### What

Render noindex into a flight data and rsc payload when page path is
`/404`

### Why

When it's static generation, noindex is not rendered due to the
statusCode from mock request is 200, but we can relying on the pagePath
as `/404` page should always contain `nonidex`

We were missing the noindex before for flight generation, now we'll
render it when it's 404 page.
2024-06-23 21:56:08 +02:00
JJ Kasper
16cf88e569
Add experimental flag for providing entry paths (#67134)
Adds a flag for experimentally building on specifically provided entry
paths. This should not be relied on as it is NOT a public facing API.
2024-06-23 10:21:10 +00:00
Jiachi Liu
b68caaf85f
dx: add pagePath info to missing component error (#66916)
### What 

Show the full `pagePath` information for missing default component app
router convention files.

Move runtime error tests from `rsc-build-errors.test.ts` to the new test
`test/development/acceptance-app/undefined-default-export.test.ts`

### Why

Previously we only log `segment` which could be `[slug]` that is not
enough useful for users to locate the bad defined component
2024-06-23 09:25:03 +00:00
Ivan Torres
515836dab0
Bump conf to 13.0.0 (#67043)
Bump conf to 13.0.0

I have changed the `moduleResolution` in tsconfig to `bundler` because
apparently the new versions of that dependency does not work with
`moduleResolution:node`, issues where it explains it: [issues in
conf](https://github.com/sindresorhus/conf/issues/181)

---------

Co-authored-by: torresgol10.itd <torresgol10.itd@gmail.com>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-23 09:17:38 +00:00
Steven
f5d616b77e
chore: add detection for image more types (#67112)
These image types aren't optimized but we can still detect them to
bypass optimization earlier.
2024-06-23 01:04:46 -07:00
mknichel
f9ea3a89f1
Add build diagnostics for saving debug information during a build (#66187)
This PR adds a `.next/diagnostics` directory containing debug
information from during a build that can be used later on to debug the
build. The first use case is to output the exact Next.js version that
was used and to record information about the stage that the build failed
in and any options that were present.
2024-06-23 00:15:52 +00:00
vercel-release-bot
7f0102dcae v15.0.0-canary.41 2024-06-22 23:22:19 +00:00
Zack Tanner
891ca7a054
ensure accessing search params mark dynamic usage (#67105)
When accessing search params, we only track dynamic access during static
generation. This has implications on fetch caching, because the fetch
cache relies on hints set during render that it's in a dynamic scope. In
15, this would signal that it should not attempt to cache the fetch at
all. In 14, this could impact the heuristic that bails from fetch cache
if dynamic access came before certain requests types, e.g. POSTs.
2024-06-22 12:56:50 +02:00
vercel-release-bot
a7930c3c29 v15.0.0-canary.40 2024-06-21 23:22:06 +00:00
Sebastian Silbermann
688eb77c0d
Remove handling on findDOMNode warning (#67054) 2024-06-21 21:17:02 +09:00
vercel-release-bot
32992fc0be v15.0.0-canary.39 2024-06-20 23:23:47 +00:00
Tim Neutkens
6bebacb220
Ensure Turbopack build runs when experimental-compile option is used (#67049)
Currently webpack would be incorrectly used when some of the
experimental options for builds were enabled. For example
`parallelServerCompiles` and `parallelServerBuildTraces`. This ensures
Turbopack is always used when it's specified to be used.

Fixes around 100 Turbopack build tests

<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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 #

-->
2024-06-20 17:41:24 +02:00
Jiachi Liu
3a17d4d2cd
fix: bad script tag in layout hydration error (#66998) 2024-06-20 14:09:19 +00:00
Tim Neutkens
b515bbc4bb
Upgrade Turbopack (#67017)
Upgrades Turbopack

* https://github.com/vercel/turbo/pull/8421 <!-- Tim Neutkens - Fix
Turbopack benchmark for next@canary -->
* https://github.com/vercel/turbo/pull/8396 <!-- Tim Neutkens - Rename
dev_runtime to browser_runtime -->
* https://github.com/vercel/turbo/pull/8397 <!-- Tim Neutkens - Rename
runtime/none to runtime/edge -->
* https://github.com/vercel/turbo/pull/8398 <!-- Tim Neutkens - Remove
unused Node.js runtime -->
* https://github.com/vercel/turbo/pull/8399 <!-- Tim Neutkens - Rename
build runtime to nodejs -->
* https://github.com/vercel/turbo/pull/8400 <!-- Tim Neutkens - Rename
dev runtime to browser -->

<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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 #

-->
2024-06-20 09:26:01 +02:00
vercel-release-bot
16f5c28cb3 v15.0.0-canary.38 2024-06-19 23:23:14 +00:00
Jiachi Liu
0c6dac466a
Fix esm property def in flight loader (#66990) 2024-06-19 18:26:43 +02:00
Joost
50b9966ba9
Add sassOption implementation to support sass-embedded (#64577)
## What?
This PR adds an option to use `sass-embedded`.

## Why?
For large projects sass-embedded improves SCSS compilation time by over
50%.
See also https://github.com/vercel/next.js/discussions/36160

## How?
Added a sassOption `implementation` to configure the sass-loader which
Sass implementation to use.
See also https://www.npmjs.com/package/sass-loader#implementation

I think this a similar approach to what is done for `additionalData`.

## Additional notes
In order to support `sass-embedded`, `sass-loader` is upgraded to
12.6.0.

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-06-19 14:50:21 +00:00
hrmny
d02dfc6e05
feat(turbopack): add support for esm externals in app dir (#64918)
### What?
Writes the async flag to the client reference manifest to support ESM
externals in app dir.

The `app-ssr` context can't have esm externals as that might cause a
module to be async in ssr but not on the client.

Closes PACK-2967
Fixes #64525
2024-06-19 14:49:48 +00:00
Sebastian Silbermann
318e3459c4
Use react-dom/server.edge instead of .browser in Next.js runtime (#66954) 2024-06-19 11:41:07 +02:00
Jiachi Liu
b548fc74b7
refactor: remove hydration link appending console interception (#67011)
### What

Remove the duplicated `setup-hydration-warning` 

### Why

we already handling the warning message appending in error dialog, no
need to intercept it again.
2024-06-19 10:44:27 +02:00
vercel-release-bot
9889322d72 v15.0.0-canary.37 2024-06-18 23:23:07 +00:00
Will Binns-Smith
f30e5dbb29
Run and report benchmarks (#66851)
Using `@vercel/devlow-bench`, this benchmarks changes landed on canary
and reports results to Datadog.
2024-06-18 11:11:15 -07:00
Tobias Koppers
7a9a0ccd2e
fix caching of client chunks (#66971)
### What?

cache wasn't well reused since all client chunks depend on the client
shared chunk, which had a different name for every page.
This fixes that and allows caching of all client component chunks
2024-06-18 16:41:53 +02:00
Karl Keefer
303e1966de
Expand test for AsyncLocalStorage for legacy browser compat (#61873)
Simpler/cleaner alternative to #61872.
Attempting to fix bug
https://github.com/vercel/next.js/discussions/58818#discussioncomment-8422873

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-18 07:05:55 -07:00
Chris Frank
44aeb083cc
Fix internal route redirection with absolute urls outside basePath (#64604)
When performing a redirect() with an absolute path, action-handler
attempts to detect whether the resource is hosted by NextJS. If we
believe it is, we then attempt to stream it.

Previously we were not accounting for basePath which caused absolute
redirects to resources on the same host, but not underneath the
basePath, to be resolved by NextJS. Since the resource is outside the
basePath we resolve a 404 page which returns back as `text/x-component`
and is thus streamed back to the client within the original POST
request.

This PR adds a check for the presence of the basePath within absolute
redirect URLs. This fixes the above problem.

fixes #64413
fixes #64557

---------

Signed-off-by: Chris Frank <chris@cfrank.org>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-18 06:58:38 -07:00
Jiwon Choi
a2deeeba72
refactor(next): package.json keywords back-end should be backend (#66974)
### Why?

Following of #64173, keyword `back-end` was `backend`


https://github.com/vercel/next.js/assets/120007119/644fe2fb-3db4-4b47-9070-7c504987bdc2
2024-06-18 06:05:07 -07:00
Zack Tanner
24d7a3c7dc
Remove lazyDataResolved flag (#66578)
This removes the `lazyDataResolved` property on the CacheNode -- it was
added to avoid repeatedly applying the server-patch action while data is
missing (and while waiting for the server to respond), but if we just
move the patch action be attached to then server fetch, there's no need
to separate these (we're already suspending indefinitely while data is
missing)
2024-06-18 15:00:19 +02:00
JJ Kasper
61ee393fb4
Refactor internal routing headers to use request meta (#66987)
This refactors our handling of passing routing information to the render
logic via headers which is legacy from when we had separate routing and
render workers. Now this will just attach this meta in our normal
request meta handling which is more consistent and type safe.
2024-06-18 05:59:36 -07:00
Vercel Release Bot
14fdc8ab71
Update font data (#66969)
This auto-generated PR updates font data with latest available
2024-06-18 05:59:07 -07:00
Dima Voytenko
dc461512d3
Testmode: use ipv4 address to reduce dependency on local system configuration (#66968)
We've run into numerous issues with local system configurations that
prefer ipv6 and failing to connect to the test proxy.

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-06-18 07:24:59 +00:00
Donny/강동윤
e931ec671c
build: Update swc_core to v0.95.2 (#66902)
# Turbopack

* https://github.com/vercel/turbo/pull/8473 <!-- Donny/강동윤 - feat: Check
the number of direct dependants while tree shaking -->
* https://github.com/vercel/turbo/pull/8420 <!-- Tobias Koppers - Tree
Shaking grouping of items -->
* https://github.com/vercel/turbo/pull/8510 <!-- Tobias Koppers - read
larger chunks when reading a trace file -->
* https://github.com/vercel/turbo/pull/8509 <!-- Tobias Koppers - avoid
duplicates in primary_modules -->
* https://github.com/vercel/turbo/pull/8508 <!-- Tobias Koppers - only
create spans for nodes that are actually visited -->
* https://github.com/vercel/turbo/pull/8502 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.95.2` -->


### What?

Update `swc_core`.

- [CHANGELOG](064af5391d/CHANGELOG.md (160---2024-06-15))


### Why?

I improved the performance of the parser by margin.
2024-06-18 03:27:52 +00:00
Tobias Koppers
c9eab6ea7a
small memory and tracing improvement (#66899)
### What?

* reduce resolve tasks
* fix name for tracing
2024-06-18 04:34:27 +02:00
vercel-release-bot
83f21e98c5 v15.0.0-canary.36 2024-06-17 23:23:31 +00:00