Fork me on GitHub
#hyperfiddle
<
2023-06-13
>
Vincent23:06:06

Hey so I just gotta say, it's a real delight developing with Electric! I have finally moved the code from my development bocks to a cloud-hosted IP so I can access it online. I noticed: if I do not use https and just use clear-text http: I can actually have hot-loaded changes on my production box. So now I have my IDE tapped into my box via SSH, and I'm live-coding the production box. CSS changes are instantaneous across all connected peers because of shadow-cljs I think. Granted, compilation time is slow at ~12-18 seconds per rebuild, but it's perfectly acceptable to code locally and push changes later if that gap is intolerable. last night I had my desktop, laptop, and phone all pointed to the same website, and as I implemented changes I watched all three of them update. It was quite a satisfying moment as a developer.

👏 11
🎉 10
2
Vincent23:06:30

App is at 1600 lines and of the 16GB of ram, 4023MB are currently in use. I'm optimistic 16GB will be enough even for lots and lots of peers 😅

Dustin Getz23:06:20

congrats on your success Vincent you’ve been working hard!

😁 2
gratitude-thank-you 2
Hendrik05:06:09

@U055PQH9R4M nice and very interesting work 🙂 Just for my understanding: You are running a shadow cljs server watch on you cloud server or how do you achieve hot code reload? And why is it not working with https? Shouldn’t it be possible to have nginx or any load balancer in front of your app and configure it as an ssl termination point?

Ronny Li10:06:51

I'm super curious to learn more about your setup! I'd be interested in a video demo of your environment and project, if you have the time to record such a thing. Also my only exposure to Electric code so far has been the tutorials so it'd be awesome to see how it works in an almost-prod situation!

Dustin Getz13:06:05

I don't think the memory consumption is caused by electric's runtime fwiw, i would suspect the database query engine first (it may be reserving memory for future use?)

Dustin Getz13:06:32

Where are you hosting @U055PQH9R4M

Vincent13:06:41

current mem use down from 4G to 1.5G after a reload, maybe it is the query engine? I'm using a "box" (an ip) at digitalocean.

Vincent14:06:52

@U023LKF2PQV it's all out of the box electric, not sure about shadow w/ https; maybe the default is to have it off, using cleartext http i get live compilations and immediate css upticks, you think it should also work this way with https? maybe, not sure.

Hendrik15:06:17

thanks for your answer. I’m not 100% sure if https works. However, if it is behind an ssl termination point (nginx, loadbalancer, etc.), then your server app recieves plain http.