These are chat archives for opal/opal

6th
Jul 2016
Bernhard Weichel
@bwl21
Jul 06 2016 10:34 UTC
@elia imho zepzo support can be droppef if it makes maintenace easier
This message was deleted
I am looking for an api which allows to list, create, read files on cloud services such as dropboc owncloud etc. Is there any hint, even for one which already has an opal wrapper
Mitch VanDuyn
@catmando
Jul 06 2016 14:56 UTC
:-( opal 0.10 not working with reactrb prerendering... very odd error
Mitch VanDuyn
@catmando
Jul 06 2016 15:04 UTC
looks like this line no longer works as it did:
Opal::Processor.load_asset_code(::Rails.application.assets, 'components')
Mitch VanDuyn
@catmando
Jul 06 2016 15:14 UTC
I see its deprecated! Thanks for the good documentation!!
Mitch VanDuyn
@catmando
Jul 06 2016 15:25 UTC
however there seems to be a change in semantics?
Mitch VanDuyn
@catmando
Jul 06 2016 15:36 UTC
well not there, but someplace else... load_asset returns the same thing, but...
Mitch VanDuyn
@catmando
Jul 06 2016 15:57 UTC
okay so when I do load_asset, i get this string back:
"if (typeof(Opal) !== 'undefined') { Opal.loaded([\"opal\",\"corelib/runtime.self\",\"development/react.self\"]); Opal.load(\"components\"); }"

regardless of whether i am in opal 9, or opal 10

this is then sent to the ruby racer for evaluation.
everything works fine
but
in opal 10, on the top level module "React" seems to be defined... like wise only the the top level Component module is defined.

Mitch VanDuyn
@catmando
Jul 06 2016 16:11 UTC
So the problem was I have some "hardcoded javascript" like this:
@ctx.eval("Opal.React.IsomorphicMethods.$some_method...")

which now wants to look like this:

@ctx.eval("Opal.React.$$scope.get('IsomorphicMethods').$some_method...")

Is there a better way of dynamically decided which to use other than doing this:

if @ctx.eval("Opal.React.IsomorphicMethods") 
... old way
else
... new way
end

How far back was $$scope.get defined (I want to stay compatible with Opal 0.8 +)

Elia Schito
@elia
Jul 06 2016 19:47 UTC
@catmando I'm quite sure $$scope.get works back to 0.8, but trying is the right way to find out :P
@catmando also would probably be better to use Module#const_get if it's implemented on older versions… that way you use a ruby API instead of an internal Opal behavior
Doug Orleans
@dougo
Jul 06 2016 20:21 UTC
This page seems a few versions out of date: http://opalrb.org/docs/
v0.9.2 stable
Elia Schito
@elia
Jul 06 2016 21:18 UTC
@dougo yeah, I'm in the process of updating all the things, when all it's done I'll publish the blog post on the site and start sharing that around