I'm actually struggling with the latter. I maintain a polyfill library which itself needs a Promise polyfill for max compatibility (a project goal). I want it to be included if people grab my lib "off the shelf", but allow opt out. Is there a way for that? https://github.com/lgarron/clipboard-polyfill/issues/79 …
-
-
I honestly don't know. I feel like this is something that gets lost in the toolchain shuffle.
@mikeal?1 reply 0 retweets 3 likes -
Hrm... Best to just let them polyfill Promise.
1 reply 0 retweets 4 likes -
Not for the client. I see *so* many copies of Bluebird served to Chrome and it's a serious downer.
2 replies 0 retweets 1 like -
By "them" I mean the end user. Most browser have it natively, if you specifically want to support older ones the user can add the polyfill themselves. We *dont* want 8 copied in deps.
1 reply 0 retweets 2 likes -
So you'd recommend that even for a library that itself polyfills a Promise-based API for browsers as far back as IE9?
1 reply 0 retweets 0 likes -
I feel uncomfortable saying "bring your own Promise polyfill for maximum compatibility" because I *myself* don't even know how to do it for modern JS projects.
2 replies 0 retweets 0 likes -
I think it's not as common as you might assume to support browsers this old. Yes, many big sites with many users care, but most developers who put stuff up aren't making things work this far back.
1 reply 0 retweets 2 likes -
... until something breaks when they get enough users? It feels like the users who will benefit the most from "batteries included" are the ones who won't know how to include the batteries (or that/when they should).
2 replies 0 retweets 0 likes -
Also, there are more users with newer broswers but slower connections than older browsers and great connections. We too easily discount the cost of the bundle size chasing compatibility with older browsers.
1 reply 2 retweets 15 likes
Too true.
-
-
Yeah, I'm very sympathetic to code size. If I only publish the version of the lib without a polyfill, is there a good reference page I can link from the README on how to polyfill Promise in various common types of projects?
1 reply 0 retweets 0 likes -
If they are using a bundler it will do it for them. If they are just using a script include I'd show them an include for modernizer or something.
1 reply 0 retweets 0 likes - 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.