-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Remove rAF fork #12980
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
Remove rAF fork #12980
Conversation
ReactDOM: size: -0.1%, gzip: -0.1% Details of bundled changes.Comparing: 1594409...e10ad4c react-dom
react-art
react-scheduler
Generated by 🚫 dangerJS |
) { | ||
warning( | ||
false, | ||
'schedule depends on requestAnimationFrame. Make sure that you load a ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"schedule depends on requestAnimationFrame" doesn't make it obvious "schedule" is a name so it reads a bit odd. Maybe we can reword the whole message to not mention the library name? e.g.
This browser doesn't support requestAnimationFrame. Make sure [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely - thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK but see the nit
(Will also need a Jest test fix) |
Thanks for the review! |
**what is the change?:** Undid facebook#12837 **why make this change?:** We originally forked rAF because we needed to pull in a particular version of rAF internally at Facebook, to avoid grabbing the default polyfilled version. The longer term solution, until we can get rid of the global polyfill behavior, is to initialize 'schedule' before the polyfilling happens. Now that we have landed and synced facebook#12900 successfully, we can initialize 'schedule' before the polyfill runs. So we can remove the rAF fork. Here is how it will work: 1. Land this PR on Github. 2. Flarnie will quickly run a sync getting this change into www. 3. We delete the internal forked version of 'requestAnimationFrameForReact'. 4. We require 'schedule' in the polyfill file itself, before the polyfilling happens. **test plan:** Flarnie will manually try the above steps locally and verify that things work. **issue:** Internal task T29442940
I've manually tested this and it seems ok - going to try and land and quickly sync early tomorrow morning. |
Found a potential issue internally, will debug that before landing this on Github. See internal task T29442940 |
I think this changed causes a runtime error in the jsdom environment which doesn't occur in the latest release (16.4.1). I discovered this while testing the DevTools profiler on sites shared by open source users. One of those sites uses jsdom as part of the production build process. |
@bvaughn If you remember which site it was, message me a link? |
Why does it only affect the Facebook build? Changes in the Specifically, I think the issue might be that we warn when |
Thanks for the quick fix! I see that we always should guard when accessing a possibly not defined global API. I know we wanted to avoid using
The |
what is the change?:
Undid #12837
why make this change?:
We originally forked rAF because we needed to pull in a particular
version of rAF internally at Facebook, to avoid grabbing the default
polyfilled version.
The longer term solution, until we can get rid of the global polyfill
behavior, is to initialize 'schedule' before the polyfilling happens.
Now that we have landed and synced
#12900 successfully, we can
initialize 'schedule' before the polyfill runs.
So we can remove the rAF fork. Here is how it will work:
'requestAnimationFrameForReact'.
polyfilling happens.
test plan:
Flarnie will manually try the above steps locally and verify that things
work.
issue:
Internal task T29442940