Re: [WICG/webcomponents] [templates] A declarative JavaScript templating API (Issue #1069)

svieira left a comment (WICG/webcomponents#1069)

There are a number of concerns that have been voiced here that I agree with (the lack of an extra layer of render indirection making it impossible to have a context API, the need to have sensible behavior for a surprising number of built-in objects or else a large amount of boilerplate for each of them, etc.) but I wanted to highlight another one that hasn't been mentioned.  

A very common composition pattern is the decorator:

```js
// In JSX but the same thing can be done in anything
function Foo(props) {
  const [myProps, theirProps] = extract(props);
  return <my-stuff my={myProps.explicit}><their-stuff {...theirProps} /></my-stuff>
}
```

How does this pattern work with this proposal?  I'm not seeing how to translate from the Perl-esque / K-like sigils of `?`, `@`, `.` (maybe we should add `!` for signal peeking and `~` for implicated `await`?) for an explicit prop passing to the implicit splat of a bunch of props that I don't own and I don't want to own.

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

Message ID: <WICG/webcomponents/issues/1069/3025113442@github.com>

Received on Tuesday, 1 July 2025 18:31:58 UTC