mindreader

mindreader

Live reloading without phoenix / liveview?

I just want to save a file and auto recompile, nothing more, no restarting, no plugs. We have an application that is just normal elixir without phoenix or live view or external assets. This may be answered somewhere, but I cannot find it anywhere because there are so many posts about live reloading not working in the contexts of these other projects.

We’ve been using for years a program we wrote ourselves, rl | Hex which is notable by how incredibly bad it is. If you have multiple nodes up clustered they both recompile and fight each other. Sometimes I wake up in the morning and my cpu is at 100% because it is just spinning for no good reason. Rarely it just stops working entirely until I restart it.

I tried phoenix_code_reloader, but looking at it, I can’t see where it actually recompiles anything and indeed it doesn’t seem to do anything without additional configuration involving endpoints that don’t exist in my project.

First 5 of 5 Posts Switch mode

adamcstephens

adamcstephens

Lettuce seems to provide this capability.

axelson

axelson

Scenic Core Team

Yeah Phoenix.CodeReloader is a little hard to follow. The actual compilation happens on line 307 of Phoenix.CodeReloader.Server (and is tied to phoenix configuration):
https://github.com/phoenixframework/phoenix/blob/dfb0c00d2077e10f8df6cc6e334e04924c4c2bcd/lib/phoenix/code_reloader/server.ex#L307

When I want to recompile my code on any changes I use exsync (I’m also a maintainer):
https://github.com/falood/exsync/

One great benefit of exsync is that if you use path: dependencies then they’ll automatically be recompiled for you with no additional configuration needed (with phoenix you need to manually set :reloadable_apps).

mindreader

mindreader OP

Lettuce looks a bit primitive, but exsync actually may be a real improvement over what I use. I will give it a spin soon and see how well it works.

emadb

emadb

We are using remixed_remix | Hex and it’s working quite well.

D4no0

D4no0

You can also take a look at BigBrother — BigBrother v0.1.0. I did it a while ago by extracting the recompilation part from phoenix.

If you need support for this specific library, feel free to contact me.

— All posts loaded —

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
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
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
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

We're in Beta

About us Mission Statement