Changed the way that Gutenberg detection happens. Gutenberg can be fa… #210
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.
We ran into an issue with javascript errors when submitting jobs from the page editor. I discovered that the issue was caused by having these 3 plugins:
Smartling Connector
Classic Editor
Yoast SEO (or any other plugin that enqueues the React library)
Gutenberg uses React. Smartling Connector detects that React is loaded to determine wether or not the editor is Gutenberg vs Classic using a simple
if (window.React) { }
. Because we’re using the Classic Editor plugin, Gutenbert is disabled there should be no React.The problem arises with the Yoast SEO plugin. It also uses React. This makes Smartling Connector think that the editor is Gutenberg, so it tries to show alerts using the Gutenberg
core/notices
, which doesn’t exist because we’re actually using the Classic Editor.We changed the way that Gutenberg is detected from a simple React check to using a class on the body. This method is defined here WordPress/gutenberg#12200 (comment)