These are chat archives for opal/opal
@Qudware I'm just some random, but I'd say it's production ready. I've been following Opal's development since 2014 or so and I'd definitely say it's in active development. I have a few projects that have been using it for awhile (none open source unfortunately), and it's definitely made JS more pleasant to work with.
And if you're specifically interested in reactrb, there's an active gitter chat here for that too.
@catmando what version of middleman? Where are you getting stuck? If you're using v3, it's stuck at Opal 0.7.X I believe, due to sprockets compatibility. I actually have a v3 project where I set up something external so that I could use a modern version of opal, but I was never quite thrilled with it.
And I'll post some example projects in a bit.
Here's half the instructions for now:
sprockets is no longer a default part of the middleman install, add this to your
gem 'middleman-sprockets', '4.0.0'
You will also need to then make the following changes to your
activate :sprockets after_configuration do Opal.paths.each do |p| sprockets.append_path p end end set :js_dir, 'app' # for instance if your ruby code is in <project>/source/app
The huge thing I haven't figured out is source maps support. Anyone here know how to add opal source maps support to middleman?
Opal.load('test')(assuming I have a single ruby file called test)
yeah, sorry, the actual JS stuff was the other half of the instructions I didn't include.
But yeah, as I understand it, as of 0.8 and greater, opal code does not auto-execute just because it got pulled in with sprockets (meaning you'd see its source in your compiled js file, but it wouldn't be running).
This does give you the flexibility of not having to worry about what order sprockets pulls your files in, but then (if you're using a .js file as an entry point), you'll need to do
Opal.load('FILENAME') to make sure it executes.
yeah, I have something similar with my v3 project. I have an opal directory with its own Gemfile and then a Rakefile that will build what's in the opal directory. Then I have a Procfile in the main middleman directory that runs middleman at the same time as the Rake rebuilder.
What I want to do though is experiment with getting webpack going both for JS dependencies and building opal files, especially given that the middleman devs seem so intent on divorcing the project from sprockets and using the external pipeline instead (external pipeline is v4 only though).