Commit graph

10352 commits

Author SHA1 Message Date
vercel-release-bot
033ba46f56 v14.0.2-canary.1 2023-10-31 09:34:35 +00:00
Nhan Doan
adc636dd54
fix: update Next.js version in create-next-app (#57532)
### What?
The default template generated from `create-next-app` still says **Next.js 13**.

<img width="1053" alt="image" src="https://github.com/vercel/next.js/assets/2561973/1413dcda-d73d-43a9-ba47-8322cf193c52">

### Why?
Next.js 14 is released.
2023-10-31 01:36:27 +00:00
Jimmy Lai
6e6503f59e
perf: change the chunks configuration for server code (#57773)
Stumbled upon this while investigating. The previous configuration did not make a lot of sense.

On Node, fs reads can be expensive so it's best to avoid them as much as possible. The current configuration would create chunks eagerly for nothing, leading to sub optimal perf.

The only reason we want chunk on the server is to avoid reloading common parts between entrypoints, so I'm changing the config to reflect that.
2023-10-31 01:18:45 +00:00
Vadim Korolik
f3bba78ce9
Add @highlight-run/node to externals list (#57783)
This is a native module that uses node.js features, so it should be
externalized by default.
Related to #52091

cc @deltaepsilon
2023-10-30 18:04:24 -07:00
mknichel
60422e65a5
[.next/trace] Serialize trace info across workers to preserve .next/trace with webpackBuildWorker (#57761)
This PR sets up the webpack build workers (webpackBuildWorker: true) to serialize debug trace information across the worker boundary so that it can appear in the final .next/trace file at the end of the build.

Currently, when webpackBuildWorker is turned on, all traces that appear under the webpack compilation are lost. After this PR, they will appear in the trace file just like when the workers are not enabled.
2023-10-31 00:53:10 +00:00
Jiachi Liu
cd821c8e03
Fix nested esm package default import resolving mismatch (#57784)
For app router bundling layers "SSR rendering" and "browser" layer, which are used for server side rendering and client, we should still apply the module resolving rules to all assets since we bundled everything, removed the default exclude conditions as they'll not apply the rules to node_modules. That could cause the mismatch resolving for package.

E.g. You have two dual packages A and B are both compatible for ESM and CJS, and both have default export. B is depent on A, but when you import B in a client component that will be SSR'd, it's picking up the CJS asset like the case described in #57584 .

Fixes #57584 
Closes NEXT-1702
2023-10-31 00:31:23 +00:00
vercel-release-bot
5eb6607279 v14.0.2-canary.0 2023-10-30 23:23:45 +00:00
OJ Kwon
cce9f0d34f
fix(metadata): align metadata suffix hash between turbopack (#57544)
### What?

Wraps up metadata-dynamic-routes tests fixes for the turbopack. There is 1 remaining failing test due to lacks of supporting `import.meta.url` which need to be addressed separately.

I spent amount of time why turbopack cannot find the route for the dynamic metadata for a certain route. In the end, found there are mismatching expectations for the route due to different hash for the certain route. We do use the same djb2 hash between next.js and turbopack both, so it was quite confusing why we don't get deterministic hash.

After trying some experiments, found out root cause was how 2 different runtimes handle overflow for given type of numbers. In rust + turbpack we use u32 and do 32-bit hash calculation for given string, while in js we implicitly used number type as is, in result overflow occurs with default 53-bit float. 

Originally I tried to adjust hash in turbopack side to preserve js hash as-is, but so far I found it was non trivial to do so as rust there's no out of the box types we can coerce to the js number type. In result, unlike other fixes in turbopack this PR changes how js hash is being generated. I hope this woulndn't be a breaking changes; expect so since this is a metadata specific hash that we do not have written spec for it.

Closes WEB-1890
2023-10-30 19:56:55 +00:00
vercel-release-bot
4df888a55f v14.0.1 2023-10-30 19:21:25 +00:00
vercel-release-bot
41dec2cbd6 v14.0.1-canary.5 2023-10-30 18:37:29 +00:00
Josh Story
e26c9011d6
Update React from 8c8ee9ee6 to 0c6348758 and types (#57772)
Update React from 8c8ee9ee6 to 0c6348758

- https://github.com/facebook/react/pull/27627
- https://github.com/facebook/react/pull/27624
- https://github.com/facebook/react/pull/27610
- https://github.com/facebook/react/pull/27592
- https://github.com/facebook/react/pull/27593
- https://github.com/facebook/react/pull/27588
- https://github.com/facebook/react/pull/27591
- https://github.com/facebook/react/pull/27587

Update @types/react to 18.2.33
Update @types/react-dom to 18.2.14
2023-10-30 11:31:38 -07:00
moka-ayumu
0623a4f79f
Modify tailwindcss related dependency of create-next-app (#57262)
### What?
If the version of `autoprefixer` is 10.0.0 and the version of `tailwindcss` is less than 3.3.0, the error `RangeError: Maximum call stack size exceeded` occurs when you create with tailwindcss & typescript and run it.

### Why?
The exact reason is unknown, but it appears to be a compatibility issue. Also, currently configuring tailwindcss with ts makes the tailwind config file in ts, which is supported since tailwindcss version 3.3.0. (In js, it works even if you set the version of `autoprefixer` to 10.0.1 and lower the version of tailwindcss.)

### How?
Simply default the minimum version of `autoprefixer` to 10.0.1 and the minimum version of `tailwindcss` to 3.3.0.
2023-10-30 17:54:28 +00:00
Leah
6dc7c3c436
fix(turbopack): don't match empty route groups (#57647)
### What?

Previously the matching just used the last match for children which could lead to empty groups or groups without page matches overriding the actual page.

This PR makes sure this doesn't happen and emits an issue (which unfortunately doesn't get displayed yet) in case there are 2 `page` matches which would go into the children slot.

Closes WEB-1895
2023-10-30 17:44:02 +00:00
vercel-release-bot
9d49afc5ea v14.0.1-canary.4 2023-10-30 17:29:15 +00:00
Zack Tanner
9128b58654
fix gsp tracing issue (#57766)
This removes the ignores for dev react bundles which was added as an
optimization but causes issues when react is imported from an ESM module
since all requires are being analyzed for named exports.

Fixes #57582
2023-10-30 18:24:51 +01:00
Jiachi Liu
3553c6516d
Improve error for missing default export in dynamic metadata routes (#57711)
Displaying hints of "missing default export" if you didn't properly export the `default` handler for og image 

```
   ▲ Next.js 14.0.1-canary.2
   - Local:        http://localhost:3000

 ✓ Ready in 1089ms
 ✓ Compiled /opengraph-image/[[...__metadata_id__]]/route in 211ms (44 modules)
 ⨯ Error: Default export is missing in "/Users/huozhi/workspace/next.js/test/e2e/app-dir/metadata-dynam
ic-routes/app/opengraph-image.tsx"
    at eval (webpack:///app/opengraph-image.tsx?3407:11:1)
    at (app-metadata-route)/../../../../packages/next/dist/build/webpack/loaders/next-metadata-route-lo
ader.js?page=%2Fopengraph-image%2F%5B%5B...__metadata_id__%5D%5D%2Froute&isDynamic=1!./app/opengraph-im
age.tsx?__next_metadata_route__ (/Users/huozhi/workspace/next.js/test/e2e/app-dir/metadata-dynamic-rout
es/.next/server/app/opengraph-image/[[...__metadata_id__]]/route.js:362:1)
    at __webpack_require__ (/Users/huozhi/workspace/next.js/test/e2e/app-dir/metadata-dynamic-routes/.n
ext/server/webpack-runtime.js:33:42)
```
2023-10-30 16:36:24 +00:00
AZM
8dbf4e616d
chore: Update flight-client-entry-plugin.ts typo (#57734)
Updated typo

<!-- 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?
  Updated one of the most common typos
### Why?
  Improve the quality of documentation for readers.
### How?
    neccessary -> necessary
Closes NEXT-
Fixes #

-->
2023-10-30 16:31:59 +01:00
Niaz Morshed Nayeem
3248ee71c8
Fix: Build compilation warning when using middleware (#57685)
### Fixing a bug

- Related issues linked using `fixes #57533`
- 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

### What?

If there is a `middleware.js` or `middleware.ts` file in Next.JS 14, running `next build` shows the following warning:

```
./node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js
A Node.js module is loaded ('url' at line 3) which is not supported in the Edge Runtime.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime

Import trace for requested module:
./node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js
```
This PR will remove the warning.

Closes NEXT-
Fixes #57533
2023-10-30 02:15:11 +00:00
Dak Washbrook
24a71dcd72
Support viewport export via TS Plugin (#57554)
### What?

The Next.js TS Plugin generally supports the named exports for the pages and layouts.
Currently the TS Plugin doesn't support the new viewport export.

See: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#use-viewport-export

### How?

Added the `viewport` export to the `constants.ts`.

Closes #57680
2023-10-30 00:59:47 +00:00
Vercel Release Bot
7e1f57bef4
Update font data (#57728)
This auto-generated PR updates font data with latest available
2023-10-30 00:36:48 +00:00
vercel-release-bot
fc1ecc407c v14.0.1-canary.3 2023-10-29 23:22:02 +00:00
Boris Besemer
c88e089ade
fix: move logging config validation out of experimental (#57530) 2023-10-29 16:09:33 +01:00
vercel-release-bot
54a9da0a1e v14.0.1-canary.2 2023-10-28 23:21:43 +00:00
JJ Kasper
27471acd30
Add node-pty to externals list (#57640)
This is a native module so exteranlize it by default
2023-10-27 17:06:54 -07:00
vercel-release-bot
c70506de77 v14.0.1-canary.1 2023-10-27 23:22:34 +00:00
mknichel
ec20e24645
[Traces] Await the flush of the trace write stream to make sure trace file is written (#57641)
This PR fixes an issue where sometimes the `.next/trace` file would not be written at the end of a build. The process was not waiting for the write stream to be flushed before closing, losing the contents of the trace, which was especially visible when using `experimental-compile`.
2023-10-27 22:14:34 +00:00
mknichel
71116ce364
debug: Add tags to next build traces to track build configuration in the .next/trace file (#56965)
This PR adds two simple tags to the `.next/trace` output for the `next-build` span to keep track of parameters to the build step when looking at build traces, and a `isTurbotrace` for the tracing step.
2023-10-27 21:51:26 +00:00
Dima Voytenko
08fdc1ebcf
OpenTelemetry: propagate a configured context(s) to root requests (#57084)
Implement OTEL propagation according to the OpenTelemetry API per
https://opentelemetry.io/docs/specs/otel/context/api-propagators/. Any
configured propagator should work with this API, including
`W3CTraceContextPropagator` (https://www.w3.org/TR/trace-context/).

Alternative to the https://github.com/vercel/next.js/pull/56891.

/cc @sfirrin
2023-10-27 14:10:15 -07:00
Lee Robinson
ec8ee596d0
Add Next.js 14 codemods to CLI output. (#57552)
Following the documentation:

```
▲  commerce/ npx @next/codemod@latest next-og-import .
Invalid transform choice, pick one of:
- name-default-component
- add-missing-react-import
- withamp-to-config
- url-to-withrouter
- cra-to-next
- new-link
- next-image-to-legacy-image
- next-image-experimental
- built-in-next-font
```
2023-10-27 02:18:20 +00:00
vercel-release-bot
6a63c4ffeb v14.0.1-canary.0 2023-10-26 23:22:39 +00:00
Phil Wolstenholme
e93a35bb26
update next/third-parties to use Next 14 or 13 as a peer dependency, instead of just 13 (#57515)
Just tried to update to 14 but `next/third-parties` looks like it's still expecting us to be on Next 13

```
Error: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: shop-next@0.1.1
npm ERR! Found: next@14.0.0
npm ERR! node_modules/next
npm ERR!   next@"^14.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^13.0.0" from @next/third-parties@14.0.0
npm ERR! node_modules/@next/third-parties
npm ERR!   @next/third-parties@"^14.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/XXXXXXXX/.npm/_logs/2023-10-26T17_27_38_736Z-eresolve-report.txt
```
2023-10-26 22:05:01 +00:00
vercel-release-bot
b546d8b22c v14.0.0 2023-10-26 16:04:54 +00:00
JJ Kasper
340a9f7b3e
Update experimental config check (#57505)
As discussed updates the warning with experimental config

---------

Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
2023-10-26 06:04:22 -07:00
vercel-release-bot
356dc42f1a v13.5.7-canary.37 2023-10-26 12:34:50 +00:00
Jimmy Lai
cfbffb2ff4
Revert "Apply react-server transform and valication to middleware (#5… (#57504)
…7448)"

This reverts commit 17bd232cf2.

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

-->
2023-10-26 05:29:49 -07:00
vercel-release-bot
fc1b6c4742 v13.5.7-canary.36 2023-10-26 11:42:38 +00:00
Jimmy Lai
3e7f96e16a
revert "Apply react-server condition for pages api (#57459)" (#57500)
This reverts commit 6b18f397cb.

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

-->
2023-10-26 04:37:13 -07:00
vercel-release-bot
c7d02f48b2 v13.5.7-canary.35 2023-10-26 08:44:45 +00:00
Tobias Koppers
936b953eda
update turbopack (#57487)
* https://github.com/vercel/turbo/pull/6290 <!-- Tobias Koppers - fix
hmr client to be actually reliable -->

Closes WEB-1887

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 10:39:33 +02:00
Sebastian Markbåge
d396631090
Don't terminate PPR renders with dynamicUsageErr (#57488)
We track dynamicUsageErr in patch-fetch usually and then abort the whole
prerender if that happens. With PPR we use maybePostpone and not that so
we should just not abort when we use ppr.
2023-10-26 04:35:56 -04:00
Zack Tanner
4666e8545d
revert ppr logging changes (#57486)
need to investigate this better

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 00:28:24 -07:00
vercel-release-bot
a9fc27a8e5 v13.5.7-canary.34 2023-10-26 07:19:26 +00:00
Tobias Koppers
9d8dbfa337
fix client-only alias in SSRed client components (#57484)
### What?

client-only is allows in SSR, server-only should error



Closes WEB-1883
2023-10-26 09:13:59 +02:00
Tobias Koppers
581b1be064
update turbopack (#57485)
* https://github.com/vercel/turbo/pull/6289 <!-- Tobias Koppers - Revert
"normalize pattern correctly to avoid slow path in matching" -->

Closes WEB-1885
2023-10-26 09:13:00 +02:00
Andrew Clark
00df11b0a7
Update React from a9985529f to 8c8ee9ee6 (#57483)
React upstream changes:

- https://github.com/facebook/react/pull/27594
- https://github.com/facebook/react/pull/27584

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-26 07:10:27 +00:00
Jiachi Liu
07483d4b4c
Move serverActionsBodySizeLimit to serverActions.bodySizeLimit (#57433)
Scope all `serverActions` config in one group "serverActions" to make it
more semantics

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 08:51:32 +02:00
Jiachi Liu
b3e5392b8d
Add deprecation warning for disabling output file tracing (#57467)
<img width="728" alt="image"
src="https://github.com/vercel/next.js/assets/4800338/71f95a9d-3d9e-4191-ab85-6b88311d20c5">

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 08:51:17 +02:00
Zack Tanner
2c21635cf6
if there are errors during postpone, or postpone was caught, fail static generation (#57477)
Rather than sending a warning, we should fail the build if a postpone
call is caught. We should also fail the build if there are any errors
during static generation similar to the non-ppr case.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-25 23:43:33 -07:00
Shu Ding
3e341678cb
Fix missing SWC transforms for optimized barrel files (#57474)
With Barrel Optimization, we are trying to "shortcut" the import to be
directly pointing to the final target, as barrel files shouldn't have
any side effects. However, there could be `"use client"` and `"use
server"` directives which we can't ignore. Hence we must apply the
`serverComponents` transform of SWC to these barrel files too.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-25 23:38:35 -07:00
Justin Ridgewell
df0fb70c8c
turbopack: Support Actions in both RSC and Client layers (#57475)
### What?

Adds support for Server Actions imported by both server and client.

### Why?

If an Action is imported by both the Client and RSC layers, we need to
support them as if they're the same action.

### How?

First, we need to ensure both layers create the same action hash ids,
which we can then use to deduplicate actions imported by both layers. If
a conflict is found, we prefer the RSC layer's action.

Closes WEB-1879

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 08:32:04 +02:00