Apicurio / apicurio-data-models

A library (Java and JavaScript compatible) to implement data models for OpenAPI and AsyncAPI.
https://www.apicur.io/datamodels/
Apache License 2.0
54 stars 37 forks source link

Live transpiling #243

Open turutosiya opened 3 years ago

turutosiya commented 3 years ago

Hi.

I'm implementing custom validation rules.

It takes time to run :

$ mvn clean package -Ptranspilation

Is there any option to transpile lively along with editing original .java files?

EricWittmann commented 3 years ago

We don't have a live transpilation option at the moment, because our typical development workflow is to do everything in Java (using a standard Java toolchain/IDE) first. This lets us write code and test that code using JUnit as the iterative development process. Once we're happy with the code, then we can make sure it also works when transpiled using the maven build.

So typically we write code in e.g. Eclipse or Intellij. And we run the tests using JUnit, also typically in the IDE. This allows debugging and fast iterations. Then verify transpilation at the end.

EricWittmann commented 3 years ago

That said, I'm not opposed to a live transpilation feature of some kind. So if you wanted to contribute something like that, that sounds very cool. :)

turutosiya commented 3 years ago

Thanks! I understood.

I realized that jsweet-maven-plugin is ready for Hot Transpilation :

$ mvn jsweet:watch

https://github.com/lgrignon/jsweet-maven-plugin#hot-transpilation

I'll try this.

EricWittmann commented 3 years ago

Awesome - if you can configure something that works well for you, I would love to add it to the documentation/readme.