fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.21k stars 739 forks source link

Add something in the UI to allow configuring settings #135

Open DrewML opened 8 years ago

DrewML commented 8 years ago

Frequently when I'm writing a codemod or ESLint rule on the site, I have some objects logged out to the console (with some expanded). Every time I forget this and make a change to the codemod, the data I'm looking at gets blown away.

It would be nice if this was an option that could be disabled in the UI. I'd be happy to do the work if you're open to it.

Having said that, I'd imagine we would need to determine a place in the UI where it was appropriate to show options that aren't specific to the parser. Thoughts?

fkling commented 8 years ago

Having said that, I'd imagine we would need to determine a place in the UI where it was appropriate to show options that aren't specific to the parser. Thoughts?

Yeah, I think that's the biggest issue actually :D Don't really have a good idea yet. Maybe a gear button in the top right of the transformer which opens a settings dialog.

In the meantime, I believe if you select "preserve log" in Chrome, it should not clear the console.

DrewML commented 8 years ago

smh

Can't believe I didn't realize that - I had been making console.clear a no-op manually when loading the page. THANK YOU

DrewML commented 8 years ago

Repurposing the issue to just account for adding a pattern in the UI where non-parser-related settings can be added moving forward.

Examples:

hzoo commented 8 years ago

In 6.16 for Babel, https://babeljs.io/blog/2016/09/28/6.16.0#new-feature you can pass down both parser options and generator options. I made the changes and tested them for recast/astexplorer in mind so would be good to have as an option.