#πŸ«’ olive - live reload for your classic server

1 messages Β· Page 1 of 1 (latest)

stable river
#

Hey everyone!
I'm happy to share with you Olive !
It's a web server proxy that enables live reload and automatic code reload when working on a "classic" server (a server that renders HTML).
You can find the docs here: https://hexdocs.pm/olive/ !

The v1 is very barebone and a proof of concept more than anything but it's a start!

Thanks to @indigo zenith for the great name suggestion! πŸŽ‰

sand sequoia
#

@dusky briar weren't you lookiung for something like this recently?

stable river
#

Don't tell me it already exists! Ahah πŸ˜…

dusky briar
#

Oh lovely!

#

Missing emoji!

stable river
#

Yeah, I saw that 😦 I need to release a v2 asap

sand sequoia
#

gleam docs update ^.^

stable river
#

I see build, publish or remove. So I can only change my readme and gleam docs publish and no need of release, tags or anything?

sand sequoia
#

oh yeah i was close

#

yes docs are separate from code releases

#

change em as much as you like

stable river
#

Nice, I'll try that then, thanks πŸ™‚

dusky briar
#

Because of the nature of the code:atomic_load, any changes to your main function will not be taken into account.

May want to expand a little on this talking about stateful processes

#

And link any official docs

stable river
#

Yup, I also need to specify I'm doing so shenanigans to spawn the main process as <module>@@main:run(<module>)

stable river
#

πŸ«’ olive v1.1.0 is out! πŸŽ‰
New goodies to configure main_port, proxy_port, bind address and filtering logs or not. Docs have been updated with all of the details!

stable river
#

πŸ«’ olive v1.2.0 is out! πŸŽ‰
Now Olive is smart and watches for any "path" dependencies as well as the main folder! It also gives the list of folder being watched, and tells what file triggered a code reload!

stable river
#

πŸ«’ olive v1.3.0 is out! πŸŽ‰
It's a minor release with better error messages and a few fixes. Now olives build your project before starting it (forgot about that!), and the output of gleam build is nicely displayed as usual! (it was caught by olive and displayed without colours and goodies 😞 ). Also, because of all the shenanigans, olive stops when a change is made in main file to force a restart from the user (a warning is displayed for that as well)

dusky briar
#

Awesome

opaque widget
#

I started using Olive last night, I didn’t get browser reload working but as a dev server it’s very nice and seems to work better than my watchexec script did πŸ€—

stable river
#

There's some limitations and maybe some gotchas that IΒ might discover along the way.

#

I'm still new to Gleam and Erlang ecosystem in general but I wanted a tool to have, at least, some live reload when building a classic web server πŸ˜‰

#

The last version should fix some bugs by the way. And I was wondering if I could add some ajax call and morphdom to replace the live reload. That could allow to keep some state while fetching the updated view from the server πŸ€”

mild steeple
#

Ooh I have a use case for this hehe

stable river
#

For morphing or olive in general ?

mild steeple
#

olive in general

reef stream
#

Great tool you made! I was trying to use it with the latest version of mist and I can't, due to olive using gleam_http v3 and not v4

#

Do you think you could update it?

stable river
#

I'll take a look as soon as possible πŸ‘

reef stream
#

Thanks!

stable river
#

πŸ«’ v1.3.1 released! πŸŽ‰
Nothing fancy, just the relaxed http version. Should now allow for v4. 🀞

reef stream
#

Thank you so much!

stable river
#

πŸ«’ v1.4.0 released! πŸŽ‰

  • Olive now watches for priv directories, and any changes in them. It will trigger clients to reload without rebuilding your project.
  • Added watch_debounce option in CLI.
  • Added debug level for logger. Olive is quieter by default.
last mist
#

Could this be approach be used together with cgi: https://hex.pm/packages/cgi to have old-school php deployment by uploading files :D?

#

Or is CGI even not required, just use wisp and gleam on the production box and copy files over?

dusky briar
#

There’s no long running process with cgi so no restarter needed

last mist
stable river
#

Olive is a dev tool, it has nothing to do with production and how you deploy and update your app. So I'm not sure to see anything linking it with cgi. And you could use whatever you want for your deploy then, no?

last mist
stable river
#

That exists within erlang too. You could get away with a little erlang script that just do that maybe πŸ€” Doesn't need to use gleam specifically. In prod, you run erlang/javascript code, not the gleam code directly, right?

#

And if there's no long running process with cgi as lpil stated, then there's really nothing more to do that just copy/paste the compiled code

last mist
stable river