-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Extend compat metadata for URL and URLSearchParams polyfills #853
Extend compat metadata for URL and URLSearchParams polyfills #853
Conversation
Certain versions of edge and safari support URL, URLSearchParams and URL.prototype.toJSON. However the compat data doesn't seem to note that, thus leading for unnecessary polyfilling. The updated data has been taken from MDN and caniuse: - https://developer.mozilla.org/en-US/docs/Web/API/URL#Browser_compatibility - https://caniuse.com/#feat=url - https://caniuse.com/#feat=mdn-api_url_tojson - https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#Browser_compatibility - https://caniuse.com/#feat=urlsearchparams
@slowcheetah Do you mind reviewing this? |
}, | ||
'web.url-search-params': { | ||
chrome: '67', | ||
firefox: '57', | ||
chrome: '61', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this version of Chrome does not support the full feature set of url search params. I can't remember what is missing but the test suite does cover it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhm, according to https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#Browser_compatibility it should support it. .sort
was added in that version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However bumping it up to 67 again would be fine for me.
See also #656 (comment) . Only in Safari (WebKit 2.28.4) "new URL('https://x', undefined)" throws an error, so polyfill for it is kind of OK. But I do not see what fails with |
The change above is about "new URL" and "new URLSearchParams". In Safari
All of the above state, than in Safari 14.1 the problem will disappear. The defect for I send my code to terser and I use The motivation for the change can be expressed in different ways. One of the ways is: Skipping not needed polifills in core-js for "URLSearchParams" leads to smaller JavaScipt files, that user download from internet. Smaller files means less electricity is necessary for the transmission and less electricity implies less pollution. By releasing a new version of core-js, which does not send polifills for If there are difficulties to tackle the change as a whole, please split it in smaller pieces and make progress with whatever is clear. |
Add to the compat data new results of those tests? Maybe, because all this year I was in prison and for this time were changed some generations of browsers. But... I don't see anything that could be added. Modern versions of Edge get data from the
You use it in this way, someone in another - and bugs from the feature detection could affect them if they will not get this polyfill. Sure, the detection of used features in injection plugins could be smarter, I have some ideas about it - but anyway it's very hard work and definitely will be improved not soon. If you are completely sure that this module is not required in your case - you could add it to the blacklist of the plugin - and it will not be injected.
Because of the big words like this, I have no ideas about how to charge my iPhone. |
Can the tests for |
Nope. They are too tied under the hood by the spec. |
* Submission lib uses URLSearchParams and at some point Babel started to polyfill it. The compat data core-js-compat can't give the root cause for the Safari 14 requirement[^1]. Since other compat data like MDN shows it only needs Safari 11[^2], exclude it from the bundle. [^1]: zloirock/core-js#853 (comment) [^2]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#browser_compatibility
Certain versions of edge and safari support URL, URLSearchParams and
URL.prototype.toJSON. However the compat data doesn't seem to note that,
thus leading for unnecessary polyfilling.
The updated data has been taken from MDN and caniuse: