These are chat archives for opal/opal

10th
Jul 2018
Jamie Gaskins
@jgaskins
Jul 10 2018 13:34
Is there a new way to load JS dependencies on master? Clearwater loads virtual-dom as a JS library (vendored into opal/) by just requiring it, and that works fine in v0.11.1.pre, but that seems to have changed on master. I now get LoadError: cannot load such file -- clearwater/virtual_dom/js/virtual_dom
Elia Schito
@elia
Jul 10 2018 13:35
@jgaskins I'll look into it, can you please open an issue as a reminder?
Jamie Gaskins
@jgaskins
Jul 10 2018 13:35
Sure thing. I was just wondering if anyone knew off the top of their head. :-)
Elia Schito
@elia
Jul 10 2018 13:36
I changed stuff related to filenames in master to have better error messages that point to real paths instead of "logical"/internal ones
I'm quite sure there's still some rough edge to smooth out for vanilla js files
btw, vanilla js files were never required when you "#require" them (there's no relialbe require-system for js), but it was just a signal to include them into the bundle (the same as sprockets' //= require … directive)
Jamie Gaskins
@jgaskins
Jul 10 2018 13:46
Ahhh, okay, cool. I was wondering why it wasn't in Opal.modules
I kept thinking "how does this even work?!" :-D
Elia Schito
@elia
Jul 10 2018 13:47
yeah :smile: that seemed the most sensible way to do it, the same treatment is reserved for corelib/runtime.js
Jamie Gaskins
@jgaskins
Jul 10 2018 13:48
in that case, I imagine the check for the key in Opal.modules that was being ignored before for JS files is now being enforced?
Elia Schito
@elia
Jul 10 2018 13:50
yeah, they used to be marked as already loaded (which was technically true) so that the require would run smoothly
Jamie Gaskins
@jgaskins
Jul 10 2018 13:51
ahh, the return false short circuit
cool
Elia Schito
@elia
Jul 10 2018 13:52
yep, look for Opal.loaded or something similar if you want to dig in