-
Notifications
You must be signed in to change notification settings - Fork 48.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rename AsyncMode -> ConcurrentMode #13732
Conversation
Run Prettier Fix up More renames
Details of bundled changes.Comparing: d0c0ec9...d02c8b8 react-test-renderer
react-is
scheduler
Generated by 🚫 dangerJS |
@@ -68,8 +68,8 @@ export const StrictMode = REACT_STRICT_MODE_TYPE; | |||
|
|||
export {isValidElementType}; | |||
|
|||
export function isAsyncMode(object: any) { | |||
return typeOf(object) === REACT_ASYNC_MODE_TYPE; | |||
export function isConcurrentMode(object: any) { |
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.
Both this and symbol export rename would be a breaking change technically. Unfortunately we forgot the unstable prefix here. Let’s keep both and add a deprecation warning for isAsyncMode.
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've made the change. Did I do it correctly?
packages/react-is/src/ReactIs.js
Outdated
'and will be removed in React 17+. Update your code to use ' + | ||
'ReactIs.isConcurrentMode() instead. It has the exact same API.', | ||
); | ||
if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
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.
This should be inside if (__DEV__)
Hey @trueadm. This change will require a corresponding change in react-devtools. Are you also going to own that? |
@bvaughn Just found the comment. Sure! |
Is it the breaking change? |
No. Both async and concurrent modes are "unstable_" (e.g. |
* Rename AsyncMode -> ConcurrentMode
- Partial revert of facebook#13732 - Fixes facebook#13958.
- Partial revert of facebook#13732 - Fixes facebook#13958.
Are there any doc about the usage of this ConcurrentMode Mode? |
No — it's unstable. We only document stable features. |
* Rename AsyncMode -> ConcurrentMode
…k#13959) - Partial revert of facebook#13732 - Fixes facebook#13958.
* Rename AsyncMode -> ConcurrentMode
This PR renames
AsyncMode
toConcurrentMode
. Specifically:React
exportsunstable_ConcurrentMode
now rather thanunstable_AsyncMode
.ReactTestRender
now takesunstable_isConcurrent
as an option rather thanunstable_isAsync
.isAsync
have been renamed toisConcurrent
to reflect the naming changes.REACT_ASYNC_MODE_TYPE
has been renamed toREACT_CONCURRENT_MODE_TYPE
.react-is
now exportsisConcurrentMode
, renamed fromisAsyncMode
.