[wp-trac] [WordPress Trac] #56313: Add the ability to handle ES Modules and Import Maps
WordPress Trac
noreply at wordpress.org
Fri Feb 23 11:41:22 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 jonsurrell):
Regarding the `$id` parameter, `$module_id` or `$script_module_id` removes
and doubt and is likely easier to find when searching. However, in the
context of modules `$id` seems unlikely to be a significant source of
confusion. My preference would be to maintain `$id`.
For precedent, scripts use `$handle`, not `$script_handle`.
{{{#!php
<?php
function wp_register_script( $handle /*…*/ ) {}
function wp_register_script_module( string $id /*…*/ ) {}
}}}
Although it may be a poor comparison 🙂 I agree with [comment:80 azaozz]
that
> [`$handle`] is somewhat unclear what exactly it represents: something
between "name" and "id"?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56313#comment:84>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list