meh` changed the topic of #opal to: http://opalrb.org - Ruby runtime and library on top of Javascript | 1.0.0 is near | This channel is logged at https://botbot.me/freenode/opal/
<fkchang> meh`: I defined in the class, with the update, my code is broken, so I need to track that down to see if anythings changed wrt inheritance
<meh`> snap, sorry about that
GitHub146 has joined #opal
<GitHub146> [lissio] meh pushed 2 new commits to master: http://git.io/8P2hQw
<GitHub146> lissio/master c1d9b86 meh: component: improve inheritance generation
GitHub146 has left #opal [#opal]
<GitHub146> lissio/master ac724e0 meh: component: allow #tag to define other attributes
<meh`> fkchang, ok, now you can define other attributes with #tag
GitHub170 has joined #opal
GitHub170 has left #opal [#opal]
<GitHub170> lissio/master 6c6f8eb meh: component: update selector generation
<GitHub170> [lissio] meh pushed 1 new commit to master: http://git.io/OQ-lig
<meh`> fkchang, and the internally generated classes will be better looking if they're not anonymous classes
<fkchang> ok, I'll pull that and see, seems like my fail is in the middle of lissio code
<meh`> fkchang, if you can give me a stacktrace or something I'll probably figure it out
<meh`> all my stuff is working on latest tho
<fkchang> Uncaught NoMethodError: undefined method `each' for nil app.js:2551
<fkchang> (anonymous function) app.js:2551
<fkchang> def.$method_missing.TMP_1 app.js:1738
<fkchang> def.$raise app.js:2240
<fkchang> method_missing_stub app.js:466
<fkchang> def.$element.$c._p.TMP_18 app.js:21428
<fkchang> Opal.$yield1 app.js:582
<fkchang> def.$each.TMP_6 app.js:5398
<fkchang> def.$element app.js:21428
<fkchang> $opal.defs.$a._p.TMP_9 app.js:21308
<fkchang> $opal.defn.TMP_3 app.js:1708
<fkchang> $opal.defs.$a._p.TMP_7 app.js:21295
<fkchang> $a._p.TMP_27 app.js:21480
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> $opal.defs.$a._p.TMP_3 app.js:19232
<meh`> you sure you're calling super everywhere?
<fkchang> Opal.$yield1 app.js:575
<fkchang> def.$each.TMP_3 app.js:6743
<meh`> sounds like an @events setup failure
<fkchang> (anonymous function) app.js:19235
<fkchang> $a._p.$a._p.TMP_11 app.js:19283
<fkchang> Opal.$yield1 app.js:582
<fkchang> def.$each.TMP_6 app.js:5398
<fkchang> def.$each.TMP_2 app.js:11850
<fkchang> $a._p.TMP_8 app.js:19283
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> $opal.defs.$a._p.TMP_3 app.js:19232
<fkchang> Opal.$yield1 app.js:575
<fkchang> def.$each.TMP_3 app.js:6743
<fkchang> (anonymous function) app.js:19235
<fkchang> def.$initialize.self.roots.$a._p.TMP_5 app.js:19250
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$collect.self.$each._p app.js:3062
<fkchang> Opal.$yield1 app.js:582
<fkchang> def.$each.TMP_6 app.js:5398
<fkchang> $opal.defn.TMP_1 app.js:1656
<fkchang> def.$each.TMP_3 app.js:4270
<fkchang> def.$collect.TMP_4 app.js:3072
<fkchang> def.$initialize.TMP_4 app.js:19250
<fkchang> def.$new.TMP_2 app.js:1606
<fkchang> def.$inner_dom.TMP_4 app.js:18710
<fkchang> $opal.defs.$a._p.TMP_9 app.js:21309
<fkchang> $opal.defn.TMP_3 app.js:1708
<fkchang> $opal.defs.$a._p.TMP_7 app.js:21295
<fkchang> def.$start app.js:21617
<fkchang> $opal.defn.TMP_1 app.js:1656
<fkchang> $opal.defs.$a._p.TMP_4 app.js:21592
<fkchang> $opal.defs.$a._p.TMP_2 app.js:21576
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> def.$ready.$a._p.TMP_2 app.js:19063
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> def.$to_proc.self.proc.$b._p.TMP_7
<fkchang> could be, I'll check, it seems to be this line
<fkchang> return item.$render()}, TMP_27._s = self, TMP_27), $a).call($b, (($c = $scope.Component) == null ? $opal.cm('Component') : $c));
<fkchang>
<fkchang> I lied, my spike that I did w/lissio and jubilee had super everywhere, this one, which is practice for my preso didn't
DrShoggoth has quit [Quit: Leaving]
<meh`> yeah, I'm not sure having super everywhere is the best way to go
<fkchang> so now I'm farther, but the error is
<fkchang> Uncaught TypeError: Object Unstarted has no method '$element' app.js:21397
<fkchang> (anonymous function) app.js:21397
<fkchang> def.$element app.js:21400
barry__ has quit [Remote host closed the connection]
<fkchang> $a._p.TMP_9 app.js:21308
<fkchang> $opal.defn.TMP_3 app.js:1708
<fkchang> $a._p.TMP_7 app.js:21295
<fkchang> $a._p.TMP_27 app.js:21480
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> $a._p.TMP_3 app.js:19232
<fkchang> Opal.$yield1 app.js:575
barry has joined #opal
<fkchang> def.$each.TMP_3 app.js:6743
<fkchang> (anonymous function) app.js:19235
<fkchang> $a._p.TMP_11 app.js:19283
<fkchang> Opal.$yield1 app.js:582
<fkchang> def.$each.TMP_6 app.js:5398
<fkchang> def.$each.TMP_2 app.js:11850
<fkchang> $a._p.TMP_8 app.js:19283
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> $a._p.TMP_3 app.js:19232
<fkchang> Opal.$yield1 app.js:575
<fkchang> def.$each.TMP_3 app.js:6743
<fkchang> (anonymous function) app.js:19235
<fkchang> self.roots.$a._p.TMP_5 app.js:19250
<fkchang> Opal.$yieldX app.js:602
<fkchang> self.$each._p app.js:3062
<fkchang> Opal.$yield1 app.js:582
<fkchang> def.$each.TMP_6 app.js:5398
<fkchang> $opal.defn.TMP_1 app.js:1656
<fkchang> def.$each.TMP_3 app.js:4270
<fkchang> def.$collect.TMP_4 app.js:3072
<fkchang> def.$initialize.TMP_4 app.js:19250
<fkchang> def.$new.TMP_2 app.js:1606
<fkchang> def.$inner_dom.TMP_4 app.js:18710
<fkchang> $a._p.TMP_9 app.js:21309
<fkchang> $opal.defn.TMP_3 app.js:1708
<fkchang> $a._p.TMP_7 app.js:21295
<fkchang> def.$start app.js:21617
<fkchang> $opal.defn.TMP_1 app.js:1656
<fkchang> $a._p.TMP_4 app.js:21592
<fkchang> $a._p.TMP_2 app.js:21576
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> $a._p.TMP_2 app.js:19063
<fkchang> Opal.$yieldX app.js:602
<fkchang> def.$call.TMP_2 app.js:9459
<fkchang> self.proc.$b._p.TMP_7 app.js:13441
<fkchang> looks like here
<fkchang> def.$element = function() {
<fkchang> var $a, $b, $c, $d, TMP_17, $e, TMP_18, self = this, scope = nil, elem = nil;
<fkchang> if ((($a = self.element) !== nil && (!$a._isBoolean || $a == true))) {
<fkchang> return self.element};
<fkchang> scope = (function() {if ((($a = self.$parent()) !== nil && (!$a._isBoolean || $a == true))) {
<fkchang> return self.$parent().$element()
<fkchang> So I'd guess inheritance, of some sort, maybe coz I use tag and not element?
<meh`> no
<meh`> is Unstarted a class?
barry has quit [Read error: Operation timed out]
<meh`> no wait, I think I know
<meh`> it's again, a super bug
<meh`> this is retarded
<meh`> fkchang, basically, you're doing super instead of super()
<meh`> and it's setting the string "unstarted" or "Unstarted" or a class, or something, as the parent
<meh`> I have to document this, or choose a better way to handle it all
<meh`> either remove the parent business
<meh`> which I never used anyway
<meh`> yeah, fuck this
barry has joined #opal
<meh`> no super
barry has quit [Remote host closed the connection]
<fkchang> meh`: right, I correctly called super() on 1 of my classes, and not on the other, thx
<meh`> fkchang, yeah but disregard all the super business
<meh`> I'm removing it, it's too prone to errors
<meh`> an accessor is easier
<meh`> if you want to set the parent, you just set @parent
<meh`> or self.parent =
<meh`> and it will be used
<fkchang> as in class to inherit from?
<meh`> no
<meh`> basically
<meh`> Component.new(parent)
<meh`> parent is used to find the scope of the element
<meh`> now you can set the parent scope to look for #element directly from the class
<meh`> this removes the need to call super through all the chain
<fkchang> what will the default be?
<meh`> nil, as is now
<meh`> nothing changes
<meh`> except if you were relying on the parent business
<meh`> but I doubt it
<fkchang> btw, my on :click from the child propagating in to the parent is still there
<meh`> and that is
<meh`> wait
<meh`> not
<meh`> mmh
<meh`> fkchang, so you have Foo and Bar < Foo, you define a :click on Foo and one on Bar, and if you create a Foo both the Foo and Bar :click get called'
<meh`> ?
<fkchang> yes, for both classes
<meh`> are you 100% sure it's a Foo instance and not a Bar instance?
<fkchang> it's both, I have a card (yellow) and a bug card (red), click on both of them, and they both do both click events
GitHub150 has joined #opal
GitHub150 has left #opal [#opal]
<GitHub150> [lissio] meh pushed 1 new commit to master: http://git.io/lXeR-Q
<GitHub150> lissio/master fb2e297 meh: component: remove the super monkey business
dleedev has joined #opal
<fkchang> and BugCard < Card
<meh`> fkchang, yeah, I'm trying to make a reduced testcase, give me a few
<meh`> oook
<meh`> I can reproduce it
<meh`> this is weird
<meh`> this can only mean something
<meh`> way more worrying
<meh`> ok, no
<meh`> this doesn't make any sense at all
<meh`> lol
<meh`> fuck
<meh`> fkchang, okay, found it
<meh`> fkchang, I should do a deep copy instead of a shallow one
<meh`> too bad there's no #deep_dup in opal-activesupport
<meh`> snab
<meh`> guess there's no other way
GitHub6 has joined #opal
<GitHub6> lissio/master 934a6c5 meh: component: deep clone @events and @tag
<GitHub6> lissio/master 48113a7 meh: component: fix selector generation
GitHub6 has left #opal [#opal]
<GitHub6> [lissio] meh pushed 2 new commits to master: http://git.io/tF0QUA
<meh`> fkchang, ^
<meh`> should be fixed now
GitHub158 has joined #opal
<GitHub158> lissio/master e693eba meh: component: more inheritance chain improvements
<GitHub158> [lissio] meh pushed 1 new commit to master: http://git.io/AzDrYQ
GitHub158 has left #opal [#opal]
<fkchang> meh`: thx
<fkchang> meh`: how come this doesn't work for @background
<fkchang> class BugCard < Card
<fkchang> tag class: [:card, "bug-card"]
<fkchang>
<fkchang> def initialize(card_model)
<fkchang> @background = :red
<fkchang> super
<fkchang> end
<fkchang> css do
<fkchang> background @background
<fkchang> end
<fkchang>
<fkchang> def unhighlight
<fkchang> element.style { background @background}
<fkchang> end
<fkchang> end
<fkchang>
<fkchang> meh`: but I'll say the on :click inheritance is fixed
<fkchang> meh`: though I expected the subclass to inherit the additional attributes in the tag card, i.e. I did a tag class: card, :draggable => "true" in Card, and just a tag class: [:card, "bug-card"], I expected it to inherit , :draggable => "true", which it did before the deep copy
<dleedev> how do you manipulate DOM in opal?
<fkchang> dleedev: you could do it through opal-browser or opal-jquery
<dleedev> ah, thanks
<dleedev> is opal-jquery a binding into jquery.js, or is it a jquery-ish library in opal?
<fkchang> it's a ruby binding, the interface is more rubylike that a straight wrapping, which I think is a good thing
<fkchang> Document.ready? do
<fkchang> blah
<fkchang> end
barry has joined #opal
barry has quit [Ping timeout: 252 seconds]
fkchang has quit [Remote host closed the connection]
<dleedev> is there something like pry for opal?
RoxasShadowRS has quit [Read error: Connection reset by peer]
marcandre has joined #opal
e_dub has joined #opal
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
<dleedev> > opal-repl myscript.rb
<dleedev> Could not find asset: opal-browser
<dleedev> I built and installed the opal-browser gem, but if I require it, it blows up
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
<dleedev> well, I gotta go now, but it would be nice if something was written in the README about how to require gems
dleedev has quit [Quit: dleedev]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
<meh`> snab, he's gone
DrShoggoth has joined #opal
DrShoggoth has quit [Max SendQ exceeded]
GitHub159 has joined #opal
GitHub159 has left #opal [#opal]
<GitHub159> [lissio] meh pushed 1 new commit to master: http://git.io/XA3omQ
<GitHub159> lissio/master 8237eed meh: component: merge with #tag and replace with #tag!
GitHub33 has joined #opal
<GitHub33> [opal-browser] meh pushed 2 new commits to master: http://git.io/BuFMwA
<GitHub33> opal-browser/master ab851e5 meh: animation_frame: add documentation
<GitHub33> opal-browser/master 3ad0b16 meh: dom/element: rename #matches? to #=~
GitHub33 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal-browser/builds/17954333
<travis-ci> [travis-ci] opal/opal-browser#135 (master - 3ad0b16 : meh): The build has errored.
travis-ci has left #opal [#opal]
marcandre has quit [Remote host closed the connection]
Noldorin has quit []
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal-browser/builds/17954333
<travis-ci> [travis-ci] opal/opal-browser#135 (master - 3ad0b16 : meh): The build failed.
travis-ci has left #opal [#opal]
<meh`> fuck you
barry has joined #opal
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal-browser/builds/17954333
<travis-ci> [travis-ci] opal/opal-browser#135 (master - 3ad0b16 : meh): The build passed.
DavidEGrayson has joined #opal
barry has quit [Ping timeout: 252 seconds]
meh` has quit [Ping timeout: 252 seconds]
barry has joined #opal
barry has quit [Ping timeout: 240 seconds]
e_dub has quit [Quit: e_dub]
e_dub has joined #opal
dleedev has joined #opal
dimaursu16 has quit [Ping timeout: 245 seconds]
<dleedev> do opal hashes only support string keys?
dimaursu16 has joined #opal
ryanstout has quit [Quit: ryanstout]
dimaursu16 has quit [Ping timeout: 264 seconds]
dimaursu16 has joined #opal
<adambeynon> dleedev: nope. Any object should be supported as a key
<dleedev> adambeynon: how does that work?
<dleedev> it look like self.map is an empty javascript object, in which case keys would be cast as strings
barry_ has joined #opal
barry_ has quit [Ping timeout: 240 seconds]
DavidEGrayson has quit [Read error: Connection reset by peer]
RoxasShadowRS has joined #opal
e_dub has quit [Quit: e_dub]
dimaursu16 has quit [Ping timeout: 245 seconds]
dimaursu16 has joined #opal
dimaursu16 has quit [Ping timeout: 252 seconds]
<adambeynon> dleedev: sorry, had to pop out
<dleedev> np
<adambeynon> so yes, self.map is a js object
<adambeynon> but there is also self.keys
<adambeynon> and array of keys
<adambeynon> so we hash each key, set the real object into the array, and put the hash => value in the js object
<adambeynon> (we are cheating a little by not using a real "hash" method, but thats going to be fixed at some point)
elia has joined #opal
barry_ has joined #opal
barry_ has quit [Ping timeout: 240 seconds]
<dleedev> adambeynon: I don't see the part where you has the key
<dleedev> it seems like the key is used directly as the key to self.map
<dleedev> s/has/hash
<adambeynon> dleedev: javascript is implicitly using toString() on each object
<adambeynon> until we implement #hash(), to use that instead
<adambeynon> so really we are hashing the string value of each key, rather than its hash()
<dleedev> I see
<dleedev> that doesn't sound very safe, and should be documented
<dleedev> for instance, 1 and "1" would clash in the hash, right?
<adambeynon> dleedev: yes they would
<dleedev> and there's no plan to change that, right?
<adambeynon> dleedev: yeh, I want to fix it. Its just going to take a while, and at the moment I only have time for smaller fixes
<adambeynon> I need a couple of weekends to root out some of these bigger bugs and missing parts
<dleedev> actually fixing it might require a complete re-implementation of the hash-bucket-list implementation in js
<dleedev> is that what you mean?
<adambeynon> dleedev: probably not. every time a key is accessed/set, instead of doing self.map[object], we would need to do something like:
<adambeynon> self.map[object.$hash()]
<dleedev> so basically a compromise where $hash() is essentially equality
<dleedev> that might be a decent compromise
<adambeynon> dleedev: hopefully it should cover most of the rough edges
<adambeynon> the string + numerics hashing to the same is the biggest problem atm
kludge` has quit [Ping timeout: 252 seconds]
kludge` has joined #opal
barry_ has joined #opal
barry_ has quit [Client Quit]
dleedev has quit [Quit: dleedev]
meh` has joined #opal
marcandre has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
Kilobyte|StupidC has joined #opal
marcandre has quit [Remote host closed the connection]
Kilobyte|StupidC has quit [Quit: kilobyte22.de]
meh` has quit [Ping timeout: 245 seconds]
Noldorin has joined #opal
fkchang has joined #opal
Kilobyte|StupidC has joined #opal
DrShoggoth has joined #opal
dfranciosi has quit []
elia has quit [Ping timeout: 260 seconds]
dleedev has joined #opal
KresiusMengg has joined #opal
<KresiusMengg> nothing like http://p.pw/DLV jaja (wait to pass the advertising) xD
KresiusMengg has left #opal [#opal]
meh` has joined #opal
<meh`> fkchang, the @background there isn't working because you are using instance_exec and not call
<meh`> fkchang, you have to css do |_| _.background @background end
<meh`> dleedev, you can't require external libraries from the opal-repl, it's only for stdlib and corelib for now
<dleedev> so is there no way for me to test out my code in the console?
<meh`> dleedev, depends on the kind of code
<meh`> dleedev, there's till work going on in the tool side of things
<fkchang> dleedev: I dunno if I pushed it, but I added a require_js that will require a js file from a cdn url
<fkchang> for opal-irb
<fkchang> meh`: thx, I think I thought of that and tried it, but I'll try again
<fkchang> meh`: yeah, I tried again, it doesn't work
<meh`> fkchang, wait
<meh`> fkchang, yeah, sorry, that would't change a thing
<meh`> unless @background is an ivar in the class
<meh`> fkchang, you can only use the on :render in that case
<meh`> the css block is created at compile time
ryanstout has joined #opal
Noldorin has quit []
GitHub168 has joined #opal
<GitHub168> opal/master 2c6bae2 meh: Alias Native::Array#to_ary to #to_a
GitHub168 has left #opal [#opal]
<GitHub168> [opal] meh pushed 1 new commit to master: http://git.io/cipSRQ
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/18010341
<travis-ci> [travis-ci] opal/opal#1725 (master - 2c6bae2 : meh): The build passed.
<meh`> mh, something's not right
<adambeynon> meh`: with what?
<meh`> adambeynon, trying to improve the DOM::NodeSet bullshit
<meh`> and noticed the above bug with Native::Array
<meh`> but it's still not working ◕ ◡ ◔
<meh`> but now I think I changed my mind
<adambeynon> lol. im also struggling with api design
<adambeynon> going from an objective-c api to ruby is tough
Noldorin has joined #opal
<meh`> no ok, the #to_ary change is proper
<meh`> it's how I'm using it that's wrong
<meh`> adambeynon, ping
<adambeynon> meh`: hi
<meh`> adambeynon, something's wrong
<meh`> def self.[](*nodes)
<meh`> new(nodes.flatten.map { |x| DOM(Native.convert(x)) })
<meh`> end
<meh`> nodes here somehow is arguments[0]
<meh`> OR
<adambeynon> meh`: how are you calling the method? And what are the args?
<meh`> the Chrome debugger is broken
<meh`> NodeSet[Native::Array.new(`#@native.childNodes`)]
<meh`> nodes is the Native::Array
<meh`> even in the console
<meh`> nodes is nodes[0]
<meh`> but arguments si normal
<meh`> is
<meh`> and calling $slice.call(arguments, 0) yields the right result
<meh`> I'm confused
<meh`> ok I'm confused
<meh`> even more
<meh`> the Scope variables says something else
<meh`> what is going on
<meh`> ◕ ◡ ◔
<fkchang> meh`: I remember you mentioning something like "a coworker was going to work on std components for lissio"
<meh`> fkchang, he implemented autocomplete
fkchang has quit [Read error: Connection reset by peer]
fkchang has joined #opal
<fkchang> ah, jo looks similar to the dsl I made up in ruby, looks like their std components might be a good set to model for lissio http://joapp.com/docs/#Class%20Hierarchy