Commit graph

16128 commits

Author SHA1 Message Date
Delba de Oliveira
a611641cec
[Docs] Remove extra line in summary dropdowns (#51226)
They were causing markdown to render a <p> tag which has margins and broke the summary dropdowns
2023-06-13 13:50:20 +00:00
Chad Luo
2a93345f14
[Docs] fix example function param and signature (#51235)
Apparently the object deconstruction in the example doesn't work. This PR proposes a working version:

```diff
- export default function Page({ params: { slug: string } }) {
-   return <div>My Post: {slug}</div>
- }
+ export default function Page({ params }: { params: { slug: string } }) {
+   return <div>My Post: {params.slug}</div>
+ }
```

According to the [page reference](https://nextjs.org/docs/app/api-reference/file-conventions/page), the page function parameter slugs needs to be retrieved by calling `params.slug`.

The TypeScript section below shows the correct function type signature, although not referencing to the parameter.
2023-06-13 13:33:31 +00:00
vercel-release-bot
b80dc83b23 v13.4.6-canary.2 2023-06-13 13:13:56 +00:00
Kiko Beats
4633b2254b
[docs] Add missing Edge Runtime APIs (#51224)
Added missing APIs, also sorted all of them alphabetically to make it
easier to read.

---------

Co-authored-by: Delba de Oliveira <delbabrown@gmail.com>
2023-06-13 11:01:40 +01:00
Jiachi Liu
d544c2806e
docs: fix prettier lint (#51222)
Fix prettier lint errors in #51080
2023-06-13 09:19:10 +00:00
Michael Novotny
cefdb27662
docs: Adds Note to Good to know consistency (#51080)
* Changes all `Note` → `Good to know`
* Consistently puts the colon on the outside of bold text
* Documents singe and multi-line styles in contribution guide

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-12 19:00:07 -07:00
vercel-release-bot
6e9113fe59 v13.4.6-canary.1 2023-06-12 22:32:21 +00:00
Tyler Lutz
9fc904f489
docs: fix typos in Server Actions docs. (#51185) 2023-06-12 15:07:27 -07:00
Max Leiter
cdfdaab67d
docs: correct valid route segments for icon/favicon/apple-icon (#51188)
Improves the documentation to correctly mention that only favicon is
restricted to the root app/ segment.

x-ref:
[slack](https://vercel.slack.com/archives/C03KAR5DCKC/p1686425241975119)
2023-06-12 15:06:57 -07:00
Jeremy Douglas Hoover
3b2ee1e085
docs: Fix typo on strategy for next/script. (#51189) 2023-06-12 15:06:12 -07:00
Jack Sutton
4ae8bc7da0
docs: Update Vanilla Extract example link. (#51192) 2023-06-12 15:05:48 -07:00
Tyler Lutz
1987f44474
docs: Add separate lines to eslint prompt. (#51143) 2023-06-12 15:05:23 -07:00
S. Mahdi Mir-Ismaili
0c9041e5b9
Fix a mistake URL in "docs/generate-metadata.mdx/metadataBase" (#51199)
The sample output of `metadataBase` configuration (`<head <link rel="alternate" ...>`) had an incorrect `href`:

https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
2023-06-12 21:34:15 +00:00
Jiachi Liu
9d0129c635
Fix standalone not found (#51172)
Fixes #50232

Passing down the private env into `'render-server'` module to pick up the proper react with require-hook in standalone server
fix NEXT-1260
2023-06-12 21:14:32 +00:00
Jiachi Liu
8a11835fbe
Strip _rsc query for navigation between app and page (#51195)
Fix a missing case from #50970

When navigating from app to page, the `_rsc` query should still be stripped
2023-06-12 20:36:36 +00:00
Steven
a6a9d65c8c
fix: helpful error when output: export and next export -o (#51191)
We already have a warning when using `next export` with `output: export` because the `next export` is effectively a no-op (the exported output was already generated during `next build`).

However, this PR ensures that `next export -o <dir>` throws an error when `output: export` is defined because the files were already emitted to the `distDir` in the `next build` step and we can't safely no-op at this point.

We also guide the user to the correct solution which is to use `output: export` along with `distDir: <dir>` in your next.config.js (instead of mixing legacy behavior with the new behavior).

fix #48207
fix NEXT-980
2023-06-12 20:15:58 +00:00
Shu Ding
de83bf5598
Revert "Do not merge chunkGroups' CSS files" (#51193)
Reverts vercel/next.js#51103
2023-06-12 19:42:06 +00:00
Delba de Oliveira
d106155c9c
Update next/head warning to link to the correct docs page (#51013)
Fixes https://github.com/vercel/next.js/issues/50844
2023-06-12 19:16:04 +00:00
Michael Novotny
a973ad64d4
Makes codeblock language and filename extensions consistent (#51056)
There was mismatched usage of `js`, `jsx`, `ts`, and `tsx`. Just tried to get them all in sync.
2023-06-12 18:55:08 +00:00
Delba de Oliveira
98351e9398
[Docs] Update static assets page to filter out <PagesOnly> information (#51180)
Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-06-12 18:25:06 +00:00
Jiachi Liu
74225d1945
Prefer module fields for RSC server layer (#51179)
Follow up for #50548 

There're some packages like `aws-sdk-js-v3` which doesn't have a exports field yet: 

```
  "main": "./dist-cjs/index.js",
  "types": "./dist-types/index.d.ts",
  "module": "./dist-es/index.js",
 ```
 
 This PR let u pick up by the js assets based on main fields, will prefer `"module"` field instead of `"main"`
 
 Closes NEXT-1286
2023-06-12 17:50:12 +00:00
OJ Kwon
bcb63f3250
ci(workflow): enable test trace upload (#51107)
### What?

WEB-1150. 

This PR is an attempt to upload next.js's test results into datadog test trace to track its status. 

Originally it tried to use automatic trace injection (dd-trace/ci/init). However, due to some of custom environments / setup we use it was not compatible out of the box. Instead, this PR injects a new test reportert to generate junit report, then upload it at once at the end of the testing pipeline.

The reporter is configured to run when necessary variables set, local run should not be affected. 

One thing to note is this report will not count retry results, as it'll create duplicated test entry with multiple results since we runts jest per individual test. This'll allow to detect flaky test easier, but also it means we'll get bit of skewed test results compare to the real world as first failure will be accounted as test fail immediately.
2023-06-12 17:14:13 +00:00
Jiachi Liu
272ffffd59
docs: fix prettier error (#51182) 2023-06-12 11:31:53 -05:00
Mehran Mirshekaran
0f5b1917df
docs: remove accidental character before use client directive. (#51176) 2023-06-12 08:46:37 -07:00
Shu Ding
b664cdb1c0
Add option for debugging CPU usage (#51174)
Add a `NEXT_CPU_PROF` environment variable to programmatically profile CPU for the router worker and two render workers. This is helpful because the `--cpu-prof` isn't reliably writing the result (#27406) especially with our multi-process architecture.

![CleanShot-2023-06-12-GS9p3SbN@2x](https://github.com/vercel/next.js/assets/3676859/b7cf80d2-a35a-4e90-978d-dec70be89f90)
2023-06-12 15:31:36 +00:00
Lee Robinson
e5a45c8a49
docs: clarify usePathname usage as client hook. (#51146)
Using client components for `usePathname` is not a de-optimization. This
update tries to make this more clear by sharing more information about
the design and tradeoffs of this approach.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-12 07:58:06 -07:00
Lee Robinson
f9813ad671
docs: Improve Actions docs. (#51145)
Adds more clarity on which pieces are Next.js only, how actions
integrate with Next.js, and details on the progressive enhancement
story.
2023-06-12 07:57:17 -07:00
Tobias Koppers
6b0a6f0c25
add turbopack integration tests to CI (#50904)
### What?

* enable turbopack tests in new CI
* split pre-build step into native and JS builds to allow to start
native tests faster
* update swc_core to sync with turbo
* update turbopack

### Why?

Running our test suite is still important as long we don't have the full
integration test suite enabled.

### Turbopack updates

* https://github.com/vercel/turbo/pull/5215 <!-- OJ Kwon - ci(workflow):
upload benchmark results to datadog -->
* https://github.com/vercel/turbo/pull/5239 <!-- OJ Kwon -
fix(swc_plugin): use shared runtime -->
* https://github.com/vercel/turbo/pull/3090 <!-- CHEN Yuan - Docs: prior
to run testcases, add guides to install dependencies for testcases. -->
* https://github.com/vercel/turbo/pull/5264 <!-- Tobias Koppers - update
test runner -->

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-12 07:47:43 -07:00
Tristan
b870bf22e5
docs: Fix useSearchParams link in adoption guide. (#51151) 2023-06-12 07:36:52 -07:00
James Pearson
d2e014a011
docs: fix link to next/font API reference. (#51169) 2023-06-12 07:34:02 -07:00
Omar Houmz
1c1ef0ef3f
Update next-image-unconfigured-host.md with correct Remote Patterns Documentation link to new docs (#49750) 2023-06-12 14:05:37 +00:00
vercel-release-bot
bb092bc127 v13.4.6-canary.0 2023-06-12 11:38:47 +00:00
Jiachi Liu
aa3e043bbf
Add unique search query for RSC requests to be cacable on CDN (#50970)
Adding a `_rsc` query for RSC payload requests so that they can be
differentiated on resources level for CDN cache for the ones that didn't
fully respect to VARY header.

Also stripped them for node/edge servers so that they won't show up in
the url

x-ref:
https://github.com/vercel/next.js/pull/49140#issuecomment-1549405009

Closes #49140
Closes NEXT-1268
2023-06-12 11:52:36 +02:00
Sayyed Shozib Abbas
109e6cb34b
docs: fix grammar issue in next/image intro. (#51133) 2023-06-11 12:59:21 -07:00
Shu Ding
38d789f826
Do not merge chunkGroups' CSS files (#51103)
This is a temporary fix before we can ship #51018 (more details there). If there're multiple chunk groups holding the same CSS module, we use files from the first one. This has some flaws but still better than our current status.
2023-06-11 16:05:26 +00:00
OJ Kwon
6ba6762d75
ci(workflow): consolidate bytesize upload workflow (#51110)
### What?

context: https://github.com/vercel/next.js/actions/runs/5231928600/jobs/9446394605#step:16:33

For some reason, installing datadog cli on some action runner (Windows) is unexpectedly slow: while other platform takes ~30s, windows only takes more than > 7m.

PR updates workflow logic to consolidate artifacts, and then send metrics at once on a separate ubuntu workflow.
2023-06-11 04:42:22 +00:00
Jiachi Liu
cfd64aab55
Fix windows metadata slashes (#51088)
Fixes #51086

The path is used as href, should be normalized as posix style
fix NEXT-1282
2023-06-10 23:30:32 +00:00
JJ Kasper
d8763ca347
Fix getting last stable release stats (#51106)
Small fix ensuring we use the correct repo for getting the last stable
tag
2023-06-10 16:00:10 -07:00
vercel-release-bot
db10dd6740 v13.4.5 2023-06-10 22:03:48 +00:00
vercel-release-bot
d683006526 v13.4.5-canary.12 2023-06-10 21:17:36 +00:00
JJ Kasper
efaddcda60
Fix race condition with publish (#51105)
We publish multiple packages in parallel which can cause issues with the
prepublish only script running as turbo clearing/restoring dist caches
can causing files to be missing if a publish is in progress. We also
don't need to run these as all packages are already built prior to
publishing. This also includes fixes for release stats.
2023-06-10 14:05:27 -07:00
Shu Ding
2ede83560f
Remove redundant condition (#51070)
This review comment was sent after merging the PR: https://github.com/vercel/next.js/pull/51067#discussion_r1224745071

The layer condition doesn't do anything if `hasServerComponents` is disabled.
2023-06-10 20:50:43 +00:00
vercel-release-bot
41d92fe3fd v13.4.5-canary.11 2023-06-10 19:47:11 +00:00
Pau Fernández
bd97c01fca
docs: remove added verb and fix good to know section. (#51054) 2023-06-10 11:55:27 -07:00
Arun S V
6a9fb9e77f
Update 03-linking-and-navigating.mdx (#51084)
Fixed a typo in 'Scrolling to an id' section.

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

- 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-06-10 11:53:42 -07:00
Michael Novotny
8366f1af31
docs: Clarify manual graceful shutdown in dev server (#51078)
Replaces #50481

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-10 07:24:25 -07:00
Michael Novotny
e797546ee3
Adds missing and in How to Use These Docs section (#51058)
Fixes #50227
2023-06-10 13:15:02 +00:00
Michael Novotny
83860091a6
Removes PORT from .env concatenation example (#51063)
This is to [avoid confusion](https://github.com/vercel/next.js/issues/32603#issuecomment-996751692) about being able to set Next.js's port via `.env`, which is currently not allowed.
2023-06-10 10:47:49 +00:00
OJ Kwon
9bc73dbc1a
ci(workflow): generate run summary for all build targets (#51057)
### What?

I noticed some deploy job fails at

https://github.com/vercel/next.js/actions/runs/5222848985/jobs/9428961695#step:15:20

when there's no summary exists by missing necessary flags for the few platform targets.
2023-06-10 00:27:44 +00:00
vercel-release-bot
387430c659 v13.4.5-canary.10 2023-06-09 23:46:48 +00:00