chore: add missing command payloads to reactotron-core-contract #1582
+437
−114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please verify the following:
yarn build-and-test:local
passesREADME.md
(or relevant documentation) has been updated with your changesDescribe your PR
Summary
This PR improves type safety across the Reactotron codebase by replacing
any
types in theCommandMap
interface with specific, well-defined TypeScript interfaces. All payload types are now consolidated inreactotron-core-contract
for consistency and reusability.Changes Made
1. New Type Definitions in
reactotron-core-contract
Created dedicated type definition files for command payloads:
apiResponse.ts
-ApiResponsePayload
for HTTP request/response dataasyncStorage.ts
-AsyncStorageMutationPayload
for storage mutationsbenchmark.ts
-BenchmarkReportPayload
for performance benchmarksclientIntro.ts
-ClientIntroPayload
for client connection infodisplay.ts
-DisplayPayload
for custom display eventsimage.ts
-ImagePayload
for image data with metadatasagaTaskComplete.ts
-SagaTaskCompletePayload
andSagaTaskCompleteChild
for Redux-saga taskscustomCommand.ts
-CustomCommandRegisterPayload
andCustomCommandUnregisterPayload
repl.ts
-ReplLsResponsePayload
andReplExecuteResponsePayload
2. Updated
CommandMap
InterfaceReplaced all
any
types with specific payload types:3. Updated
reactotron-core-client
reactotron-core-contract
DisplayConfig
to extendDisplayPayload
name
andid
fields where needed4. Updated
reactotron-core-ui
Removed duplicate type definitions in UI command components and imported types from
reactotron-core-contract
:ApiResponseCommand
AsyncStorageMutationCommand
BenchmarkReportCommand
ClientIntroCommand
DisplayCommand
ImageCommand
SagaTaskCompleteCommand
5. Documentation
Updated
reactotron-core-contract/README.md
with:CommandType
and payload typesNotes
any
where appropriate (e.g., saga middleware dynamic data, storage values, eval results)