409 karma · joined October 10, 2019
However, when I'm writing, I find I sometimes need to do research. I suppose for the best writing flow I should block time for research and time for pure writing. However, if I discover I need to look something up, a hard block on internet access would be a problem. Of course it's a slippery slope from researching something on Wikipedia to navigating to related articles. Timed access per hour?
Flavour book: https://frequal.com/Flavour/book.html
Flavour home page: https://flavour.sourceforge.io/
Example app: https://frequal.com/wordii
While templates are a big part of Flavour, it also includes routing, components, and idiomatic invocation of Java services.
The book on Flavour is here: https://frequal.com/Flavour/book.html
Example 5-letter word game single-page app made with 100% Java, 100% Flavour: https://frequal.com/wordii/
It is built on the Flavour framework:
* Routing enhancements for Dates (contributed by linuxfun) * The archetype has been updated with support for routing and deep linking. (The old archetype is now archetype-minimal, still useful for projects that don't need routing.)
For more information on Flavour:
* Flavour Book: https://frequal.com/Flavour/book.html * Flavour Home Page: https://flavour.sf.net/
* Ticket #11 is resolved: Spaces are allowed in path parameters
* Ticket #3 is resolved: Fixed vague error message for missing setter in html:bidir-value
* Fixed archetype to hide static message after startup
For more information on Flavour:
* Flavour Book: https://frequal.com/Flavour/book.html
* Flavour Home Page: https://flavour.sf.net/
It's local-first so you control this sensitive information. It features easy reuse and exercise tracking.
https://frequal.com/Flavour/book.html#org44d6b49
Your single-page app code calls your backend API using strong types. Your code is clean and the framework handles marshaling and unmarshalling JSON.
For example, try Wordii, a 5-letter word game here: https://frequal.com/wordii/
If you look in the network tab, you can see it is loaded as a small HTML page, a classes.js file, and a few CSS files. All of those are served as simple static resources.
More information on how Wordii was created: https://frequal.com/java/MakingWordiiAPureJavaSpa.html
How much trouble was it to get working? Not sure how doppio handles the absence of raw TCP connections and a standard filesystem in the browser, but if it works in doppio I would think it could work in TeaVM too.
I don't see such fears around ECMAScript/WASM. Since the dominant players have a vested interest in users feeling safe leaving those technologies turned on for all websites, they'll keep investing to maintain that safety (and the marketing of that safety).
This is a massive insurance policy for building a TeaVM app -- the foundational web technologies it builds on are receiving incredible investments from industry heavyweights. It's not just security that is maintained, new Web APIs are regularly developed too. Want to use USB from your web app? No need to wait for Oracle to roll out a Java API for it -- browser vendors have made a new API and you can call it from you TeaVM app right away.
Furthermore, since the browser vendors never want browser code to have public security issues, they work hard to find and fix problems in their sandboxes and runtimes. This of course benefits TeaVM apps as well, since they play in those same sandboxes, and gives them a level playing field with other web apps in perpetuity.
Plugin-based applets were only safe as long as Sun had clout and the browser vendors were investing less in security than the Java team.
By contrast, TeaVM is Apache-licensed, available for commercial use without any gotchas, limits, or entanglements.
Several use cases where TeaVM shines:
* A developer or team has strong Java skills and wants to develop single-page apps
* A Java desktop project wants to move to the web and has lots of validation logic they don't want to double-maintain in Java and ECMAScript/WASM
* A Java-based game developer wants to make a Canvas-based version of their game for the web (potentially full-screen)
* A Java developer wants a batteries-included framework for web development. TeaVM comes with a minifier, tree-shaker, packager, and more, out of the box, with familiar 'mvn clean install' semantics (And Gradle support too).
For more details on use cases and reasons for picking TeaVM, read chapter 1 of my book here: https://frequal.com/Flavour/book.html
I made a general guide for migrating from Swing to TeaVM here: https://frequal.com/TeaVM/migration/MigratingFromSwingToTeaV...
For a more specific example, I ported an open-source Java applet and described the process here: https://frequal.com/java/RestoringA19YearOldGameWithTeaVm.ht...
TeaVM ( https://teavm.org/ ) is an Apache-licensed project, free for use in commercial projects. It is mature and used widely, including in frameworks like Flavour ( https://frequal.com/Flavour/book.html ) and more projects listed here: https://www.frequal.com/TeaVM/TeaVmBasedSites.html
TeaVM compiles Java code to run in the browser, efficiently and quickly. It features short build times, small downloadable files, and a batteries-included toolset (including minification, tree-shaking, and packaging). Previous releases have conquered all similar open-source tools (that support threading) in independent testing: https://renato.athaydes.com/posts/comparing-jvm-alternatives...
It lets you write your frontend and backend code in the same language, even sharing models and validation logic so refactorings work full stack.
You get strong typing and a rich SPA framework that includes routing, templates, and easy server calls.
There's a book ( https://frequal.com/Flavour/book.html ) and a Java SwingSet-like app with live demos and source code called Tea Sampler ( https://frequal.com/tea-sampler/ ).
One tool I've been using to speed up maven is mvnd, the maven daemon. It's a drop in replacement for mvn with impressive speedups.
Flavour book: https://frequal.com/Flavour/book.html
https://frequal.com/Flavour/book.html
It describes how to make single-page apps in Java, using the Flavour framework. No plugins, no extensions, and 99.9% pure Java. Plenty of sample code and links to relevant podcast episodes and demos.