WebKit / standards-positions

WebKit's positions on emerging web specifications
https://webkit.org/standards-positions/
242 stars 19 forks source link

HTML modules #285

Closed o-t-w closed 8 months ago

o-t-w commented 10 months ago

WebKittens

No response

Title of the spec

HTML Modules

URL to the spec

https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-explainer.md

URL to the spec's repository

No response

Issue Tracker URL

No response

Explainer URL

No response

TAG Design Review URL

https://github.com/w3ctag/design-reviews/issues/334

Mozilla standards-positions issue URL

https://github.com/mozilla/standards-positions/issues/137

WebKit Bugzilla URL

No response

Radar URL

No response

Description

Following the standardisation of JSON modules and CSS modules, HTML modules make use of the import attributes syntax to import HTML.

import {content} from "foo.html" with { type: "html" };
annevk commented 10 months ago

Is this proposal being actively developed somewhere? It hasn't been discussed in the Web Components community for many years now.

o-t-w commented 10 months ago

It initially stalled because of all the churn with import assertions/import attributes and because it was decided to progress CSS modules and JSON modules first. Sadly the Edge team (who originally worked on it) have not had the bandwidth to progress the specification, but the Web Components Community Group are still keen to see it progress. The initial issue thread is still pretty active. Developer sentiment is still positive 1, 2, 3

jaredcwhite commented 10 months ago

I can concur, still lots of chatter out there in web component circles. I will hear questions to the effect of "why can't we just write an HTML template and import that as a web component?" To which I always reply, well hopefully we will get there with HTML modules!

In fact, I wrote a bundler-level solution for it as this esbuild plugin, which is now being used in production: https://github.com/whitefusionhq/esbuild-plugin-html-modules

justinfagnani commented 8 months ago

@annevk true, it hasn't been discussed directly for a while, and I believe that @dandclark may be working on other things than web specs, but with import attributes landing and talks about declarative custom elements - which would need a HTML module format to be very useful - I think things could be picked up. Not sure what that means for a standard position issue though.

I'm personally working on a new Rollup plugin / polyfill to allow us to try out various semantics.

annevk commented 8 months ago

Appreciate the update. I will close this for now. Once there's a proposal with concrete implementer requirements that can be evaluated we'll be happy to go over it. The WebKit team definitely considers this an area worthy of exploration.