These are chat archives for opal/opal

9th
Apr 2015
Fred Mitchell
@flajann2
Apr 09 2015 04:41

Thanks @fkchang and @jaredcwhite for your inputs. I am creating a control panel for my neural network engine RubyNEAT, and eventually want it to be a full-blown dev environment where you can monitor the evolution and make changes to some of the parameters, tweaking them in real time.

So it will be heavy on the visualization.

I find D3 annoying to work with directly, but like its performance. Angular 2 is coming out soon as well, but would just rather (re)do everything in Opal. Using Sinatra as a light-weight interface to RubyNEAT as a plugin, but I don't like some of the issues I am having with it, as Sinatra wants to "steal" the entire show...

Fred Mitchell
@flajann2
Apr 09 2015 04:47
Lisso is looking pretty good. I think I will try that.
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 13:31
hi there
Elia Schito
@elia
Apr 09 2015 13:32
hi
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 13:32
I have a PHP site with a custom JS app using Websockets, I'm considering using opal to tidy up the code
but I'm kinda clueless on how should I go for it, I'm trying to compile using opal -F output.js myfile.rb but it fails when requiring the 'browser' library (I already have the gem installed)
Elia Schito
@elia
Apr 09 2015 13:35
try ruby -r opal-browser -S opal –c myfile.rb > myfile.js
@meh can you release an updated opal-browser to rubygems?
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 13:39
it returns /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- opal-browser :( despite I just installed opal-browser with gem install opal-browser --pre
Elia Schito
@elia
Apr 09 2015 13:39
yeah, just noticed the realsed version is still for opal-0.6
@juanfgs if you're using bundler you can add it as a git dependency tho…
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 13:41
let me try that
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 13:51
still fails :(
Adam Beynon
@adambeynon
Apr 09 2015 14:07
@elia: Have you tried opal-react yet? Im considering moving an app from opal-haml to use it instead
(currently about 100 views/templates)
Elia Schito
@elia
Apr 09 2015 14:08
@adambeynon not seriously
Adam Beynon
@adambeynon
Apr 09 2015 14:09
@elia As with anything I’ve done backbone based, it just ends up in files full of DOM selectors for updating and event registering
but, the shared templates with rails is the one reason I havent tried something else (yet)
Elia Schito
@elia
Apr 09 2015 14:10
I'm don't use client views heavily, current app has just 1
And I re-render each time the model changes
Best thing would be to produce react components from haml…
Adam Beynon
@adambeynon
Apr 09 2015 14:13
@elia yeap, trying to work that out atm. To allow “normal” haml templates and “react” style templates would probably need a new file extension to keep sprockets working ok
Elia Schito
@elia
Apr 09 2015 14:19
@adambeynon also I guess it would require a new Haml::Compiler to produce react js code instead of strings…
Adam Beynon
@adambeynon
Apr 09 2015 14:21
@elia writing compilers is fun though! (maybe)
Elia Schito
@elia
Apr 09 2015 14:21
I wrote a haml2erb gem once…
't was lol :D
Juan Francisco Giménez Silva
@juanfgs
Apr 09 2015 14:40
got it working! :)
I created this Rakefile http://pastebin.com/epbarJqD just in case some one is struggling with that issue
still don't know why it doesn't work with just gem install and ruby -r opal-browser, but this seems to work
Elia Schito
@elia
Apr 09 2015 14:51
:+1:
Forrest Chang
@fkchang
Apr 09 2015 16:01
@adambeynon @elia seems like the react.rb dsl is very close to @meh 's paggio, maybe that could be the common template format for rails and react.rb