how should import css and html module behave

You can delete this, or notify me to delete this if this is out of the scope of this forum. It might be but I can't help but feel you will have the answer.

javascript was made for the web, and ECMAScript takes the web out of javascript, but since the web was first where it ran, how should CSS and HTML modules behave when imported? As a simple string? As the equivalent javascript dom object? Or as a context where the HTML imported can import with live ids meaning the scope of the module that imports it has access to those IDs that lay in the HTML element or is this not in the scope of ECMAScript?

It's very much out of scope for the language itself; that's something for the HTML spec to decide.

The language says that an import evaluates JS code, and when it can, and what a Module Namespace object must look like - iow, on the importing side, you shouldn't necessarily be able to determine what kind of module you're importing.

Worth checking out: GitHub - tc39/proposal-import-assertions: Proposal for syntax to import ES modules with assertions

That links to CSS and HTML module proposals (not as part of ECMAScript) at the bottom of the motivation section.

1 Like

Okay, my apologies for the post delete if you like.