New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Piwik.js] Refacto selectors #8640
Comments
For piwik.js we need to try to support as much browsers as possible, as those browsers wouldn't be tracked correctly otherwise. So imho we should also support IE < 8. |
With |
Yup I understand why you need to support these browsers, but you can use a modern code, then a polyfill for olders one, isn't it ? @tsteur :
It's faster and consistant accross browsers. It You can find some issues with it cf but if you know them it's not a problem anymore. I think a polyfill is a good solution. |
I know, we're just going this way to keep testing etc simple. By using one code path for all it's easier for us to test etc. Eg our query code would only run on old browsers and we would most likely not notice if it is not working correctly etc. It might be possible to do if we had automated testing on older browsers but this is not the case currently |
Is there currently a problem eg re performance etc? As mentioned, ideally it would be the case like you said but currently not really doable for us. |
I don't think it's a problem with performance, piwik has to perform as well as it can. Dude Piwik parse the DOM (with a lot of lol 😖) ! It has to work on mobile device etc. AMHA If you can use a modern and fast API you have to. |
Hi,
I think you can remove a lot of code from here by using
document.querySelectorAll
ordocument.querySelectorAll
(Compat table). If you read one of the link from the find method:So with it you won't need
makeNodesUnique
, and you can usefindMultiple
without doing a lot of queries.PS: I think you need to support IE8 but without its support we can remove the code from
findFirstNodeHavingAttribute
tooThe text was updated successfully, but these errors were encountered: