Repository navigation
Social: fix blank Social admin page on WordPress 6.9.x - #49654
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! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
On WP 6.9.x the publicize build externalized @wordpress/theme into the wp-theme script handle, which only exists in WP 7.0. WordPress silently skips enqueuing a script whose dependency handle is unregistered, so the standalone Jetpack Social admin page rendered blank (auto-sharing, being server-side, kept working). Bundle @wordpress/theme and @wordpress/private-apis inline for the social-admin-page entry only, so that standalone page renders on 6.9.x. The block-editor entries keep externalizing both: they load inside the block editor and must share WordPress's canonical private-apis instance, so inlining a second copy there breaks lock()/unlock() across bundles. Fixes: https://linear.app/a8c/issue/JETPACK-1716
ec02874 to
892d9e2
Compare
|
This is the only change we need to fix the issue. diff --git a/projects/packages/publicize/webpack.config.js b/projects/packages/publicize/webpack.config.js
index 00b62de959b..9e40800846f 100644
--- a/projects/packages/publicize/webpack.config.js
+++ b/projects/packages/publicize/webpack.config.js
@@ -17,7 +17,14 @@ const socialWebpackConfig = {
},
node: false,
plugins: [
- ...jetpackWebpackConfig.StandardPlugins(),
+ ...jetpackWebpackConfig.StandardPlugins( {
+ DependencyExtractionPlugin: {
+ requestMap: {
+ '@wordpress/theme': { external: false },
+ '@wordpress/private-apis': { external: false },
+ },
+ },
+ } ),
// Service-walkthrough illustrations referenced by
// `_inc/components/services/utils.tsx` via runtime URLs (so the
// chassis esbuild pipeline, which doesn't configure a binary
|
There was a problem hiding this comment.
Pull request overview
Fixes a Jetpack Social admin UI regression on WordPress 6.9.x where the Jetpack → Social page rendered blank due to an unregistered wp-theme dependency handle preventing the admin bundle from enqueuing.
Changes:
- Split Publicize’s webpack config into two compiler configs so dependency extraction can differ by surface.
- For the standalone Social admin page bundle, inline-bundle
@wordpress/themeand@wordpress/private-apisto avoid the missingwp-themehandle on WP 6.9.x. - Add a changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| projects/packages/publicize/webpack.config.js | Splits entrypoints and adjusts dependency extraction so the Social admin page can load on WP 6.9.x. |
| projects/packages/publicize/changelog/fix-jetpack-1716-social-blank-wp69 | Adds a patch-level changelog entry for the blank Social admin page fix. |
|
Thanks @manzoorwanijk! Gentle heads-up in case it helps: I actually tried that exact version first, and it tripped the post-editor and Social E2E tests, which is why I ended up splitting it so only the admin-page bundle inlines. Could be something I missed, you know this code far better than me, so totally your call on the final approach, just wanted to mention this. Thanks for for looking into it! |
manzoorwanijk
left a comment
There was a problem hiding this comment.
This works fine as a fix for Social admin page, but I will leave the build tooling changes to @anomiex for review.
Thank you for taking this up.
anomiex
left a comment
There was a problem hiding this comment.
I don't have any comments that would block merging this. Updating the changelog entry would be a good idea though.
I don't know whether enabling devServer for the classic-editor entry point is fixing an old oversight or is undoing something that was intentional in the past.
I also stand by my statement in Slack that it would be better to have a centralized polyfill for the missing script than to bundle @wordpress/theme and such in half a dozen different bundles. But I don't think it would be worthwhile to hold up this fix on someone refactoring everything to do that instead.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ordPress 6.9.x (#49859) * Revert "Social: fix blank Social admin page on WordPress 6.9.x (#49654)" This reverts commit cb65288. * Register WP build polyfills for the legacy admin page and editor * Social: request only the wp-theme / wp-private-apis polyfills the bundles 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.
Summary
Fixes: JETPACK-1716 — the Jetpack Social admin page (Jetpack → Social) renders blank on WordPress 6.9.x.
Bug
Linear: JETPACK-1716
Since Jetpack 15.9, on sites running WordPress 6.9.x, Jetpack → Social renders blank. Connections stay healthy and posts still auto-share (that path is server-side), so it presents as an admin-UI-only failure. Reported across three Zendesk tickets and several WordPress.org forum threads; the only workaround so far has been upgrading to WordPress 7.0.
Root cause
@wordpress/themearrives transitively via@wordpress/ui. With the default build config it is externalized into the script handlewp-theme, which is registered in WordPress 7.0 but not in 6.9.x. WordPress silently refuses to enqueue a script whose declared dependency handle is unregistered, so the Social bundle never loads. No console error is thrown (the script simply is not enqueued), which matches the "blank page, nothing red in console" reports.What changed
projects/packages/publicize/webpack.config.js: split the entry points so dependency extraction differs by surface.social-admin-page(standalone admin page): bundle@wordpress/themeand@wordpress/private-apisinline, so the page renders on WP 6.9.x. They are bundled jointly so@wordpress/theme's module-initlock()lands on the sameprivate-apisconsent map (same pattern as Boost / Jetpack AI admin / Search dashboard, PR Components: Migrate remaining Notice consumers to @wordpress/ui #48173). This is safe here because the admin page is standalone, with no other script sharing a canonicalprivate-apisinstance.block-editor-jetpack,block-editor-social,classic-editor: keep externalizing both (unchanged). These load inside the block editor and must share WordPress's canonicalprivate-apisinstance; bundling a second copy inline breakslock()/unlock()across bundles (Cannot unlock an object that was not locked before).Scope / known limitation (follow-up for the Social team)
This PR fixes the blank Social admin page on WP 6.9.x, the primary symptom in every ticket.
It does not restore the editor's per-post "Share to social media" controls on WP 6.9.x. Those controls live in the block-editor bundles, which still need the
wp-themehandle that WP 6.9.x lacks, and that bundle cannot inline@wordpress/themewithout breaking the sharedprivate-apisinstance (see above). Restoring them on old WP needs deeper work, e.g. registering awp-themeshim for older WP or decoupling the editor bundle from@wordpress/theme. This is the same behaviour as the current release on 6.9.x (no regression), and is worth a follow-up owned by the Social team.Testing instructions
Tested on a JN sandbox rolled back to WordPress 6.9.4 (standalone Jetpack Social plugin):
wp-themeis not registered on WP 6.9.4 (wp_script_is( 'wp-theme', 'registered' )returns false).social-admin-page.asset.phpno longer listswp-theme(inlined), whileblock-editor-*.asset.phpstill list it (externalized, unchanged).Cannot unlock ...(an issue an earlier iteration of this PR introduced and this version resolves). On WP 6.9.x the editor Social panel remains absent, as in the current release.Not tested: single-plugin layouts (the sandbox had both the main Jetpack plugin and the standalone Social plugin active), and WordPress versions other than 6.9.4.
Screenshots
Before (WP 6.9.4, Social admin page blank):
After (fix applied, Social dashboard renders):
Console note (not a regression)
On the test site the console shows
Store "jetpack-connection" is already registered.This is a dual-plugin test-environment artifact: the sandbox has both the mainjetpackplugin and the standalonejetpack-socialplugin active at once, each registering thejetpack-connectionstore. It does not occur on a real site running one of the two, and it is not related to this change.Does this pull request change what data or activity we track or use?
No.
Reviewed locally
Reviewed with
/jetpack-review-prbefore flipping to ready. The fix area was re-scoped after CI E2E (editor + Social) flagged a regression in the first iteration; this version is verified against those surfaces on JN. Local lint/tests rely on CI (this clone'snode_modulesis mid-reinstall).Notes
This PR was created during Bug Blitz via the jetpack-bug-blitz Claude skill. The fix was authored with Claude Code assistance by a Happiness Engineer who encounters this bug in support tickets.
#jetpack-happy-ai-updates