Skip to content

Relying only on content type might be too late for certain optimizations #7

Closed
@phistuck

Description

@phistuck

What about one of the following?

import {baz} from html "foo.html";
import {baz} from html, "foo.html";
import {baz} from "foo.html" html;
import {baz} from "foo.html", html;
import {baz} from "foo.html", type "html";
import {baz} from [html] "foo.html"
import {baz} from [type = "html"] "foo.html"
import {baz} from [type: "html"] "foo.html"
import {baz} from {type: "html"} "foo.html"
import {baz} from {html: "foo.html"}

My https://discourse.wicg.io/t/specifying-nonce-or-integrity-when-importing-modules/1861 has some prior art for the syntax and some acknowledgement and suggestions by Dominic.

I am not developing a browser, but I imagine that knowing this in advance might be useful to trigger more optimizations.
Furthermore (or perhaps more importantly?), it would be more readable and self explanatory (.html is not mandatory in the URL).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions