report-toolkit icon indicating copy to clipboard operation
report-toolkit copied to clipboard

sorting output should be done in the CLI

Open boneskull opened this issue 6 years ago • 2 comments

Currently, sorting is done in the core API (toReportFromObject), which doesn't make a lot of sense:

  1. sorting must concatenate the stream to an array, which means there's a bottleneck
  2. internally, sorting does not matter
  3. sorting the output only has any bearing on the order of messages output by the inspector
  4. thus, sorting should be done JIT, which would be JUST BEFORE the formatter gets the data
  5. and this should happen in the CLI

boneskull avatar Jul 15 '19 18:07 boneskull

also, IMO sorting is out-of-scope for non-CLI usage

boneskull avatar Jul 17 '19 23:07 boneskull

to do this, you'd need to pull any sort-related anything out of the inspect fn in core/src/observable.js and make it part of the stream in cli/src/commands/inspect.js. there's a sort() in common/src/observable.js helper fn that may help. if it's not used, remove it.

boneskull avatar Feb 05 '20 00:02 boneskull