Commit graph

13876 commits

Author SHA1 Message Date
Hannes Bornö
72baaebb92
Move error recovery test to new file (#45407) 2023-01-30 09:00:08 -08:00
JJ Kasper
c7deecfd29
Fix flakey app metadata test (#45391)
We shouldn't use an arbitrary timeout here.

x-ref:
https://github.com/vercel/next.js/actions/runs/4038320521/jobs/6942258801
2023-01-29 20:57:23 -08:00
JJ Kasper
b0d951bccd
Fix nested example setup with create-next-app (#45390)
Noticed in https://github.com/vercel/next.js/pull/45387 we aren't
properly setting up nested examples due to not stripping to the right
level so this ensures we handle that case properly.
2023-01-29 11:54:28 -08:00
William Mbotta
87e0c3d6ee
Update example path for authsignal/passwordless-login (#45387) 2023-01-29 11:34:18 -08:00
JJ Kasper
13b32ba981
Ensure PATH env matches CI locally (#45376)
Since the tests are run with `pnpm test` locally this adds the repo's
`node_modules/.bin` to the PATH env variable although in CI `node
run-tests.js` is used which doesn't augment PATH like this so this
strips these from the env when running isolated tests to match behavior.

x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1674913457101449)
2023-01-28 19:47:13 -08:00
Jan Kaifer
1df93002a3
Revert "Fix release stats" (#45164)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-29 00:15:05 +00:00
Shu Ding
b8b13af109
Refactor TS plugin code structure (#45375)
This PR mainly refactors the TS plugin structure and moves things over the typescript/ folder under server/. I created a rules/ folder to separate different kinds of insights, current it covers:
- Intellisense for entries on the server layer:
  - Hide autocompletions for disallowed APIs such as `useState`
  - Show errors if these are used
- Intellisense for all entires:
  - Prop hints such as `params` and `searchParams` for pages, and named slots for layouts
  - Error for invalid props
- Intellisense for exported configs:
  - Autocompletion and docs for configs
  - Hover hints for configs
  - Error for invalid configs and extra exports
- Intellisense for client boundary modules
  - Warn if `"use client"` isn't on the top of other expressions
  - (**new**) Error for unserializable props passed to exported functions

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 22:44:42 +00:00
Clive Townsend
3421b482c2
Typo (#45380)
## Documentation / Examples

- [ ] 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)
2023-01-28 21:41:06 +00:00
JJ Kasper
b0cf24137e
Remove old CI workflows (#45377)
These workflows are no longer necessary as `react@next` is now included
in Next.js itself for app dir.

x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1674039337638229)
2023-01-28 12:27:12 -08:00
Tim Neutkens
83d6a437f2
Add shared mutable type in router-reducer (#45369)
<!--
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:
-->

Preparation for making the mutable shared across the actions.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 20:36:14 +01:00
JJ Kasper
2701792516
Update more flakey API support checks (#45373)
x-ref: https://github.com/vercel/next.js/actions/runs/4033048662/jobs/6933337411
2023-01-28 19:24:06 +00:00
Sean Coker
09f235d9be
Update with-redux example tsconfig to use strict: true (#45325)
I was updating one of my old next.js v3 apps to v13, and decided to play
around with RTK. Using the with-redux example sort of sets users up for
some weird typing issues as mentioned here:
https://github.com/reduxjs/redux-toolkit/issues/2862

I found that github issue _after_ reading through all the official RTK x
TS docs, and it seems it could have all been avoided with stricter
typing. I'm hoping RTK can add this bit to their docs soon.
2023-01-28 10:50:36 -08:00
Tim Neutkens
4972f2308e
Add support for --experimental-app-only (#45352)
<!--
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:
-->

Allows you to `next build --experimental-app-only` which excludes
`pages` altogether. Useful for quickly debugging while migrating.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-01-28 10:48:32 -08:00
Lotte
67468f98c4
Add support for tsconfig 'nodenext' | 'node16' (#44177)
## ESM: support module option for tsconfig.json 

- fixes #37525
- fixes #41961

With [TypeScript 4.7 providing ECMAScript Module Support](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js), we can now set this in our tsconfig.json file for the [module](https://www.typescriptlang.org/tsconfig#module) option.

Webpack added "extensionAlias" to solve importing ts files with .js extension -> https://github.com/webpack/enhanced-resolve/pull/351



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-01-28 16:17:40 +00:00
Tim Neutkens
b4c80c92cb
Move reducers to separate file per action (#45336)
<!--
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:
-->

More cleaning / moving code around.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 14:58:44 +01:00
Tim Neutkens
b8a1892e00
Enable file nesting for unit test files in vscode (#45329)
<!--
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:
-->

Adds support for this type of nesting of files in the VSCode explorer.

![CleanShot 2023-01-27 at
10.52.05@2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/VceFdFT9YKEsQBBXXDFJ/74cd9a65-094a-491e-aadd-d65ba63c5b9d/CleanShot%202023-01-27%20at%2010.52.05@2x.png)

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 14:56:56 +01:00
Tim Neutkens
05e51ac14d
Move reducer types into separate file (#45333)
<!--
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:
-->

Part of the larger refactor, moving the types around, no functional
changes in this PR.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 11:45:12 +01:00
JJ Kasper
be86fcf6d5
v13.1.6 2023-01-27 18:25:45 -08:00
JJ Kasper
bcd63af2c9
Fix fetch stack test on deploy 2023-01-27 18:23:27 -08:00
JJ Kasper
6e73650833
v13.1.6-canary.3 2023-01-27 17:49:58 -08:00
Jan Kaifer
deb3b0237b
Update i18n example to handle public files and /api routes (#45266)
> Update i18n example to handle `public` files and `/api` routes
2023-01-28 01:38:10 +00:00
Shu Ding
6bcb06c19d
Limit the static paths worker number during development (#45344)
As per my testing, this saves about 150~210 MB memory for the dev server
as I have an 8-core CPU.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

---------
2023-01-27 17:28:41 -08:00
JJ Kasper
23353771d7
Fix next-server trace including dev server dependencies (#45359)
This ensures we aren't including the `dev-server` dependencies in the
`next-server` tracing.

x-ref:
https://dev.azure.com/nextjs/next.js/_build/results?buildId=46884&view=logs&jobId=14d0eb3f-bc66-5450-3353-28256327ad6c
x-ref:
https://dev.azure.com/nextjs/next.js/_build/results?buildId=46889&view=logs&jobId=14d0eb3f-bc66-5450-3353-28256327ad6c
2023-01-27 17:25:44 -08:00
JJ Kasper
1404eedf79
Update flakey app prefetch test (#45361)
x-ref:
https://github.com/vercel/next.js/actions/runs/4028868244/jobs/6926255942
2023-01-27 16:18:27 -08:00
JJ Kasper
ca134f6dce
Update flakey API support tests (#45360)
x-ref:
https://github.com/vercel/next.js/actions/runs/4027758161/jobs/6923946045
2023-01-27 16:06:38 -08:00
Himself65
01cd4ab4cb
fix: next build in typescript 5.0 (#45275)
Related: ff92ab0ac9/src/compiler/types.ts (L6901)

Upstream: https://github.com/microsoft/TypeScript/pull/51901/files#diff-e9fd483341eea176a38fbd370590e1dc65ce2d9bf70bfd317c5407f04dba9560R6890

```shell
> @blocksuite/next-example@ build /Users/himself65/Code/blocksuite/packages/react/examples/next
> next build

info  - Linting and checking validity of types ..We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default.

The following mandatory changes were made to your tsconfig.json:

        - moduleResolution was set to node (to match webpack resolution)

warn  - TypeScript project references are not fully supported. Attempting to build in incremental mode.

> Build error occurred
Error: Debug Failure. Unexpected moduleResolution: node
    at resolveModuleName (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:39044:24)
    at Object.resolve (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:114797:47)
    at loadWithModeAwareCache (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:114837:40)
    at actualResolveModuleNamesWorker (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:115072:126)
    at resolveModuleNamesWorker (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:115389:22)
    at resolveModuleNamesReusingOldState (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:115541:77)
    at processImportedModules (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:117013:29)
    at findSourceFileWorker (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:116775:9)
    at findSourceFile (/Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:116640:22)
    at /Users/himself65/Code/blocksuite/node_modules/.pnpm/typescript@5.0.0-dev.20230125/node_modules/typescript/lib/typescript.js:116589:24 {
  type: 'Error'
}
info  - Linting and checking validity of types . ELIFECYCLE  Command failed with exit code 1.

Process finished with exit code 1
```



## 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`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 23:06:52 +00:00
JJ Kasper
b90b48e969
Remove invalid assertion/duplicate test suite (#45355)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1674855052585189?thread_ts=1674757022.781019&cid=C04DUD7EB1B)
2023-01-27 14:04:46 -08:00
Steven
1b750e18b1
fix: ncc compiled confg/schema-utils2/schema-utils3 (#45351)
This is currently failing on canary


https://github.com/vercel/next.js/actions/runs/4027328455/jobs/6923764729
2023-01-27 13:06:05 -08:00
JJ Kasper
8324b4f030
v13.1.6-canary.2 2023-01-27 10:51:08 -08:00
Leah
e42260c5c0
add turbopackLoaders to config validation (#45337)
unfortunately, we didn't know about this part 🙃
2023-01-27 14:20:30 +00:00
Tim Neutkens
bd50adabee
Clean up resolved todos (#45332)
These tests were added in #43845

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 13:25:06 +00:00
Tim Neutkens
a1c15d84d9
Add test for createOptimisticTree (#45330)
<!--
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:
-->

Additional unit tests for the router reducer.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 13:31:42 +01:00
Tim Neutkens
433a580bf8
Remove extra .ts from test file (#45328)
<!--
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:
-->

Ensures this file nests correctly in vscode.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 13:29:45 +01:00
JJ Kasper
ad12f48796
Add turbopack route resolve handling (#45314)
Relies on: https://github.com/vercel/turbo/pull/3446
2023-01-27 04:29:01 -08:00
Jiachi Liu
9822f78f1f
Resolve metadata fields (#45237)
## Feature

- [x] 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`
- [x]
[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)
2023-01-27 12:57:48 +01:00
Tim Neutkens
f879e093d2
Ensure invalidateCacheBelowFlightSegmentPath file name is in line with the rest (#45299)
<!--
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:
-->

Missed that this one was created with the wrong casing.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] 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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-27 09:58:28 +01:00
Tim Neutkens
88a3fadef0
Remove unused optimistic tree parameters (#45264)
<!--
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:
-->

Noticed that there were some leftover parameters. Removed them as
they're no longer needed.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 09:52:57 +01:00
Tim Neutkens
c1737180b3
Add test for isNavigatingToNewRootLayout (#45305)
<!--
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:
-->

Adds a test for isNavigatingToNewRootLayout.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 09:52:39 +01:00
Tim Neutkens
0d635dffea
Add test for fillCacheWithNewSubTreeData (#45298)
<!--
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:
-->

Follow up to moving router-reducer. This adds a unit test for injecting
the subTreeData.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 09:33:01 +01:00
Tim Neutkens
a94b9db8ec
Add unit test for redirect.ts (#45223)
Adds a simple unit test for `redirect.ts` to test Graphite stacked
changes.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-27 09:32:40 +01:00
Tim Neutkens
a00daf7120
Add unit test for shouldHardNavigate (#45303)
<!--
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:
-->

Similar to the other PRs. This adds a test for shouldHardNavigate. It
also removes the `treePatch` variable from the function as it was only
passed around, not used.

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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] 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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-27 09:31:28 +01:00
JJ Kasper
ad2f145e4a
Ensure we warn for middleware with next export (#45288)
We currently don't make it obvious when next export is being leveraged
and middleware is present which won't work when deployed to a static
host so this ensures we warn the same way we do for API routes.

x-ref: https://github.com/vercel/vercel/pull/9319
2023-01-26 16:18:35 -08:00
Leah
160997bb96
add pageExtensions as a supported turbopack option (#45321)
depends on #45322
2023-01-26 15:16:14 -08:00
JJ Kasper
7c6e1e6834
Enable JS CNA tests for turbopack (#45323)
Enables the JS CNA template tests for turbopack as well now that we
landed `jsconfig` paths support.

x-ref: https://github.com/vercel/turbo/pull/3409
2023-01-26 14:53:29 -08:00
Will Binns-Smith
806c9eeb6c
build(cargo): update turbopack to turbopack-230126.1 (#45322)
**Note**: This requires https://github.com/vercel/next.js/pull/45314,
otherwise the following error is shown, but does not block builds:

```
error - [build] examples/create-app
  Error evaluating Node.js code
  TypeError: makeResolver is not a function
    at getResolveRoute (path/to/next.js/examples/create-app/.next/build/chunks/router.js:21:18)
    at async Module.route (path/to/next.js/examples/create-app/.next/build/chunks/router.js:24:36)
    at async Module.run (path/to/next.js/examples/create-app/.next/build/chunks/[turbopack-node]_ipc_evaluate.ts.js:19:39)
```

### Features

- https://github.com/vercel/turbo/pull/3446
- https://github.com/vercel/turbo/pull/3396
- https://github.com/vercel/turbo/pull/3499

### Bug fixes

- https://github.com/vercel/turbo/pull/3433

### Misc

- https://github.com/vercel/turbo/pull/3479
2023-01-26 14:42:48 -08:00
Flo
d45df25de6
Fix:Manage Firefox and Safari Network error message (#44929)
Not all browsers implement the network error message in the same way:
For example if I execute `fetch('//foo.bar/').catch(err =>
console.log(err.message))` in Chrome / Firefox / Safari browsers
console, I get respectively:
- `Failed to fetch`
- `NetworkError when attempting to fetch resource.`
- `Load failed`

This PR fixes it.

## Bug

- [x] Related issues linked using fixes
[#45190](https://github.com/vercel/next.js/issues/45190)
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-01-26 14:20:20 -08:00
Wyatt Johnson
57ba24e39a
Improved pnpm clean (#45312)
When incompatibilities with upgrades to `swc` occur between releases,
these changes expand the existing `pnpm clean` script to additionally
run any `clean` script under any of the lerna packages. In this case, a
new script was created under `packages/next-swc` that removes
`packages/next-swc/native/*`, allowing the default to automatically use
the WASM build.

Users wanting to reset their repository can now run:

```sh
pnpm clean
```

Future packages or outputs that are built should have their `clean`
script remove them to allow for easy repository resetting.
2023-01-26 13:24:19 -08:00
JJ Kasper
eed2086cc6
Update flakey fetch stack test (#45318)
x-ref:
https://github.com/vercel/next.js/actions/runs/4017855404/jobs/6902831642

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-26 12:55:15 -08:00
Tim Neutkens
4911a27eae
Add docs on how to use MDX with app (#44923)
Explains how to use the recent changes that allow for rendering MDX as
server components.
<!--
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

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] 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: Lee Robinson <me@leerob.io>
2023-01-26 21:31:49 +01:00
JJ Kasper
98b43a0709
Update debug logs for app cache (#45291)
Cleans up the debug logs a bit to be more usable
2023-01-26 11:43:47 -08:00