prodo-dev / prodo

Prodo is a React framework to build apps faster.
https://docs.prodo.dev
MIT License
114 stars 5 forks source link

Expose some universe vars to devtools #170

Closed andrejak closed 5 years ago

andrejak commented 5 years ago

Shows exposed plugin states (for example route and local) in devtools state panel. At least partially closes https://github.com/prodo-ai/prodo/issues/118.

(in the below screenshot, the app has no internal state, just route) Screenshot 2019-10-08 at 17 06 15

With empty app state, we could instead show this (ignore color change): Screenshot 2019-10-08 at 17 07 12

tdawes commented 5 years ago

Plugins might need to define for themselves how their state should be rendered - e.g. for the firestore plugin, I wouldn't really want to see the db_cache (but perhaps would be fine if it was just called db)

andrejak commented 5 years ago

At the moment, the firestore plugin can customize it only to the extent of choosing which variables to expose (eg. call exposeUniverseVariables(["db", "db_cache"]) will expose both, whereas exposeUniverseVariables(["db"]) would keep db_cache hidden). (Neither has actually been added yet, I only added route and local so far) Did you have in mind a custom rendering function that would filter data to a more granular level, or change how it's displayed?

andrejak commented 5 years ago

@coffee-cup this should be ready for re-review :)

coffee-cup commented 5 years ago

Some minor suggestions

State          (editable)
{
}

Plugin State
{
}
andrejak commented 5 years ago

Do these look allright to you?

  1. Only app state, no plugin state Screenshot 2019-10-10 at 12 04 30

  2. Both app state and plugin state Screenshot 2019-10-10 at 12 08 26

  3. No app state (but plugin state) Screenshot 2019-10-10 at 12 09 55

coffee-cup commented 5 years ago

I like them!