<elia>
anything against picking up <script type="text/ruby"> synchronously? cc: ylluminate
<elia>
adambeynon, I'm mean those with the src attribute
DouweM has quit [Quit: Leaving...]
<adambeynon>
elia: hi. Yeah that sounds fine to me
<adambeynon>
What about requires inside them
<adambeynon>
Worth attempting to handle?
<elia>
adambeynon, first thing to do about requires is to route them to Kernel#require and give it an empty implementation that ppl can override to their taste
<elia>
sync,async,experiments,node,requirejs, then we'll see
<elia>
I'd like to work on the real-req branch this sat
<elia>
adambeynon, you think you can do that by then?
<elia>
btw to answer your original question I think we can skip them for now and make as few assumptions as possible
<elia>
otherwise we would need to support a bunch of configurations like assets host, basic authentication, and who knows what else
* ylluminate
gives thumbs up on require inside as well, but yes, anything to get a quick inclusion right now is a big win.
<ylluminate>
i think too that this would help to facilitate a quicker integration into jsbin, no?
<ylluminate>
thanks guys
<adambeynon>
elia: what were your thoughts on requiring the "main" file in rails/sprockets apps?
<elia>
adambeynon, basically copying sassimporter
<adambeynon>
ahh, forgot about that. Will read that source to get an idea
<elia>
requires inside ruby won't any longer be managed by sprockets
<elia>
but sprockets will still be notified of the dependencies (depend_on)
<elia>
adambeynon, take a look at sassimporter
e_dub has joined #opal
ryanstout has joined #opal
<adambeynon>
elia: on a sidenote, sprockets has a nice cache class that we could possibly make use of for our sourcemaps
<adambeynon>
instead of the current global variable
<travis-ci>
[travis-ci] opal/opal#1765 (master - 2714aaf : Elia Schito): The build was fixed.
<ryanstout>
would it be possible to optionally do an AST transform to make require’s async. You could make it so a require transforms into require ‘path’ do … end with all of the code after the require being inside the do / end
<ryanstout>
just throwing that out, probably isn’t simple or possible :-)
<elia>
ryanstout, probably easier with top file requires (but I'm just guessing)
<ryanstout>
yea
<ryanstout>
probably couldn’t work except with those
<ryanstout>
though maybe it could
<elia>
plans are primarily for static requires tho
<elia>
the most important things are two
<elia>
1. get Kernel#require called
<elia>
2. get stuff loaded in the right order/place
<ryanstout>
yea
<elia>
so the compiler will accumulate code inside some Opal.modules = {}
<elia>
and then Kernel#require gets stuff from there at runtime
<ryanstout>
thats a good idea
<ryanstout>
so the require still happens and can be over-ridden
<elia>
right, hooks are a good thing
<elia>
then a Kernel#async_require is still possible imo: e.g. `require_async 'foo.rb', 'bar.rb' do … end`
<elia>
but also really platform dependent
<ryanstout>
yea
elia has quit [Quit: Computer has gone to sleep.]
<adambeynon>
ryanstout: I have looked at making opal requires into an async
<adambeynon>
make them compile into an AMD style thingy
<ryanstout>
adambeynon: yea?
<adambeynon>
but yeah, only works top level
<adambeynon>
which is still pretty useful
<ryanstout>
yea, for me that would be useful
<adambeynon>
ryanstout: I think we could actually just handle the top level ones automatically (using some requirejs/amd style syntax) and then just leave the other ones (inside methods, dynamic etc) to revert to Kernel#require
<ryanstout>
yea
<adambeynon>
would make opalrb.org/try more useful so we could pull in stdlib as well
<ryanstout>
in volt I’m just using top level’s
e_dub has quit [Ping timeout: 268 seconds]
e_dub has joined #opal
ch007m has quit [Ping timeout: 246 seconds]
ch007m has joined #opal
meh` has joined #opal
ch007m has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mieko>
adambeynon: I threw together a toy a few days that added a "coverage call" prelude to every method body (ala gprof). After execution, I had a hash in Opal.coverage showing which methods were actually executed during the run. How crazy would it be to feed that back into the compiler as a white list, and selectively omit method definitions?
<mieko>
Of course, one would have to be sure to have a test suite that gets absolutely full coverage.
<ryanstout>
mieko: I’ve thought about doing the same thing, sounds really cool
<ryanstout>
dead code eliminiation
<ryanstout>
getting that kind of coverage is really tricky though. it would be nice if you could remove the code and load it on demand if it does end up being needed
<mieko>
Yeah, considering the runtime nature of it, I likened it to profile-guided optimization, but with a really sharp edge.
<ryanstout>
yea
<mieko>
ryanstout: That'd be a method_missing from hell.
<ryanstout>
yea, I was thinking of doing it at the class level
<mieko>
Haha, I happened to catch the first one a few hours after you posted it. Looks awesome.
<ryanstout>
mieko: ok, wasn’t sure if you were around back then :-)
<ryanstout>
its almost ready to start building production apps on it
<ryanstout>
mieko: anyway, the post on that page is great, sums up a lot of my thoughts
DrShoggoth has joined #opal
<mieko>
ryanstout: Apparently I've drank enough Opal kool-aid this week that I'd rather spend 3 hours hacking Opal than write a single-line workaround in my code.
<mieko>
meh`: Lissio looks a lot like the mini-MV* we're building to replace our backbone monstrosity (piece by piece). I haven't had a chance to look far into it, but I was curious how much Application/routing all-in it requires.
<mieko>
Vs. "Here's some JSON or a URI, here's a DOM element, do your thing"
elia has joined #opal
<meh`>
mieko, well, it's split up, if you don't need routing, you don't have to use it
dimaursu16 has quit [Ping timeout: 240 seconds]
<meh`>
mieko, the fancy stuff are models, adapters and components
<meh`>
mieko, if you have specific questions ask them, I'll answer to them in a bit
dimaursu16 has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
<ryanstout>
when using opal, does anyone have it where chrome won’t bring up the JS file from a JS error?
DouweM has joined #opal
<elia>
ryanstout, probably sourcemaps related
<ryanstout>
elia: sourcemaps are off
<ryanstout>
it happens at least 70% of the time for me
<ryanstout>
if its not happening for anyone else, it must be something I’m doing