Skip to content

HTML modules spec draft editorial feedback #783

@domenic

Description

@domenic

Hey @dandclark, @BoCupp, @samsebree, @travisleithead. Excited to see the blink-dev intent to implement! I wanted to provide some spec feedback on https://github.com/w3c/webcomponents/blob/gh-pages/proposals/html-module-spec-changes.md in the hopes of making the future integration into HTML smoother. It's all generally editorial, but I thought getting it out there sooner would be a good idea.

  • We should define the new module record type in the HTML spec, not the ES spec. ES provides a base class, which gets specialized by different host environments which have their own needs---e.g. the WebAssembly spec will have its own type of module record, and HTML modules should have theirs. We shouldn't bake HTML-specific semantics into the core language.
  • We should rebase the spec on top of Layering: Enable cyclic dependencies with non-STMR module types tc39/ecma262#1311. I am not sure why that hasn't landed yet, but I've asked. That should make things easier in various ways.
  • Since HTML modules will continue to be included through <script type="module">, we should continue using the script infrastructure. As such, just as a naming thing, the spec-level struct should be "HTML module script", which is a third type of script. We should probably then rename the existing "module script" type to "JS module script"; that will be needed anyway when we introduce WebAssembly module scripts.
  • [[ScriptName]] is a confusing slot name; I'd suggest [[ExternalScriptURL]]. Then maybe [[ModuleRecord]] could be named [[InlineModuleRecord]]. You could also probably get rid of [[IsInline]], just keying off the null-ness or not of those other two slots.

Overall, very exciting stuff!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions