Commit graph

17623 commits

Author SHA1 Message Date
Will Binns-Smith
df3c1b822a
Turbopack next/font/google: don't insert css rules for multiple weights or styles (#55852)
If multiple weights or styles are requested, e.g. `Open_Sans({ weight: ['300', '400']})` or `Open_Sans({ style: ['normal', 'italic']})`, don't insert css rules for those properties.

Prior behavior was to insert the first ('300' or 'normal' in the above cases), which did not match webpack's behavior.


Closes WEB-1645
2023-09-25 18:20:52 +00:00
Abdulghane Jesry
1d86a092ad
Update 03-linking-and-navigating.mdx (#55969)
I've removed a duplicated example.
2023-09-25 18:03:24 +00:00
Matthew Martinez
3dc2c1c7f8
docs-55629 update router cache column in cache interactions api table (#55630)
Fixes https://github.com/vercel/next.js/issues/55629.

Updates the `Router cache` column in the [Cache Interactions API Table](https://nextjs.org/docs/app/building-your-application/caching#apis) to reflect `Revalidate (Server Action)` in the `revalidateTag`, `revalidatePath` and `cookies` rows when used in a Server Action.
2023-09-25 17:48:30 +00:00
3λiȯ+
9d86c1224c
docs: Correct place for passing extension option to createMDX() (#55967)
### What?

Fixing a little mistake in the documentation, where the placement of the `extension` option for `createMDX()` was described as being inside the `options` property:

```ts
const withMDX = createMDX({
  options: {
    extension: /\.mdx?$/,
```

But it's actually a property of its own:


```ts
const withMDX = createMDX({
  extension: /\.mdx?$/,
```

I confirmed that the latter is correct because:

- It solves an issue I was having: Unable to import `.md` files
- On the same docs page, there's another place where it mentions this `extension` option and the code example is correct there
- The option is described in a similar issue, such as https://github.com/vercel/next.js/issues/45431#issuecomment-1410363864
2023-09-25 17:38:01 +00:00
Radu Petre Tarean
fb551c90e7
Update 03-linking-and-navigating.mdx (#55907)
I hope this is right, the description said for a link to be active the pathname should match the href, sorry if its wrong
2023-09-25 17:11:47 +00:00
Tim Neutkens
60af1969c5
Remove .test.js from dist (#55946)
Noticed a couple of directories had unit tests in `dist` which are being
run and reported during the Turbopack runs. These are generally quite
small so I'm not expecting this to have much effect on the package size
or CI runs, just making sure the data is correct.
<!-- 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-09-25 19:05:07 +02:00
Mayank
82eb6e6f49
chore(examples): bump dependency versions (#55899)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-25 16:31:49 +00:00
Ahmed Ayman
e0e573546b
fix-failed-to-generate-self-signed-certificate issue:#55891 (#55947)
- Related issues linked using fixes #55891

Wrap binaryPath, keyPath, certPath with double quotes
this with casing an error if there is a directory name has a space for ex. folder with name **test https**
2023-09-25 15:57:58 +00:00
Deepa Subramanian
9e3c1829b0
docs: add not-found to file conventions page (#55944)
Issue: https://github.com/vercel/next.js/issues/53888

Added "not-found.js" information to error.mdx after the `global-error.js`. Please approve.




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-25 15:06:01 +00:00
Balázs Orbán
37b5cea794
chore: NextJS -> Next.js (#55961) 2023-09-25 14:53:11 +00:00
vercel-release-bot
76e06d55a8 v13.5.3 2023-09-25 14:24:47 +00:00
vercel-release-bot
b98ebb2806 v13.5.3-canary.4 2023-09-25 13:16:18 +00:00
Jimmy Lai
ca57258dbd
app router: ensure static prefetch renders loading.js (#55950)
Should fix the problem surfaced in https://github.com/vercel/next.js/issues/43548#issuecomment-1732416492 

The scenario in which this breaks is when we're asking the app renderer to generate a prefetch payload statically. The renderer was not checking if there were loading.js below the current rendering level, which is the root when statically rendering, so it would always render null, which was incorrect.

Tested out with the original repro  https://next-instant-loading-8nv6psqod-feedthejim.vercel.app
2023-09-25 12:59:31 +00:00
Tim Neutkens
69439d8583
Add trailingSlash, basePath, and assetPrefix to Turbopack (#55921)
Still some failing tests but it's a start. Adds the env vars used to
support trailing slash, base path and asset prefix.

<!-- 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-09-25 14:01:52 +02:00
Tim Neutkens
cae7833af4
Ensure Turbopack passing test list is sorted (#55948)
I noticed that running the script to pull in the results wasn't
deterministic between test runs, this ensures the list, passing,
pending, and errors are all sorted, which makes the diff only include
what actually changed between runs.

<!-- 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-09-25 12:59:26 +02:00
Jiachi Liu
a63b89b140
Loose types of app routes return value (#55849)
### What

#51394 introduced a pretty strict type of return value of route type
that causing failure with `next build`.
There're few ways of writing a app route, it could contain few return
values based on the usage:

* return a `Response` or promise of it
* return `NextResponse` of promise of it, since it's extended from
`Response`, same type
* use `redirect()` or `notFound(), since it returns `never`, and the
below code is not reached, the handler itself could still return void.
e.g. using `redirect` in a `GET` route

We loosed the type so `redirect()` can be still allowed without
specifying the return value there.
Related typescript issue:
https://github.com/microsoft/TypeScript/issues/16608#issuecomment-309327984

### How
* Re-enable the bail on types / build error in the app-routes tests
* Separate the tests, move runtime erroring ones to
`test/e2e/app-dir/app-routes-errors`
* Add new case to app-routes tests of mixed return value

Closes #55623 
Related #55604
2023-09-25 11:34:21 +02:00
Tim Neutkens
adcf6e6614
Add experimental.strictNextHead to Turbopack (#55915)
This option only has a process.env replacement. Ensures
`test/development/client-navigation` can run for Turbopack.

<!-- 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-09-25 09:26:14 +02:00
Vũ Văn Dũng
0b74f51882
docs: Add example on query parameters in route handlers (#55789)
### Why?

There is already an example of handling query parameters (`searchParams`) in route handler, but it's quite hidden (in [Opting out of caching](https://nextjs.org/docs/app/building-your-application/routing/route-handlers#opting-out-of-caching)). It made it hard for many developers to figure out how to do that: [there](https://discord.com/channels/752553802359505017/1127781032242974790) [are](https://discord.com/channels/752553802359505017/752647196419031042/1143181251856044042) [several](https://discord.com/channels/752553802359505017/752647196419031042/1146007247630106704) [people](https://discord.com/channels/752553802359505017/752647196419031042/1154623267164917861) who couldn't find that section in the documentation. (Linked are messages in the Next.js Discord server.)

Therefore this PR adds an example to the route handler documentation on how to do that, so developers can take reference more easily.
2023-09-24 15:23:40 +00:00
Mostafa Gouda
8f7d83f1fd
docs: Add note that Server Actions work with static routes (#55626)
In the new next.js v13.5 blog post, the [other improvements section](https://nextjs.org/blog/next-13-5#other-improvements) mentions:

> [Improvement] Server Actions now work with fully static routes (including revalidating data with ISR)

In the forms and mutation docs page, the [good to know section](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#how-server-actions-work) mentions:

> Currently, if a route uses a Server Action, it is required to [render dynamically](https://nextjs.org/docs/app/building-your-application/rendering/server-components#server-rendering-strategies).

I have changed the good to know section to convey the new improvement mentioned in the v13.5 blog post
2023-09-24 15:03:16 +00:00
Tim Neutkens
ea148f3581
Move client-navigation test to test/development (#55888)
Moves the client-navigation test suite to be isolated as part of
test/development.
Tried to make the minimal amount of changes neccesary to ensure the
tests pass first before using the newer `NextInstance` methods.

<!-- 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-09-24 11:38:53 +02:00
João de Vasconcelos
3b8bbe197f
Fix missing async keyword in function declaration (#55887)
Just a one word change to fix the example in https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#generate-images-using-code-js-ts-tsx
2023-09-24 01:54:38 +00:00
Dom Sip
814db26c9c
Revert "fix typo in API Reference - Image Component" (#55889)
Currently the image props section is broken:
https://nextjs.org/docs/pages/api-reference/components/image



Reverts vercel/next.js#55776

fixes: [#55869](https://github.com/vercel/next.js/issues/55869)
2023-09-23 22:30:26 +00:00
Tim Neutkens
951af1d9fc
Move experimental.runtime warning to config loading (#55880)
Ensures this warning is in line with the other warnings for removed config.
2023-09-23 20:10:16 +00:00
Tim Neutkens
ba5524d02d
Remove unnecessary Object.assign (#55882)
Noticed this was combining two objects but it can just be created as one object.
2023-09-23 18:20:28 +00:00
Jiachi Liu
2248cfc044
test: re-enabled the disabled manifest test (#55810)
Re-enable the disabled test
2023-09-23 17:57:08 +00:00
Tim Neutkens
19f2fe45ad
Ensure opentelemetry mismatched version error bubbles (#55868)
Noticed that the error happens to be caught accidentally and doesn't bubble up because of that.
2023-09-23 15:12:31 +00:00
vercel-release-bot
ec671bb5f5 v13.5.3-canary.3 2023-09-23 02:02:57 +00:00
Zack Tanner
c2e0213fa5
fix bugs pertaining to server actions + navigation (#55853)
This fixes some scenarios where executing a server action after navigation can cause the action to behave incorrectly (double submitting, not resolving). There are two separate issues:

- `canonicalUrl` and `pendingNavigatePath` were not constructed using the same function (`createHrefFromUrl`) so in certain situations they'd be comparing different values
- a fulfilled inFlightServerAction should not be invoked again

Closes NEXT-1655
Closes NEXT-1654
Fixes #55845
Fixes #55814
Fixes #55805
2023-09-23 01:42:39 +00:00
Deepa Subramanian
d5db4d366c
Update 10-testing.mdx (#55801)
Made changes as suggested by the reporter. 

```json filename="tsconfig.json or jsconfig.json"
{
  "compilerOptions": {
    "module": "esnext",
    "moduleResolution": "node",
    "baseUrl": "./",
    "paths": {
      "@/components/*": ["components/*"]
    }
  }
}
```

```json filename="package.json"
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "cypress:open": "cypress open"
  }
}
```
2023-09-23 01:11:46 +00:00
Wyatt Johnson
ce42a999f4
Use swc for runtime bundling (#55842)
This swaps the existing minifier for the Next.js runtime bundling from [terser](https://github.com/terser/terser) over to [swc](https://swc.rs/docs/configuration/minification). This small change has slightly decreased development file sizes, and dramatically decreased the time it takes to bundle the runtime. The results below were ran once on my MacBook Pro (M1 Pro).

## Compilation Speed

About 3 times faster

- `next_bundle_pages_dev`: improved from 7.28s to 1.85s.
- `next_bundle_pages_turbo`: improved from 7.28s to 1.85s.
- `next_bundle_pages_prod`: improved from 7.28s to 1.93s.
- `next_bundle_server`: improved from 7.28s to 2.68s.
- `next_bundle_app_turbo`: improved from 8.09s to 2.89s.
- `next_bundle_app_turbo_experimental`: improved from 7.74s to 2.77s.
- `next_bundle_app_prod`: improved from 7.86s to 2.77s.
- `next_bundle_app_dev`: improved from 9.41s to 2.86s.
- `next_bundle_app_prod_experimental`: improved from 8.01s to 3.12s.
- `next_bundle_app_dev_experimental`: improved from 9.11s to 3.58s.
- `next_bundle`: improved from 9.50s to 3.69s.

## File Sizes

About the same, small improvements in development bundle sizes

```shell
# Using terser
692K    packages/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js
460K    packages/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js
460K    packages/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js
436K    packages/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js
672K    packages/next/dist/compiled/next-server/app-page.runtime.dev.js
436K    packages/next/dist/compiled/next-server/app-page.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/app-route-experimental.runtime.dev.js
 48K    packages/next/dist/compiled/next-server/app-route-experimental.runtime.prod.js
 48K    packages/next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js
 48K    packages/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/app-route.runtime.dev.js
 48K    packages/next/dist/compiled/next-server/app-route.runtime.prod.js
 28K    packages/next/dist/compiled/next-server/pages-api-turbo.runtime.prod.js
 28K    packages/next/dist/compiled/next-server/pages-api.runtime.dev.js
 28K    packages/next/dist/compiled/next-server/pages-api.runtime.prod.js
 64K    packages/next/dist/compiled/next-server/pages-turbo.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/pages.runtime.dev.js
 64K    packages/next/dist/compiled/next-server/pages.runtime.prod.js
204K    packages/next/dist/compiled/next-server/server.runtime.prod.js

# Using swc
684K    packages/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js
460K    packages/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js
460K    packages/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js
436K    packages/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js
660K    packages/next/dist/compiled/next-server/app-page.runtime.dev.js
436K    packages/next/dist/compiled/next-server/app-page.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/app-route-experimental.runtime.dev.js
 48K    packages/next/dist/compiled/next-server/app-route-experimental.runtime.prod.js
 48K    packages/next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js
 48K    packages/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/app-route.runtime.dev.js
 48K    packages/next/dist/compiled/next-server/app-route.runtime.prod.js
 28K    packages/next/dist/compiled/next-server/pages-api-turbo.runtime.prod.js
 28K    packages/next/dist/compiled/next-server/pages-api.runtime.dev.js
 28K    packages/next/dist/compiled/next-server/pages-api.runtime.prod.js
 64K    packages/next/dist/compiled/next-server/pages-turbo.runtime.prod.js
 68K    packages/next/dist/compiled/next-server/pages.runtime.dev.js
 64K    packages/next/dist/compiled/next-server/pages.runtime.prod.js
204K    packages/next/dist/compiled/next-server/server.runtime.prod.js
```
2023-09-22 21:46:33 +00:00
Justin Ridgewell
b0aecccaa2
Allow filtering individual test cases inside test files (#55786)
### What?

Updates `run-test.js` to allow running individual test cases inside a test file.

### Why?

So that we can dramatically increase Turbopack's test coverage. Turbopack has implemented most (but not all) necessary features from the webpack bundles. But a single failing test case would prevent us from running any case inside a test file. With case filtering, we're able to run the cases we know will pass and prevent regressions on those.

### How?

Case filtering is only exposed via the `NEXT_EXTERNAL_TESTS_FILTERS` ENV, which points to a JSON file containing a map of test files with the test cases inside those files that are known to pass.

The known-passing test cases can be updated after Turbopack's daily integration test run by running `test/build-turbopack-tests-manifest.js`, which will update the `test/turbopack-tests-manifest.json` manifest.

Closes WEB-1640

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-09-22 21:37:48 +00:00
Tim Neutkens
8f7d24fab7
Ensure next-swc-loader types are used (#55846)
Uses satisfies to check the next-swc-loader options passed. Found a few
mismatches and implicit default, made sure they match up the same
default values but set explicitly.

This will need a thorough double-check. 

<!-- 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-09-22 23:23:08 +02:00
Lee Robinson
5f4238d9fa
docs: useFormState (#55564)
This PR shows how to use a new React hook `useFormState` in the context
of the [Forms and
Mutations](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations)
docs. It also updates the forms example (`next-forms`) to show the
recommended patterns for loading / error states.

Related: https://github.com/vercel/next.js/pull/55399
---
Co-authored-by: John Pham <johnphammail@gmail.com>
2023-09-22 16:10:25 -05:00
vercel-release-bot
c923257c1b v13.5.3-canary.2 2023-09-22 19:42:08 +00:00
Daigo Shitara
380986c535
fix typo in API Reference - Image Component (#55776)
removed unnecessary parentheses

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-22 19:31:20 +00:00
Deepa Subramanian
965fcfa04c
Update 01-pages-and-layouts.mdx (#55795)
``` 
Pages and Layouts
The Pages Router has a file-system based router built on the [concept of pages](https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts).
```
Change requested:
Here `concept of pages` hyperlinks routes to the current page. This bit confusing for someone trying to learn next.js. removing the hyperlink to the text would make clear.
2023-09-22 19:16:47 +00:00
Will Binns-Smith
816033a679
Update rust toolchain to nightly-2023-09-21 (#55774)
This:

- Updates to the latest api change for `StdError` in `error_generic_member_access` rust-lang/rust#99301
- Updates `pathfinder_simd` for compatiblity


Closes WEB-1636
2023-09-22 19:12:25 +00:00
JJ Kasper
2cc30fc87a
Update flakey next-image tests (#55838)
x-ref: https://github.com/vercel/next.js/actions/runs/6277156082/job/17048498592
x-ref: https://github.com/vercel/next.js/actions/runs/6277508886/job/17049437197
2023-09-22 18:29:51 +00:00
Tim Neutkens
7f1c05514b
Remove extra type (#55837)
Noticed these values are already included in WebpackLayerName so the extra type is not needed.
2023-09-22 18:16:57 +00:00
OJ Kwon
2df7cf6020
feat(turbopack): construct output path with distDir next.js config (#55613)
### What?

This PR enables basic support for next.config.js's `distDir` config. PR have two main pieces, one for honoring distDir and construct output path other than `.next`, and secondly assign `process.env.__NEXT_DIST_DIR` to client / edge. The latter increased size of PR bit as had to downstream to the compile_define calls.

Corresponding tests are enabled to verify its behavior.

Closes WEB-1610
2023-09-22 18:07:03 +00:00
Will Binns-Smith
d9ca3cc6c6
Correctly mark turbo sessions in telemetry (#55835)
This regressed in #55063


Closes WEB-1643
2023-09-22 17:54:32 +00:00
Tim Neutkens
b5c399698d
Remove next-typescript check in webpack config (#55819)
This package has been legacy for multiple years and has been marked
deprecated, this check is no longer useful.

<!-- 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-09-22 19:43:16 +02:00
Tim Neutkens
dca5e22384
Remove legacy checks for unstable_getXProps (#55813)
These methods have been landed for multiple years now, it's fine to remove the legacy checks for `unstable_`.
2023-09-22 17:22:06 +00:00
Tim Neutkens
6177f9f9c3
Move DefineEnv to separate file (#55811)
Narrowing down the webpack config a bit.

<!-- 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-09-22 19:07:52 +02:00
Leah
7fa1618ef7
chore: update turbopack to turbopack-230922.2 (#55828) 2023-09-22 18:52:18 +02:00
Zack Tanner
f20728ac3d
fix Image when used with --experimental-https (#55775)
The IPC request to `imageOptimizer` assumed the server was listening on http, so this updates it to pull the protocol from `getRequestMeta` instead. This also adds the option to pass in a path to the CA Root so that the dev server can add it to `NODE_EXTRA_CA_CERTS`


Closes NEXT-1646
Fixes #55706
2023-09-22 14:26:20 +00:00
Jiachi Liu
57cd1d0284
Remove unused internal env var (#55762)
`__NEXT_PREBUNDLED_REACT` is replaced by `__NEXT_EXPERIMENTAL_REACT` as we're bundling built-in react for app router
2023-09-22 00:51:11 +00:00
vercel-release-bot
0d6f3ac36b v13.5.3-canary.1 2023-09-21 23:58:45 +00:00
OJ Kwon
4484ef1106
test(turbopack): explicitly clean up instance for turbopack (#55772)
### What?

Minor improvement to test fixture to clean up the instance if explicitly specified to continue test. This is required to run turbopack related tests.

Closes WEB-1634
2023-09-21 23:50:13 +00:00
Jiachi Liu
39e688e802
Fix output log extra new line (#55770)
For progress spinner, only log new line when `process.stdout.isTTY`

## After

![image](https://github.com/vercel/next.js/assets/4800338/cb850b22-0985-4129-ba5e-961f3c914701)

## Before

![image](https://github.com/vercel/next.js/assets/4800338/5c69d964-74dd-432f-901d-ad86a4307422)

Adding extra space make sure there's loading bar between prefix text and spinner 

![image](https://github.com/vercel/next.js/assets/4800338/b99f7ec6-af9d-445b-a6ea-3d1592b4553d)


Closes NEXT-1647
2023-09-21 23:35:59 +00:00