[wp-trac] [WordPress Trac] #61356: Add $is_module as an extra strategy argument when enqueueing js script.

WordPress Trac noreply at wordpress.org
Mon Jun 3 11:07:47 UTC 2024


#61356: Add $is_module as an extra strategy argument when enqueueing js script.
----------------------------+--------------------------------------
 Reporter:  itumulak        |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Script Loader   |    Version:  trunk
 Severity:  normal          |   Keywords:  2nd-opinion dev-feedback
  Focuses:  sustainability  |
----------------------------+--------------------------------------
 With [https://core.trac.wordpress.org/ticket/56313 Modules API] not able
 to utilize `wp_localize_script`, would it make sense to add an `is_module`
 option as another argument for `wp_enqueue_script` or
 `wp_register_script`? When set to true, `type="module"` is added in the
 script tag.

 I have created my own Script Module class so that I can use JavaScript
 modules and localize scripts. See
 [https://gist.github.com/itumulak/9d0341036feaf156d89694bb9a007fcc here].

 First time here. Feedback is very welcome.

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


More information about the wp-trac mailing list