Skip to content
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

Suggestion: a polyfill free version? #43

Closed
thenano opened this issue Dec 19, 2021 · 5 comments
Closed

Suggestion: a polyfill free version? #43

thenano opened this issue Dec 19, 2021 · 5 comments

Comments

@thenano
Copy link

thenano commented Dec 19, 2021

Hi @garronej,

First of all I'd like to thank you for all the work you've put into this. I've been using this library from the start and it's pretty much the thing that made migration to MUI v5 possible for me. The amount of work and love you've put into this is inspiring, so thank you very much!

I had previously opened an issue here with regards to an error I was having with the fromEntries polyfill included in this lib (specifically on ie11). Long story short the polyfill included here requires Symbol.Iterator, which does come with recommended ie11 polyfills for react apps. Our project doesn't use those, we instead use the polyfill.io service which allows us to reduce bundle size and also move polyfill dependencies elsewhere. For reference, we ended up including the Object.fromEntries polyfill from there which doesn't have other polyfill dependencies (https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Object/fromEntries/polyfill.js).

Recently with further upgrades we've also had to include Array.find and Proxy, the latter one being slightly harder as it's not really included in any of the major polyfill providers, so it requires that specific package which you linked. Proxy, specifically, is a problem not just in ie11, but in several older browsers, which we started to see errors for in our logs. I know it's all in your README and adding the required polyfills is not particularly hard, but specifically in our case since we run automatic dependency upgrading in our pipelines we tend to see these issues come up in production, even if it only impacts a small percentage of users.

So my suggestion would be if there is a possibility of having a version that doesn't require any of these polyfills. I haven't looked into the code to see what Proxy or Array.find is doing, and if there are other ways to do the same thing, so please excuse my request if it doesn't make any sense. I just thought I'd put the suggestion out there since, for example, even though MUI v5 itself doesn't support ie11 and older browsers, it does actually work on them bar some stying issues or other very specific problems.

Again, please ignore if this doesn't make any sense, and thank you for the great work.

Fernando

@garronej
Copy link
Owner

garronej commented Dec 19, 2021

Hi @thenano,
Thank you very much for you appreciation. It means a lot to me!
I was expecting this PR. It makes perfect sense. While I can do without Array.prototype.find, I think I really need Proxy to implement the new nested selector API. I will investigate if there is a way to do without.

@thenano
Copy link
Author

thenano commented Dec 19, 2021

@garronej thank you very much for your quick reply! let me know if there's anything I can do to help.

@garronej
Copy link
Owner

I just published a new version that:

  • Do not use Array.prototype.find polyfill.
  • Do not crash if Proxy is not available, only the nested selector API wont work.

Later, if I find a way to do w/o Proxy I will implement it.

What do you think?

@thenano
Copy link
Author

thenano commented Dec 19, 2021

That is absolutely perfect, thank you so much! We don't use the nested selector api anyways so this is perfect for us.
Thanks again, I can't believe how quickly you sorted this out!

@thenano thenano closed this as completed Dec 19, 2021
@garronej
Copy link
Owner

Glad it do it for you!
My secret is I use ts-ci 🤫

gitbook-com bot pushed a commit that referenced this issue Feb 4, 2022
gitbook-com bot pushed a commit that referenced this issue Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants