<!--
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 that you're making:
-->
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
## Documentation / Examples
- [X ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
---------
Co-authored-by: JJ Kasper <jj@jjsweb.site>
### What?
Add all available options to cli commands
Consistent formatting for all options
### Why?
Options were not consistent across all commands, some were missing
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
It's not totally clear from the docs that using `NEXT_PUBLIC_` env vars
will be a problem for pipelines that deploy the same image to multiple
environments (this bit us in a production incident). This PR is an
attempt to make it clear. Open to feedback/suggestions!
---------
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Add @leerob as an optional global code owner. This means he won't be
tagged for reviews on every PR, but he can approve PRs. This allows the
@vercel/devex to make changes more quickly, without having to distract
the Next.js team.
Co-authored-by: JJ Kasper <jj@jjsweb.site>
These docs were wrong because `./pages` is not sufficient to run a
codemod.
Imagine a project that has `./components` and `./pages` and many
directories for example.
Also its important to run at the root of the Next.js project so that the
path has a `next.config.js` because some codemods modify that config.
Tweak code owners after some testing and feedback.
- Move the Next.js team up to be optional global code owners (so that everyone can review but are not tagged for review). Global individuals should still be tagged if there are no specific `.vercel.approvers` files in subdirectories.
- Adds @vercel/devex to image files so there's coverage on those files for the docs
- Target specific folder and files for Styfle to get notified
- Deletes some rules in the old GitHub codeowners
This removes the `__internal_nextjs_integration_test` compile-time feature. This would end up requiring an additional set of build targets for running integration tests was only used for two cases:
* Determining whether to read from an env var to load mocked Google fonts responses in next/font/google tests. This now uses the presence of this variable to determine whether to use mocked responses.
* Enabling the `next-dev/serializable` feature. This is now set directly instead.
Test Plan:
* Integration tests with Turbopack.
* Manual test of next/font/google with Turbopack
Both of our bundlers won't split different exports of a module into different chunks, we can rely on https://github.com/facebook/react/pull/26624 to simplify the structure. This reduces the size of the client reference manifest by ~70%.
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.
Added missing APIs, also sorted all of them alphabetically to make it
easier to read.
---------
Co-authored-by: Delba de Oliveira <delbabrown@gmail.com>
* 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>
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
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
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
### 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.
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)
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>