Skip to content

About

Server-side Inertia.js adapter for the Java ecosystem

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

inertia-java

Server-side Inertia.js adapter for the Java ecosystem, built the way inertia-laravel is: controllers return page objects, the protocol carries them over plain HTTP, and the client-side router renders — no API layer, no embedded server. The library is a plain, registerable bean that manipulates only the HTTP exchange and the HTML root page, with Thymeleaf playing the role of Laravel's Blade.

Works on Spring Boot 3.x and 4.x, Quarkus, and any Jakarta EE 9+ servlet container (plain Tomcat/Jetty included) — including GraalVM-native-ready Boot 4 with Jackson 3, the case that breaks other Java adapters.

Modules

Artifact Purpose
inertia-core The Inertia protocol engine. Zero dependencies (Java 8+).
inertia-web Framework-neutral web glue (no servlet dependency): Thymeleaf + Vite renderers, version/hot providers, bundled root template — Java 8+.
inertia-servlet Jakarta Servlet glue: protocol filter, request adapter, writers (delegates to inertia-web).
inertia-servlet-javax The legacy twin for pre-Jakarta containers (Tomcat 9 / Java EE 8 era): same glue on javax.servlet, Java 8 — tests are the parity pin.
inertia-spring-boot Spring Boot integration (3.x and 4.x).
inertia-spring-boot2 The legacy Boot 2 twin (2.7 line, javax + Java 8): same auto-configuration via META-INF/spring.factories, same properties.
inertia-quarkus Quarkus integration (Undertow + RESTEasy + CDI).
inertia-demo Runnable demo: three canonical Vite front-ends (Vue 3, React 19, Svelte 5) served by three back-ends (Boot 3/4, Boot 2.7 legacy, Quarkus).
<dependency>
    <groupId>io.github.wesleybritovlk.inertia</groupId>
    <artifactId>inertia-spring-boot</artifactId>
    <version>1.0.0</version>
</dependency>

(Quarkus: inertia-quarkus · raw servlet/Jakarta EE: inertia-servlet.)

Documentation

Doc Topic
Getting started — concepts the protocol, the modules, the root template, the front-end boilerplate (any stack), dev vs build mode
Getting started (Spring Boot) zero-to-package: pom, controller, front-end, dev loop, validation
Getting started (Quarkus) the same path on Quarkus (@Inject Inertia, quarkus:dev)
Getting started (pure servlet) WAR on any Jakarta EE 9+ container
The web layer the inertia-web module: bundled root.html, head-fragment override, renderers, versions — Java 8
Native compilation GraalVM native-image: ownership, the reflective serializer bridge, build recipes, lab evidence
Publishing the central profile, dry-run bundle validation, your one-time secrets (token + GPG key), the release-day command
The servlet glue the inertia-servlet transport glue, class by class
Development workflow npm run dev + the back-end (HMR, Fast Refresh, hot flag)
Pages and props every prop builder: lazy, deferred, merged, once, scroll
Partial reloads the X-Inertia-Partial-* protocol
Redirects and versioning 303/409 rules, asset-version guard
Flash and validation session flash, error bags
Shared props request-scoped shared props
Serialization Jackson 2/3 hybrid chain + the PageSerializer SPI
Configuration every inertia.* property and bean override
Quarkus adapter CDI wiring, config mapping, overrides
Other frameworks the core ports without any servlet layer
Differences from inertia-laravel every behavior that is not a 1:1 port

A runnable proof of the whole flow lives in inertia-demo/.

Building from source

git config core.hooksPath .githooks   # one-time: enables the pre-commit gates
mvn test                              # the full suite (209 tests)
mvn install                           # installs all modules locally
mvn verify -Pboot4                    # the whole reactor on Spring Boot 4 (Jackson 3)

The pre-commit hook enforces Spotless formatting, 75% instruction/branch coverage (JaCoCo), zero SpotBugs findings (effort Max) and zero dead-code findings (PMD) on every commit.

Each behavioral rule was implemented and then verified against the actual sources of inertia-laravel and @inertiajs/core (v3.10) — see the test names in inertia-core (InertiaProtocolTest).

Credits

  • inertia-laravel — the canonical server adapter; the behavioral reference for this port.
  • inertia4j — the prior Java adapter; the SPI/core split that inspired the ports design here.
  • @inertiajs/core sources + inertia docs — the client-side protocol contract.

About

Server-side Inertia.js adapter for the Java ecosystem

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages