astexplorer
astexplorer copied to clipboard
Feature request: Show a diff between parsers
Not sure how we would show this or if we could make it look good but it would be useful (for me at least) to compare the AST tree between different parsers (in particular babel/esprima for babel-eslint). :smile:
I was going to make diff for before/after transform, but between parsers? Dunno, looks like too specialized and rare task IMO... Also, you can use other online tools when needed for this http://tlrobinson.net/projects/javascript-fun/jsondiff/
I know of at least one other person who wants this ;) I guess computing the diff shouldn't be too difficult, but I'm wondering what a good visualization would look like. Worst case: patch-style JSON diff I guess.
:grin: there's gota be a few people!
Need to decide what to show for
- removed/added properties
- changed properties
and maybe a filter for things that are the same?
I know of at least one other person who wants this ;)
Wants diff between different parsers? But in most cases they return very different ASTs (except of ESTree-based, which are minority although have some discrepancies)
Might help to find those discrepancies in ESTree so we can make some PRs (if we didn't already know about them)
@hzoo Those discrepancies are intentional - either internal properties required for parser work (babylon 5, acorn, espree) or complete forks of ESTree (babylon 6), so PRs won't be accepted.
@RReverser: diffs between ASTs in general.
@fkling I don't really see where it would fit into UI of this tool (if it's generic comparison and not pre-transform vs post-transform, which I do agree is useful), but maybe I'm just missing something.
@RReverser: Yeah, I think pre-/post-transform would make sense. But I also agree that is becoming more difficult to extend the UI. Maybe we have to introduce tabs or something ;)
@fkling window.open
#justsaying :P
I was going to make diff for before/after transform,
@RReverser did you ever make this?
Nope.