konsoletyper / teavm-flavour-examples-todomvc

18 stars 1 forks source link

How to launch this example? #1

Open Namek opened 6 years ago

Namek commented 6 years ago

Hi! What should I use to build and launch it? Pure maven from a console? IntelliJ? Eclipse?

How should it be configured? Java version, working directory...

Can I debug it? (build as for Desktop, not JavaScript)

konsoletyper commented 6 years ago

What should I use to build and launch it? Pure maven from a console? IntelliJ? Eclipse?

The simplest way to build this example is to run mvn install from console. You can also install TeaVM IDEA plugin and import this project into IDEA. See TeaVM IDEA tutorial for details.

How should it be configured? Java version, working directory...

Java version should be 8. Newer versions of TeaVM support 9 and 10, but they aren't published on Maven Central. I can update pom.xml to use TeaVM 0.6.0 from bintray, if you want. There's no need to build from a particular working directory.

Can I debug it? (build as for Desktop, not JavaScript)

You can't build it as "desktop application", since TeaVM converts JVM bytecode to JavaScript, which runs in the browser, not on the desktop. You should use either JavaScript source maps or TeaVM IDEA plugin to debug the generated JavaScript code as if it was Java or Kotlin code. This example is already configured for debugging in the browser, so you can just open browser devtools and navigate through Kotlin and Java code, set breakpoints, etc. To learn how to use Chrome devtools, you can read documentation. To learn how to debug from IDEA, please, read TeaVM documentation.

LuigiAlice commented 4 years ago

Hi, I have updated the example:

1.3.72 0.2.1 0.6.1

But I can't post a todo because JSON.serialize() crashes. No serializer was found: JsonSerializer serializer = getObjectSerializer(object);