1
Optimized Script and Style Loading in Editor Mode Without Dependency-Specific Elements
Source: elementor/elementor#31300 · opened by @devsblink
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
• I confirm I have read and followed the Editor V4 Discussion Form guidelines, and agree this discussion may be closed without warning.
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
• I confirm I have read and followed the Editor V4 Discussion Form guidelines, and agree this discussion may be closed without warning.
No pledges yet. Be the first to back this.
Comments
Similar requests
🏞️ Custom loading control for media content/assets
1 vote · 0 comments
Please allow an option in "safe mode" to disable customer <script> to ensure the Elementor editor itself is not broken due to user error
2 votes · 0 comments
Element Panel and Settings Change Indicators
2 votes · 0 comments
Pseudo elements :after & :before
5 votes · 0 comments
Inheriting Elementor styles in the WordPress block editor
1 vote · 0 comments
No comments yet.