Wanna get some #webComponents topics on the docket for @w3c #TPAC? Join the planning discussion in https://discord.gg/kbba8cKPg9 and help us get the hottest button topics unlocked as vendors, contributors and the community gather next month in Kobe!

#shadowDOM #elementInternals #referenceTarget #declarativeCSSModules #htmlModules #DOMTemplating

Join the Web Components Discord Server!

Check out the Web Components community on Discord - hang out with 491 other members and enjoy free voice and text chat.

Discord

So we have Constructible Style Sheets https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet, should we also have Constructible HTML Documents? 🤔

E.G. where a constructed Style Sheet is shared and mutable, should there be a shared an mutable HTML primitive?

Like a lot of HTML needs to be hyper custom, but maybe the shadow DOM of oft-repeated elements like buttons or inputs? Things that rely heavily of <slot>s over templating?

#webComponentsCG #htmlModules

CSSStyleSheet: CSSStyleSheet() constructor - Web APIs | MDN

The CSSStyleSheet() constructor creates a new CSSStyleSheet object which represents a single Stylesheet.

MDN Web Docs

@konnorrogers

@keithamus doesn't need to worry, too much... the Edge team is super invested in bringing a version of this to life for use!! 🚀

It's very exciting: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/CSSModules/v1Explainer.md

#cssModules #htmlModules #jsonModules #ohMy

MSEdgeExplainers/CSSModules/v1Explainer.md at main · MicrosoftEdge/MSEdgeExplainers

Home for explainer documents originated by the Microsoft Edge team - MicrosoftEdge/MSEdgeExplainers

GitHub

@keithamus @ryantownsend @developers

I'd be down for a Level 1 that was only collapsing this into HTML: https://codesandbox.io/p/sandbox/n6q2t5?file=%2Ffetch-html.js

We can get into the magic of templates and arguments and whatnot later...

Then a standard issue HTML-first page could be rendered a la:

<template src="/header.html"></template>
<template src="/nav.html"></template>
<template src="/side-nav.html"></template>

<!-- CONTENT -->

<template src="/footer.html"></template>

🤯

#htmlModules #htmlMacros #webComponents

@SaraSoueidan At the #webComponentsCG we see #HTMLModules and #declarativeWebComponents as the sort of APIs that would open the door to "HTML Macros" in this way. @justinfagnani have we captured that as a specific proposal, or is it still a part of the larger conversation?

@mayank “HTML modules” as a macro is such a cool idea. I agree 100% that it’s a place we should focus in on things like this. The #webComponentsCG sees this as a big next step towards clarifying #declarativeCustomElements API. Converting your blog to an explainer would be a great next step.

Disclaimer: in a recent meeting with implementors we agreed that Cross Root Aria and Scoped Custom Element Registries are of higher priority. Having solid plans for #HTMLModules when they get done will be 🔥

Through the conversation, I wondered whether the misunderstanding that a #customElement directly correlates to a #frameworkComponent was eased or expanded with the theoretical advent of an HTML Module. Much of what we were seeing as #htmlModules seemed more directly related to what we see in #frameworkComponents, which seems like an interesting path to investigate.

With #domPart and HTML Modules, it it possible to recreate what we know now as a #JSFramework in just HTML!?! 🤯

😅 Running meetings is not for the feint of heart. Running meetings where the gathering is discussing ways for ward for the web... an even more complicated endeavor! We're doing it at the #webComponentsCG, however!

Today we had a great session on #declarativeCustomElements and #htmlModules and more. Learn more about the discussion, here: https://github.com/w3c/webcomponents-cg/issues/79#issuecomment-1957721815

#webComponents #w3c #whtwg #html

Declarative Custom Elements/HTML Modules/HTML-in-JS - February 2024 · Issue #79 · w3c/webcomponents-cg

At the WCCG's February Meeting (#77), we resolved to hold a breakout session specifically focusing on gathering use cases and proposals to present to implementors in the April Quarterly Face-to-fac...

GitHub
@calebhailey Call your senators, I mean browser implementors, and tell them you want to see: https://github.com/w3ctag/design-reviews/issues/334 #htmlModules built of the same syntax features as JSON and CSS modules, Import Attributes!
HTML Modules · Issue #334 · w3ctag/design-reviews

こんにちはTAG! I'm requesting a TAG review of: Name: HTML Modules Explainer doc, Code example For those interested in further details, this design doc has specifics on how we would propose to implement ...

GitHub

@westbrook @davatron5000 @stubbornella I suspect this might overlap with existing #HtmlModules work.

Also one more idea similar to 1.:

5. Could we use this format to do the initial render of a component? By which I mean that #Angular compiles components to #JavaScript which looks like:

```
function renderComponent() {
if (initialRender) {
createComponentDom();
} else {
updateExistingDom();
}
}
```

This always bugged me as inefficient, because the first branch is only ever executed once per component instance. If we compiled components to this SFC format, could we just do the first render at compile time, generate the HTML directly and drop that `createComponentDom` function?

I'm not knowledgeable enough to say that definitely makes sense, but I think it's an interesting idea at least.

Not sure if other frameworks could benefit from similar optimizations, I suspect #React would not, but I'm less clear on non-#VDom frameworks.