Optimized Script and Style Loading in Editor Mode Without Dependency-Specific Elements #31300
devsblink
started this conversation in
Feature Request
Replies: 1 comment
|
Hi @devsblink! Thank you for reaching out! 🙏 Please, keep in mind the Editor V4 category is for discussing and sharing feedback about your experience with the new Editor, not to request features for the existing editor. Please, follow our Contribution Guidelines to avoid confusion next time. Help us keep different channels organized so others can add their vote for your feature request, and we can keep the Editor V4 category focused on discussing Editor V4 features. Thank you |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
In the current setup, registered styles and scripts are loaded in the editor mode without relying on any dependency-specific elements. While this ensures broader compatibility and cleaner integration, it can unintentionally lead to performance issues. Specifically, the editor becomes slow due to unnecessary or globally loaded assets that aren't conditionally enqueued based on actual usage.
To improve performance, it's recommended to optimize asset loading by:
Registering scripts/styles globally but only enqueuing them when needed.
Using conditional checks to detect active blocks/widgets in the editor.
Avoiding broad loading of styles/scripts across all editor views.
This helps maintain clean, modular code while ensuring that editor performance remains smooth and responsive.
Agreement
All reactions