pinia icon indicating copy to clipboard operation
pinia copied to clipboard

Pinia Devtools Wishlist

Open posva opened this issue 3 years ago • 23 comments

I think it would be nice to gather feedback about how to improve the existing devtools or reporting bugs.

If you find something that you think can be improved, a screenshot is usually enough to help describe the improvement. I want to use this issue to track those improvements.

  • [x] Display all getters in the Inspector View (🍍 Pinia (root))
  • [x] Allow calling $reset() directly from the devtools (Using actions + adding this in formatStoreForInspectorState(). This should only appear in the inspector view, next to the state property.
  • [x] Add a settings panel (https://devtools.vuejs.org/plugin/plugins-guide.html#plugin-settings)
    • [ ] Use emojis in messages (defaults to true)
    • [x] Disable "x store installed" message https://github.com/vuejs/pinia/discussions/1070
    • [x] ~~Show stores in components (defaults to true)~~ This can be set already in plugin settings
  • [ ] Time travelling
    • [ ] Changing the current state from the timeline (should not add new events)
    • [ ] Use a patch-driven approach like in Vue Devtools for perf reasons
  • [ ] Clear ans concise information about single mutations
  • [x] Allow prod devtools (with less information because events might not be there)
  • [ ] Clicking on a store in pinia devtools should make it available as a global variable
  • [ ] Add component originator of an action

Please do not use the issue to report bugs, use the Discussions for help or open an issue with a boiled down reproduction for bugs.

posva avatar Oct 20 '21 13:10 posva

Editing some state (e.g. the percent) using Pinia (root) leads to an error: image

And it would also be nice if the root overview shows getters etc instead of only the store's state

j4k0xb avatar Oct 26 '21 19:10 j4k0xb

It would be great if we could reset the state of an entire store using a button, i.e. having an action that calls store.$reset()

https://pinia.esm.dev/core-concepts/state.html#resetting-the-state

DannyFeliz avatar Oct 26 '21 22:10 DannyFeliz

I fixed the error when changing from the root store. Having all the getters would be nice!

@DannyFeliz That should be doable with https://devtools.vuejs.org/plugin/api-reference.html#on-inspectcomponent

posva avatar Oct 27 '21 08:10 posva

Would time travelling be possible?

JoseLuisRNP avatar Nov 21 '21 13:11 JoseLuisRNP

I found that mutation info about array/object modifying isn't complete. Given: Method that simply pushes new value to array in the store. image Mutation info: image As you can see, there are no information about what store field was modified.

Djaler avatar Dec 12 '21 12:12 Djaler

The information should be in effect or target but there are plans to improve the display of mutations in the timeline too

posva avatar Dec 12 '21 13:12 posva

I'm having a somewhat weird bug. If I do initiate a store from my Vue3 application's main.ts file, Pinia instance does not get bound to devtools. Therefore cannot inspect the store whatsoever.

const app = createApp(App);
app.use(createPinia());
app.mount("#app");

if (user) {
  const rootStore = useRootStore();
  rootStore.setUser(user);
}

This is what I'm doing basically.

PS: Store gets initialized without a problem. Can observe the state of rootStore.

Devtools version: 6.0.0.20 Vue version: 3.2.16 Pinia version: 2.0.4

izerozlu avatar Dec 12 '21 21:12 izerozlu

The information should be in effect or target but there are plans to improve the display of mutations in the timeline too

What do you think about such idea: save previous store state using deep clone, so on state change we can compare it with previous

Djaler avatar Dec 13 '21 14:12 Djaler

Is there a way to track the actions on chrome Vue dev tools when using Pinia with Vue3?

KohliSuraj avatar Feb 16 '22 15:02 KohliSuraj

The yellow color used for some of the text and the mutation markers is much too difficult to see in the (Chrome) light theme. Something with more contrast is needed.

plweil avatar Mar 05 '22 01:03 plweil

I seem to be encountering a devtool related issue with Pinia. I defined a new store using the composition API method (not the object store format) and when directly modifying a returned ref's value it is not reflected in the devtools but the mutation does happen and works. If I use the variable somewhere in the template, for example using {{ the_variable }}, then the devtools do update the value. Manually clicking the refresh button also does the trick. Anything I'm missing or doing wrong, or is this a limitation of the devtools together with Pinia?

Ragura avatar Apr 13 '22 12:04 Ragura

@Ragura that is an expected behavior of the devtools: it won't update something if it's not used. It's okay to use the refresh button for stuff like that 🙂

posva avatar Apr 13 '22 13:04 posva

When using the Vue Devtools in production mode with the provided flag VUE_PROD_DEVTOOLS the pinia plugin is not showing up. Even though other plugins (i18n or router) are. Is this a known issue with pinia?

Caruki avatar Jun 03 '22 10:06 Caruki

Would be great to show the actual state property being modified eg here we know the store is pokedex but i'd like to know the state property that "set" is targeting.

Screenshot 2022-08-31 at 00 22 11

EmmanuelQ avatar Aug 30 '22 21:08 EmmanuelQ

maybe main branch my cognitive dissonans saying me

drrible avatar Oct 16 '22 18:10 drrible

i hope action event can custom props, i want add some props, like event from file and code lineNumber

baixiaoyu2997 avatar Nov 18 '22 11:11 baixiaoyu2997

Any news on when Time travelling will be available in the dev tools?

JackEdwardLyons avatar Nov 21 '22 23:11 JackEdwardLyons

One major feature imo is implementing NuxtServerInit like Vuex. Auto importing defineStore and acceptHMRUpdate by default in nuxt 3 for minimal config (just adding pinia to modules) would be great for a lazy person like me.

MuhammadM1998 avatar Dec 11 '22 21:12 MuhammadM1998

What problem does this feature solve?

The idea is to use a Pinia store that is selected in Pinia devtools the same way that you can use a selected Vue component, see below screenshots:

With Vue components one can select a component and immediately manipulate it in console using $vm: image

A similar approach would go a long way to enable Pinia usage when a pinia store is selected: image on above shot, $p will refer to the selected Pinia store and is a shortcut of finding a component that is using the store, selecting it, then use it as $vm.filtersStore that is if the developer exposed the store.

I normally use this to reset the store, manipulate other props or functions of the store manually to test things. If this works just like Vue components, this will be super duper great.

As you can see from my console "autocomplete" I have to find a component that uses the store in Vue first, click on it so I have access to $vm then access the store thru $vm.blahStore that is IF i had exposed it in that component.

emahuni avatar Dec 13 '22 13:12 emahuni

Is "Disable "x store installed" message" resolved?

nikolay-yavorovskiy avatar Feb 16 '23 20:02 nikolay-yavorovskiy

When using the Vue Devtools in production mode with the provided flag VUE_PROD_DEVTOOLS the pinia plugin is not showing up. Even though other plugins (i18n or router) are. Is this a known issue with pinia?

Does anyone know how to fix this?

cobaltt7 avatar Apr 11 '23 00:04 cobaltt7

Is there any intention of integrating the pinia dev tools into the nuxt dev tools panel, or is that out of the scope of this conversation?

Clive-Ward-Cron avatar Jun 01 '23 17:06 Clive-Ward-Cron

+1 Any update, would love that. I was able to use it with Vuex, but want to stay away from that.

chadwtaylor avatar Oct 20 '23 12:10 chadwtaylor