-
Notifications
You must be signed in to change notification settings - Fork 793
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
RFC: option to disable polyfills #4087
Comments
Thanks for the issue. Could you help me understand a bit how the polyfill affects your code? I took a quick look through the code and saw that the Node file defines an |
The field is present on instantiation, but not on the prototype. The polyfill checks the prototype, which im unclear is correct or incorrect behavior. MDN says that the field should exist on Node. The spec doesnt seem to suggest that prototype specially is guaranteed to have the field https://dom.spec.whatwg.org/#node, or that it’s even statically available. Seems like some impla do use prototypical inheritance, but im not clear if its required (appears not). My gut says the polyfill detection may be too presumptive. Tldr, happy-dom doesnt set the field on the prototype, that seems OK, but axe then mutates a getter on happy-dom and breaks happy-dom |
Typing from Phone, sorry for the brevity or terseness |
Thanks for looking deeper, @cdaringe! We agree with your assessment that the incompatibility is with We agree that the spec doesn't technically demand a prototypal property here; however, it does demand that the property be read-only, which in practice leads it to be present on For fixing this specific incompatibility, we think it would be preferable to update As far as an option to disable polyfills entirely: we're going to decline this feature suggestion (and so I'm going to close this issue). axe-core's polyfills are already surrounded with guards that no-op them in all supported environments that don't require them. A "no polyfills" option would only be applicable to environments that we explicitly do not support. That said, we are interested in eventually updating |
No problem, thanks for writing back with a thorough response. I think it’s a fair take. |
Product
axe-core
Feature Description
Problem
Polyfills are currently forced.
In my env, I do not want polyfills, because the break compatibility with my environment (see capricorn86/happy-dom#978). I ended up doing my own polyfill to deactivate axe's polyfill, but it's worth consideration.
Discussion
It would be great to add a flag to bypass the polyfill logic and allow me to get me my environment runtime into top shap!
The text was updated successfully, but these errors were encountered: