-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Enhancement
Copy link
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] PerformanceRelated to performance effortsRelated to performance efforts
Description
What problem does this address?
Currently, edit-site pages load all block editor assets and settings upfront, even when they don't render an editor. This impacts performance for navigation flows that don't require the editor. (e.g., styles page, post list...).
What is your proposed solution?
Create a @wordpress/lazy-editor package that loads the block editor asynchronously on-demand. This would allow edit-site to defer loading editor resources until actually needed.
Proposed architecture:
- Editor Settings Endpoint - REST API endpoint to fetch block editor settings dynamically
- Editor Assets Endpoint - REST API endpoint to return required block editor assets (scripts/styles)
@wordpress/load-assetsPackage - Utility for dynamically loading scripts and styles into the DOM@wordpress/lazy-editorPackage - Higher-level component that acceptspostTypeandpostIdprops and handles async loading of settings, assets, and rendering
Benefits:
- Improved initial load performance for edit-site pages
- Reduced bundle size for navigation-only flows
- Better code splitting and resource management
Backwards compatibility
A lot of third-party plugins that are not using the right hooks to enqueue assets might have conflicts with this, so we'd need a fallback/opt-in/opt-out at some point.
cc @WordPress/gutenberg-core WDYT?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] PerformanceRelated to performance effortsRelated to performance efforts