409 karma · joined October 10, 2019
If your interest is one language (Java or Kotlin) full-stack for a single-page app, you will be interested in my Flavour book: https://frequal.com/Flavour/book.html
I've written a book about it here: https://frequal.com/Flavour/book.html
https://habr-com.translate.goog/ru/articles/757182/?_x_tr_sl...
and the original article:
https://habr.com/ru/articles/757182/
This is from the author of TeaVM, who has 10 years of experience getting Java and JVM code to run efficiently in the browser. https://teavm.org/
TeaVM's existing transpilation of Java to JavaScript performs well (using the browsers JS GC). It will be interesting to see if WASM GC matures to the point where it is even faster.
Comparison to Blazor:
* https://frequal.com/java/TeaVmVsBlazorWasm1-0.html
* https://frequal.com/java/TeaVmVsBlazorChart.html
Flavour podcast: https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-2...
Java Magazine article: https://blogs.oracle.com/content/published/api/v1.1/assets/C...
Real, fast-loading apps made with Flavour:
* Wordii, a 5-letter word game: https://frequal.com/wordii
* Tea Sampler: Demo app with code samples of coding with Flavour: https://frequal.com/tea-sampler/
No bloated download. No upgrade treadmill. Just short podacsts with no install.
Castini-hosted podcasts include:
* Castini Show: https://castini.frequal.com/cast/show/Castini%20Show/2394171...
* Flavourcast: https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-2...
Flavour is a fast, batteries-included, type-safe framework for making modern SPA web apps in Java (and other JVM languages).
* Great Lighthouse scores? Check!
* Real SPAs without sluggish network round trips? Check!
* Modern path-based routing? Check!
* Components (built-in and user-defined)? Check!
* Effortless service calls? Check!
* Refactor frontend and backend simultaneously using your current IDE? Check!
If this sounds interesting, check out these other resources:
* Article in Java Magazine: https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
* 100% Flavour 5-letter word game: https://frequal.com/wordii
* Flavour podcast (created with Castini, a Flavour app): https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-2...
TeaVM apps score quite well on Lighthouse. Previous iterations of CheerpJ had challenges in startup time and download size. Results here: https://renato.athaydes.com/posts/comparing-jvm-alternatives...
For a concrete test, try launching this full TeaVM/Flavour 5-letter word game, it downloads in <2s even on mobile. https://frequal.com/wordii/
TeaVM has become even smaller and faster since that article was published. The test suites are here in case someone wants to conduct a rematch: https://github.com/renatoathaydes/jvm-alternatives-to-js
A Java option for modern web apps exists, and it's called Flavour: https://flavour.sourceforge.io/
* Build SPAs in Java with HTML templates and components
* Fast build times and batteries-included build framework
* Easy calls to Java web services, just invoke a method and Flavour handles marshalling and unmarshalling, you just see/use Java objects.
* Full-stack refactoring
* Built on TeaVM, so you get the all the benefits of a mature, performant framework with support for threads and multiple JVM languages (bytecode-based transpilation).
TeaVM vs Blazor comparison chart: https://frequal.com/java/TeaVmVsBlazorChart.html
TeaVM longer comparison with Blazor: https://frequal.com/java/TeaVmVsBlazorWasm1-0.html
Java Magazine article on Flavour and TeaVM: https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
A good collection of specific, detailed how-to's for various use cases is in Tea Sampler here:
https://frequal.com/tea-sampler/
A more general collection of education and advocacy articles are here:
I do agree that more needs to be written about this mature, permissively-licensed tool that makes Java work in modern browsers. Hopefully these links are a start.
It has a permissive Apache license and numerous success stories:
https://frequal.com/TeaVM/TeaVmBasedSites.html
There is also a full SPA toolkit called Flavour Plus for making pure Java, web-native, full-stack web apps:
TeaVM transpiles Java to JavaScript. I used it to convert a Java interactive fiction project to run natively in the browser:
https://frequal.com/java/RestoringA19YearOldGameWithTeaVm.ht...
More background on TeaVM:
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
However, true "Java Geeks" should try the JavaScript support in TeaVM. It is mature and battle-tested. The resulting code runs great in a browser.
Live TeaVM-based game: https://frequal.com/wordii
Getting started with TeaVM: https://frequal.com/TeaVM/
Performance Comparison: https://frequal.com/java/TeaVmPerformance.html
It is easy to get started by using the maven archtetype, there's an tutorial in Java Magazine here:
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
With TeamVM and Flavour you get a full front-end SPA framework that lets you code business logic in Java, and pair that with HTML and CSS to make components.
To see what it can do, check out Wordii, a fast-paced 5-letter word game: * Wordii: https://frequal.com/wordii * Making Wordii using TeaVM and Flavour: https://frequal.com/java/MakingWordiiAPureJavaSpa.html
https://frequal.com/java/TeaVmVsBlazorWasm1-0.html
Comparison Chart: https://frequal.com/java/TeaVmVsBlazorChart.html
TeaVM is coming up on 10 years, so it has proven its longevity.
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
For example, try this 5-letter word game:
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
* Super fast builds
* Complete Maven builds, no JS build nightmares
* Minifying, obfuscating
* Full, fast, HTML/CSS-based component framework.
* Works with any JVM language, not just Java
See a TeaVM-based game, Wordii: https://frequal.com/wordii/
It lets you code in Java, compile to a native SPA, and gain all the benefits you'd expect from a single, strongly-typed language top to bottom (refactoring, POJO reuse on the front end, etc.).
There is a full intro article in Java Magazine:
https://blogs.oracle.com/javamagazine/post/java-in-the-brows...
TeaVM converts Java code to run in the browser. It provides the ability to call JS functions to access browser features like canvas and XHR. However, unless you want to be coding like Vanilla JS, you'll want a framework on top. SnapKit provides that.
The discipline and effort required to build the proper framework-level abstractions to be portable to future UI toolkits is extremely impressive.
And unlike some other projects, most of the demos are non-trivial, substantial apps. Even Swing doesn't have demos like these.
Congrats, Jeff!