Inertia.js – Build React, Vue, or Svelte apps with server-side routing

rob | 142 points

I really like the server side routing part of Inertia and that you can pass data to the frontend directly in the first request without needing to do an additional http request (altough this might be a bit problematic for sensitive information in case the sites are cached).

However, there are also things that make it feel gimmicky:

- The resolve function createInertiaApp runs more than once (mainly) on the first page load causing a re-render and it seems like there is no plan to fix that in near feature https://github.com/inertiajs/inertia/issues/1595 / https://github.com/inertiajs/inertia/issues/1091

- There are issues like this where they could at least merge the PR to improve the documentation as there seem to be many people to misunderstand the usage the function but it did not happen https://github.com/inertiajs/inertia/issues/1631

lessname | 4 months ago

Adonis has great support for inertia builtin. Very quick to get started. https://docs.adonisjs.com/guides/getting-started/installatio...

Docs here: https://docs.adonisjs.com/guides/views-and-templates/inertia

Using inertia with SSR is very nice for the combination of:

* I want to have simple server-rendered views, with added client side sprinkling

* I want to be able to use off-the-shelf components like complex data grids to build fast

* I want to minimize API communication headaches

banashark | 4 months ago

Inertia is pretty interesting! Recently, Elixir / Phoenix started supporting it:

https://youtu.be/uyfyFRvng3c

calexanderaz | 4 months ago

It’s funny, this is how we built apps in 2014-era Rails at Airbnb, and by 2015 we were doing server-side rendering of some React components too. We had a thing to pop a React component into our regular rails views as a “partial”.

    <%= render_react_component('MyComponent.js', :name => 'Hypernova The Renderer') %>
https://github.com/airbnb/hypernova?tab=readme-ov-file#rails
jitl | 4 months ago

At the Laracon it was estimated the new version 2 of inertia will be released in October with new features like multiple async requests, polling, infinite page scroll with smart background loader, etc

mmerlin | 4 months ago

Here's a server-side community adapter our team has been using for ASP.NET Core. It works pretty well! I helped contribute the Vite helper to bring HMR and ease of integration.

https://github.com/kapi2289/InertiaCore

adrum | 4 months ago

How difficult is it to troubleshoot Inertia when something breaks?

That was my only fear when I toyed with Inertia, Django, and Svelte for an afternoon. When I’d get an error it seemed obscure or not indicative of the underlying cause.

What’s everyone’s experience? Inertia seems like magic. And that’s what scares me a little.

halfcat | 4 months ago

How good is the Rails integration? I know Inertia is very popular in the Laravel community, but I rarely see it being mentioned among rubyists.

rmsaksida | 4 months ago

Is there any functionality that is not offered by SvelteKit? SvelteKit is batteries including SSR/web server solution for Svelte and works beautifully together, as they are tightly coupled.

miohtama | 4 months ago

There is a really good adocast channel on YouTube going over this and it's integration with Adonisjs

https://youtube.com/playlist?list=PL9dIWiKCV571S3ILiADMKlZS4...

losthobbies | 4 months ago

I really like Inertia. For my project, I have chosen yo use Laravel with the Jetstream starter kit, converted to React. It works quite well for my current use cases.

https://github.com/knowii-oss/knowii

dSebastien | 4 months ago

My experience with using Inertia.js for Laravel has always been smooth and pleasant.

But I can't say the same with translations/localisation.

begueradj | 4 months ago

This is good if you would compile your node app into a binary, everything in one place.

tamimio | 4 months ago
[deleted]
| 4 months ago

Is this similar to React Server Actions?

nsonha | 4 months ago
[deleted]
| 4 months ago

Eh... This needs Go support. In Go everyone doing SSR is a htmx goon, which is terrible.

Also why use PHP or Ruby, both as slow as JS instead of Next Nuxt or SvelteKit?

Only reason I could think is traditional shared hosting compatibility.

lakomen | 4 months ago

[dead]

wetpaws | 4 months ago