Commit graph

16581 commits

Author SHA1 Message Date
vercel-release-bot
63a6cdaf53 v13.4.10-canary.3 2023-07-10 23:02:55 +00:00
Florentin / 珞辰
0648a109eb
add version to function config manifest (#52507)
Adds `version` to function config manifest as suggested in https://github.com/vercel/vercel/pull/10069#discussion_r1255021336
2023-07-10 20:28:59 +00:00
Shu Ding
d175aea210
perf: Refactor recursiveReadDirSync (#52517)
- Use `opendirSync` instead of `readdirSync`
- Use `.slice` instead of `.replace` as the rootDir

Before (1.54ms):

![CleanShot 2023-07-10 at 18 33 23@2x](https://github.com/vercel/next.js/assets/3676859/829e0a49-35da-4754-bc3f-6fe243e815f4)

With the change (0.88ms):

![CleanShot 2023-07-10 at 18 47 43@2x](https://github.com/vercel/next.js/assets/3676859/cabe1fdd-5861-49ba-8c8d-b505c16fbf7a)

This scales when public/ folder grows.
2023-07-10 17:51:42 +00:00
SleeplessOne1917
0ce55e3f09
Chore: Remove redundant intersection type (#52453)
### What?
The type definition of `ImgProps` is the following:
```typescript
export type ImgProps = Omit<ImageProps, 'src' | 'alt' | 'loader'> & {
  loading: LoadingValue
  width: number | undefined
  height: number | undefined
  style: NonNullable<JSX.IntrinsicElements['img']['style']>
  sizes: string | undefined
  srcSet: string | undefined
  src: string
}
```

`ImgProps` is then used as part of the definition of the `ImageElementProps` type. For the latter, `Omit<ImageProps, 'src' | 'alt' | 'loader'>` is intersected with `ImgProps` even though the intersection with that type is already part `ImgProps`'s definition. This PR removes the redundancy.

### Why?
I was looking at how Next.js implemented it's optimized image component to create something similar for a WASM framework when I noticed this typing and got confused. I figured making a PR would be the polite thing to do.

### How?
Removed redundant part of type definition.
2023-07-10 16:48:02 +00:00
Mate Papp
b450895387
docs: correct TypeScript spelling on the home page (#52500)
### What?
Changing the word TypeScript with an uppercase S.

### Why?
- Because that's the official recommendation from TypeScript. (Reference: [typescriptlang.org](https://www.typescriptlang.org))
- The docs already uses this format (e.g. [TypeScript page](https://nextjs.org/docs/app/building-your-application/configuring/typescript)) so it's just a matter of consistency.
2023-07-10 16:15:19 +00:00
Victor Machado
8360ca0332
docs: add CDN optimization as possible hydration error cause (#52489)
At my work, we use Cloudflare as our CDN, and it has various optimization options for the served code including the "Auto Minify" feature that can minify JS, HTML and CSS to reduce download speed. After months of trying to update React to version 18, I have finally found out that the "Auto Minify" was the root cause of the problem, not anything in our code such as invalid tag nesting or printing dates. Because of that, I thought it would be helpful to add CDN as a possible place for investigating hydration errors.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-07-10 16:09:12 +00:00
Jimmy Lai
810f0e8710
perf: create an experimental bundled version of the next server (#52206)
This PR:
- adds a minified bundled server for Next with some optimisations applied
- a test server in minimal-server.js
- misc changes:
   - makes some polyfills lazy
   - adds a cached version of node-html-parser
   -
2023-07-10 15:40:06 +00:00
vercel-release-bot
4e710645f8 v13.4.10-canary.2 2023-07-10 14:44:00 +00:00
Shu Ding
0fe6e850fe
Fix tracking of client reference manifest (#52505)
The problem was introduced in #52450, that the client reference manifest isn't being tracked and included in the function.

Verified that this fixes the issue.
2023-07-10 14:27:08 +00:00
Balázs Orbán
4ddb6fc794
chore: add label to locked threads (#52497)
[Slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1688975623048229)

Docs: https://github.com/dessant/lock-threads#inputs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-10 14:59:23 +02:00
Tobias Koppers
8643014b13
turbopack: Module Trait (#52401)
### What?

refactoring see https://github.com/vercel/turbo/pull/5477

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-10 14:35:53 +02:00
Tim Neutkens
73e2979cb8
Ensure useParams return array for catch-all routes (#52494)
## What?

Ensures `useParams` matches `params` passed to the page, also matches the docs.

Fixes #50856
Fixes NEXT-1419
2023-07-10 12:04:44 +00:00
Ryo Matsukawa
cf08f60077
fix(create-next-app): click event blockage under 1024px by adjusting z-index (#52074)
### What?

Fixed a bug that the title of the topmost Docs was unclickable when less than 1024px.

### Why?

This appears to be due to the fact that these clickable elements are overlapped by the logo image wrapper in Next.js, preventing the propagation of click events for these elements.

### How?

To mitigate this problem, this PR assigns a z-index of -1 to the Next.js logo image wrapper. This change ensures the wrapper is placed beneath the clickable elements, thereby preventing it from blocking click events on smaller screens.

#### Before

https://github.com/vercel/next.js/assets/76232929/7b84737d-8a43-4c92-870e-86d08e4eaf74

#### After

https://github.com/vercel/next.js/assets/76232929/648b2e9b-33b5-4905-b10f-03904c1f7529
2023-07-10 11:21:36 +00:00
Yagiz Nizipli
85bca2e778
refactor: avoid unnecessary async scopes in eslint (#52418)
This pull request:
- removes unnecessary object copying in `hasEslintConfiguration`
- returns always `null` on `runLintCheck`, and make sure it does not return undefined.
- removes unnecessary async scope creation on `isDirectory`
2023-07-10 10:52:20 +00:00
Balázs Orbán
a06775cdf3
fix: add aws packages to default serverComponentsExternalPackages (#52388)
Related #51969

[Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1688734253149379?thread_ts=1688734176.782469&cid=C04DUD7EB1B)
2023-07-10 10:24:03 +00:00
Lee Robinson
c6b163f3c5
docs: Update _app and _document (#52479)
- Remove specific TypeScript sections and add JS/TS code block toggles
- Consolidate "Good to know" information into sections
- Add links back to incrementally adopting the App Router when trying to
use escape hatches
- Add better TS example for `getInitialProps` (even tho it's not
recommended, still helpful)
2023-07-10 11:29:17 +02:00
Carlos Menezes
9ea188a06f
chore(docs): Typesafe metadata object (#52252)
Adds missing `Metadata` type to a few declarations.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-07-10 11:19:59 +02:00
Yago Veloso
dfebdb75d9
docs: Add formData example for Route Handlers (#52358)
Add formData function

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-07-10 11:14:12 +02:00
Gnadhi
c15d99dc3e
Update 08-parallel-routes.mdx (#52419)
I Belive this is the incorrect location for the default.js in this
example it should be in app/@authModal/default.js not
app/@authModal/login/default.js

<!-- 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-07-10 11:03:10 +02:00
Ngô Đức Anh
98cc99df46
fix(standalone): fixed output: "standalone" crashing build when there is no app/ page (#51993)
### What?
This PR fixes build crashing when `output: 'standalone'` and `experimental.appDir` is enabled but there is no app pages.

### How?
It does that by checking whether `.next/server/app` exists before copying the folder to `.next/standalone/...`

Closes #51828
Fixes #44442
Fixes #44120
2023-07-10 08:40:02 +00:00
vercel-release-bot
62c2c5abc2 v13.4.10-canary.1 2023-07-10 08:01:26 +00:00
Shu Ding
990c58c5ef
Split the client reference manifest file to be generated per-entry (#52450)
This PR changes client manifest generation process. Instead of one big
manifest file that contains client references for the entire app, we're
now generating one manifest file per entry which only covers client
components that can be reached in the module graph.
2023-07-10 09:48:03 +02:00
Darshan Jain
c68c4bdc9f
fixed error #52486 fetchUsers to fetchUser (#52487)
#52486 

Here I fixed the typo error of fetchUsers to fetchUser in
docs/api-reference/04-functions/not-found.mdx

async function fetchUser(id) { // Here instead of fetchUsers i changed
it to fetchUser
const res = await fetch('https://...')
if (!res.ok) return undefined
return res.json()
}

export default async function Profile({ params }) {
const user = await fetchUser(params.id)

if (!user) {
notFound()
}

// ...
}

https://nextjs.org/docs/app/api-reference/functions/not-found
2023-07-10 09:43:05 +02:00
Jiachi Liu
85033e3add
Override file based images with social images property (#52416)
Metadata API should provide a way to override the filebased metadata
images. As usually for child routes, if there's new social images or
icons are provided, the ones from parent routes should be overridden /
skipped.

The `metadata` object export or `generateMetadata` should be able to do
that. Sometimes users still add other og info (besides images) to
metadata export (both object and `generateMetadata`).
I think we should check if they really have returned images property,
then decide to override.

- For the same level of routes:
- If there's no `openGraph.images` in the returned value, merge with
file based images
- If there's any `openGraph.images` in the returned value, ignore file
based ones

- For child level of routes:
Always override the parent level, ignoring parent level file based
images unless they use `generateMetadata` to merge from
`resolvingParentMetadata` value, then the parent level's file based ones
will present there


Closes NEXT-1418
2023-07-10 09:09:01 +02:00
Hank Lin
2ef8938ff0
docs: fix the incrementalCacheHandlerPath (#52124)
The `incrementalCacheHandlerPath` have to be under `experimental`.
And the path should use `path` library so that the custom cache handler can be used.
2023-07-10 04:08:15 +00:00
Thor 雷神 Schaeff
af1948bde1
docs: add Supabase loader for next/image (#52480)
### What?

- Adds Supabase Storage custom loader docs.

### Why?

- Help folks find supabase storage as an option for Image loaders.
2023-07-10 03:59:41 +00:00
Lee Robinson
4f8f9ae5b0
docs: Improve hydration mismatch error guide. (#52481) 2023-07-09 20:41:42 -07:00
Jordan Newland
922498e886
docs: Update TypeScript plugin section for VS Code prompt (#52111)
Hey Next.js Team, 👋🏻

I noticed Next.js apps scaffolded with create-next-app weren't prompting me for the TypeScript workspace version in VS Code. After digging through the repo, I stumbled on this https://github.com/vercel/next.js/pull/49133 PR from Tim. While this PR explains why it was removed, I'm not sure the docs were ever updated to reflect this change.

This PR aims to address that with a simple note in the TypeScript Plugin section of the TypeScript docs page.

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-09 23:12:36 +00:00
MONEY
ea000d1028
docs: clarify fetch request de-duplication (#52100)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:55:15 -07:00
nroland013
ef6cb4c954
docs: Add Kuma to CSS-in-JS supported list. (#52438)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:54:19 -07:00
Luc Gagan
399fa9cfa9
docs: Add Playwright/Cypress Discord links (#52084) 2023-07-09 15:53:54 -07:00
Tom Ballinger
a2618ede90
examples: Update Convex to latest version (0.19) (#52473)
Update Convex example to use convex 0.19.x

- [x] The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- [x] Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md
2023-07-09 22:51:15 +00:00
Delba de Oliveira
7ea788e472
docs: Improve error handling docs for server-side errors. (#52302)
This PR adds more info about `error.message`, `error.digest`, and
omission of sensitive error details from Server Components.

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-09 15:38:19 -07:00
Nick Mazuk
1ffada9a70
docs: Simplify message in React essentials section. (#52469)
`Infact` is not a word. It should be `In fact`.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-09 19:13:04 +00:00
Jiachi Liu
632a582807
Fix metadata layer webpack rule for server-only (#52403)
After we separating the metadata routes to a separate layer, we didn't apply the webpack alias rules properly to it as it's should still be treated as pure "server" side

This PR fixes the aliasing for that new metadata layer and make it working properly with "server-only"

Fixes #52390
2023-07-09 18:23:51 +00:00
Brennan Colberg
99490de928
fix metadata-related typo in MDX documentation (#52446) 2023-07-09 16:34:15 +02:00
Steven
0abc874ed5
chore(ci): fix turbo input path globs (#52414)
This PR fixes turbo.json inputs to avoid cache hit when it should be cache miss.

Example PR it was incorrectly cached:

- [PR 52407](https://github.com/vercel/next.js/pull/52407)
- [Commit 06b780](06b780e15e)
- [Logs with cache hit](https://github.com/vercel/next.js/actions/runs/5488474758/jobs/10001427837#step:27:29)

The docs mention the glob is relative to the workspace (aka package) directory, not the monorepo root.

> inputs globs must be specified as relative paths rooted at the workspace directory.

https://turbo.build/repo/docs/reference/configuration#inputs
2023-07-08 01:57:24 +00:00
Justin Ridgewell
9ccc6fc4a6
[turbopack]: Remove skipped integration tests (#52421)
https://github.com/vercel/next.js/pull/52413 removed all of our skipped tests, and the test suite that runs them will panic if none are found as a safety feature.
2023-07-07 23:41:07 +00:00
Shu Ding
e50c9180a3
Cache concurrent ensurePage requests for the same page (#52360)
This should resolve part of the `MaxListenersExceededWarning` problem mentioned in #50909. When there are too many concurrent requests sent to the dev server, we only need to handle the first.

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2023-07-07 23:08:55 +00:00
Alex Kirszenberg
b8589dfdb0
Update Rust nightly toolchain (#51757)
Matching turbo PR: https://github.com/vercel/turbo/pull/5376

## Turbopack updates

* https://github.com/vercel/turbo/pull/5376 <!-- Alex Kirszenberg -
Update nightly toolchain -->
2023-07-07 18:17:07 -04:00
Will Binns-Smith
d660bc906f
Remove integration tests now in vercel/turbo (#52413)
These tests were moved into vercel/turbo in https://github.com/vercel/turbo/pull/5415.
2023-07-07 20:35:07 +00:00
Donny/강동윤
d11aafb740
Update swc_core to v0.79.13 (#52371)
### What?

Update SWC crates to `v0.79.13`.

### Why?

 - Explicit resource management proposal is now fully implemented, although it's behind a parser flag because it's stage 3
 - Some bugs of `swcMinify` are fixed.

### How?

Closes WEB-1272

## Turbopack updates

* https://github.com/vercel/turbo/pull/5475 


Co-authored-by: Alex Kirszenberg <1621758+alexkirsz@users.noreply.github.com>
2023-07-07 19:37:05 +00:00
Wyatt Johnson
f45a7fce9a
Temporarily revert change to pages render (#52407)
This reverts the change to the pages render until a more substantial refactor can ensure that using the custom `app.render` method will attach a match to the request metadata.

- Fixes #52384
2023-07-07 17:58:36 +00:00
Alex Kirszenberg
ffc471cdc7
Turbopack: Use a different chunking context for web entry (#52404)
This fixes Turbopack integration tests.

In https://github.com/vercel/next.js/pull/51928, I made it so all dev chunking contexts output to the same directory. However, in the case of the web entry source, this can lead to conflicts. This PR ensures the chunking context is different for that one case.
2023-07-07 16:28:18 +00:00
Yagiz Nizipli
82dd3dbf35
perf: reduce system calls on eslint plugin (#52359)
This pull request removes unnecessary caching of fsLstat calls by
calling `readdirSync` with `withFileTypes` option.

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-07-07 16:28:44 +02:00
Paul Ostrouskiy
b0e4d8e447
[Docs] remove unnecessary dot. (#52387)
There's unneeded dot in a sentance
2023-07-07 14:50:25 +02:00
Yagiz Nizipli
d5f355adea
perf: improve URL validation performance (#52353)
The performance of the current implementation can be improved by using
`URL.canParse` which is pending for backport to Node 18 right now. This
pull request also reduces the usage of try/catch in the happy path.
2023-07-07 14:22:41 +02:00
Kelly
67d7219cfd
Fix typos in examples/with-redux (#52368)
Two minor typos fixed:

`Thnuk` >> `Thunk`
`configre` >> `configure`
2023-07-07 12:18:50 +00:00
Steven
27a252b953
chore(ci): update logging for release (#52357)
```
Error: Command failed: git clone https://github.com/vercel/next.js --single-branch --branch v13.4.NaN --depth=20 /tmp/next-statsmIAdTr/main-repo
Cloning into '/tmp/next-statsmIAdTr/main-repo'...
warning: Could not find remote branch v13.4.NaN to clone.
fatal: Remote branch v13.4.NaN not found in upstream origin
```


https://github.com/vercel/next.js/actions/runs/5480032198/jobs/9982817862#step:7:1658

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-07 13:46:00 +02:00
vercel-release-bot
b2c6bc4572 v13.4.10-canary.0 2023-07-07 11:14:32 +00:00