-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix - EditorProvider and private APIs #24
Merged
Merged
Conversation
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
dcalhoun
approved these changes
Sep 17, 2024
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.
Testing succeeded for me. 🚀
dcalhoun
added a commit
that referenced
this pull request
Sep 20, 2024
This appears to already be invoked by the `EditorProvider`. The redundant invocation was likely erroneously left in place when we began using the `EditorProvider` recently. #24 https://github.com/WordPress/gutenberg/blob/219065c3be5881a68a8667fda9c04c7b7f546763/packages/editor/src/components/provider/index.js#L178
dcalhoun
added a commit
that referenced
this pull request
Sep 23, 2024
* fix: Remove redundant `getEditorSettings` invocation This appears to already be invoked by the `EditorProvider`. The redundant invocation was likely erroneously left in place when we began using the `EditorProvider` recently. #24 https://github.com/WordPress/gutenberg/blob/219065c3be5881a68a8667fda9c04c7b7f546763/packages/editor/src/components/provider/index.js#L178 * fix: Disable the editor sub-registry Reinstate the editor singleton registry so that third-party blocks may query the block editor state.
dcalhoun
added a commit
that referenced
this pull request
Dec 17, 2024
This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`.
dcalhoun
added a commit
that referenced
this pull request
Dec 17, 2024
This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`.
dcalhoun
added a commit
that referenced
this pull request
Dec 17, 2024
This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`.
dcalhoun
added a commit
that referenced
this pull request
Dec 17, 2024
This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`.
dcalhoun
added a commit
that referenced
this pull request
Dec 17, 2024
This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`.
dcalhoun
added a commit
that referenced
this pull request
Dec 18, 2024
* build: Add patch-package * build: Configure patch-package * fix: Replace unsupported editor architecture This largely reverts #24, which resulted in several regressions. Namely, oddities in the block toolbar emptying and empty Patterns/Media tabs in the block inserter. The previous changes was implemented to workaround an experimental API that is no longer exported after WordPress/gutenberg#64892. That remains an issue, but the new workaround is to patch Gutenberg itself to export this necessary API with `patch-package`. * fix: Disable interception `blob:` URLs leading to an Android crash While the reason for why the `blob:` requests trigger is unknown, they originate when utilizing the block inserter's Patterns tab. The requests seemingly originate from the embedded editor previews rendered for each pattern.
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.
This PR addresses an issue where a removed experimental API breaks the editor in the latest Gutenberg version.
It now uses the
EditorProvider
exported from@wordpress/editor
However, the main issue is that the media library tab no longer loads because theinserterMediaCategories
data is missing.This occurs because the data is marked as private, and the
EditorProvider
component removes it using the BlockEditorProvider, where the propstripExperimentalSettings
is set to true.In Gutenberg, the editor uses
ExperimentalEditorProvider
withExperimentalBlockEditorProvider
, but these are not publicly exported.For now, we can merge this to have a working editor and then look for a long-term solution, likely by attempting to export the other provider as a private API until it is no longer marked as experimental.
Additionally, this PR updates the WordPress packages to their latest versions, adding support for multi-select.
A new middleware is introduced in the API Fetch setup to avoid fetching post content when the editor loads. We are already passing the data, and fetching it again can slow down the editor on slower connections and cause issues where content might flicker or reload.
Regarding post loading, for empty posts, a post ID is expected when the editor loads. For drafts, the Web editor generates a post ID by auto-saving. Since this functionality is not available, a
-1
post ID is set to ensure the editor loads correctly.To test
Note
You can use the following WordPress iOS build to test these changes
Precondition: Enable the feature flag
Experimental Block Editor
Test case 1 - The editor loads an existing post
Test case 2 - The editor loads with a new post