[wp-trac] [WordPress Trac] #56313: Add the ability to handle ES Modules and Import Maps
WordPress Trac
noreply at wordpress.org
Thu Feb 22 04:05:39 UTC 2024
#56313: Add the ability to handle ES Modules and Import Maps
-------------------------------------+-------------------------------------
Reporter: idad5 | Owner: luisherranz
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.5
Component: Script Loader | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit- | Focuses: javascript,
tests needs-dev-note | performance
-------------------------------------+-------------------------------------
Comment (by azaozz):
Replying to [comment:79 gziolo]:
> The question is, should we call it `wp_deregister_script_module ` for
consistency with scripts and styles.
Imho this name is descriptive, sounds good, and seems consistent.
Replacing `deregister` with `remove` would also work (imho both are quite
good).
> If we want to keep consistency, should we also rename all `$id` params
with `$handle`
Yea `$handle` is used everywhere in (the old) script loader. However I've
always had the feeling it is somewhat unclear what exactly it represents:
something between "name" and "id"?
Agree that the current `$id` params may be a bit ambiguous. They were
renamed in [57327] from `$module_id`. If they are renamed again, I'd
suggest using the old name: `$module_id` as that seems better than
`$handle` imho. Another possibility would be `$script_module_id` which is
long but best describes what they are and how they are used.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56313#comment:80>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list