Opal is completely broken?

333 views Asked by At

I've been totally unsuccessful in getting Opal to work.

When I try to embed it in a Sinatra server using the tutorial here or the example code here, I get undefined method 'source_maps' for #<Opal::Server:0x8b11540>. When I use the updated code linked at the bottom of this post, I get uninitialized constant Opal::Sprockets::SourceMapHeaderPatch.

So, I abandon Sinatra and try using Opal in a Rack app instead, using their own example here. And I get a totally blank webpage.

Finally, I follow the tutorial here to the letter, and again all I get is a blank page in my browser.

So, what am I doing wrong? Or is Opal really as broken as it appears?

(oh, and that's not even mentioning the two serious out-of-bounds bugs in the rescue block in parse() in opal/parser.rb that completely kill any chance of debugging an error)

1

There are 1 answers

0
Elia Schito On

The documentation needs to be updated and versioned.

But 0.8 rc1 seems pretty stable and has working examples here (including source maps).

Keep in mind that source maps are kinda hacked into sprockets and the rack setup to get them working isn't trivial.