These are chat archives for opal/opal

23rd
Jul 2016
Keenan Brock
@kbrock
Jul 23 2016 18:54

I hardcoded:

gem "sprockets", "~> 3.6.x"

and it went away.
if you need a temporary fix

Keenan Brock
@kbrock
Jul 23 2016 20:56
I hope this is a faq but...
I'm having all sorts of problems getting code up and running.
It often seems to complain when it hits Ë characters - that are all over the generated code.
Any suggestions?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:18
@kbrock Add this meta tag: <meta charset="utf-8" />
Keenan Brock
@kbrock
Jul 23 2016 21:18
aah - thanks
@jgaskins Is there an easy to start tutorial?
all the tutorials I find are for v5.0
Jamie Gaskins
@jgaskins
Jul 23 2016 21:19
It is indeed a faq. I've run into it myself several times. :-)
Keenan Brock
@kbrock
Jul 23 2016 21:19
thanks
Jamie Gaskins
@jgaskins
Jul 23 2016 21:19
Tutorial for Opal?
Keenan Brock
@kbrock
Jul 23 2016 21:19
yea
I'm JUST starting out
(have been with ruby since rails 0.9)
sorry. should say since ruby 1.8.5 (ruby != rails ;) )
Jamie Gaskins
@jgaskins
Jul 23 2016 21:21
@kbrock Have you done much front-end dev?
Keenan Brock
@kbrock
Jul 23 2016 21:21
minimal
my js is ugly, and my css looks like 1990's
Jamie Gaskins
@jgaskins
Jul 23 2016 21:21
lol
Keenan Brock
@kbrock
Jul 23 2016 21:21
everything has changed since I've done js (~2002)
tried the awesome opal, and resources
but there are so many examples and all seem outdated (opal 0.5.0-0.6.0)
not sure if I should got the precompile route (all the rakefile/guard examples break - but not too hard to fix)
or try a sprockets - the world of js/nodejs/react/... too many possibilities. you know?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:24
You can get started pretty easily with Clearwater and Rails, so Rails will manage the asset compilation for you. There's even a starter kit specifically for that.
Keenan Brock
@kbrock
Jul 23 2016 21:24
thanks. heard about clearwater on ruby rogues
it is what brought me back
volt is slick, but the world is a rails world
cool - I'll do that - thanks so much
ooh, is opal-browser recent?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:25
ha! Nice. That was me on with the Rogues. ;-)
Keenan Brock
@kbrock
Jul 23 2016 21:25
or do most people do the opal-jquery
NICE
your enthuiasm came over well.
Jamie Gaskins
@jgaskins
Jul 23 2016 21:25
Thanks!
Keenan Brock
@kbrock
Jul 23 2016 21:25
I tend not to listen to rogues much anymore
but that episode was too enticing to skip
I mean virtual dom
opal
come on. who could skip that?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:26
I've really enjoyed working with it.
Keenan Brock
@kbrock
Jul 23 2016 21:26
do you play much with websockets?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:27
Yep
Keenan Brock
@kbrock
Jul 23 2016 21:27
with rails?
you go action cable, or faye?
anything special with clearwater to keep in mind?
I did notice an opal-channel thing
Jamie Gaskins
@jgaskins
Jul 23 2016 21:27
Faye, I haven't tried anything with Rails 5/ActionCable yet.
Keenan Brock
@kbrock
Jul 23 2016 21:28
do I need to get into opal-browser?
or does clearwater kinda get rid of that?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:28
There's also opal-pusher.
Keenan Brock
@kbrock
Jul 23 2016 21:28
oooh
pusher-api is a 3rd party service. right?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:29
opal-browser and bowser are both Ruby bindings to browser APIs. Clearwater uses bowser under the hood because it's got a very small payload.
But you can use either one. If you're using WebSockets, you'll definitely want to use one of them.
Yeah, Pusher is 3rd-party.
but can't get it running on a recent version
and to tell you the truth
felt like they were writing their own bowser (I like the size of that one)
so I wanted to upgrade and run it - but just felt dead in the water
also the code had too many backticks. wasn't separated well.
So I gave up and started looking at https://github.com/4r2r/opal-robots
close to my end goal (I'm starting too big...)
but I want the brains to be running on server + websockets
Jamie Gaskins
@jgaskins
Jul 23 2016 21:32
Yeah, if you're writing a lot of backticks, you probably want to encapsulate that :-)
Keenan Brock
@kbrock
Jul 23 2016 21:32
when you write apps, do you require 'opal' - or do you tend to create opal.js and html include that?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:33
The first two lines of my apps are almost always:
require 'opal'
require 'clearwater'
Keenan Brock
@kbrock
Jul 23 2016 21:33
so your application.js is BIG
Jamie Gaskins
@jgaskins
Jul 23 2016 21:33
Nah, a little over 100KB minified/gzipped.
Keenan Brock
@kbrock
Jul 23 2016 21:34
heh
I'm still confused by js so I was hoping for 100 lines ;)
Jamie Gaskins
@jgaskins
Jul 23 2016 21:34
It's about the same JS payload size as an equivalent Ember app.
Keenan Brock
@kbrock
Jul 23 2016 21:35
well. I'm selling myself short. I hack / fix bugs in js in the open source community a lot. but there is a difference between hacking / improving and speaking a language natively
yea. not complaining about payload size. just hard to keep that all in my brain
@jgaskins cool. the starter kit is just a rails app with application.rb swapped and a hello controller. thanks. this is great
Jamie Gaskins
@jgaskins
Jul 23 2016 21:38
If you're loading Opal from a CDN (like cdn.opalrb.org), you can omit that require line from your app: https://github.com/opal/opal-cdn
@kbrock No worries. :-)
Keenan Brock
@kbrock
Jul 23 2016 21:39
last one - I promise ;)
have you played with games?
Jamie Gaskins
@jgaskins
Jul 23 2016 21:39
You can also hop into the Clearwater channel if you like: https://gitter.im/clearwater-rb/clearwater
Keenan Brock
@kbrock
Jul 23 2016 21:39
like phaser?
thanks
Jamie Gaskins
@jgaskins
Jul 23 2016 21:40
I haven't checked out Phaser, but @ylluminarious made Ruby bindings to it: http://opalphaser.com
Keenan Brock
@kbrock
Jul 23 2016 21:41
yea - phaser looked sweet. I got a few screens in but then... well... it was javascript.
so opal phaser is very tempting
Keenan Brock
@kbrock
Jul 23 2016 22:00
Have people tried opal-rails with rails 5.0?
Elia Schito
@elia
Jul 23 2016 22:30
@dougo @kbrock re sprockets: I'm in the process of decoupling sprockets support, opal 0.11 will ship without sprockets as a dependency and opal-sprockets will be needed; it will support for multiple sprockets versions
Keenan Brock
@kbrock
Jul 23 2016 22:31
@elia thanks
very cool
George Plymale II
@ylluminarious
Jul 23 2016 23:03
@kbrock you're welcome to our gitter channel if you have any questions about opal-phaser: https://gitter.im/orbitalimpact/opal-phaser
Keenan Brock
@kbrock
Jul 23 2016 23:03
thanks @ylluminarious
George Plymale II
@ylluminarious
Jul 23 2016 23:05
np