Re: [WICG/webcomponents] DOM parts use outside of <template> seems unlikely (Issue #1035)

For what it's worth, most of our SSR is actually done using Java, not JS. So we will likely have to tackle this problem as well. The  DOM part API is largely aimed to be flexible enough to handle all the dynamic ways existing frameworks operate on DOM nodes (ie Angular directives, signals, etc), so I can see how these features aren't as useful to a direct data -> html transform.

For action at a distance (which is a great idea!), we've messed around with an API like the following (consider the array to be interchangeable with a more structured object dsl).


const template = html(`<a href={{0}}></a>`);
const clone = template.clone(['/home']);
const partRoot = clone.getPartRoot();
partRoot.update(0, '/info');

This doesn't seem too different than what you are proposing.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1035#issuecomment-1808868585
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/1035/1808868585@github.com>

Received on Monday, 13 November 2023 19:19:43 UTC