Commit graph

11 commits

Author SHA1 Message Date
Steven
148fb086c5
chore(script): improve markdown changelog output in sync-react.js (#52052)
This makes it really easy to copy/paste the changelog into the PR description after running `sync-react.js`.

Previously, the output would link to incorrect PRs because it didn't know the PR number was from a different repo.

We know `facebook/react` uses squash so there should always be a PR number at the end of the commit title.

Example of the new format: https://github.com/vercel/next.js/pull/52005
2023-06-30 20:21:53 +00:00
Andrew Clark
e659653e48
Upgrade React to 18.3.0-canary-b7972822b-20230503 (#49158)
Includes the following upstream changes:

- [b7972822b](https://github.com/facebook/react/commits/b7972822b)
useOptimisticState -> useOptimistic
([#26772](https://github.com/facebook/react/pull/26772)) (Andrew Clark)
- [388686f29](https://github.com/facebook/react/commits/388686f29) Add
"canary" to list of allowed npm dist tags
([#26767](https://github.com/facebook/react/pull/26767)) (Andrew Clark)
- [8a25302c6](https://github.com/facebook/react/commits/8a25302c6)
fix[dynamic-scripts-injection]: unregister content scripts before
registration ([#26765](https://github.com/facebook/react/pull/26765))
(Ruslan Lesiutin)
- [2c2476834](https://github.com/facebook/react/commits/2c2476834)
Rename "next" prerelease channel to "canary"
([#26761](https://github.com/facebook/react/pull/26761)) (Andrew Clark)
- [fa4314841](https://github.com/facebook/react/commits/fa4314841)
Remove deprecated workflow key from Circle config
([#26762](https://github.com/facebook/react/pull/26762)) (Andrew Clark)
- [5dd90c562](https://github.com/facebook/react/commits/5dd90c562) Use
content hash for react-native builds
([#26734](https://github.com/facebook/react/pull/26734)) (Samuel Susla)
- [559e83aeb](https://github.com/facebook/react/commits/559e83aeb)
[Fizz] Allow an action provide a custom set of props to use for
progressive enhancement
([#26749](https://github.com/facebook/react/pull/26749)) (Sebastian
Markbåge)
- [67f4fb021](https://github.com/facebook/react/commits/67f4fb021) Allow
forms to skip hydration of hidden inputs
([#26735](https://github.com/facebook/react/pull/26735)) (Sebastian
Markbåge)
- [8ea96ef84](https://github.com/facebook/react/commits/8ea96ef84)
[Fizz] Encode external fizz runtime into chunks eagerly
([#26752](https://github.com/facebook/react/pull/26752)) (Josh Story)
- [491aec5d6](https://github.com/facebook/react/commits/491aec5d6)
Implement experimental_useOptimisticState
([#26740](https://github.com/facebook/react/pull/26740)) (Andrew Clark)
- [9545e4810](https://github.com/facebook/react/commits/9545e4810) Add
nonce support to bootstrap scripts and external runtime
([#26738](https://github.com/facebook/react/pull/26738)) (Dan Ott)
- [86b0e9199](https://github.com/facebook/react/commits/86b0e9199) Gate
DevTools test to fix CI
([#26742](https://github.com/facebook/react/pull/26742)) (Andrew Clark)
- [b12bea62d](https://github.com/facebook/react/commits/b12bea62d)
Preinits should support a nonce option
([#26744](https://github.com/facebook/react/pull/26744)) (Josh Story)
- [efbd68511](https://github.com/facebook/react/commits/efbd68511)
Remove unused `initialStatus` parameter from `useHostTransitionStatus`
([#26743](https://github.com/facebook/react/pull/26743)) (Sebastian
Silbermann)
- [18282f881](https://github.com/facebook/react/commits/18282f881) Fix:
Update while suspended fails to interrupt
([#26739](https://github.com/facebook/react/pull/26739)) (Andrew Clark)
- [540bab085](https://github.com/facebook/react/commits/540bab085)
Implement experimental_useFormStatus
([#26722](https://github.com/facebook/react/pull/26722)) (Andrew Clark)

---------
2023-05-03 14:03:19 -07:00
Shu Ding
287e379b92
Vendor react@experimental (#48697)
Part of #47759 (which had been reverted twice so here we only land a part of the change), relates to NEXT-926. Thanks to #48506 we can soon switch between these two channels during runtime.

Also fixes a problem of `renderKind` (only revealed after upgrading React), it should be also based on the `match` kind.
2023-04-25 14:29:02 +00:00
Shu Ding
f6604d4afe
Revert "Re-land "Vendor react@experimental under an experimentalReact flag"" (#48478)
Reverts vercel/next.js#48041
fix NEXT-926
2023-04-17 15:00:02 +02:00
Shu Ding
9c0e520896
Re-land "Vendor react@experimental under an experimentalReact flag" (#48041)
Reverts vercel/next.js#48038

fix NEXT-926

---

The root cause was that when copying the package.json, I removed all
fields except for a few (such as `exports`) but missed the `browser`
field. That caused the client bundle to resolve to the Node.js version
of React DOM, and then we had the `async_hooks` error. Added it back in
99c9b9e51f8b0d4e4503ece9d07bce09161f3341.

I reproduced the error with next-site earlier and confirmed that this
fix is good.
2023-04-08 17:16:24 +02:00
JJ Kasper
9448913149
Revert "Vendor react@experimental under an experimentalReact flag" (#48038)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1680804950611789?thread_ts=1680791613.468109&cid=C04DUD7EB1B)

Reverts vercel/next.js#47759
fix NEXT-926
2023-04-06 11:48:09 -07:00
Shu Ding
89b4605f1a
Vendor react@experimental under an experimentalReact flag (#47759)
Next.js includes various feature sets that depend on specific release
channels of React. However, our current setup only includes the `next`
channel of React, which restricts our ability to integrate with features
available on the `experimental` channel.

To address this limitation, this pull request introduces the following
changes:
- Vendors the `react@experimental` version, along with the corresponding
`react-dom` and `scheduler` packages.
- Modifies the `sync-react` script to also update the `experimental`
channel and removes `--version` as they're always synced to the latest
now.
- Retains the default behavior of using the `next` channel in the
`appDir` directory.
- Adds an option to switch to the `experimental` channel by setting
`experimental.experimentalReact: true` in the configuration.

fix NEXT-926 ([link](https://linear.app/vercel/issue/NEXT-926))
2023-04-05 14:05:47 +00:00
Shu Ding
7e933a094c
Revert "Revert "Update vendored React"" (#46881)
Reverts vercel/next.js#46861. This requires
https://github.com/vercel/turbo/pull/4102 to be released and bindings to
be updated first.

~Also depends on #46896 to be merged first, and conflicts to be
resolved.~
2023-03-07 13:04:08 -08:00
JJ Kasper
0f621cb133
Revert "Update vendored React" (#46861)
Reverting temporarily as this breaks turbopack support for app dir 

x-ref:
https://github.com/vercel/next.js/actions/runs/4349458918/jobs/7600147372
x-ref:
https://github.com/vercel/next.js/actions/runs/4349607013/jobs/7600148420

Reverts vercel/next.js#46826
2023-03-06 21:17:15 -08:00
Shu Ding
003b3af700
Update vendored React (#46826)
This PR updates vendored React to the latest `@next` version, as well as
corresponding changes to the manifest and module reference generation
code.

The new React version includes the following upstream changes:

- 49f741046 Fix: Infinite act loop caused by wrong shouldYield (#26317)
(Andrew Clark)
-  106ea1c58 Support Iterables in Flight (#26313) (Sebastian Markbåge)
- f905da227 [Flight] Send server reference error chunks to the client
(#26293) (Hendrik Liebau)
- e0241b660 Simplify Webpack References by encoding file path + export
name as single id (#26300) (Sebastian Markbåge)
- 25685d8a9 Codemod tests to waitFor pattern (9/?) (#26309) (Andrew
Clark)
- 64dde7082 Codemod tests to waitFor pattern (8/?) (#26308) (Andrew
Clark)
- 3cb5afb82 Codemod tests to waitFor pattern (7/?) (#26307) (Andrew
Clark)
- e98695db9 Codemod tests to waitFor pattern (6/?) (#26305) (Andrew
Clark)
- 9a52cc8bc Convert ReactLazy-test to waitFor pattern (#26304) (Andrew
Clark)
- 03462cfc7 [Fizz] External runtime: fix bug in processing existing
elements (#26303) (mofeiZ)
- faacefb4d Codemod tests to waitFor pattern (4/?) (#26302) (Andrew
Clark)
- 06460b6fb Remove unnecessary (and incorrect) code for compatibility
with Paper in the Fabric version of GlobalResponderHandler (#26290)
(Rubén Norte)
- e64a8f403 Codemod tests to waitFor pattern (3/?) (#26299) (Andrew
Clark)
- ce8a72fd4 Codemod tests to waitFor pattern (2/?) (#26296) (Andrew
Clark)
- 1f1f8eb55 [Float][Fizz][Fiber]: Refactor <style> Resource
implementation to group on flush (#26280) (Josh Story)
- 5c633a48f Add back accidentally deleted test comments (#26294) (Andrew
Clark)
- b073104c2 [DevTools] improve troubleshooting in README (#26235)
(Mengdi Chen)
- fcf218791 [DevTools] Remove renderer.js from extension build (#26234)
(Mengdi Chen)
- b72ed698f Fixed incorrect value returned as public instance from
reconciler (#26283) (Rubén Norte)
- 25a8b9735 Codemod tests to waitFor pattern (1/?) (#26288) (Andrew
Clark)
- e52446733 New internal testing helpers: waitFor, waitForAll,
waitForPaint (#26285) (Andrew Clark)
- d49e0e0be Removed unused imperative events implementation from React
Native renderer (#26282) (Rubén Norte)

---------
2023-03-06 16:51:10 -08:00
Andrew Clark
2e23cd7535
Add script to automate updating vendored React version (#46663)
Since we intend to update our vendored copy of React frequently, I wrote
a script to automate the steps.

Basic usage (defaults to most recent React canary version):

```sh
pnpm run sync-react
```

Specify a canary version:

```sh
pnpm run sync-react --version 18.3.0-next-41110021f-20230301
```

Update package.json but skip installing the dependencies automatically:

```sh
pnpm run sync-react --no-install
```

At the end it will print out a changelog so you can copy/paste it into
the PR description.

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

## 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-03-02 02:15:02 +00:00