faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
<FromGitter> <eliasjpr> @andrewc910 you can have a process monitor in case the server stops. Amber will try its best to reboot event after a crash
<FromGitter> <damianham> @andrewc910 I install a service in /lib/systemd/system and use systemctl to start/stop/restart etc.
_whitelogger has joined #amber
<FromGitter> <Blacksmoke16> if you are using docker swarm it has some stuff to handle that for you
<FromGitter> <Blacksmoke16> (even tho its kinda dieing it still useful for small stuff imo)
<FromGitter> <andrewc910> Never actually set up systemd. Wasn't too bad. This is just to demo a shard i am making so i just used iptables & systemd. Made sure everything persists & boots after reboots. Anything i should be aware of using either of these? I typically don't do manual deploys like this
<FromGitter> <andrewc910> http://3.23.28.58/ ⏎ No handwritten JS. OOP View components like lucky, websockets & html over the wire :) I am quite happy about this.
<FromGitter> <eliasjpr> Nice!
<FromGitter> <eliasjpr> @andrewc910 do you have the repo for this? I would like to explore the code
<FromGitter> <andrewc910> @eliasjpr ⏎ https://github.com/andrewc910/motion.cr ⏎ ⏎ The readme is a mess & somewhat incoherent but i am sure you'll understand the gist. The view component portion was pulled from lucky and then modified for amber. The rest is all custom code. [https://gitter.im/amberframework/amber?at=5f3e840befafab7e3a883b4c]
<FromGitter> <eliasjpr> This is pretty awesome! So all the transformation is on the server side?
<FromGitter> <andrewc910> Yeah it's 100% SSR and then uses the morphdom package for dom-diffing
<FromGitter> <eliasjpr> Interesting
<FromGitter> <eliasjpr> I have done something similar using preact
<FromGitter> <eliasjpr> basically ⏎ ⏎ `````` [https://gitter.im/amberframework/amber?at=5f3e8526582470633b6a64a9]
<FromGitter> <eliasjpr> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5f3e853433878e7e602feca8]
<FromGitter> <andrewc910> I am personally not a huge fan of javascript frameworks. I will use them for work without complaints but i typically don't work in js for personal projects. This was to reduce the need for some JS :D
<FromGitter> <eliasjpr> But this is incredible! I really like this work. Can wait to see more of it
<FromGitter> <eliasjpr> I saw you had to write a few javascript files
<FromGitter> <andrewc910> Thanks! I want to get timers & model broadcasts working next.
<FromGitter> <andrewc910> Yeah, the project requires you to install my node package. It reads the html, adds event listeners to any portions of the page that have the data attributes, then handles the websocket connections & dom-diffing.
<FromGitter> <andrewc910> All a user needs to do is: ⏎ ⏎ ```import { createClient } from '@awcrotwell/motion'; ⏎ const client = createClient()``` [https://gitter.im/amberframework/amber?at=5f3e85e833878e7e602fee5c]
<FromGitter> <eliasjpr> @andrewc910 I was wondering if is possible to make the Motion::Base a module instead of a class?
<FromGitter> <damianham> @andrewc910 I really like this work. I use React a lot for SPA frontends but I can see this as an attractive alternative. A couple of my recipes have SPA<-->server model synchronization over websockets. You might find some useful code there.
<FromGitter> <eliasjpr> Also I see a small limitation listed for Motion
<FromGitter> <eliasjpr> > MotionComponents are limited to a single top-level DOM element ⏎ I think I might be able to help to remove this limitation
<FromGitter> <andrewc910> @eliasjpr It totally can be. Lucky has it as a module, then in the lucky project, it mixes into a `base::component` and you inherit from that. What would the benefit be? In regards the the limitation, you can have the top level be a component but it can't actually have motions. This is because the html transformer needs to be able to find 1 exact child. If we have multiple children in a component, the html
<FromGitter> ... transformer fails. Take a look at the method. It's pretty easy to understand: https://github.com/andrewc910/motion.cr/blob/81b1e918629d34abf79675bb466bf741d3fc8efc/src/motion/html_transformer.cr#L20
<FromGitter> <andrewc910> @damianham Thank you! I have seen your react recipe. Got any others? Will definitely take a look :)
<FromGitter> <damianham> @andrewc910 follow this link - https://github.com/topics/amber-recipe - it lists the repos that are tagged with amber-recipe
<FromGitter> <andrewc910> Oh I forgot about that. Thanks! Will take a look later this week 😁
<FromGitter> <mixflame> Hey guys just to let you know I made two shards to aid with filtering content for younger audiences. https://github.com/mixflame/Linksafe.cr https://github.com/mixflame/obscenity-cr
_whitelogger has joined #amber
<FromGitter> <eliasjpr> Thank you @mixflame
<FromGitter> <eliasjpr> @andrewc910 The benefit of a module is that you can turn anything into a motion
<FromGitter> <eliasjpr> and is more portable than a class
<FromGitter> <eliasjpr> Also because of the nature of a motion I think its best to make it a struct