dillon1000/react
Commit
Browse files DevTools: Restore inspect-element bridge optimizations (#20789)
* Restore inspect-element bridge optimizations When the new Suspense cache was integrated (so that startTransition could be used) I removed a couple of optimizations between the backend and frontend that reduced bridge traffic when e.g. dehydrated paths were inspected for elements that had not rendered since previously inspected. This commit re-adds those optimizations as well as an additional test with a bug fix that I noticed while reading the backend code. There are two remaining TODO items as of this commit: - Make inspected element edits and deletes also use transition API - Don't over-eagerly refresh the cache in our ping-for-updates handler I will addres both in subsequent commits. * Poll for update only refreshes cache when there's an update * Added inline comment
Changed paths13 files
First-parent comparisonpackages/react-devtools-shared/src/__tests__/inspectedElement-test.js ModifiedM packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js ModifiedM packages/react-devtools-shared/src/backend/agent.js ModifiedM packages/react-devtools-shared/src/backend/legacy/renderer.js ModifiedM packages/react-devtools-shared/src/backend/renderer.js ModifiedM packages/react-devtools-shared/src/backend/types.js ModifiedM packages/react-devtools-shared/src/backendAPI.js ModifiedM packages/react-devtools-shared/src/bridge.js ModifiedM packages/react-devtools-shared/src/devtools/views/Components/InspectedElement.js ModifiedM packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js ModifiedM packages/react-devtools-shared/src/devtools/views/Components/types.js ModifiedM packages/react-devtools-shared/src/inspectedElementCache.js ModifiedA packages/react-devtools-shared/src/inspectedElementMutableSource.js AddedPatch
Files changed
Rendering syntax-highlighted changes…