Re: [WICG/webcomponents] [templates] Ensure that template instantiation actually improves the platform (#704)

@bahrus 

`querySelectorAll` is a good example of how the designers of that API looked at a useful practical ergonomic userland API and butchered its implementation in the browser. 

jQuery: 

- a single API that returns an array of elements, or an empty array of no elements are found

Browsers:

- two separate APIs. One to retrieve a single element. One to retrieve multiple. Both throw exceptions

- querySelectorAll doesn't return an array. It returns a NodeList that didn't even have a convenience method like `forEach` for two or three years after querySelectorAll was introduced. And you still need to call Array.from on it to have access to anything useful like map or reduce. 


I wonder why it didn't make a dent in jQuery. Perhaps because it objectively *sucks* and you still need to write otherwise useless wrappers to make it practical?

What is it with browser implementors that they look at powerful, practical userland abstractions and go: nah, we're going to implement none of that. 

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

Message ID: <WICG/webcomponents/issues/704/1196333835@github.com>

Received on Wednesday, 27 July 2022 06:54:28 UTC