<ryanstout>
so maybe its a path issue, because it will load the .map files if I request them, but its just not showing up in chrome
<ryanstout>
so it looks like its only trying to request the map for helpers.js.map
<ryanstout>
but my other opal files have this stuff in them: //@ sourceMappingURL=/__opal_source_maps__/templates/page.js.map
<adambeynon>
maybe they are loaded lazily ... like only when you trace errors/lines etc
<adambeynon>
I only look at them using `debugger` statements
<ryanstout>
let me try that
<ryanstout>
CMD+SHIFT+R clears the page cache right?
<adambeynon>
yes, I think thats it
<ryanstout>
humm, no luck
<ryanstout>
its strange, seems like everything needed is working
<ryanstout>
so looks like /__opal_source_maps__/corelib/helpers.js.map is the first one in the file.
<adambeynon>
ohhhh, its loading them all inside one js file?
<adambeynon>
that could be the problem
<adambeynon>
well, it is the problem
<ryanstout>
its one .rb file that requires a bunch of others
<adambeynon>
how many .js files are actually served?
<ryanstout>
1
<adambeynon>
yeah, it will only load one source map per .js file
<adambeynon>
the Opal::Server has a #debug property
<adambeynon>
are you using the server directly?
<ryanstout>
I'm using it directly from Opal::Environment.new, then I copied the SourceMap class
<ryanstout>
I didn't want the default index page, so I couldn't use Opal::Server
<ryanstout>
do you think opal will support multiple files on source maps?
<adambeynon>
well, there are other ruby tools which can do that
<adambeynon>
I cant remeber their name
<adambeynon>
remember*
<ryanstout>
sorry, maybe we're not talking about the same thing
<ryanstout>
I know in source map's, you can see the individual files from concatenated files. Seeing as how the require's are basically concatenating, I would assume it could just show the individual required files.
<adambeynon>
I think it would be too tricky for the way sprockets works
<adambeynon>
sprockets in Opal::SErver handles each ruby file in its own <script> tag
<adambeynon>
so the source maps load properly
<ryanstout>
ok
<ryanstout>
so maybe I'll make it add each script tag in dev
<ryanstout>
adambeynon: thanks for the help
<ryanstout>
having them in separate files makes for a ton of requests and a super long page load time. (went from instant to 4+ seconds)
<ryanstout>
any idea if its something I could patch sprockets to support?
<ryanstout>
actually, it said it took 9sec
<adambeynon>
should be quicker on the second load, I think
<ryanstout>
still 2.5 seconds
<ryanstout>
I know its only in dev, but that still seems like a long time
elia has joined #opal
<ryanstout>
ok, so if I use the debug option on Opal::Server, and do requires, it spits out the required file as a separate file, but the file it was required from also has it included as well.
<ryanstout>
which probably explains the high page load
<adambeynon>
what does your index page look like?
<ryanstout>
you mean html wise?
<adambeynon>
yep
<ryanstout>
its doing a separate JS file for each require
<ryanstout>
sorry, never mind, I figured it out
<ryanstout>
weirdly its a 4 second load on the 2nd loads now (13 seconds on first load)
<ryanstout>
(not trying to complain, just trying to get a sense if there's something I can do to improve it)
<adambeynon>
that seems really long. usually on the apps I write, the first load is 4-6 secons, and the second/third/etc loads are less than a second
<ryanstout>
let me remove all of my code and see how long it takes just loading opal
<adambeynon>
ryanstout: check to make sure the page cache is enabled in chrome
<adambeynon>
sprockets should do caching anyway
<adambeynon>
but just in case
<ryanstout>
adambeynon: page cache in chrome?
<ryanstout>
or is there something in sprockets?
<ryanstout>
yea, 6.2s for just opal
<ryanstout>
(with source maps)
<ryanstout>
1.39 after cache
<ryanstout>
I'm on a fast new i7
<ryanstout>
MBP
<ryanstout>
so I guess for sprockets to support concatenated source maps, it would have to convert the source map from each file and move the line/char numbers up based on where it ended up in the concatenated file?
<adambeynon>
yes, but sprockets doesnt have any sourcemap support. Thats why we need the special Opal::Server which does it all manually
<adambeynon>
I think sprockets master branch has basic support
<adambeynon>
but no releases for it
<adambeynon>
(I think)
<ryanstout>
yea, I saw that
elia has quit [Quit: Computer has gone to sleep.]
<ryanstout>
ok, well maybe I'll have to dig into the sprockets source a bit more
<ryanstout>
again, thanks for the help
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
<ryanstout>
adambeynon: does any_instance.stub work in opal-rspec?
<adambeynon>
ryanstout: haven't tried it. It does use rspec3 though, and they did change a lot of the mocking system for rspec3
<adambeynon>
double() etc works fine.
<ryanstout>
ok, didn't realize it was on 3
<ryanstout>
I have it running both in mri and opal, so I'll upgrade the mri ones and see if it works
<adambeynon>
2 was actually a lot trickier to get working, so I skipped to 3
<ryanstout>
good plan
<ryanstout>
yea, 2 was a mess
<ryanstout>
(under the hood)
<ryanstout>
I didn't realize the .should syntax was getting deprecated