[wp-trac] [WordPress Trac] #54884: Load scripts conditionally to reduce page loading and processing time

WordPress Trac noreply at wordpress.org
Sun Jan 23 19:56:18 UTC 2022


#54884: Load scripts conditionally to reduce page loading and processing time
---------------------------+--------------------------------------
 Reporter:  galbaras       |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  javascript, performance
---------------------------+--------------------------------------

Comment (by seebeen):

 Injecting scripts with appendChild can (and will) break minification and
 concatenation in caching plugins.

 I think a better approach would be to either enforce a minimum browser
 version which will also have a side-effect of not caring about backwards
 compatibility or implement asset compiling and transpiling via webpack and
 browserlist file.

 Second option can also generate all the needed polyfills via core-js
 module.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54884#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list