Commit graph

1124 commits

Author SHA1 Message Date
SCG82
4a472abc89
chore: simplify package scripts (#45226)
<!--
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`
- [ ] 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>
2023-02-07 15:30:02 -08:00
Jiachi Liu
c6fe3f3224
Update app dir react for client reference updates (#45490)
x-ref: https://github.com/facebook/react/pull/26059
x-ref: https://github.com/facebook/react/pull/26083
x-ref: https://github.com/facebook/react/pull/26093
x-ref: https://github.com/facebook/react/pull/26083
Closes NEXT-445

* Remove extra `await`
* Check if a component result is client reference, then we access for
other exports
2023-02-07 19:32:49 +01: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
8f05c0c07e
Update flakey test cases (#45290) 2023-01-25 22:55:49 -08:00
Jan Kaifer
d7307cffb7
Fix turbo usage in tests (#44715) 2023-01-18 20:35:28 +01:00
JJ Kasper
8613297cd4
Fix prepublish compiled handling (#44914) 2023-01-15 20:21:39 -08:00
JJ Kasper
d4a3c66479
Update pre-compiled (#44874) 2023-01-13 17:52:35 -08:00
Valentin Politov
9168dffc02
examples: Bump SWR to v2.0.0 (#44790) 2023-01-12 09:36:29 -08:00
JJ Kasper
12bfabd179
Update to latest version of pnpm (#44791) 2023-01-11 17:36:52 -08:00
Steven
862deb5a13
Disable telemetry for pnpm next when contributing locally (#44610)
This PR fixes telemetry so it no longer reports `pnpm next` when
contributing to Next.js
2023-01-05 13:27:05 -08:00
Jan Kaifer
cafbe2a0ad
Revert "Use turbo for packing files in test setup (#44074)" (#44566)
This reverts commit fd9ec646ac.

It seems that there is an issue with caching of inputs which uses stale
files.

We also had to disable caching of `pnpm-lock.yaml` because it requires
stable package locations chich we removed.
2023-01-04 10:23:21 -08:00
JJ Kasper
87c3578cc4
Update json5 dependency to latest (#44548)
Updates to latest version of the dependency.
2023-01-03 15:45:05 -08:00
Jan Kaifer
d6a09be303
add testonly variants for all test modes and refactored test as alias of testheadless (#44528)
So that we don't need to use `NEXT_TEST_MODE=...` ever again manually.
2023-01-03 14:43:55 -08:00
Jan Kaifer
fd9ec646ac
Use turbo for packing files in test setup (#44074) 2022-12-22 16:36:24 +01:00
Jiachi Liu
e27a7bd7a4
Update styled-jsx (#44070)
x-ref: https://github.com/vercel/styled-jsx/releases/tag/v5.1.1
2022-12-19 23:58:50 +00:00
Tim Neutkens
e45bbbe734
Add jsdoc/no-types eslint rule for TypeScript files (#44049)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-12-19 10:21:08 +01:00
Jiachi Liu
6aae39c759
Fix app client entry key for windows (#44011)
## Bug

The app client entry key was in win32 slashes like `app\blog`, and when
we add the new layer checking logic in #43197, `name.startsWith('app/')`
doesn't work.

Fixes #43854
Fixes #43902

<img width="862" alt="image"
src="https://user-images.githubusercontent.com/4800338/207641886-08ffc159-0516-4609-9a1f-8c8693586122.png">


- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2022-12-14 19:52:52 +01:00
Jiachi Liu
a97e6fff31
Upgrade playwright to 1.28.1 (#43818)
Upgrade playwright to see if the playwright installation job will be
back to normal

x-ref:
https://github.com/vercel/next.js/actions/runs/3639757976/jobs/6143653702
2022-12-07 14:14:55 -08:00
JJ Kasper
a704b71cba
Lock pnpm version during publish (#43820)
x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1670409758653869)
2022-12-07 17:24:43 +00:00
Jan Kaifer
aa7cdf35ea
Remove notifications emitted during pnpm dev (#43801)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-07 17:11:29 +01:00
JJ Kasper
90f022aeb6
Update test config (#43661)
Updates our test config to take advantage of more concurrency and also
updates to leverage the playwright docker image to reduce flakes from
actions/setup-node stalling or playwright dependencies stalling on `apt
install`.

This reduces our test times from upwards of 30 minutes down to back
around 15 minutes.
2022-12-03 19:49:00 -08:00
Jiachi Liu
48290c6a05
Update react next tag (#43617)
Fixes #43033

Also remove the unsued react-dom files: bundles for bun, and
react-dom-test-utils

x-ref: https://github.com/facebook/react/pull/25713

## Bug

- [x] 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)
2022-12-01 20:15:54 -08:00
Jiachi Liu
e901feffc3
Update precompiled react (#43288)
Update pre-compiled react to fix the streaming issue with node 18.
x-ref: https://github.com/facebook/react/pull/25645

Fixes: #42466
Manually tested locally works for the reproduction from the issue

## Bug

- [x] 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)
2022-11-23 15:57:38 +00:00
Donny/강동윤
3d62f467cf
chore: Update swc_core to v0.43.23 (#42977)
This PR updates swc crates to
a4ed624f81

---

 - Closes https://github.com/vercel/next.js/issues/42978
 - Closes https://github.com/vercel/next.js/issues/42801

<img width="1840" alt="image"
src="https://user-images.githubusercontent.com/29931815/202788043-4ba0c3a4-b4c5-43e7-8eb3-42b8341e5d5f.png">

 - Closes https://github.com/vercel/next.js/issues/43027
<img width="1840" alt="image"
src="https://user-images.githubusercontent.com/29931815/202788522-e4884f91-c83c-45e8-983a-f210144effef.png">

 - Closes https://github.com/vercel/next.js/issues/43042
<img width="1840" alt="image"
src="https://user-images.githubusercontent.com/29931815/202788866-2c319588-5a01-4628-95cc-47bb51e19153.png">

 - Closes https://github.com/vercel/next.js/issues/43060

<img width="1840" alt="image"
src="https://user-images.githubusercontent.com/29931815/202789993-2bf3af55-9752-4aa8-bcc2-98f08ecd47b7.png">


 - Closes https://github.com/vercel/next.js/issues/42852

<img width="1840" alt="image"
src="https://user-images.githubusercontent.com/29931815/202804509-88bb3d55-182d-457d-b59e-d12b30c52100.png">
2022-11-19 18:18:31 -08:00
JJ Kasper
c3993c828f
Update to latest version of turbo CLI (#42803)
Continuation of https://github.com/vercel/next.js/pull/42711 fixing
latest turbo usage in musl environment

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## 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)
2022-11-14 11:52:12 -08:00
Jiachi Liu
b180becad5
Update bundle analyzer dependency and output (#42797)
* Update `webpack-bundle-analyzer` to 4.7.0
* Change the output file paths of bundle analyzing results to
`./next/analyze/<nodejs|edge|client>.html`
2022-11-11 16:39:45 -08:00
Shu Ding
f612acffbc
Add test case for image generation (#42693)
This PR adds a basic test case to ensure Next.js and Edge Runtime
changes don't break the image generation feature, as well as record the
usage.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [x] Integration tests added
- [ ] Documentation added
- [x] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `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)
2022-11-10 09:26:36 -08:00
JJ Kasper
abaaf80f51
Revert "Update to latest version of turbo CLI (#42711)"
This reverts commit 2c199c4c19.
2022-11-09 21:15:36 -08:00
JJ Kasper
2c199c4c19
Update to latest version of turbo CLI (#42711)
Ensures we have latest patches in turbo CLI. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## 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)
2022-11-09 18:22:15 -08:00
Josh Story
677c04f088
update react builtin deps for next channel (#42639)
Updates builtin react to latest release on next channel

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## 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)
2022-11-08 10:35:17 -08:00
OJ Kwon
5654cae2d7
feat(next/mdx): support experimental mdx-rs loader (#41919)
<!--
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:
-->

This PR implements a configuration option in `next.config.js` to support
for rust-based MDX compiler (https://github.com/wooorm/mdxjs-rs).
Currently it is marked as experimental, as mdx-rs and loader both may
need some iteration to fix regressions.

When a new experimental flag is set (`mdxRs: true`), instead of using
`@mdx/js` loader `next/mdx` loads a new webpack loader instead.
Internally, it mostly mimics mdx/js's loader behavior, however actual
compilation will be delegated into next/swc's binding to call mdx-rs's
compiler instead.

I choose to use next-swc to expose its binding function, as mdx-rs
internally uses swc already and creating new binary can double up
bytesize (with all the complex processes of publishing new package).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-02 18:24:05 -07:00
Jiachi Liu
6dbf9c32ec
Handle dynamic css-in-js styles under suspense (#42293)
We insert the content returning from `useServerInsertedHTML` to head
element for app dir, but it shouldn't only inject once since there're
suspense boundaries that could hold insertions.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-02 14:18:08 +01:00
Kiko Beats
137008e613
[middleware] add tests for body reading methods #37980 (#41718) 2022-11-01 20:45:58 -07:00
Jiachi Liu
70e7e58c37
Update react next channel (#42021)
Update react channel for `fetch` patching updates 

x-ref: [slack
thread](https://vercel.slack.com/archives/C03ENM5HB4K/p1666802006931969?thread_ts=1666799939.726859&cid=C03ENM5HB4K)
2022-10-27 17:33:47 -07:00
Kiko Beats
288144c7e5
Upgrade Edge Runtime (#41987)
dropped node12 support

Co-authored-by: Steven <steven@ceriously.com>
2022-10-27 15:07:05 -04:00
Steven
a5d674237a
Bump minimum Node.js version to 14.6.0 (#41765)
We found a case where 14.0.0 breaking with private class methods, such
as:

```js
class C {
  #x() { return 42; }
  x() {
    return this.#x();
  }
}
```

This feature was introduced in Node.js 14.6.0, so we can bump the
minimum version.

See https://node.green
2022-10-24 21:47:54 -07:00
Jiachi Liu
78bf0a792b
Update react next channel (#41761)
apply react updates x-ref: https://github.com/facebook/react/pull/25560
2022-10-25 02:32:20 +00:00
Kiko Beats
89355298f2
Upgrade Edge Runtime v.1.1.0 (#41727)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-24 10:49:49 -07:00
Jiachi Liu
20f5db06fa
Update precompiled react to next channel (#41708)
Precompile `react@next` and to unlock `cache` and `use` API
2022-10-24 00:31:52 -07:00
JJ Kasper
b6ed1a7e5f
Update to latest react experimental (#41671)
x-ref: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1666452328526929)
2022-10-23 13:10:44 -07:00
Jiachi Liu
b0f87fbc7c
Bundle ssr client layer excepts react externals (#41606)
Bundle the ssr client layer for RSC, this solves the problem when
there's an esm package is using on client components, but esm imports
the installed react instead of the built-in react version since esm
imports is not intercepted by require hook.

After bundling the ssr client layer and treating react as externals, now
react compiles as cjs externals and could be intercepted by require
hook, other code are bundled together which can also get optimized.

## 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`
- [x] Integration 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`

Co-authored-by: Shu Ding <g@shud.in>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-22 16:33:51 -07:00
Javi Velasco
392c4d0b7c
Update @types/node to 14.14.31 (#41634)
This PR updates `@types/node` to `14.14.31`. The most important type is
that `ParsedUrlQuery` can hold `undefined` so we are updating the code
here to explicitly handle those cases. Aside from it we are adding a
global definition taken from NodeJS for `AsyncLocalStorage` that we
export in `server.d.ts`
2022-10-22 11:19:14 -07:00
Jiachi Liu
3a87e816fc
Disable using prebundled of react for appDir (#41635)
reverting https://github.com/vercel/next.js/pull/41337

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-21 23:55:19 -07:00
Tim Neutkens
14c9376899
BREAKING CHANGE: Remove React 17 (#41629)
Next.js 13 will require React 18.

In this PR I've only updated the peerDependency and removed the test runs in GH actions. Further cleanup will follow later, this allows us to remove the code supporting it later.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## Documentation / Examples

- [ ] Make sure the linting passes by running `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: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2022-10-21 22:20:36 +00:00
Jiachi Liu
bc335d7ef7
Prebundle react for appDir (#41337)
Inline a react and react-dom for app dir, when `appDir` flag is enabled
opt into the built-in version for all.

For server layer react, use the react share subset for server
components.
For all server side of react-dom usage, use the server-rendering-stub.

Co-authored-by: Shu Ding <g@shud.in>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-18 16:32:23 -07:00
Kiko Beats
ebae05eeed
Update edge runtime to 1.1.0-beta.40 (#41513)
changes: https://github.com/vercel/edge-runtime/compare/edge-runtime@1.1.0-beta.39...edge-runtime@1.1.0-beta.40
2022-10-18 13:57:11 +00:00
Kiko Beats
8c4ef5cbc7
Update edge runtime to 1.1.0-beta.39 (#41418)
https://github.com/vercel/edge-runtime/compare/edge-runtime%401.1.0-beta.37...edge-runtime%401.1.0-beta.39
2022-10-14 09:48:32 -07:00
Tim Neutkens
8f49ffc488
Upgrade React experimental (#41419) 2022-10-14 16:25:49 +02:00
Shu Ding
24b600303f
Do not bundle react-dom in the SSR build (#41227)
Currently `react-dom` isn't handled as an external dependency in SSR,
unlike `react`. This means that the ReactDOM imported by client
components isn't the same instance as the ReactDOM that does SSR.

This PR also upgrades React experimental to the latest version.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-06 20:27:24 +02:00
Shu Ding
c6dc62ef04
Upgrade React experimental (#41222)
<!--
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`

## 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`
- [ ] Integration 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`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-06 18:06:14 +02:00