Open monperrus opened 4 years ago
In fact, the JavaFX tool does not require Java: it uses latest Java bundling tools to slice a JVM and produce an executable app that does not require a JVM installed.
Anyway, a web version would be great.
to overcome this, we could have a web-based UI: you paste Java code in a text area and you navigate in the spoon model in the browser.
What would be the usecase for such UI except the "wow" effect (which would be quite nice for talking about Spoon)?
If the usecase is indeed only pasting a piece of Java code and getting the representation, I guess we could have a very simple web API in which we could send code and receive a serialized representation of the model to manipulate in Javascript.
But would that be enough? For example, if the usecase is more to be able to get a visual representation of a Java Github repository, then the API will be quite different.
What would be the usecase for such UI
Having at least the same features than the JavaFX app, but without downloading binaries. Be able to log information (what do guys parse, log potential crashes)
Yes, the "wow" effect, for minimizing the bar to enter in the Spoon world, and to recruit new users.
See astexplorer. It might be worth trying to integrate spoon to this project.
nice!
As far as I understand, all of the parsers in astexplorer are written in Javascript (even Scala parser uses Scala.js to transpile its code to Javascript) and published in npm as dependencies.
Even though it's possible to create a small js library, which gets the JSON-serialized ast from Spoon for a given code snippet, honestly I don't think that the maintainers would really like the idea of installing java and spoon jar on their server in addition to that library.
But in any case, we can start with adding JSON-serialized ast.
For the record, the code for having a JSON AST is not in this repo but in https://github.com/SpoonLabs/gumtree-spoon-ast-diff/
See #1526
See astexplorer. It might be worth trying to integrate spoon to this project.
For the record, the code for having a JSON AST is not in this repo but in https://github.com/SpoonLabs/gumtree-spoon-ast-diff/
See #1526
I have a prototype here https://github.com/quentinLeDilavrec/astexplorer using a slightly modified version of gumtree https://github.com/quentinLeDilavrec/gumtree-spoon-ast-diff.
And it also does more than just showing the spoon ast. It also shows evolutions mined by gumtree alongside a diff editor (I've added an "Evolve" tab in addition to the original parse and transform tabs ).
I have a prototype here https://github.com/quentinLeDilavrec/astexplorer
Nice! Could you deploy it somewhere such that we can play with it?
today, we have two visualizations of a Spoon model with Swing and JavaFX.
the limitation is that it requires potential users to have Java and Spoon installed.
to overcome this, we could have a web-based UI: you paste Java code in a text area and you navigate in the spoon model in the browser.
requirements: