-
Notifications
You must be signed in to change notification settings - Fork 46
Drop unneeded polyfill & Firefox prefix. #11
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
Conversation
I spent a bit of time thinking about wether or not to polyfill, eventually deciding I should, because people including a raf plugin would expect the polyfill. I suppose I could be convinced otherwise? |
IMO these are two completely separate things, making effects in jQuery depend on rAF and actually polyfilling it (and then not using the polyfilled version)... I didn't expect to find a polyfill here. But I might not be a typical user of the plugin. :) I'd go for a note in README about this not being a rAF polyfill and maybe redirecting to the one by popularized by Paul Irish. If you decide to keep the polyfill, I can refactor this patch - with only one vendor prefix left the previous iterating over array is not needed. |
BTW, your README doesn't say anything about polyfilling rAF, only about making jQuery use it. |
If you wanted to update this without the polyfill (even safer now) I'd land it |
Rebased. I removed the webkit prefix now, too, though. If you look at http://caniuse.com/#feat=requestanimationframe you'll see the webkit prefix is only needed in old Chrome (irrelevant), Safari 6 & iOS 6.1. Those are old browsers, too, and they're rAF implementation has some bugs so it's even better to skip those implementations. That's also why jQuery 3.0.0 will use rAF only if available unprefixed (albeit with further fixes, i.e. using the Page Visibility API to restore paused animations when switching tabs). You could also add a warning to README that this plugin should not be used with jQuery >= 3 as they use rAF by default and maybe you could even skip the whole logic and print a warning when such a jQuery is loaded? |
BTW, I can't get it to build... It uses the ancient Grunt 3, maybe it doesn't work in newer Node+npm setups?
|
I skipped the qunit task and it built. I've tested it manually later in Chrome. |
Think you might be able to update the ancientness and add some notes to the
|
I can't promise I'll have time for that within the next few days but I can
try to find some. :)
|
In the meantime this should be good to land, though, if it looks good to On Wed, Feb 3, 2016 at 5:18 PM, Michał Gołębiowski m.goleb@gmail.com
Michał Gołębiowski |
Drop unneeded polyfill & Firefox prefix.
...and of course I forgot to remove the comment about the polyfill that's no longer there. :) |
gave you push so feel free to fix on master ;) On Wed, Feb 3, 2016 at 11:30 AM, Michał Gołębiowski <
|
I submitted a PR with the refactoring & lib updates (including an update to Grunt 0.4.5), PTAL: #16. |
Firefox prefix hasn't been needed since v23 (we're on 26 now, in 2 days on 27; the last ESR is 24, ESR 17 is no longer supported)
The polyfill for rAF wasn't used at all in the plugin and was contributing significantly to the file size. Similarly,
cancelAnimationFrame
was feature-detected but then not needed at all. I removed the polyfill & other unneeded parts, shaving off 158 bytes of 428 gzipped.