-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up experimental builds #17071
Set up experimental builds #17071
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -451,9 +451,8 @@ const ReactDOM: Object = { | |
warningWithoutStack( | ||
!container._reactHasBeenPassedToCreateRootDEV, | ||
'You are calling ReactDOM.hydrate() on a container that was previously ' + | ||
'passed to ReactDOM.%s(). This is not supported. ' + | ||
'passed to ReactDOM.createRoot(). This is not supported. ' + | ||
'Did you mean to call createRoot(container, {hydrate: true}).render(element)?', | ||
enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot', | ||
); | ||
} | ||
// TODO: throw or warn if we couldn't hydrate? | ||
|
@@ -479,9 +478,8 @@ const ReactDOM: Object = { | |
warningWithoutStack( | ||
!container._reactHasBeenPassedToCreateRootDEV, | ||
'You are calling ReactDOM.render() on a container that was previously ' + | ||
'passed to ReactDOM.%s(). This is not supported. ' + | ||
'passed to ReactDOM.createRoot(). This is not supported. ' + | ||
'Did you mean to call root.render(element)?', | ||
enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot', | ||
); | ||
} | ||
return legacyRenderSubtreeIntoContainer( | ||
|
@@ -526,8 +524,7 @@ const ReactDOM: Object = { | |
warningWithoutStack( | ||
!container._reactHasBeenPassedToCreateRootDEV, | ||
'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + | ||
'passed to ReactDOM.%s(). This is not supported. Did you mean to call root.unmount()?', | ||
enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot', | ||
'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?', | ||
); | ||
} | ||
|
||
|
@@ -650,13 +647,9 @@ function createRoot( | |
container: DOMContainer, | ||
options?: RootOptions, | ||
): _ReactRoot { | ||
const functionName = enableStableConcurrentModeAPIs | ||
? 'createRoot' | ||
: 'unstable_createRoot'; | ||
invariant( | ||
isValidContainer(container), | ||
'%s(...): Target container is not a DOM element.', | ||
functionName, | ||
'createRoot(...): Target container is not a DOM element.', | ||
); | ||
warnIfReactDOMContainerInDEV(container); | ||
return new ReactRoot(container, options); | ||
|
@@ -666,13 +659,9 @@ function createSyncRoot( | |
container: DOMContainer, | ||
options?: RootOptions, | ||
): _ReactRoot { | ||
const functionName = enableStableConcurrentModeAPIs | ||
? 'createRoot' | ||
: 'unstable_createRoot'; | ||
invariant( | ||
isValidContainer(container), | ||
'%s(...): Target container is not a DOM element.', | ||
functionName, | ||
'createRoot(...): Target container is not a DOM element.', | ||
); | ||
warnIfReactDOMContainerInDEV(container); | ||
return new ReactSyncRoot(container, BatchedRoot, options); | ||
|
@@ -682,9 +671,8 @@ function warnIfReactDOMContainerInDEV(container) { | |
if (__DEV__) { | ||
warningWithoutStack( | ||
!container._reactRootContainer, | ||
'You are calling ReactDOM.%s() on a container that was previously ' + | ||
'You are calling ReactDOM.createRoot() on a container that was previously ' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not expect all fo these conditional names to change, given that we run this test against not-experimental builds as well. Why did they? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the first commit.
Slightly unrelated but I did it this way instead of checking |
||
'passed to ReactDOM.render(). This is not supported.', | ||
enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot', | ||
); | ||
container._reactHasBeenPassedToCreateRootDEV = true; | ||
} | ||
|
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.
I assume that since we're using parallel containers, this won't actually increase the duration of every CI job? That would not be great.
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.
The workflows run in parallel, yeah