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

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
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
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
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New

Other Trending Topics Top

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
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
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
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
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
lawik
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./ The firs...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews