Skip to content
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

Feature request: Show a diff between parsers #73

Open
hzoo opened this issue Dec 9, 2015 · 12 comments
Open

Feature request: Show a diff between parsers #73

hzoo opened this issue Dec 9, 2015 · 12 comments

Comments

@hzoo
Copy link
Collaborator

hzoo commented Dec 9, 2015

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). 😄

@RReverser
Copy link
Collaborator

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/

@fkling
Copy link
Owner

fkling commented Dec 9, 2015

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.

@hzoo
Copy link
Collaborator Author

hzoo commented Dec 9, 2015

😁 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?

@RReverser
Copy link
Collaborator

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)

@hzoo
Copy link
Collaborator Author

hzoo commented Dec 9, 2015

Might help to find those discrepancies in ESTree so we can make some PRs (if we didn't already know about them)

@RReverser
Copy link
Collaborator

@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.

@fkling
Copy link
Owner

fkling commented Dec 9, 2015

@RReverser: diffs between ASTs in general.

@RReverser
Copy link
Collaborator

@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.

@fkling
Copy link
Owner

fkling commented Dec 9, 2015

@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 ;)

@RReverser
Copy link
Collaborator

@fkling window.open #justsaying :P

@swyxio
Copy link

swyxio commented Jun 26, 2018

I was going to make diff for before/after transform,

@RReverser did you ever make this?

@RReverser
Copy link
Collaborator

Nope.

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

No branches or pull requests

4 participants