dillon1000/react
Commit
Browse files refactor[Agent/Store]: Store to send messages only after Agent is initialized (#30945)
Both for browser extension, and for React Native (as part of `react-devtools-core`) `Store` is initialized before the Backend (and `Agent` as a part of it): https://github.com/facebook/react/blob/bac33d1f82d9094b45d6f662dd7fa895abab8bce/packages/react-devtools-extensions/src/main/index.js#L111-L113 Any messages that we send from `Store`'s constructor are ignored, because there is nothing on the other end yet. With these changes, `Agent` will send `backendInitialized` message to `Store`, after which `getBackendVersion` and other events will be sent. Note that `isBackendStorageAPISupported` and `isSynchronousXHRSupported` are still sent from `Agent`'s constructor, because we don't explicitly ask for it from `Store`, but these are used. This the pre-requisite for fetching settings and unsupported renderers reliably from the Frontend.
Changed paths3 files
First-parent comparisonpackages/react-devtools-shared/src/backend/agent.js ModifiedM packages/react-devtools-shared/src/bridge.js ModifiedM packages/react-devtools-shared/src/devtools/store.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…