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.

Marked As Solved

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).

Also Liked

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.

emadb

emadb

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

adamcstephens

adamcstephens

Lettuce seems to provide this capability.

Where Next?

Popular in Questions Top

New
Tee
can someone please explain to me how Enum.reduce works with maps
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement