<chesterbr>
Hi! Anyone here is using the latest Opal master? I'm having a hard time matching versions with opal-rspec and opal-sprockets (which seems to be locked to 0.5.x, but master is 0.6.0)
<chesterbr>
can check out and change version requirements on gemspecs, but first wanted to check if this is the right thing to do :-)
e_dub has joined #opal
e_dub has quit [Quit: It's a hard knock life]
<chesterbr>
ah, chat logs pointed me to opal-rspec '0.3.0.betaX'. That allowed me to run the build task, but the rake breaks at the first require of spec_helper...
<chesterbr>
...which made me realize I can't require 3rd party gems on my specs, unless there is a special trick for that. Well, will try to do without them. FWIW, I'm trying to make https://github.com/chesterbr/ruby2600/tree/opal run in Opal (currently can boot Pitfall!, but crashes and I need the specs to figure out why)
chesterbr has quit [Quit: chesterbr]
e_dub has joined #opal
e_dub has quit [Client Quit]
<ryanstout>
chesterbr: I'm running opal-rspec 0.3.0.beta2 on a project. Maybe its something in spec_helper causing it to fail?
ryanstout has quit [Quit: ryanstout]
dimaursu16 has joined #opal
dleedev has joined #opal
RoxasShadowRS has joined #opal
elia has joined #opal
wmnnd has joined #opal
dimaursu16 has quit [Ping timeout: 245 seconds]
dimaursu16 has joined #opal
RoxasShadow has joined #opal
RoxasShadowRS has quit [Ping timeout: 245 seconds]
RoxasShadow has quit [Quit: Leaving]
RoxasShadowRS has joined #opal
kludge` has quit [Ping timeout: 272 seconds]
kludge` has joined #opal
<adambeynon>
elia: how much benefit would you find in being able to call methods on js objects directly?
<adambeynon>
and getting/setting properties
<adambeynon>
(im thinking opal-jquery being a good example of something that could be removed)
<elia>
err, re-reading to understand
<elia>
adambeynon, k, :) so what you're scheming?
<adambeynon>
elia: a method call would compile without a '$' prefix
<adambeynon>
#[] and #[]= would be "special methods"
<elia>
adambeynon, anyway having that ability would make things a lot easier
<adambeynon>
elia: the only problem I have atm is having nil == null
<adambeynon>
I think that is too difficult
<elia>
lower the barrier, so even if now I don't feel pressure by not being able to do that seems good idea
<elia>
adambeynon, on the other side depends on the details
<elia>
adambeynon, what would be the impl?
<adambeynon>
elia: well, there are always gotchas :)
<adambeynon>
we would have to special case a lot of methods, i.e. ones that might clash on Array.prototype
<adambeynon>
Array#push acts differently to Array.prototype.push
<adambeynon>
two options: either a runtime helper method for special methods
<fkchang>
adambeynon: meh` any notions on where source/comments lookups will be, now that I've embedded opal-irb into a lissio app, I have the momentum to add opal-inspector features
<meh`>
no clue here
<fkchang>
meh`: did I remember right that adambeynon delegated that to you?
<meh`>
nope, still on him
DrShoggoth has joined #opal
<elia>
adambeynon, <3 infect
<adambeynon>
elia: :D since ryanstout posted his react stuff, I have been adding some bits of observable objects/arrays, also inspired by cocoa keyvalueobserving
<adambeynon>
elia: I will post it soon
<adambeynon>
buts its really slick
<elia>
adambeynon, what react stuff?
* elia
browses ryanstout gh profile
<adambeynon>
elia: yep. Im not using his stuff (didnt have time to learn it), but same idea
<adambeynon>
but instead of wrapper objects, you can observe changes to an actual array instance
<adambeynon>
[1,2,3, 4].add_observer(:empty?) { puts "array is now empty" }
<adambeynon>
that kinda thing
<adambeynon>
useful for hooking up dom changes to reflect models
<elia>
adambeynon, do you have any pointers, can't find anything among his repos
<adambeynon>
I haven't had a chance to actually use it yet, so hopefully the weekend will let me explore it a little more
<adambeynon>
hes american though, so im never around when hes online to ask him about it :/
ryanstout has joined #opal
e_dub has joined #opal
<fkchang>
adambeynon: any thoughts on code/comment lookup? I thought there was a gist you wanted to show me a little while back.
<fkchang>
I think I'm itching to add some light table inspired goodness into opal-inspector
<adambeynon>
fkchang: I scrapped the old stuff - it was very hacky. The compiler now is also much better as it doesnt destroy the old sexp tree
<adambeynon>
I think its a better idea to walk that sexp tree instead
<adambeynon>
and look for each class, module and def
<adambeynon>
each sexp has the line number and source file
<adambeynon>
so we can track back from there
<adambeynon>
keep a stack of where we are
<adambeynon>
each time we enter a module or class
<adambeynon>
dynamic methods might be tricky
<adambeynon>
but, attr_accessor and friends will be easy to find
<adambeynon>
if sexp.type == :call and sexp[1] == :attr_accessor; ... ; end
<adambeynon>
I think it would be safe to assume attr_accessor doesnt get overriden
<adambeynon>
fkchang: whether or not I can work on a full implementation is a different matter, but I can write a simple proof of concept extension to the compiler which should get you on your way
<adambeynon>
you can then take that and work out what is the best json format to export
<adambeynon>
fkchang: I am also not sure how you would integrate with Opal::Server and/or rails server and/or lissio server
<adambeynon>
I would think basing it on sourcemaps would be a good idea
<adambeynon>
i.e. a rack middleware that can be mounted
<adambeynon>
like we have /__opal_source_maps/* we could have /__opal_code_inspector/* or something
<fkchang>
adambeynon: the rack/ __opal_code_inspector__ seems like a good approach. On the front end, I anticipate "caching" that info, as the stuff you change in the browser would take precedence over what's on the server. By the same measure need a mechanism to push changes back to the server -- in my mind I sort of saw some sort of diff/pull request-ish mechanism that a user could ultimately accept or reject
<fkchang>
on the nature "like source maps", isn't source maps almost the same basic notion, i.e. give me opal code for this bit of js, where we'd pass it code "entitye" (i.e. method, inst variable) index instead of at file/line blah
<fkchang>
adambeynon: on the browser side, I imagine we'd use the same sexp walking mechanism. Maybe it's easier to work out the client side that will do that on the client side in a rudimentary form, and I can start with that w/the eventuality that it will pull in code from the server down the road, but that'd allow me to have an interface and at least show off functionality w/code written from within the browser
<ryanstout>
fkchang: I have been looking at integrating opal-orb into Volt. I was hoping to make it so you could hit ESC or something to get the console. Is there a good way to load it in after the initial page load?
<ryanstout>
fkchang: like I just need the files included from OpalIrbUtils.include_opal_irb_jqconsole_requirements and then load an opal file with required jqconsole, opal_irb_jqconsole_css and opal_irb_jqconsole>
<fkchang>
ryanstout: if you look at the lissio intergration, you could probably do the something very similar to those. I can spike a way to default it hidden response to the esc
<ryanstout>
fkchang: I mostly just don't want to have to pay the cost of loading opal-parser unless its necessary
<ryanstout>
hence wanting to only load it when requested
<fkchang>
I tried to make it loadable solely via code, but I could sync the loading of external js (meh` adambeynon this was my question from 2 days ago ) to be right -- it'd be nice to be able to load it all on demand
Kilo`byte has quit [Max SendQ exceeded]
<fkchang>
ryanstout: how about bringing up an iframe that loads all that stuff, though I'm not sure that we can see the js engine from the parent widnow
<ryanstout>
fkchang: interesting idea, it would be tricky to have to always do `parent`
<ryanstout>
`window.parent`
<ryanstout>
fkchang: basically though, if I find a way to load all of that after the fact and figure out when its loaded, that would work right?
Kilo`byte has joined #opal
<fkchang>
ryanstout: it should work if you can get it loaded
dleedev has quit [Quit: dleedev]
dleedev has joined #opal
dleedev has quit [Client Quit]
<ryanstout>
fkchang: cool, thanks for the help
<fkchang>
ryanstout: sure
<ryanstout>
question, has anyone tested the opal compiler for thread saftey
<ryanstout>
I'm seeing a weird issue sometimes when loading two pages at once
<ryanstout>
sprockets is returning: throw Error("EOFError: end of file reached")
<ryanstout>
in my .js file (which is loading an opal file)
ryanstout has quit [Quit: ryanstout]
ryanstout has joined #opal
edub has quit [Quit: It's a hard knock life]
<meh`>
ryanstout, no thread safety
<meh`>
javascript is not threaded
<meh`>
no wait
<meh`>
the compiler
<meh`>
disregard everything :D
<ryanstout>
meh`: yea, the compiler
<ryanstout>
it could be sprockets also
<meh`>
from what I remember, it shouldn't be a problem
Steve445 has joined #opal
<Steve445>
Meh online?
<Steve445>
Meh: online?
<meh`>
Steve445, yeah, I'm here
<Steve445>
Hey. StepheOTT from github. Just wanted to follow up real quick on my question from Lissio repo
<Steve445>
about the lissio new command that is in the read me
<meh`>
Steve445, did you install the gem from github?
<Steve445>
Yes
<meh`>
is it giving any error?
<Steve445>
But terminal is not picking it up after install
<meh`>
oh, are you sure you have the gem binaries path in your PATH?
<Steve445>
mmmm. thats prob it. Was expecting it to be pre-configured