Skip to content

Filtering #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dddomin3 opened this issue May 31, 2016 · 14 comments
Closed

Filtering #112

dddomin3 opened this issue May 31, 2016 · 14 comments

Comments

@dddomin3
Copy link

dddomin3 commented May 31, 2016

Vue(x) Dev Tools should have a ability to filter both state, and mutation names.
If possible, having the ability to categorize mutations with a string, enum, and/or a log level. Either through special dispatch attributes that are only considered/passed to dev middlewares, or whatever is a better implementation.

I feel as though the vuex dev tools quickly gets filled. When mutations involving many different interactions (API state, page state, component lifecycle state) all end up all in one flat list, it's hard to track an issue in a specific functionality.

@stealthybox
Copy link

Maybe we should PR Vuex to modify the Object-Style Dispatch to include a category parameter?

This is where we would start adding that to make it consumable by the devtools:
https://github.com/vuejs/vuex/blob/master/src/index.js#L84

@Namek
Copy link

Namek commented Aug 27, 2016

I would be happy to have a simple text input that would filter by action names (maybe some regex).

My case:
I've implemented a small in-app calendar where some mouse down/up/enter/leave events are triggered and based on those events some calendar days are selected to be further processed.

mouseenter is the worst event, because I have action dispatched for it so it messes action list in Vuex DevTools very quickly. Which obviously makes debugging a lot harder.

image

@stealthybox
Copy link

@Namek, as a temporary workaround, you can switch to the Object-Style Dispatch and use the silent flag for your MOUSE_ENTER mutations.

Hopefully, we can all pool together to get this implemented soon.

@posva
Copy link
Member

posva commented Feb 15, 2017

Hey @dddomin3, sorry for the delay.
About filtering mutations, it's now possible. If you organise your store using modules, you can easily filter mutations of one module.
About filtering the state. I'm not sure to understand that from a UX perspective. Can you explain the case when you see yourself filtering the state?

@dddomin3
Copy link
Author

dddomin3 commented Apr 3, 2017

Sure! Sorry for my late response. The mutation filtering improvements are great! Good job there 👍

As for state filtering:
Let's say I'm working on populating a certain piece of the state (like a user's detailed data). It'd be nice to be able to specify user.details.favoriteColor, and only display that in the store. Almost like _.get() from lodash:
https://lodash.com/docs/#get
Although, there may be a better way to UX that, that's just my imagining of it.

Honestly though, from my point of view, though, being able to filter mutations really captures the spirit of my request. I should be a lot more atomic with my suggestions!

@posva
Copy link
Member

posva commented Apr 5, 2017

yeah, or even better, writing user details favoritecolor

@michalsnik
Copy link
Member

Hey, I think we should close this issue already. Main request has been resolved wasn't it?
Would you please add a separate issue with just the last suggestion regarding updating state filtering (support for filtering nested structures) if it's still relevant @dddomin3 ?
It would be easier to talk clean about new improvements. Thanks!

@Akryum
Copy link
Member

Akryum commented Jan 4, 2018

State filtering is implemented in #418.

@akoidan
Copy link

akoidan commented Jul 22, 2018

@stealthybox

@Namek, as a temporary workaround, you can switch to the Object-Style Dispatch and use the silent flag for your MOUSE_ENTER mutations.

Could you please give an example how to use this "silent" flag?

I'm using

XmlHttpRequest.upload.addEventListener('progress', e => this.store.commit({
  type: 'setMessageProgress',
  silent: true, // you told about that flag or what? I didn't find anything at documentation nor in devtools sources
  uploaded: e
}));

In the end of the day vue devtools just hangs cause it can't handle thousand of messages from progress. Is there a way I just can remove them from displaying in it?
image

p.s. I don't wanna reduce amount of commit messages

@posva
Copy link
Member

posva commented Jul 22, 2018

Stop recording by clicking the red dot

@stealthybox
Copy link

@Deathangel908, I see the Vuex dispatch still has code for the silent prop.
I don't use Vue right now, so you'll need to look into how the DevTools are supposed to work with it yourself.

Here's the implementation: https://github.com/vuejs/vuex/blob/10be6af/src/index.js#L99-L135

@akoidan
Copy link

akoidan commented Jul 24, 2018

@posva but I do wanna record other actions

@maksnester
Copy link

Quite weird that when filter is used it filters out mutation section, and because of that I can't see the payload.

@michalsnik
Copy link
Member

Feel free to open new issue with your concern @alendorff :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants