I'm not sure what you are asking here - I was under the impression you were concerned about name collisions when using multiple wildcard imports in the same module.
"Shorter loading" times simply means that HTML and CSS loading and processing won't get blocked by JavaScript loading/parsing/executing; i.e. to have a benefit the page will have to contain static HTML and CSS.
This was a questions about the scope of the global namespace inside a module. I assume, something like window[myVariable] = "NewValue" is not possible in a module?!?
It's only top level var and function declarations in inline JavaScript that pollute the global object (typically prevented with an IIFE). This doesn't happen in type="module" or ECMAScript modules - those names are "module global" but do not create properties on the global object.
const and let are block scoped so they don't affect the global object.
In modules you can still alter the global object via any name that is bound to it (provided that part isn't read-only). So window['myVariable'] = 'NewValue'; is possible.
Imported names are "module global" but do not create properties on the global object
What about imports inside a module? This pollutes the namespace of the module, but not the global namespace:
html
<- module A <- libA
<- module B <- libB
I assume that dynamic import would also help to get short loading times in some cases.
This was a questions about the scope of the global namespace inside a module. I assume, something like window[myVariable] = "NewValue" is not possible in a module?!?
varandfunctiondeclarations in inline JavaScript that pollute the global object (typically prevented with an IIFE). This doesn't happen intype="module"or ECMAScript modules - those names are "module global" but do not create properties on the global object.constandletare block scoped so they don't affect the global object.window['myVariable'] = 'NewValue';is possible.