Re: [WICG/webcomponents] [DOM Parts] Add new declarative syntax and update iterative proposal (PR #1023)

@hax commented on this pull request.



>  
 ```js
-const [firstName, lastName] = AttributePart.create(element, "title", null, [
-  null,
-  " ",
-  null,
-]);
-// Syntax to be improved. Here, a new AttributePart is created between each string.
+const part = AttributePart(document.getPartRoot(), element, "href");
+part.value = ["mailto: ", email];

I suppose the behavior should align with `String.raw`, so what's the logic difference between `#commitWithStatics` and `String.raw`? It seems the only difference is how to treat `null/undefined` in `this.value`. `String.raw` will treat them as `"null"` and `"undefined"`, but `#commitWithStatics` will use empty strings.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/pull/1023#discussion_r2062918141
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/pull/1023/review/2798027424@github.com>

Received on Monday, 28 April 2025 05:38:49 UTC