igorb

igorb

Hello all!

Announcing Fireside, a tool to install and upgrade code templates that are themselves Elixir apps.

Fireside allows you to bring over microservices directly into your Elixir monolith. As an example, I built and open-sourced an e-commerce core for an online store (used in a real platform), and Fireside lets you install everything it needs to run in just one command: mix fireside.install shopifex@github:ibarakaiev/shopifex. This will:

  1. Install all its dependencies (as well as their Igniter installers, if available).
  2. Import all files listed in fireside.exs of the component.
  3. Run an optional setup/1 hook that uses Igniter for custom things like modifying config.exs, running mix tasks, etc.
  4. Calculate the hash of the AST of each imported file and record it in config/fireside.exs.

Then, if the component changes in the remote, you can bring over changes with mix fireside.update shopifex. Fireside components can even expose an upgrade/3 function that can run Igniter modifications. It’s kind of like a database migration, but for your app (or, rather, for an isolated part of it).

However, if you modify the imported code, Fireside will detect it by looking at the hash of its new AST and will reject updates. This is so that you can change the imported code and not risk having your changes overwritten. For this use case, it’s recommended to “unlock” the component before editing with mix fireside.unlock {component}, more on which below.

Some use cases, like project starter templates or code from tutorials, don’t require “locking”, and can be installed with the --unlocked flag. In this case, Fireside will import the code once and forget about it. This would be useful for something like phx.new if it were created with Fireside, in which case it would be possible to add a Phoenix template to an existing Elixir app. Updating or removing (mix fireside.uninstall) would not be possible in this case.

The key difference between regular code templates and Fireside components is that Fireside is AST-aware (thanks to Igniter!) and Fireside components are themselves standalone Elixir apps that you can test and build in any way you want—“exporting” only the critical parts. I wrote a bit more about the motivations and potential use cases in a blog post: Embedded Microservices and Fireside.

If you want to take it for a spin, feel free to take a look at the README and Creating a Fireside Component. If you do like it, let me know here or by leaving a star in the repo :slight_smile:

https://github.com/ibarakaiev/fireside

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
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

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews