These are chat archives for opal/opal

15th
Jan 2018
G. Gibson
@mistergibson
Jan 15 2018 01:11
@iliabylich : OK, I'll try that - thanks for your help
G. Gibson
@mistergibson
Jan 15 2018 01:18
@iliabylich : Actually, that didn't work so well. Even after doing Opal.eval("require 'browser/socket'"); => true ... Browser::Socket remains undefined ... hrm
Ilya Bylich
@iliabylich
Jan 15 2018 03:29
@mistergibson Don't do eval, it doesn't help. Everything that you need must be required in the main .rb file.
Could you share your file please?
G. Gibson
@mistergibson
Jan 15 2018 04:07
Ah, is eval in a differing name space?
I'll cobble a gist for you ...
Sorry for all the pestering - I'm just still giddy with the prospect of coding in Ruby .... IN a webpage! Awesome.
Mitch VanDuyn
@catmando
Jan 15 2018 23:11
Is there any known issue (or changes in behavior) in Opal 0.11 around the second parameter of const_get and const_defined?
specifically we have code with const_get(xxx, false) (meaning do not search down tree) and it broke in Opal 0.11
Elia Schito
@elia
Jan 15 2018 23:13
@catmando the const lookup was rewritten, as far as you know the new behavior differs from MRI?
Mitch VanDuyn
@catmando
Jan 15 2018 23:15
we don't know in detail.... just got a report from @sfcgeorge that code which was working with const_get(xxx, false) or perhaps const_defined? stopped working in 11, until he changed false to true.
that is all I know ATM
Elia Schito
@elia
Jan 15 2018 23:19
@catmando ok, that could be a collateral effect of the improved behavior, @sfcgeorge let me know what's that, if it's an actual issue I'd like to look into it
Mitch VanDuyn
@catmando
Jan 15 2018 23:21
@elia is there any way to run try opal on older versions?
Simon George
@sfcgeorge
Jan 15 2018 23:27

A version selector on Try Opal would be amazingly helpful.

In this case I just know that making the second parameter true made something work in 0.11 that had worked in 0.10. I don't know which one the bug is in though, just because it worked before doesn't mean it was working as intended.

Elia Schito
@elia
Jan 15 2018 23:30
@catmando no, but you can run the CLI on any installed version with opal _0.10.5_ -e 'p RUBY_ENGINE_VERSION'
@sfcgeorge yeah, 0.11 catched a bunch of errors in one of my apps
Mitch VanDuyn
@catmando
Jan 15 2018 23:33
@elia :-) I have never used the CLI
I will try it now :-)
is there an opal irb ?
Mitch VanDuyn
@catmando
Jan 15 2018 23:45
@elia - just using some simple tests I can see no behavior change...
Elia Schito
@elia
Jan 15 2018 23:52
@catmando there's opal-repl, it needs thrubyracer IIRC