Skip to content
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

Pick up RDT extension bundle changes and further shrink bundle size by minifying #3

Conversation

markerikson
Copy link

This PR:

  • Removes a stray window.allReactComponentDisplayNames.set() line left over from the React Component Display Names backend PR (which needs to be rewritten and thus this branch should not have any references to it yet)
  • Stops building RDT extension bundles we don't care about for Replay
  • Partially reverts the changes from [DevTools] use backend manager to support multiple backends in extension facebook/react#26615 . We don't have an extension UI, and we're not trying to give users a way to select which backend version to load. Right now there's only one backend version, and we need to initialize it immediately upon injection. So, we directly create an agent and bridge again inside of setup() when the backend is injected
  • Restores minifying the RDT extension bundles. I had turned this off early on in development work back in December so that I could hand-edit the RDT extension bundles, and left it there for readability. Since we have a goal of loading less JS to improve evaluation perf, this is a huge improvement
  • Also turns off a couple more RDT features we don't use now (RN style editing and profiling hooks)

Note that I previously picked up the the major RDT extension building changes in facebook#26615 and facebook#26563 by merging main into feature/replay-react-devtools.

Overall, we went from:

  • Prior feature/replay-react-devtools branch: installHooks.js 380K, react_devtools_backend.js 430K
  • With merge: installHooks.js 20K, react_devtools_backend.js 450K
  • This full PR, with minification + stripping out features: installHooks.js 5K, react_devtools_backend.js 128K

Thus going from ~810K JS being evaluated, to ~133K.

Here's what the react_devtools_backend.js bundle looks like afterwards, contents-wise:

image

@markerikson markerikson merged commit 8a075b8 into feature/replay-react-devtools Apr 26, 2023
@markerikson markerikson deleted the feature/FE-1401-rdt-injecthook-changes branch April 26, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant