support ReactDOM.render(..., document) without crashing#26129
Merged
gnoff merged 2 commits intofacebook:mainfrom Feb 8, 2023
Merged
support ReactDOM.render(..., document) without crashing#26129gnoff merged 2 commits intofacebook:mainfrom
gnoff merged 2 commits intofacebook:mainfrom
Conversation
|
Comparing: 758fc7f...3de6076 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
sebmarkbage
approved these changes
Feb 8, 2023
Contributor
sebmarkbage
left a comment
There was a problem hiding this comment.
Wow. People still use this api with the warning?
eps1lon
approved these changes
Feb 8, 2023
Collaborator
eps1lon
left a comment
There was a problem hiding this comment.
Still seeing this diff:
()"` |
-| `version=(numeric string)`| (changed, ssr mismatch)| `"42"` |
-| `version=(-1)`| (changed, ssr mismatch)| `"-1"` |
-| `version=(0)`| (changed, ssr mismatch)| `"0"` |-| `version=(integer)`| (changed, ssr mismatch)| `"1"` |
-| `version=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` | -| `version=(float)`| (changed, ssr mismatch)| `"99.99"` |
-| `version=(true)`| (initial, warning)| `<empty string>` |-| `version=(false)`| (initial, warning)| `<empty string>` |
-| `version=(string 'true')`| (changed, ssr mismatch)| `"true"` | -| `version=(string 'false')`| (changed, ssr mismatch)| `"false"` |
-| `version=(string 'on')`| (changed, ssr mismatch)| `"on"` |
-| `version=(string 'off')`| (changed, ssr mismatch)| `"off"` |
-| `version=(symbol)`| (initial, warning)| `<empty string>` |
-| `version=(function)`| (initial, warning)| `<empty string>` |
-| `version=(null)`| (initial)| `<empty string>` |
-| `version=(undefined)`| (initial)| `<empty string>` |
+| `version=(string)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(empty string)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(array with string)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(empty array)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(object)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(numeric string)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(-1)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(0)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(integer)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(NaN)`| (initial, warning, ssr mismatch)| `<undefined>` |
+| `version=(float)`| (initial, ssr mismatch)| `<undefined>` | +| `version=(true)`| (initial, warning, ssr mismatch)| `<undefined>` |
+| `version=(false)`| (initial, warning, ssr mismatch)| `<undefined>` |
+| `version=(string 'true')`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(string 'false')`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(string 'on')`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(string 'off')`| (initial, ssr mismatch)| `<undefined>` |+| `version=(symbol)`| (initial, warning, ssr mismatch)| `<undefined>` |
+| `version=(function)`| (initial, warning, ssr mismatch)| `<undefined>` |
+| `version=(null)`| (initial, ssr mismatch)| `<undefined>` |
+| `version=(undefined)`| (initial, ssr mismatch)| `<undefined>` |
## `version` (on `<svg>` inside `<div>`)
| Test Case | Flags | Result |which makes it seem like no value is rendered. Will just replace this test with one using lang since version is obsolete anyway.
github-actions bot
pushed a commit
that referenced
this pull request
Feb 8, 2023
as reported in #26128 `ReactDOM.render(..., document)` crashed when `enableHostSingletons` was on. This is because it had a different way of clearing the container than `createRoot(document)`. I updated the legacy implementation to share the clearing behavior of `creatRoot` which will preserve the singleton instances. I also removed the warning saying not to use `document.body` as a container DiffTrain build for [a3152ed](a3152ed) [View git log for this commit](https://github.com/facebook/react/commits/a3152eda5f89e20f056521855f7fa101ce50e4c3)
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
as reported in #26128
ReactDOM.render(..., document)crashed whenenableHostSingletonswas on. This is because it had a different way of clearing the container thancreateRoot(document). I updated the legacy implementation to share the clearing behavior ofcreatRootwhich will preserve the singleton instances.I also removed the warning saying not to use
document.bodyas a container