[wp-trac] [WordPress Trac] #49470: Script loader: simplify maintenance

WordPress Trac noreply at wordpress.org
Tue Feb 18 22:11:18 UTC 2020


#49470: Script loader: simplify maintenance
---------------------------+--------------------
 Reporter:  azaozz         |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  5.5
Component:  Script Loader  |    Version:  5.0
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+--------------------
 The main functionality of script-loader is to provide a list of all
 WordPress scripts and stylesheets together with their dependencies,
 translation objects and extra/inline code.

 During the WP 5.0 development a few (shorthand) functions were introduced
 that output hard-coded data used to "construct" that list by running
 several loops instead of the simpler, one-line definitions like in the
 pre-existing list. This makes it harder to "see" and maintain the entries
 in the list, and doesn't bring any benefits (all data is still hard-coded,
 but is now in separate places). It also makes it harder to "dynamically"
 extract and construct the scripts list like in #48154.

 For best results and easier maintenance the "helper functions" introduced
 in WP 5.0 should be removed and the list of scripts in `wp_default_scripts
 ()` should include all entries.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49470>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list