Re: [whatwg/dom] Add NodeList.setAttributes (#895)

> Is this the kind of evidence you are looking for? If you have questions, I can try to find more specific evidence.

@michaschwab thanks for the terrific examples of how this might be used, and might be helpful. I do see the need here, and it does seem like a very common pattern on the web and in common libraries. The comments from @developit back this up. I guess I'm left with these questions:

 1. How much faster might a native "bulk" API be, as compared to the current practice of one-at-a-time? This would likely require some prototyping to measure. There would clearly be **some** benefit, as the round-trips through the JS bindings layer would be eliminated. But these are already highly optimized, so it's unclear how much time would be saved.
 2. Is this a single API that supports:
    * multiple elements?
    * properties?
    * attributes?
 3. Or are there separate APIs for all of the above?
 4. Is there some sort of ordering of assignments that is preserved?
... and most importantly ...
  5. How is this different than, or perhaps, could this be implemented using, [the "Template Instantiation" proposal](https://github.com/rniwa/webcomponents/blob/add-dom-parts-proposal/proposals/DOM-Parts.md)?

For <span>#</span>5, it seems like that would depend on how the APIs are typically used. If it is for just a single assignment, e.g. after creating a bunch of elements, then Template Instantiation likely wouldn't help. This is perhaps part of your jquery example. But for your D3.js example, that definitely seems right in the wheelhouse of Template Instantiation.

@yuzhe-han @josepharhar

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/895#issuecomment-718349973

Received on Thursday, 29 October 2020 04:21:32 UTC