Workiva / Workiva/over_react

overReactReduxDevToolsMiddleware needs more informative warning when `toJson` not implemented

Open
#422 0 comments 0 reactions 0 assignees View on GitHub

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_react Version(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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.