These are chat archives for opal/opal

13th
Mar 2016
Elia Schito
@elia
Mar 13 2016 00:49
@cj ping, can I help?
CJ Lazell
@cj
Mar 13 2016 16:43
@elia I'd love some help, just let me know when you're around :)
my main thing is right now I have to do this https://gist.github.com/4244aae55f5418a43eaf and I was wondering what the best way to make require handle it. in the compiler or just extend require
Elia Schito
@elia
Mar 13 2016 17:10
@cj so what is the context? webpack or is that the require from node?
CJ Lazell
@cj
Mar 13 2016 17:11
this is in the .rb file loaded through webpack and opalrb-loader
let me push the code up
I also updated opalrb-loader to 0.9.2
using the regular ruby require for some reason doesn't hot reload with wbepack
CJ Lazell
@cj
Mar 13 2016 17:18
also it looks like Opal.normalize_loadable_path is no longer used
Elia Schito
@elia
Mar 13 2016 17:19
the name is shorter now, like normalize, but I need to check…
CJ Lazell
@cj
Mar 13 2016 17:20
@elia so check this http://local.sh:3000/ to get an idea of what I'm doing... let me know when you are looking
elia @elia is looking
Elia Schito
@elia
Mar 13 2016 17:22
cool stuff
CJ Lazell
@cj
Mar 13 2016 17:22
yee, it's insainly quick
works with newly created files and everything
Elia Schito
@elia
Mar 13 2016 17:23
so, about the require thing, I thnk it's better to override like rubygems does
CJ Lazell
@cj
Mar 13 2016 17:26
so I tried overriding it, but it didn't seem to like it
is the update loaded
er*
https://github.com/cj/opalrb-loader/blob/master/index.es6.js#L79 is what needs to be change to work with 0.9.2
you can drop the normalize part which is now embedded
CJ Lazell
@cj
Mar 13 2016 17:29
k, let me try that
CJ Lazell
@cj
Mar 13 2016 17:37
@elia so would you just extend require by doing def require(*args) extra code; super end ?
Elia Schito
@elia
Mar 13 2016 17:38
Yes, probably you should use some alias trick
the alternative is to have a different method, but was probably unpractical
CJ Lazell
@cj
Mar 13 2016 17:40
yee, I'm trying to make it use one code base for most things
I'm also running into this when doing require_relative https://gist.github.com/7be66a99438cebcea043
Elia Schito
@elia
Mar 13 2016 17:52
@cj what's the original code?
CJ Lazell
@cj
Mar 13 2016 17:53
for the compile it's https://github.com/cj/opalrb-loader/blob/master/compiler.rb (according to the docs it doesn't supposed require_tree yet, so I'm thinking that's the issue maybe)
Elia Schito
@elia
Mar 13 2016 17:53
could be
is it compiling everything through node?
(don't know webpack very well)
CJ Lazell
@cj
Mar 13 2016 18:02
yee, I can't alias the require because opal gives me the error cann't handle dynamic requires
Elia Schito
@elia
Mar 13 2016 18:03
you need to config it with ignore
should be done when passing options to the compiler
gotta go
CJ Lazell
@cj
Mar 13 2016 18:04
o really... what's the option?
doh, ok... laters :)
found it, thank you again
nodecraic
@webworkio
Mar 13 2016 18:27
hey, if anyone has any remote remote , designer, DevOps or Sysadmin jobs they can post them at http://webwork.io
CJ Lazell
@cj
Mar 13 2016 18:34
any ideas why I'd be getting this error? http://prntscr.com/aessii