GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ReactDOMClient to ServerIntegrationTestUtils by rickhanlonii · Pull Request #28130 · react/react

Conversation

@rickhanlonii

@rickhanlonii rickhanlonii commented Jan 27, 2024

Copy link
Copy Markdown
Contributor

Overview

Adds support for ReactDOMClient for ServerIntegration* tests.

Also converts tests that pass without any other changes. Will follow up with other PRs for more complex cases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 27, 2024
@rickhanlonii
rickhanlonii force-pushed the rh/server-test-utils branch from 806c110 to 233b65d Compare January 27, 2024 23:02
@react-sizebot

react-sizebot commented Jan 27, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: 9aef5d2...e204d76

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.59 kB 176.59 kB = 55.01 kB 55.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 178.69 kB 178.69 kB = 55.64 kB 55.64 kB
facebook-www/ReactDOM-prod.classic.js = 573.52 kB 573.52 kB = 100.99 kB 100.99 kB
facebook-www/ReactDOM-prod.modern.js = 557.29 kB 557.29 kB = 98.07 kB 98.07 kB
test_utils/ReactAllWarnings.js Deleted 67.55 kB 0.00 kB Deleted 16.54 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 67.55 kB 0.00 kB Deleted 16.54 kB 0.00 kB

Generated by 🚫 dangerJS against e204d76

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jan 27, 2024
Add ReactDOMClient to ServerIntegration tests (minor fixes) #28131
Merged
Add ReactDOMClient to ServerIntegrationSelect #28132
Merged
Add ReactDOMClient to ServerIntegrationBasic #28133
Merged
Add ReactDOMClient to ServerIntegrationElements #28134
Merged
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) #28135
Merged
Add ReactDOMClient to ServerIntegrationReconnecting #28136
Merged
eps1lon
eps1lon approved these changes Jan 28, 2024
View reviewed changes
@rickhanlonii
Add ReactDOMClient to ServerIntegrationTestUtils
e204d76
@rickhanlonii
rickhanlonii force-pushed the rh/server-test-utils branch from 233b65d to e204d76 Compare February 1, 2024 20:53
rickhanlonii
rickhanlonii commented Feb 1, 2024
View reviewed changes
Comment thread packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js
if (ReactDOMClient) {
ReactDOMClient.hydrateRoot(domElement, reactElement, {
onRecoverableError: () => {
// TODO: assert on recoverable error count.

@rickhanlonii rickhanlonii Feb 1, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to add and ignore onRecoverableError errors. I started to add support for asserting this count, but it's going to require a lot more thought and tests to be updated so I'm not adding it here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
rickhanlonii
rickhanlonii commented Feb 1, 2024
View reviewed changes
Comment thread scripts/jest/shouldIgnoreConsoleError.js
) !== -1
) {
// This also gets logged by onRecoverableError, so we can ignore it.
return true;

@rickhanlonii rickhanlonii Feb 1, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still one error that is duplicated in console.error and onRecoverableError, so it's fine to ignore. There's a comment on that error to remove it: https://github.com/facebook/react/blob/763612647ceb66d95f728af896ca5e18a8181db8/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L1682

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rickhanlonii
rickhanlonii merged commit 6054be9 into main Feb 1, 2024
@rickhanlonii
rickhanlonii deleted the rh/server-test-utils branch February 1, 2024 23:27
rickhanlonii added a commit that referenced this pull request Feb 1, 2024
@rickhanlonii
Add ReactDOMClient to ServerIntegrationSelect (#28132)
c42e7c7
## Overview

Branched off #28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. 
```

So the mismatch is in the ignored warnings. 

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.
rickhanlonii added a commit that referenced this pull request Feb 1, 2024
@rickhanlonii
Add ReactDOMClient to ServerIntegrationBasic (#28133)
278199b
## Overview

Branched off #28130

In `hydrateRoot`, we now error if you pass `undefined`:

```
Warning: Must provide initial children as second argument to hydrateRoot. 
```

So we expect 1 error for this now.
rickhanlonii added a commit that referenced this pull request Feb 1, 2024
@rickhanlonii Sebastian Silbermann
Add ReactDOMClient to ServerIntegrationElements (#28134)
c0d9277
## Overview 

Branched off #28130

## ~Failing~ Fixed by @eps1lon 

The tests are currently failing because of two tests covering special
characters. I've tried a few ways to fix, but I'm stuck and will need
some help understanding why they fail and how to fix.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
rickhanlonii added a commit that referenced this pull request Feb 1, 2024
@rickhanlonii Sebastian Silbermann
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) (#28135)
fa6674b
## Overview

Branched off #28130

### ~Failing~ Fixed by @eps1lon 
Most of the tests pass, but there are 3 tests that have additional
warnings due to client render error retries.

For example, before we would log:

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
```

And now we log

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
```

We can't just update the expected error count for these tests, because
the additional error only happens on the client. So I need some guidance
on how to fix these.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
rickhanlonii added a commit that referenced this pull request Feb 1, 2024
@rickhanlonii
Add ReactDOMClient to ServerIntegrationReconnecting (#28136)
4bd5e3e
## Overview

Branched off #28130

## Why

In #24276 we changed the new root
behavior to error when a client-render is forced for certain cases, so
these now expect a mismatch even though they're using
`suppressHydrationWarning`.
rickhanlonii added a commit that referenced this pull request Feb 2, 2024
@rickhanlonii
Add ReactDOMClient to ServerIntegration tests (minor fixes) (#28131)
b25dcd3
## Overview 

Branched off #28130

Converts to `createRoot`, with a few additional in-line conversions in
each file.
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii @gaearon
Add ReactDOMClient to ServerIntegrationTestUtils (#28130)
5c8fd5d
## Overview

Adds support for `ReactDOMClient` for  `ServerIntegration*` tests. 

Also converts tests that pass without any other changes. Will follow up
with other PRs for more complex cases.
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii @gaearon
Add ReactDOMClient to ServerIntegrationSelect (#28132)
0856ef5
## Overview

Branched off #28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. 
```

So the mismatch is in the ignored warnings. 

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii @gaearon
Add ReactDOMClient to ServerIntegrationBasic (#28133)
bb42911
## Overview

Branched off #28130

In `hydrateRoot`, we now error if you pass `undefined`:

```
Warning: Must provide initial children as second argument to hydrateRoot. 
```

So we expect 1 error for this now.
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii Sebastian Silbermann @gaearon
Add ReactDOMClient to ServerIntegrationElements (#28134)
8b23b2f
## Overview 

Branched off #28130

## ~Failing~ Fixed by @eps1lon 

The tests are currently failing because of two tests covering special
characters. I've tried a few ways to fix, but I'm stuck and will need
some help understanding why they fail and how to fix.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii Sebastian Silbermann @gaearon
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) (#28135)
a008537
## Overview

Branched off #28130

### ~Failing~ Fixed by @eps1lon 
Most of the tests pass, but there are 3 tests that have additional
warnings due to client render error retries.

For example, before we would log:

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
```

And now we log

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
```

We can't just update the expected error count for these tests, because
the additional error only happens on the client. So I need some guidance
on how to fix these.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii @gaearon
Add ReactDOMClient to ServerIntegrationReconnecting (#28136)
3759c7e
## Overview

Branched off #28130

## Why

In #24276 we changed the new root
behavior to error when a client-render is forced for certain cases, so
these now expect a mismatch even though they're using
`suppressHydrationWarning`.
gaearon pushed a commit that referenced this pull request Feb 3, 2024
@rickhanlonii @gaearon
Add ReactDOMClient to ServerIntegration tests (minor fixes) (#28131)
4cc2e33
## Overview 

Branched off #28130

Converts to `createRoot`, with a few additional in-line conversions in
each file.
@gnoff gnoff mentioned this pull request Feb 5, 2024
Update React from 60a927d04 to 2bc7d336a vercel/next.js#61522
Merged
gnoff added a commit to gnoff/next.js that referenced this pull request Feb 6, 2024
@gnoff
updated React from 60a927d04 to 2bc7d336a.
6290768
- react/react#28250
- react/react#28225
- react/react#28123
- react/react#28240
- react/react#28239
- react/react#28245
- react/react#28244
- react/react#28238
- react/react#28235
- react/react#28221
- react/react#28215
- react/react#28214
- react/react#28213
- react/react#28212
- react/react#28211
- react/react#28247
- react/react#28210
- react/react#28186
- react/react#28232
- react/react#28169
- react/react#28177
- react/react#28170
- react/react#28168
- react/react#28122
- react/react#27982
- react/react#28217
- react/react#28223
- react/react#28208
- react/react#28209
- react/react#28200
- react/react#28199
- react/react#28198
- react/react#28197
- react/react#28196
- react/react#28194
- react/react#28192
- react/react#28191
- react/react#28182
- react/react#28181
- react/react#28180
- react/react#28178
- react/react#28201
- react/react#28176
- react/react#28162
- react/react#28131
- react/react#28190
- react/react#28172
- react/react#28171
- react/react#28173
- react/react#28174
- react/react#28175
- react/react#28136
- react/react#28135
- react/react#28134
- react/react#28133
- react/react#28132
- react/react#28130
- react/react#28202
- react/react#28102
- react/react#28161
- react/react#28193
- react/react#28195
- react/react#28189
- react/react#28160
- react/react#28096
- react/react#28183
- react/react#28125
- react/react#28157
- react/react#28115
- react/react#28124
- react/react#28163
- react/react#28164
- react/react#28150
- react/react#28159
- react/react#28069
- react/react#28110
- react/react#28148
- react/react#28116
- react/react#28099
- react/react#28100
- react/react#28147
- react/react#28128
- react/react#28126
- react/react#28139
- react/react#28140
- react/react#28141
- react/react#28142
- react/react#28113
- react/react#28129
- react/react#28114
- react/react#28053
- react/react#28091
- react/react#28087
- react/react#28112
- react/react#28086
- react/react#28101
- react/react#28106
- react/react#28117
- react/react#28118
- react/react#28105
- react/react#27883
- react/react#28111
- react/react#28095
- react/react#28108
- react/react#28090
- react/react#28089
- react/react#28076
- react/react#28074
- react/react#28103
- react/react#28098
- react/react#28097
- react/react#28068
- react/react#28093
- react/react#28094
- react/react#28073
- react/react#28084
- react/react#28063
- react/react#28085
- react/react#28083
- react/react#28065
- react/react#28061
- react/react#28077
- react/react#28075
- react/react#28078
- react/react#28050
- react/react#28011
- react/react#28055
- react/react#28066
- react/react#28067
- react/react#28010
- react/react#27993
- react/react#28052
- react/react#28060
- react/react#28059
- react/react#28034
- react/react#28033
- react/react#28004
- react/react#28051
- react/react#28012
- react/react#28001
- react/react#28002
- react/react#27995
- react/react#28006
- react/react#28005
- react/react#28007
- react/react#28008
- react/react#28009
- react/react#28000
- react/react#28003
- react/react#27997
- react/react#27240
- react/react#27977
- react/react#27940
- react/react#27939
- react/react#28090
- react/react#28089
- react/react#28076
- react/react#28074
- react/react#28103
- react/react#28098
- react/react#28097
- react/react#28068
- react/react#28093
- react/react#28094
- react/react#28073
- react/react#28084
- react/react#28063
- react/react#28085
- react/react#28083
- react/react#28065
- react/react#28061
- react/react#28077
- react/react#28075
- react/react#28078
- react/react#28050
- react/react#28011
- react/react#28055
- react/react#28066
- react/react#28067
- react/react#28010
- react/react#27993
- react/react#28052
- react/react#28060
- react/react#28059
- react/react#28034
- react/react#28033
- react/react#28004
- react/react#28051
- react/react#28012
- react/react#28001
- react/react#28002
- react/react#27995
- react/react#28006
- react/react#28005
- react/react#28007
- react/react#28008
- react/react#28009
- react/react#28000
- react/react#28003
- react/react#27997
- react/react#27240
- react/react#27977
- react/react#27940
- react/react#27939
gnoff added a commit to vercel/next.js that referenced this pull request Feb 6, 2024
@gnoff
Update React from 60a927d04 to 2bc7d336a (#61522)
2395557
Updates React from 60a927d04 to 2bc7d336a

Also updates aliases for `react.shared-subset` to `react.react-server`

### React upstream changes

- react/react#28250
- react/react#28225
- react/react#28123
- react/react#28240
- react/react#28239
- react/react#28245
- react/react#28244
- react/react#28238
- react/react#28235
- react/react#28221
- react/react#28215
- react/react#28214
- react/react#28213
- react/react#28212
- react/react#28211
- react/react#28247
- react/react#28210
- react/react#28186
- react/react#28232
- react/react#28169
- react/react#28177
- react/react#28170
- react/react#28168
- react/react#28122
- react/react#27982
- react/react#28217
- react/react#28223
- react/react#28208
- react/react#28209
- react/react#28200
- react/react#28199
- react/react#28198
- react/react#28197
- react/react#28196
- react/react#28194
- react/react#28192
- react/react#28191
- react/react#28182
- react/react#28181
- react/react#28180
- react/react#28178
- react/react#28201
- react/react#28176
- react/react#28162
- react/react#28131
- react/react#28190
- react/react#28172
- react/react#28171
- react/react#28173
- react/react#28174
- react/react#28175
- react/react#28136
- react/react#28135
- react/react#28134
- react/react#28133
- react/react#28132
- react/react#28130
- react/react#28202
- react/react#28102
- react/react#28161
- react/react#28193
- react/react#28195
- react/react#28189
- react/react#28160
- react/react#28096
- react/react#28183
- react/react#28125
- react/react#28157
- react/react#28115
- react/react#28124
- react/react#28163
- react/react#28164
- react/react#28150
- react/react#28159
- react/react#28069
- react/react#28110
- react/react#28148
- react/react#28116
- react/react#28099
- react/react#28100
- react/react#28147
- react/react#28128
- react/react#28126
- react/react#28139
- react/react#28140
- react/react#28141
- react/react#28142
- react/react#28113
- react/react#28129
- react/react#28114
- react/react#28053
- react/react#28091
- react/react#28087
- react/react#28112
- react/react#28086
- react/react#28101
- react/react#28106
- react/react#28117
- react/react#28118
- react/react#28105
- react/react#27883
- react/react#28111
- react/react#28095
- react/react#28108
- react/react#28090
- react/react#28089
- react/react#28076
- react/react#28074
- react/react#28103
- react/react#28098
- react/react#28097
- react/react#28068
- react/react#28093
- react/react#28094
- react/react#28073
- react/react#28084
- react/react#28063
- react/react#28085
- react/react#28083
- react/react#28065
- react/react#28061
- react/react#28077
- react/react#28075
- react/react#28078
- react/react#28050
- react/react#28011
- react/react#28055
- react/react#28066
- react/react#28067
- react/react#28010
- react/react#27993
- react/react#28052
- react/react#28060
- react/react#28059
- react/react#28034
- react/react#28033
- react/react#28004
- react/react#28051
- react/react#28012
- react/react#28001
- react/react#28002
- react/react#27995
- react/react#28006
- react/react#28005
- react/react#28007
- react/react#28008
- react/react#28009
- react/react#28000
- react/react#28003
- react/react#27997
- react/react#27240
- react/react#27977
- react/react#27940
- react/react#27939
- react/react#28090
- react/react#28089
- react/react#28076
- react/react#28074
- react/react#28103
- react/react#28098
- react/react#28097
- react/react#28068
- react/react#28093
- react/react#28094
- react/react#28073
- react/react#28084
- react/react#28063
- react/react#28085
- react/react#28083
- react/react#28065
- react/react#28061
- react/react#28077
- react/react#28075
- react/react#28078
- react/react#28050
- react/react#28011
- react/react#28055
- react/react#28066
- react/react#28067
- react/react#28010
- react/react#27993
- react/react#28052
- react/react#28060
- react/react#28059
- react/react#28034
- react/react#28033
- react/react#28004
- react/react#28051
- react/react#28012
- react/react#28001
- react/react#28002
- react/react#27995
- react/react#28006
- react/react#28005
- react/react#28007
- react/react#28008
- react/react#28009
- react/react#28000
- react/react#28003
- react/react#27997
- react/react#27240
- react/react#27977
- react/react#27940
- react/react#27939

Closes NEXT-2331
@ztanner ztanner mentioned this pull request Mar 19, 2024
(backport) Update React from 60a927d04 to 14898b6a9 vercel/next.js#63442
Closed
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii @AndyPengc12
Add ReactDOMClient to ServerIntegrationTestUtils (react#28130)
a5bcf68
## Overview

Adds support for `ReactDOMClient` for  `ServerIntegration*` tests. 

Also converts tests that pass without any other changes. Will follow up
with other PRs for more complex cases.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii @AndyPengc12
Add ReactDOMClient to ServerIntegrationSelect (react#28132)
f4f8e19
## Overview

Branched off react#28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. 
```

So the mismatch is in the ignored warnings. 

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii @AndyPengc12
Add ReactDOMClient to ServerIntegrationBasic (react#28133)
e733f74
## Overview

Branched off react#28130

In `hydrateRoot`, we now error if you pass `undefined`:

```
Warning: Must provide initial children as second argument to hydrateRoot. 
```

So we expect 1 error for this now.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii Sebastian Silbermann @AndyPengc12
Add ReactDOMClient to ServerIntegrationElements (react#28134)
f44539f
## Overview 

Branched off react#28130

## ~Failing~ Fixed by @eps1lon 

The tests are currently failing because of two tests covering special
characters. I've tried a few ways to fix, but I'm stuck and will need
some help understanding why they fail and how to fix.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii Sebastian Silbermann @AndyPengc12
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) (react#28135)
2ba47ff
## Overview

Branched off react#28130

### ~Failing~ Fixed by @eps1lon 
Most of the tests pass, but there are 3 tests that have additional
warnings due to client render error retries.

For example, before we would log:

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
```

And now we log

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
```

We can't just update the expected error count for these tests, because
the additional error only happens on the client. So I need some guidance
on how to fix these.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii @AndyPengc12
Add ReactDOMClient to ServerIntegrationReconnecting (react#28136)
45ad1f7
## Overview

Branched off react#28130

## Why

In react#24276 we changed the new root
behavior to error when a client-render is forced for certain cases, so
these now expect a mismatch even though they're using
`suppressHydrationWarning`.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@rickhanlonii @AndyPengc12
Add ReactDOMClient to ServerIntegration tests (minor fixes) (react#28131
e5bde42
)

## Overview 

Branched off react#28130

Converts to `createRoot`, with a few additional in-line conversions in
each file.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@rickhanlonii
Add ReactDOMClient to ServerIntegrationTestUtils (#28130)
06365e8
## Overview

Adds support for `ReactDOMClient` for  `ServerIntegration*` tests.

Also converts tests that pass without any other changes. Will follow up
with other PRs for more complex cases.

DiffTrain build for commit 6054be9.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegrationSelect (#28132)
029d735
## Overview

Branched off react/react#28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead.
```

So the mismatch is in the ignored warnings.

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.

DiffTrain build for commit react/react@c42e7c7.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegrationElements (#28134)
6dbde82
## Overview

Branched off react/react#28130

## ~Failing~ Fixed by @eps1lon

The tests are currently failing because of two tests covering special
characters. I've tried a few ways to fix, but I'm stuck and will need
some help understanding why they fail and how to fix.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>

DiffTrain build for commit react/react@c0d9277.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegrationBasic (#28133)
e516274
## Overview

Branched off react/react#28130

In `hydrateRoot`, we now error if you pass `undefined`:

```
Warning: Must provide initial children as second argument to hydrateRoot.
```

So we expect 1 error for this now.

DiffTrain build for commit react/react@278199b.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) (#28135)
bdb7f33
## Overview

Branched off react/react#28130

### ~Failing~ Fixed by @eps1lon
Most of the tests pass, but there are 3 tests that have additional
warnings due to client render error retries.

For example, before we would log:

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
```

And now we log

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
```

We can't just update the expected error count for these tests, because
the additional error only happens on the client. So I need some guidance
on how to fix these.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>

DiffTrain build for commit react/react@fa6674b.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegrationReconnecting (#28136)
b2e00b2
## Overview

Branched off react/react#28130

## Why

In react/react#24276 we changed the new root
behavior to error when a client-render is forced for certain cases, so
these now expect a mismatch even though they're using
`suppressHydrationWarning`.

DiffTrain build for commit react/react@4bd5e3e.
Akshato07 pushed a commit to Akshato07/-Luffy that referenced this pull request Feb 20, 2025
@rickhanlonii
Add ReactDOMClient to ServerIntegration tests (minor fixes) (#28131)
9b7b9b8
## Overview

Branched off react/react#28130

Converts to `createRoot`, with a few additional in-line conversions in
each file.

DiffTrain build for commit react/react@b25dcd3.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii
Add ReactDOMClient to ServerIntegrationTestUtils (react#28130)
e17a45a
## Overview

Adds support for `ReactDOMClient` for  `ServerIntegration*` tests. 

Also converts tests that pass without any other changes. Will follow up
with other PRs for more complex cases.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii
Add ReactDOMClient to ServerIntegrationSelect (react#28132)
be3585c
## Overview

Branched off react#28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. 
```

So the mismatch is in the ignored warnings. 

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii
Add ReactDOMClient to ServerIntegrationBasic (react#28133)
b956b87
## Overview

Branched off react#28130

In `hydrateRoot`, we now error if you pass `undefined`:

```
Warning: Must provide initial children as second argument to hydrateRoot. 
```

So we expect 1 error for this now.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii Sebastian Silbermann
Add ReactDOMClient to ServerIntegrationElements (react#28134)
d3fd0ee
## Overview 

Branched off react#28130

## ~Failing~ Fixed by @eps1lon 

The tests are currently failing because of two tests covering special
characters. I've tried a few ways to fix, but I'm stuck and will need
some help understanding why they fail and how to fix.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii Sebastian Silbermann
Add ReactDOMClient to ServerIntegration(Hooks|NewContext) (react#28135)
e249b76
## Overview

Branched off react#28130

### ~Failing~ Fixed by @eps1lon 
Most of the tests pass, but there are 3 tests that have additional
warnings due to client render error retries.

For example, before we would log:

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
```

And now we log

```
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
Warning: Expected server HTML to contain a matching text node for "0" in <div>.
Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks.
```

We can't just update the expected error count for these tests, because
the additional error only happens on the client. So I need some guidance
on how to fix these.

---------

Co-authored-by: Sebastian Silbermann <[email protected]>
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii
Add ReactDOMClient to ServerIntegrationReconnecting (react#28136)
e1d880d
## Overview

Branched off react#28130

## Why

In react#24276 we changed the new root
behavior to error when a client-render is forced for certain cases, so
these now expect a mismatch even though they're using
`suppressHydrationWarning`.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@rickhanlonii
Add ReactDOMClient to ServerIntegration tests (minor fixes) (react#28131
21de6ad
)

## Overview 

Branched off react#28130

Converts to `createRoot`, with a few additional in-line conversions in
each file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@eps1lon eps1lon eps1lon approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@rickhanlonii @react-sizebot @eps1lon @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.