-
Notifications
You must be signed in to change notification settings - Fork 1
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
Switches URL
polyfill to whatwg-url
#59
Conversation
…`ArrayBuffer` polyfills (#62) This PR fixes a bunch of issues with configuration and detection of polyfills required for an improved `URL` polyfill (#59): * adds tests that iterators are also iterable * updates browser configs where iterator behaviors differ with and without the `Symbol` polyfill * adds detection for Firefox <44 legacy iterators * adds detection for non-compliant `TextEncoder` * updates browser configs and detection for non-compliant `ArrayBuffer`
@romainmenke This is ready for review. |
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.
Some notes and questions, overal looks good!
The polyfill is indeed quite large, but I think that going for correctness is the right choice here.
9e25e15
to
f7149d0
Compare
@romainmenke I've changed the way |
This PR Is blocked by #64. |
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.
LGTM!
Thank you @mhassan1 for finding an alternative here 🙇
🤔 CI seems to be more flaky now in very old browser versions. Is there anything you can think of we can improve here? |
Flaky on |
For reference, here are the largest polyfills we have: 840K polyfills/Intl/DateTimeFormat/~timeZone/all/polyfill.js
532K polyfills/Intl/DateTimeFormat/~timeZone/golden/polyfill.js
344K polyfills/URL/polyfill.js
148K polyfills/Intl/Locale/polyfill.js
144K polyfills/String/prototype/normalize/polyfill.js So |
I think that maybe it is a really really slow parser. Probably a combination of using many other features (e.g. I am concerned that url parsing is something that can happen fairly often and frequently in some client side applications. If parsing a single URL can take anywhere between ±100ms and over 2 seconds then I am sure we will be breaking some things downstream. What options do we have here? |
I ran the I just ran that same test (all Windows 11
----------
Chrome 50: 1.40s
Chrome 49: 1.28s
Chrome 48: 1.84s
Chrome 47: 1.67s
Chrome 46: 1.73s
Chrome 45: 11.48s
Chrome 44: 11.54s
Chrome 43: 11.91s
Chrome 42: 11.96s
Chrome 41: 13.36s
Chrome 40: 16.67s
Windows XP
----------
Chrome 46: 1.23s
Chrome 45: 11.39s I've narrowed down the issue to Chrome 45 doesn't get the Options:
As a test of option 3, I replaced repeated |
Thank you for investigating further @mhassan1 🙇 At this time I think we might need to revert the changes to I think that the value of a working Do you see a path forwards that allows us to have both this polyfill for |
Upon closer inspection I am more convinced that we should revert this change. Only:
I think it is fine to have a |
This reverts commit c2a4d0b.
I've opened a PR to revert this change here: #72 But waiting to hear your thoughts and concerns first :) |
Just to clarify: the old The performance issue is caused by the frequent use of the Or, we could have two |
I've put up a PR for another proposal: remove the need for the |
This PR replaces the
URL
polyfill withwhatwg-url
. It usesbrowserify
to bundle and transpilewhatwg-url
.Resolves #53.