Live data from Hacker News

An easier way of using polyfills

hacks.mozilla.org

21–30 of 80 posts

Re: An easier way of using polyfills

#22
post #16

[deleted]

People fought the terminology for a while, but were overwhelmed. The only purpose it seems to serve is to make a simple discussion about a simple concept completely confusing to people not 'in the know', and in addition the confusing word in question is nearly ungoogleable. Greek does make things sound more mathematical/formal, though, so there's that.

edit: it does seem to be googleable now, but I think the search engines are taking hints from wikipedia.

Re: An easier way of using polyfills

#23
post #4

While a neat idea in theory, I have some qualms about this. User agent detection sounds great, until you have a user that spoofs their agent. I often do so for various reasons, and from time to time I forget to turn it off after I've finished what I was doing. If this service becomes common, then I will be given broken webpages seemingly at random. The other option, a polyfill covering specific features and served to…

Polyfills won't break your page and random, worse case you get worse performance over native. However the point of a polyfill is to do exactly what the native method would have done if it existed

It will break your page if you aren't sent a polyfill when you should have been. Imagine running a browser without Object.observe, spoofing an agent of one that does have it, and you aren't sent it. Suddenly data-binding doesn't work at all.

Re: An easier way of using polyfills

#24

While a neat idea in theory, I have some qualms about this. User agent detection sounds great, until you have a user that spoofs their agent. I often do so for various reasons, and from time to time I forget to turn it off after I've finished what I was doing. If this service becomes common, then I will be given broken webpages seemingly at random. The other option, a polyfill covering specific features and served to…

It's not just about spoofing user agents. Take third party browsers for iOS for instance - they might be called Chrome or Opera but are really just UIWebViews. If they would add "Chrome" to their user agent string, this solution might break, serving incorrect polyfills. Today these browsers identify as "CriOS" and "OPiOS" to work around broken user agent detection. This can also be a problem with all web browsing happening in embedded webviews (feed readers, reddit apps, ...)

Re: An easier way of using polyfills

#25
Does anyone know why is Array.from not able to be supported on the most recent versions of Firefox? (That's the one feature where the polyfill works on older browsers but apparently does not work on newer ones.)

Re: An easier way of using polyfills

#26
Hm. Alternatively, they could serve the same js to everyone, and (assuming sites use the CDN) it would be cached across pages, so users would only pay for it once. Zero fanciness needed on the CDN.

How big is the "full" set of polyfills anyway? Probably small enough that a single download isn't an issue on even dialup?

--

That aside, polyfill ALL the things. Hopefully making it easier makes it common, which lets devs use a nicer version of Javascript.

Re: An easier way of using polyfills

#27
post #5

While a neat idea in theory, I have some qualms about this. User agent detection sounds great, until you have a user that spoofs their agent. I often do so for various reasons, and from time to time I forget to turn it off after I've finished what I was doing. If this service becomes common, then I will be given broken webpages seemingly at random. The other option, a polyfill covering specific features and served to…

Users that spoof their user agent are likely to either be tech-savvy people who either know what they are doing or who are hiding who they are, like a bot. I'm more worried about supporting older users on old machines who barely know the difference between Internet Explorer and the internet than in supporting someone who knows exactly what a UA is and how to spoof it.

Take a look at what Microsoft is doing with their newest mobile IE browser - http://blogs.msdn.com/b/ie/archive/2014/07/31/the-mobile-web...

Basically they're crafting the UA to appear like Chrome or Firefox.

Re: An easier way of using polyfills

#28
post #16

[deleted]

People fought the terminology for a while, but were overwhelmed. The only purpose it seems to serve is to make a simple discussion about a simple concept completely confusing to people not 'in the know', and in addition the confusing word in question is nearly ungoogleable. Greek does make things sound more mathematical/formal, though, so there's that. edit: it does seem to be googleable now, but I think the search e…

Yes, whenever I hear polyfill I think computer graphics. Then I decided to read up on it and discovered that it's such a simple concept that's been employed forever. I just continue to shake my head at the kids coming up with jargon to make old things new again. I wish the computer field were less like the fashion world.

Re: An easier way of using polyfills

#29
post #19
post #16

[deleted]

I don't see what's stupid about that. Are you suggesting that anytime we want to talk about polyfills, we should instead write the following? #include "config.h" // ... #if !HAVE_FOOBAR void foobar(...) // missing: implement ourselves { } #endif Because that's nuts. This usage is actually more useful than the one that's a contraction of "polygon filling."

Well, there's "shim"....

Re: An easier way of using polyfills

#30
Something is very wrong with how web developers think about threat models if they're so incredibly willing to load completely arbitrary code into their customer's applications from a source that isn't even remotely party to the vendor/customer relationship.
Post reply on HN