Repository navigation
Social: fix missing editor sharing controls and blank admin page on WordPress 6.9.x - #49859
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
|
||
| WP_Build_Polyfills::register( | ||
| 'jetpack-social', | ||
| array_merge( WP_Build_Polyfills::SCRIPT_HANDLES, WP_Build_Polyfills::MODULE_IDS ) |
There was a problem hiding this comment.
There was a problem hiding this comment.
All dashboards are scoping the polyfills call to the dashboard page (with the exception of Social modernized dashboard, which is still under a feature flag, but I must fix before release, and PA, hence that PR).
So this PR needs to scope it as well.
Limiting the packages would require testing, but I think should be OK.
There was a problem hiding this comment.
In this case, it looks like they have some @wordpress/ui use in a bundle that's loaded into the editor. Which depends on @wordpress/theme, which isn't available in 6.9.
There was a problem hiding this comment.
Yes, the missing script issue is only with @wordpress/theme but it seems like private-api from WP 6.9 doesn't work with the latest @wordpress/theme. So, maybe we need both of them?
Code Coverage SummaryCoverage changed in 2 files.
|
…dles use Per review: the shared helper for the Social bundles (editor + legacy admin page) now requests only wp-theme and wp-private-apis instead of the full SCRIPT_HANDLES + MODULE_IDS set, so the polyfill's wp-private-apis force- replacement never touches handles Social doesn't need (e.g. wp-notices). The wp-build chassis dashboard keeps its own full registration -- it genuinely uses the @wordpress/boot|route|a11y modules, wp-notices, and wp-views.
Fixes JETPACK-1750
Proposed changes
On WordPress 6.9.x,
@wordpress/theme(pulled in transitively via@wordpress/ui) is externalized to thewp-themescript handle, which only exists on WP 7.0+ — and even WP 7.0'swp-private-apisships a core-module allowlist too old for@wordpress/theme/@wordpress/ui. WordPress silently refuses to enqueue any script with an unregistered dependency, so the Social bundles never load: the Social admin page renders blank and the editor "Share to social media" controls are missing.This reuses the existing
jetpack-wp-build-polyfillspackage — which already provideswp-theme/wp-private-apisfor the wp-build (chassis) Social dashboard — and wires it into the two surfaces that still lacked it:@wordpress/theme+@wordpress/private-apisinline for thesocial-admin-pageentry. The block-editor entries kept externalizing both, so the editor controls stayed missing — and inliningprivate-apisthere breakslock()/unlock()across bundles (Cannot unlock an object that was not locked before).Publicize_Assets::register_wp_build_polyfills()helper, and de-duplicate the existing chassis call to reuse it.All bundles keep externalizing
wp-theme/wp-private-apisuniformly; the polyfills provide a single sharedprivate-apisinstance whose allowlist permits@wordpress/themeand@wordpress/ui, so every consumer — WordPress core included — shares one instance andlock()/unlock()stays consistent. No-op on WP 7.0+.This matches the fix suggested in the issue (
WP_Build_Polyfills::register()).Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Requires a site on WordPress 6.9.x with Jetpack Social active.
add_filter( 'rsm_jetpack_ui_modernization_social', '__return_false' ).Cannot unlock an object that was not locked beforeerror.wp-theme.