-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Element: enable concurrent mode by implementing mount/unmount with createRoot #46467
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f656947
Post Editor: Disable React strict mode
tyxla d86c7d8
Don't show BlockSelectionButton when there is multiselection
jsnajdr 9ba1cbc
RichText: fix timing of synthetic input event
jsnajdr c33cf98
RichText: run composition end in separate microtask tick
jsnajdr 91e4b1c
useAsyncList: fix race condition when reading nextIndex
jsnajdr 2dd8665
Slot: mark as mounted in cDM, fixes strict mode double effects
jsnajdr a0a7226
font-size-picker.spec: Close sidebar after each test
jsnajdr 5a7d2b8
font-size-picker.spec: Close typography menu so that sidebar close bu…
jsnajdr e1c2fef
useSlot: subscribe using useSyncExternalStore
jsnajdr 539d35f
Enable concurrent mode by using createRoot to mount editor apps
jsnajdr aa9cd41
Error boundaries: show Attempt Recovery option only if onError supplied
jsnajdr 1638d6a
Remove ErrorBoundary onError callbacks and recovery buttons
jsnajdr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import { | |
store as editorStore, | ||
experiments as editorExperiments, | ||
} from '@wordpress/editor'; | ||
import { StrictMode, useMemo } from '@wordpress/element'; | ||
import { useMemo } from '@wordpress/element'; | ||
import { SlotFillProvider } from '@wordpress/components'; | ||
import { store as coreStore } from '@wordpress/core-data'; | ||
import { ShortcutProvider } from '@wordpress/keyboard-shortcuts'; | ||
|
@@ -25,14 +25,7 @@ import { unlock } from './experiments'; | |
|
||
const { ExperimentalEditorProvider } = unlock( editorExperiments ); | ||
|
||
function Editor( { | ||
postId, | ||
postType, | ||
settings, | ||
initialEdits, | ||
onError, | ||
...props | ||
} ) { | ||
function Editor( { postId, postType, settings, initialEdits, ...props } ) { | ||
const { | ||
hasFixedToolbar, | ||
focusMode, | ||
|
@@ -180,28 +173,24 @@ function Editor( { | |
} | ||
|
||
return ( | ||
<StrictMode> | ||
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. We should keep in mind to open a PR enabling 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. Strict mode enabler PR opened here: #47639 |
||
<ShortcutProvider> | ||
<SlotFillProvider> | ||
<ExperimentalEditorProvider | ||
settings={ editorSettings } | ||
post={ post } | ||
initialEdits={ initialEdits } | ||
useSubRegistry={ false } | ||
__unstableTemplate={ | ||
isTemplateMode ? template : undefined | ||
} | ||
{ ...props } | ||
> | ||
<ErrorBoundary onError={ onError }> | ||
<EditorInitialization postId={ postId } /> | ||
<Layout styles={ styles } /> | ||
</ErrorBoundary> | ||
<PostLockedModal /> | ||
</ExperimentalEditorProvider> | ||
</SlotFillProvider> | ||
</ShortcutProvider> | ||
</StrictMode> | ||
<ShortcutProvider> | ||
<SlotFillProvider> | ||
<ExperimentalEditorProvider | ||
settings={ editorSettings } | ||
post={ post } | ||
initialEdits={ initialEdits } | ||
useSubRegistry={ false } | ||
__unstableTemplate={ isTemplateMode ? template : undefined } | ||
{ ...props } | ||
> | ||
<ErrorBoundary> | ||
<EditorInitialization postId={ postId } /> | ||
<Layout styles={ styles } /> | ||
</ErrorBoundary> | ||
<PostLockedModal /> | ||
</ExperimentalEditorProvider> | ||
</SlotFillProvider> | ||
</ShortcutProvider> | ||
); | ||
} | ||
|
||
|
Oops, something went wrong.
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.
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 would make a great fix for a separate PR.
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.
That's true, but there are 8 commits like this in the PR. They are all self-contained fixes that are independent from each other.
At this moment I plan to cleanup the
reinitializeEditor
APIs, something we discussed more than a month ago but never executed. That's the last item that needs to be done before merging.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.
No blockers with this at all, I was just sharing thoughts.