Re: [whatwg/dom] Suggestion: new method - getNodesByType (#992)

@WebReflection Yes, I still see boilerplate.  And your example still requires a working knowledge of TreeWalker's internal API when your use case demonstrates use of `NodeFilter.SHOW_TEXT`.

I did a global search of GitHub for `createTreeWalker` and found only 26 JavaScript results and only 145 TypeScript results.  There were nearly 5000 results for an unrelated Java API of the same name indicating that nobody is using this.  Either TreeWalker is not well known or the API is too burdensome for most developers.  When I did a search for `querySelector` I found just under 9 million JavaScript results and almost 25 million JavaScript results for `getElementById`.

There is a substantial value to using a single method that requires a single argument and absolutely no boilerplate.

-- 
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/992#issuecomment-866868709

Received on Wednesday, 23 June 2021 14:09:07 UTC