You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: lazy-load AI Content Planner from the block editor
The 27.6 release pushed the plugin zip past the 5 MB mark. The dominant
cause was the AI Content Planner module being bundled twice:
* statically imported from packages/js/src/initializers/block-editor-integration.js
and the Sidebar/Metabox fills, so it landed in block-editor.js
(+161 KB raw / +28 KB gzipped);
* shipped a second time as the standalone js/dist/ai-content-planner.js
entry (~177 KB raw / 54 KB gzipped). That bundle's initialize.js only
exports initContentPlanner() and never self-bootstraps, so on Elementor
and classic-editor pages — where the standalone bundle was the only one
enqueued — the planner UI never actually mounted. The bundle was dead
weight there.
Convert the three import sites to dynamic import() / React.lazy + Suspense
under a single webpackChunkName, then drop the standalone webpack entry
and localize wpseoContentPlanner onto block-editor instead. The Elementor
enqueue hook is removed too: it was only ever shipping the dead-weight
bundle.
Net js/dist gzipped delta vs 27.6: -25.8 KiB. The planner code now ships
once, on demand, and block-editor.js is ~28 KiB gzipped lighter for users
without the AI feature enabled.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments