[wp-trac] [WordPress Trac] #60647: Script Modules: Allow modules to depend on existing WordPress scripts

WordPress Trac noreply at wordpress.org
Thu Apr 4 20:44:56 UTC 2024


#60647: Script Modules: Allow modules to depend on existing WordPress scripts
-----------------------------+-------------------------
 Reporter:  jonsurrell       |       Owner:  jonsurrell
     Type:  feature request  |      Status:  assigned
 Priority:  normal           |   Milestone:  6.6
Component:  Script Loader    |     Version:  6.5
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  javascript
-----------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:10 jonsurrell]:
 > The first option is to allow modules to depend on scripts. This seems to
 be a fairly simple and safe change.

 Big +1. Thinking any "mixing" of modules and "ordinary" scripts should be
 kept to a minimum, and the simpler it is handled -- the better.

 > The downside with this first option is that it does not provide a
 transition strategy from scripts to modules and we sacrifice some of the
 potential benefits of modules like deferred or conditional/on-demand
 loading of modules.

 Frankly I'm not sure if the WP old-style scripts can be transitioned to
 modules in many (most?) cases. The reason it that this would break any
 (old style) scripts added by plugins that depend on them. So thinking this
 is a no-issue for now, and perhaps won't be for a long time, if ever.

 Seems the way forward would be to deprecate the old-style scripts and
 replace them with modules, then load them if/when a plugin enqueues them.

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


More information about the wp-trac mailing list