These are chat archives for opal/opal
Could anybody help with a little problem I am having? I am working with the react.rb gem. Currently when you do a require, you say:
but this keeps causing all sorts of problems because of the name space collision with the react.js library.
I want to change things so that you say
require 'opal-react' (like
opal-jquery) but still use the
React name space within opal to refer to the opal wrapper. (I assume this is okay with the opal team, if not then something like ruby-react would be fine)
This is a dumb question I think, but I am not seeing how this is done with opal-jquery.
THANKS IN ADVANCE!
.sofile in MRI
so just change this to
if RUBY_ENGINE == 'opal' require "opal-react/top_level" require "opal-react/component" require "opal-react/element" require "opal-react/event" require "opal-react/version" require "opal-react/api" require "opal-react/validator" else require "tilt" require "opal" require "react/version" require "opal-activesupport" require "react/ext/jsx_support" Opal.append_path File.expand_path('../', __FILE__).untaint Opal.append_path File.expand_path('../../vendor', __FILE__).untaint end
and change lib/react.rb to lib/opal-react.rb
Is that right?