RxAssim

RxAssim

I’m excited to announce ExInertia, a toolkit built on top of Igniter that provides a robust integration between Phoenix and Inertia.js, with first-class support for Routes library and Bun.

:wrench: Technical Stack:

  • Built on Igniter for powerful, composable installer generators
  • Full Inertia.js integration with Phoenix using Inertiajs/inertia-phoenix
  • Modern asset pipeline using Bun + Vite (replacing esbuild/tailwind)
  • Built-in Routes integration for type-safe routing between Phoenix and TypeScript
  • Automated manifest handling for Vite assets

:package: Installation:

def deps do
  [
    {:exinertia, "~> 0.5.0"},
  ]
end

The installer, powered by Igniter (thanks @zachdaniel ), handles the complete setup:

mix exinertia.install

:hammer_and_wrench: What gets installed:

  1. Vite manifest reader in your Web namespace
  2. Inertia pipeline + configuration in your Router
  3. Routes integration for type-safe routing
  4. Modified root layout with Vite asset handling
  5. Complete Bun + Vite setup replacing esbuild/tailwind
  6. TypeScript-ready frontend structure with Routes type definitions
  7. Automated mix aliases for asset building

:high_voltage: Development Experience:

  • Hot Module Replacement (HMR) with Vite
  • TypeScript compilation with Bun
  • Type-safe routing between Phoenix and TypeScript using Routes
  • Seamless server-side rendering support
  • Zero-configuration Tailwind integration

Type-safe routing example with Routes:

// Your routes are automatically typed!
const url = Routes.path('user.show', { id: 123 });
// => "/users/123"

// TypeScript error if you miss required params
const url = Routes.path('user.show'); // Error: missing id parameter

The project is built to be modular - you can use the installers independently or compose them with your own Igniter-based installers.

:link: Resources:

https://github.com/nordbeam/exinertia

Contributions and feedback are welcome! We’re particularly interested in hearing about different use cases and integration patterns.

Showing Posts 1 to 10

zachdaniel

zachdaniel

Creator of Ash

Looks awesome!

FYI your package can be installed without modifying the mix.exs file by anyone who already is using igniter with mix igniter.install exinertia and that’s the command we recommend to use when running installers as opposed to calling exinertia.install directly :slight_smile:

Great work!

RxAssim

RxAssim OP

Thank you!

I actually wanted to contact you before I release this to get feedback about how I used Igniter.

For the installer part, I figured that since Igniter is relatively new, not a lot of people would be using it in their projects, and I aimed for having the users add only one dependency to get started.

But I’ll refine this moving forward to include your suggestion.

zachdaniel

zachdaniel

Creator of Ash

Ah, actually I just spotted this: exinertia/mix.exs at main · nordbeam/exinertia · GitHub

So one of the main reasons we suggest people work with igniter directly to install packages etc. is to ensure that igniter is a dev/test only dependency. Igniter depends on mix and having it as a production dependency causes issues.

So either exinertia itself needs to be a dev/test dependency, or it needs to make igniter an optional dependency. This lets end users list it as a dev/test dependency in their application.

Based on what it does I think either of those things is fine because exinertia doesn’t need to run in production for users right?

Small note, if you set only to only: [:dev, :test]in your installer’s info callback, then igniter will automatically install it with only: [:dev, :test], but only if installed via mix igniter.install exinertia

RxAssim

RxAssim OP

Thanks for the feedback! I’ve updated exinertia to make Igniter an optional dependency and modified the README to instruct users to install via mix igniter.install exinertia. This should help ensure Igniter remains a dev/test only dependency as intended.

zachdaniel

zachdaniel

Creator of Ash

Awesome! One small note is that mix igniter.install actually works even when igniter is not installed into a project, as long as igniter_new is installed as an archive.

So your instructions could be

# in your project directory
mix archive.install hex igniter_new
mix igniter.install exinertia

And then the user doesn’t have to manually edit even a single file :slight_smile:

skyturtle

skyturtle

Thanks for creating this! I’ve been playing around with Inertia.js and Phoenix and have really been enjoying the experience. It was getting old having to go through all the same setup steps. I had a couple of questions:

  1. Are there any changes you need to make to the Dockerfile that is created by mix phx.gen.release --docker? I tried to deploy my app to Coolify on a self-hosted VPS. My build keeps failing during the builder stage at RUN mix assets.deploy. Here is what I see in the debug log:
#22 [builder 12/17] COPY assets assets
#22 DONE 0.0s
#23 [builder 13/17] RUN mix assets.deploy
#23 0.771 Compiling 17 files (.ex)
#23 1.753 Generated test_exinertia app
#23 2.003 03:56:23.754 [debug] Downloading bun from https://github.com/oven-sh/bun/releases/download/bun-v1.2.1/bun-linux-x64.zip
#23 4.794 $ ../_build/bun x --bun vite build --minify
#23 4.806 Resolving dependencies
#23 5.309 Resolved, downloaded and extracted [128]
#23 5.371 Saved lockfile
#23 6.361 failed to load config from /app/assets/vite.config.ts
#23 6.361 error during build:
#23 6.361 undefined
#23 6.375 error: script "build" exited with code 1
#23 6.381 ** (Mix) `mix bun build --minify` exited with 1
#23 ERROR: process "/bin/sh -c mix assets.deploy" did not complete successfully: exit code: 1

It looks like the Vite.js config file can’t be found. When I used Svelte in a Phoenix + Inertia.js project, I had to install Node for the build stage to run npm install is the assets directory after it was copied. I wasn’t sure if I need to do something similar here. This is my first time using the Hex Bun package. I thought the Bun wrapper package eliminated the need to install any additional JavaScript tooling, but I might be mistaken.

  1. I was curious why you created the PhxManifestReader module. When I was trying to setup Vite within a Phoenix project, I noticed other examples had set manifest: false in their vite.config.ts and put the output to match the assets folder used by Phoenix. Is there an advantage to reading those manifest files in this manner?

Thanks again for creating this toolkit! Everything seems to be working in dev right now. This was also my first time using Igniter and the ExInertia installation experience was sweet.

RxAssim

RxAssim OP

Hi!

I forgot to bun install when running mix assets.deploy, but I’ve fixed this with the 0.7 release.

As for the PhxManifestReader question, we use PhxManifestReader to dynamically read Vite’s generated manifest file, allowing Phoenix to reference the correct, hashed asset filenames in production.

This approach leverages Vite’s chunking and cache-busting optimizations in both development and production, simplifying asset management without needing to disable the manifest in Vite.

dmitriid

dmitriid

Is there any expplanation on what Inertia is, and why everyone seems to be so excited about it?

I can’t get head or tails of it from the websites, and all integrations (exinertia included) have no docs whatsoever on how you would use it

c4710n

c4710n

Inertia replaces your application’s view layer. Instead of using server-side rendering via PHP or Ruby templates, the views returned by your application are JavaScript page components. This allows you to build your entire frontend using React, Vue, or Svelte, while still enjoying the productivity of Laravel or your preferred server-side framework.
How It Works - Inertia.js Documentation

dmitriid

dmitriid

I read that, too. And that means what exactly? I’ve always been able to build anything on the frontend using anything on the backend :slight_smile:

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews