Add a requestAnimationFrame polyfill#904
Merged
Merged
Conversation
|
|
||
| var lib = module.exports = {}; | ||
|
|
||
| require('./request_animation_frame'); |
Contributor
There was a problem hiding this comment.
Since raf is already pretty well supported (ref http://caniuse.com/#feat=requestanimationframe), I'd vote for not including the polyfill in the plotly.js bundle by default.
I would move the request_animation_frame.js to dist/extras and add a line in the dist/ README.md generated here.
79576a3 to
d87a468
Compare
d87a468 to
57611e9
Compare
| '', | ||
| '```html', | ||
| '<script>if(typeof window.Int16Array !== \'function\')document.write("<scri"+"pt src=\'extras/typedarray.min.js\'></scr"+"ipt>");</script>', | ||
| '<script>document.write("<scri"+"pt src=\'extras/request_animation_frame.js\'></scr"+"ipt>");</script>', |
Contributor
Author
There was a problem hiding this comment.
@etpinard Are two document.write script tag insertions in series valid?
Contributor
Author
There was a problem hiding this comment.
I guess I can't imagine any reason why it wouldn't be. Just not a pattern I ever really use.
Contributor
|
Thanks for cleaning this up 💃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a proper RAF polyfill based on this discussion and the resulting repo. I debated whether to make this
Lib.requestAnimationFrameandLib.cancelAnimationFrameor not. The only downside of this approach is that it would fix libraries usingrequestAnimationFramewithout a polyfill.As part of this, remove the logic from:
plotly.js/src/components/rangeslider/create_slider.js
Lines 225 to 233 in f07a274