redux-devtools-extension icon indicating copy to clipboard operation
redux-devtools-extension copied to clipboard

It would be really nice if the tree view browser did alphabetical stable sorting and showed entries in an orderly fashion

Open leidegre opened this issue 8 years ago • 10 comments

We have lots of UUIDs and props in our store finding things is sometimes really painful, for this a search function would be wonderful, however, simply using a stable sort order to display things would be really helpful.

Using Immutable.js and while switching to OrderedMap would probably work I think showing the keys in the store as sorted, regardless, is a really nice improvement.

leidegre avatar Oct 12 '17 07:10 leidegre

this would be very much appreciated 😎

odiseo42 avatar Nov 14 '17 23:11 odiseo42

+1

hugotox avatar Jan 06 '18 22:01 hugotox

This would be life-changing for me

feifanzhou avatar Feb 10 '18 21:02 feifanzhou

Yes, this would be amazing especially with complex apps

justinhp avatar Feb 27 '18 15:02 justinhp

This would be a nice option.

1Jesper1 avatar Jul 11 '18 11:07 1Jesper1

Any updates on whether this feature is coming up?

ayansome1 avatar Sep 11 '18 12:09 ayansome1

react-json-tree has sortObjectKeys parameter implemented. If someone can implement it in redux-devtools-inspector that would be a great contribution.

zalmoxisus avatar Nov 16 '18 18:11 zalmoxisus

Coming up on the 1 year anniversary of this issue, and was wondering what the blocker is. Is it just that we need to implement a small PR that calls sortObjectKeys? Or is it something deeper and more tricky/annoying?


Edit:

I can see some comments by @zalmoxisus on https://github.com/alexkuz/redux-devtools-inspector/pull/80#issuecomment-449487903 that sound sort of relevant?

https://github.com/zalmoxisus/redux-devtools-extension/issues/635#issuecomment-459054148 seems to say it's on the roadmap for a 3.0 release

0xdevalias avatar Oct 24 '19 05:10 0xdevalias

We use this until v3 is out.

This implementation only sorts the reducers in development environment and does not require to change any of the actual business code and is easy to remove once v3 is out:

import { combineReducers as combineReducersRedux } from 'redux';

// sorting of reducer keys can be removed once react-dev-tools v3 is released
const combineReducers = process.env.NODE_ENV !== 'development'
  ? combineReducersRedux
  : reducers => combineReducersRedux(Object.keys(reducers)
    .sort()
    .reduce((a, c) => {
      a[c] = reducers[c]; // eslint-disable-line
      return a;
    }, {}));

RobertHeim avatar Apr 22 '20 20:04 RobertHeim

+1 for this feature, vue-devtools does it automatically for vuex. It is badly needed when the state is large.

hamhamhammy avatar Aug 28 '20 17:08 hamhamhammy