-
Notifications
You must be signed in to change notification settings - Fork 138
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
Update react-devtools-inline, react, and react-dom dependencies #6075
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/recordreplay/devtools/5y335EN3q5zb8rvRGJDcWgJTawgN |
@bvaughn makes sense. Here are the docs on updating the re backward compatibility: agreed. If the frontend knows the version we should be able to load it. There are some funny hoops to jump through because the |
FYI: we're already fetching the ReactDevTools protocol version by sending the |
@hbenl and I tested and verified that the changes in this PR and replayio/gecko-dev#796 are compatible. The remaining trouble is that– if we were to land these PRs, old Replays would "break" due to the React DevTools protocol version. I'm going to see if I can't figure out a workaround to make the newer DevTools frontend support the older pre-recorded profiles. |
I think the short term path forward here is to embed both versions of the This is kind of hacky but it unblocks us to update React DevTools. I'm going to push this as-is so @hbenl can maybe verify that it works with the newer protocol version. (I can confirm that it works with an older protocol version.) I still need to clean things up (e.g. TypeScript types, inline comments, etc) but I'll do that a bit later. Need to pack and head to the airport shortly. |
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.
This works for me with recordings made with both the old and the new backend. The only issue is that the ReactDevTools UI is not updated when jumping to a different point in time.
Okay. I think things should work more now like they used to, except for the async module-loading hop. Sorry for not catching the jumping-between-points issue during my smoke testing. I assumed that if DevTools loaded once it would work as usual from there on out– because of my mental model of how it runs in the browser under normal conditions. |
As I start to understand the way Replay and React DevTools work together here, I realize that there's a small logic bug in the mount-only effect that might "break" things if we try to get the protocol version from a point too early in the Replay session. Going to make one more small change to account for this. |
…otocol version is known
Update React DevTools backend from 4.17.0 to 4.24.3 Relates to frontend PR replayio/devtools#6075 This commit updates the React DevTools (Firefox) `react_devtools_backend.js`: * From: version 4.17.0 (created on 08/24/2021 from revision b9964684bd8c909fc3d88f1cd47aa1f45ea7ba32) * To: version 4.24.3 (created on 03/29/2022 from revision adb8ebc927ea091ba5ffba6a9f30dbe62eaee0c5) This commit also updates `hook.js` by doing the following: * Opened `packages/react-devtools-shared/src/hook.js` in the React repo. * Stripped the Flow annotations from the file (using the Babel REPL for convenience.) * Manually added the `__DEV__`, `__EXTENSION__`, and `__TEST__` constants at the top of the file. * Manually deleted the import statement at the top of the file. * Manually re-add the `exports.installHook = installHook;` statement at the end of the file.
Resolves #5344 and #4578; relates to replayio/gecko-dev#796
This
react-devtools-inline
update introduces a newer bridge protocol version than what is currently being embedded in the backend. That means older Replay sessions containing React data won't work with it.I think the best short-term solution for this is for the devtools/client to check the protocol version embedded in the Replay, and load the
react-devtools-inline
version that supports it. This is a little hacky but it takes the pressure off of our ability to upgrade React DevTools without breaking backwards compat.Checklist
react-devtools-inline
to latest (4.24.3).react-devtools-inline
as well: Update React DevTools backend from 4.17.0 to 4.24.3 gecko-dev#796