I'm very keen to try Opal in a new Rails project, but the risk of course is that I won't discover what it can't do until I've spent hundreds of hours doing everything else, and run into a brick wall that I can't possibly get through.
What are its limitations?
For example (and of course answers should not be limited to these topics if there are other limitations worth mentioning) I would assume that you can't just use any old Ruby library in your Opal code (but I'd love to find out that I'm wrong about that!).
I would also guess there might be difficulties in using any arbitrary JavaScript library, or that there are cases where you need to write JavaScript to interface with those.
And of course there could be all sorts of issues that I haven't even begun to imagine. It looks like an amazing project, but I want to know what gotchas I might encounter unexpectedly if I were to just dive in head-first.
AssetPipeline
style). Things should improve from 0.7.x on (unreleased), (as a sidenote, similar issues are found in RubyMotion).class MyClass < `MyJsClass`; end
) and need full blown wrappers (opal-jquery is an example, and that happens all the time in Ruby too, where you seldom use FFI mapped apis directly and always wrap C libraries).That said you usually can get a lot of stuff done with just using Native or opal-jquery. I personally have found myself moving classes from the backend to the frontend more than once. Testability and code readability surely improves (as long as you write good Ruby) and you can reuse your OOD skills.
I surely may be missing something, anyone is welcomed to chime in. And it will eventually turn into a blog post on http://opalrb.com/blog.
Don't forget you are in a browser. Don't underestimate the power of Ruby.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With