overReactReduxDevToolsMiddleware needs more informative warning when `toJson` not implemented
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 432
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
- Issue Type: FEATURE REQUEST
over_reactVersion(s):3.1.4
When using overReactReduxDevToolsMiddleware with DevToolsStore, if some part of the state, or one of the actions, is not encodable by toJson, the following generic warning is issued:
dart_sdk.js:101547 OverReactReduxDevToolsMiddleware [WARNING]: You must implement a toJson method in your state and actions in order to view state changes in the redux dev tools.
This can be very difficult to track down in a large state tree.
It would be better for the error message to point to the specific object that was not encodable. I have spent a lot of time trying to track it down in various parts of my state tree and actions, when I thought I had implemented toJson properly.
In fact, immediately before I call the constructor for DevToolsStore, I create my state object and call toJson() on it, and it works perfectly, yet I get that warning while the constructor is executing in the next step.
FYI: @greglittlefield-wf @aaronlademann-wf @kealjones-wk @evanweible-wf @maxwellpeterson-wf
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at overReactReduxDevToolsMiddleware and the DevToolsStore constructor path, then reproduce the warning with a state or action whose toJson is not implemented. Trace how the middleware encodes state and actions; done means the warning identifies the specific non-encodable object rather than only giving the generic message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100