-
Notifications
You must be signed in to change notification settings - Fork 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
WP.com block editor: Exclude features from Jetpack sites #38248
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
Shouldn't |
We want to show the "Switch to classic" button on Calypso for Jetpack sites as well, so we need to keep it in the shared utilities. It's true we don't want to show it on the WP Admin block editor, but we can control that with |
Should things in So e.g.; If I understood correct, |
Yup, nice catch. I opted for the optional chaining
Correct. That's the reason why we still use |
Latest Jetpack version supports new enough WP core to use |
Unfortunately, this is the case. I think we could have versioned builds and then update the |
Oh, right – "classic", meaning, the Calypso editor 🙃 Yeesh. |
aabf2a1
to
8d59440
Compare
Having switch to classic appear in the iframe for WordPress.com but not in wp-admin for Atomic seems a little odd. Non-blocking, as this is current behavior and we can follow up with that. |
✅ Atomic features appear to work well |
✅ Also smoketested Jetpack standalone: no tracking, Calypso media integration, rich text integration |
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.
Thanks @mmtr! I think this approach should work well, though I have two last points to consider before we
- Are the filenames here too generic? We likely have a high chance of asset name collision. Folks in the future might have trouble tracing this back
- It may be worth copying over the full feature table in the summary to the readme
Note that it may also make sense to group needed changes for Automattic/jetpack#14233 I'd prefer if we had a systematic way of splitting out CSS vs a manual one off, as we're likely going to miss this in the future. |
Even with different dist files (which I agree is a good idea), Automattic/jetpack#14233 would still needed since the goal there is to avoid an extra network request (see p1576247513008200-slack-perfops). Anyway, I think we can improve our build script in order to automatically open diffs and PRs that updates those inline styles if they are modified in the |
Bundles are all served under the |
ce7baff
to
74a6b79
Compare
Alright, I performed a bunch of changes:
|
Smoke Tested: |
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.
Great I think this is good to go @mmtr ! If there's anything we missed we can add onto it in follow ups.
I also verified that view styles are inlined for Simple Sites:
In order to don't expose some `@automattic/wpcom-block-editor` features to Jetpack sites that are specific of WP.com sites, the `common` bundle has been split into two new bundles `default` and `wpcom` in Automattic/wp-calypso#38248. This PRs changes the WordPress.com block editor module to replace the `common` bundle with the new `default` and to load `wpcom` only when the site is a WP.com site (Atomic).
Changes proposed in this Pull Request
We shouldn't expose all the common features from
wpcom-block-editor
to Jetpack sites, since some of them are intended specifically for WP.com users such as:This PR seeks to fix that by splitting the
common
features into 2 new bundles:default
: loaded on all sites.wpcom
: loaded only on WP.com sites.The
common
bundle is no longer maintained and it is replaced by thedefault
bundle. Note that thecommon
build needs to keep being served onwidgets.wp.com
since it will be still used by Jetpack and Atomic sites running Jetpack 8.0 or earlier.Testing instructions
widgets.wp.com
for adding the new bundles to your sandbox:update/wpcom-block-editor-exclude-features-jetpack
.rich-text
: Extensions for the Rich Text toolbar with the Calypso buttons missing on Core (i.e. underline, justify).switch-to-classic
: Appends a button to the "More tools" menu for switching to the classic editor.fix-block-invalidation-errors
: Performs block attempt block recovery on editor load if validation errors are detected.reorder-block-categories
: Moves Jetpack and CoBlocks Block Categories below Core Categories.tracking
: Adds analytics around specific user actions.iframe-bridge-server
: Server-side handlers of the different communication channels we establish with the client-side when Calypso loads the iframed block editor. Seecalypsoify-iframe.jsx
.tinymce
: Tiny MCE plugin that overrides the core media modal used on classic blocks with the Calypso media modal.Fixes #34476