Picnic Technologies shares how they replaced Handlebars templating with a JavaScript/TypeScript framework running inside their Java backend via GraalVM. The Server-Driven UI approach lets them deploy UI changes instantly without app store releases. Key engineering decisions include: running JavaScript in-process within the JVM using GraalVM's polyglot capabilities, building a context ObjectPool to avoid expensive context creation per request, designing a promise-based interoperability API for async Java-JavaScript calls (including Calcite SQL queries), using TypeScript and JSX transpiled to vanilla JS for developer experience, and storing bundles in Amazon EFS for resilience against GitHub outages.

15m read timeFrom medium.com
Post cover image
Table of contents
Why Server-Driven UI is Our StrategyThe Status Quo: Handlebars’ LimitationsExploring Implementation OptionsAdopting GraalVM: Powering Polyglot ApplicationsPage Rendering Flow: An OverviewBridging JavaScript and JavaGet João Nogueira’s stories in your inboxDeployment: Ensuring Consistent JavaScript Execution with GraalVMA Note on Template MigrationThe End of a Journey, The Start of a New Era

Sort: