-
Notifications
You must be signed in to change notification settings - Fork 385
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
Eliminate AMP validation from Classic Editor #5996
Conversation
8308aaa
to
59decd4
Compare
59decd4
to
7f7f447
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5996 +/- ##
=============================================
- Coverage 75.41% 75.34% -0.08%
+ Complexity 5735 5700 -35
=============================================
Files 218 218
Lines 17362 17277 -85
=============================================
- Hits 13094 13017 -77
+ Misses 4268 4260 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Plugin builds for fec0b8d are ready 🛎️!
|
This is a great path to move forward on. Although it would seem users of the Classic Editor would have less visibility into validation issues right from the editor, actually the UX is much better this way. |
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 is great. Love to see all that code being cut.
Ship it.
@@ -119,6 +119,7 @@ class AMP_Validation_Manager { | |||
* | |||
* Keys are post IDs and values are whether the post has been re-validated. | |||
* | |||
* @deprecated In 2.1 the classic editor block validation was removed. | |||
* @var bool[] | |||
*/ | |||
public static $posts_pending_frontend_validation = []; |
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 variable can now be removed, no? Unless it was being referenced directly by themes/plugins.
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 can see that two plugins are making use of this variable, but in those cases they rely on the AMP plugin as a library so removing this variable shouldn't affect them.
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.
It can't be removed because it's being used by this mini plugin: https://gist.github.com/westonruter/31ac0e056b8b1278c98f8a9f548fcc1a
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.
Oh I see. Maybe we could add a note about that also so it isn't accidentally removed in the future.
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.
Added
Co-authored-by: Pierre Gordon <[email protected]>
I tried to reproduce for QA, but couldn't validate.
|
Something was wrong with my local instance of AMP. I did a clean install and validated that this issue is working. When I type an invalid entry into Classic editor, then go to frontend, I now see the error displaying in the admin bar. Passes QA. |
Summary
AMP validation in the Classic Editor is very poor. Since the Classic Editor requires a full page reload for each save, the synchronous validation performed during that request makes saving painfully long. And then if there was a validation error in the content, the presentation of the errors is poor since the specific content that has the error(s) can't be pinpointed:
Also, since the Block Editor is the future and the Classic Editor is the past, we should move along. A lot of legacy technical debt can be paid off by eliminating this integration. The Classic Editor integration was not being maintained and it is doubtful it provided any value for users. If a user is using the Classic Editor, they will still be able to discover validation errors via the admin bar when viewing the post on the frontend.
This is part of #2069.
Before
Time to save: 5 seconds
before.mov
After
Time to save: 1 second
after.mov
Checklist