meh` has quit [Ping timeout: 272 seconds]
fkchang has quit [Ping timeout: 245 seconds]
fkchang has joined #opal
DouweM has quit [Ping timeout: 265 seconds]
elia has joined #opal
adambeynon has joined #opal
<elia> adambeynon, any simple way to rescue from a specific error directly in js?
<adambeynon> elia: which error? NameError?
<elia> adambeynon, yes
<adambeynon> try { ... } catch (err) { if (err._klass === Opal.NameError) { ... } else { throw e } }
<adambeynon> basically, catch all errors and rethrow if its not the class you want
<elia> thanks :)
<adambeynon> elia: np
<adambeynon> elia: I've got something really cool to show you later as well. I've got a rails demo app that uses vienna and renders vienna views to serve up initial html
<adambeynon> gives you the best of html on the server and client side rendering
<elia> adambeynon, cool
<elia> opensource?
<adambeynon> elia: of course! ;)
<elia> YAY!
<elia> adambeynon, I than ready to open skype/screen share
<adambeynon> it also "tags" the html with the view/controller name, so you can still define all the events etc in the Vienna::View class
<elia> adambeynon, "tags" anything similar to angular?
<adambeynon> not too familiar with angular. by default, vienna adds a data-vienna-class="user_view" to the body element, so when the page loads we just recreate the Vienna::View instance as it was on the server
<adambeynon> but we already have the html
<adambeynon> so we just attach the events
<adambeynon> ALSO, im working on a way so you get models automatically loaded as well
<elia> adambeynon, awesome and awesome!
<adambeynon> elia: I think its going to be huge ;)
<adambeynon> got to run
<adambeynon> be back lunch time to show it off
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<elia> adambeynon, sounds like the ruby/rails community will have something to talk about for a while!
kludge` has quit [Ping timeout: 245 seconds]
kludge` has joined #opal
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/elia/opal/builds/12560926
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] elia/opal#30 (fix-defined - ce4277c : Elia Schito): The build was fixed.
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/elia/opal/builds/12561027
<travis-ci> [travis-ci] elia/opal#31 (fix-defined - 2c64f58 : Elia Schito): The build was fixed.
travis-ci has left #opal [#opal]
adambeynon has joined #opal
meh` has joined #opal
<meh`> adambeynon, yo
<adambeynon> hi meh`, whats up
<meh`> reading the broken angularjs issue
<adambeynon> yeah. Didnt really take any action on that when it was brought up a couple of months ago
<adambeynon> goes back to whether `$` is enough of a prefix for ruby methods
<adambeynon> mind you, a lot of people are still in the category of "extending prototypes is bad, y'all "
<adambeynon> meh`: I also wanted to chat with you later about your thoughts on pre-rendering lissio on the server
<adambeynon> I have been doing a lot of work on vienna + rails recently
<adambeynon> we could be hitting for the same thing
<meh`> adambeynon, the phantomjs script I'll write will be reusable
fkchang has quit [Remote host closed the connection]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
DouweM has joined #opal
adambeynon has joined #opal
DouweM has quit [Ping timeout: 240 seconds]
DouweM has joined #opal
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
adambeynon has joined #opal
<elia> adambeynon, so?
<elia> :P
<elia> we're waiting for the show-off here…
<adambeynon> elia: just some tidying up to do ;)
<adambeynon> still trying to find the best way to pass models down..
<adambeynon> at the moment my layout has an ugly `:content_for(:vienna_vars)` part, which isnt ideal
<elia> adambeynon, yeah, quite ugly
<elia> adambeynon, what are you putting inside that content_for?
<adambeynon> elia: it gets filled with a javascript tag which boots the Vienna::Model instances
<adambeynon> basically json
<adambeynon> I need to inject the json of the models into the page somewhere
<adambeynon> (to save another http request + database lookups)
<adambeynon> elia: one way around it is to intercept the view rendering (in the rails stack), and basically do
<adambeynon> rendered_string += "<script>......</script>
<adambeynon> Im thinking we could add a :vienna renderer
<elia> adambeynon, mmm, what about plain data attributes
<elia> ?
<elia> adambeynon, or a metatag (unless you care about streaming)
<adambeynon> elia: I did think of the data attributes, but it wasnt "just works" enough for me
<elia> that way you can add an appcontroller helper_method and that's all
<adambeynon> elia: ohh
<adambeynon> I see what you mean now
<adambeynon> yeah.. the other thing is, we dont want all ivars to be copied down, it probably need to be opt-in
<adambeynon> actually, vienna::View can handle that
<elia> adambeynon, Kernel#as_opal? :)
<elia> probably the usual as_json/to_json should be enough
fkchang has joined #opal
<fkchang> adambeynon: I'd be interested in seeing the rails/vienna app you showed elia, might make a good showcase for my talk
<elia> fkchang, sadly he didn't show anything to me… :(
<adambeynon> elia, fkchang : still trying to fight against rails to get it working smoothly :(
<elia> adambeynon, np :D
<fkchang> bummer, hopefully soon. Same thing for meh` I want to show some lissio stuff, but I'll want enough time to be able to play with it in advance
<meh`> fkchang, have hope
<meh`> I'm fairly confident I'll be able to write up a blog post with an example app a week before rubyconf
<adambeynon> elia: it needs some small code tidy ups, but this is the idea which is working (but very hardcoded at the moment)
<elia> adambeynon, so you're running vienna views inside rails too?
<adambeynon> elia: yeap. inside rails they become the view context (instead of ActionView::Base)
<adambeynon> well, inside rails they actually inherit from ActionView::Base
<adambeynon> so you still get all your helpers
<adambeynon> but, on the subclasses you define custom helpers which get run on the client side as well
<elia> adambeynon, that's awesome
<elia> adambeynon, and we'll end up porting actionview to opal :D
<elia> adambeynon, I think I already have #content_tag implemented somewhere…
<adambeynon> elia: its really cool. 1 class definition that gets run on both the server and client
<adambeynon> also, you can choose what to do
<adambeynon> client side rendering for all other requests
<adambeynon> or
<adambeynon> turbolinks style fun
<adambeynon> or indeed "normal" rails behaviour
<adambeynon> and the models keep getting pushed down
<elia> (as said above) adambeynon, sounds like the ruby/rails community will have something to talk about for a while!
<elia> and it's even more EPIC if I think in terms of fkchang rubyconf talk
<adambeynon> elia: yep! some really neat demo would be cool.
<elia> adambeynon, I think you should release under your github profile
<elia> we're all eager to collaborate!
<adambeynon> elia: sure! Its all in a current app, so I will move it out. just looking now to see how much difference rails 3 and rails 4 are
<adambeynon> dont think its going to be a problem to work with both versions
<meh`> fkchang, any idea on what the demo app for lissio should do?
<fkchang> adambeynon: I agree with elia: something public would be good
<fkchang> meh`: I'm not sure, I have to condense all the goodness of opal into 40 min, and have time for the various star wars multimedia stuff I'm weaving in. I don know the beauty of the DSL from the various snippets you've post will speak to my point that "Opal, like Ruby, is made to make the programmer happy"
<meh`> fkchang, there's also to take into consideration my approach has nothing to do with Rails
<meh`> and its ways, my target is to make the frontend completely client side
<fkchang> The notion that adambeynon brings up of 1 set of ruby code that runs on either side (netzke does this pretty well too), is a compelling point too. I want to highlight code that 1) is beautiful/makes the programmer happy 2) says things much nicer than js or even coffeescript
<meh`> and have a thin REST backend in whatever
<fkchang> If you think that my mental note for every "feature" I want to show is, "How awesome is that" -- it sort of opens up a lot of choices, rails, no rails, as long as it's awesome
<fkchang> I need a way to use the "snow walker falling down" clip that elia posted as some sort of JS fail
<fkchang> a pattern I expect to be showing is "in JS it's 60 lines of nasty code, in Opal it's 12 lines of beautiful code that follows the principle of least surprise""
<meh`> show the Tooltip :P
<elia> fkchang, and also you can reuse all of your OOD (jedi) powers
<elia> fkchang, btw I have a load of SW backstage pictures if you want
<elia> fkchang, and also it's probably worth image-googlin for "site:imgur.com ext:gif starwars"
<fkchang> for the various features, I think I'd like to show some awesome code, give a quick walk through, and then muck w/that code in real time to show them how nice it is. That would require that I'm familiar enough w/said (yet to be written) code that I can do so. I'll definitely have to pick a bunch and prune down to the code w/the most effect
<elia> (also try with site:tumblr.com)
<fkchang> elia: images can help, I was planning on a lot of video clips w/sound. For example I'm going to mention the problem w/the Javascript revolution is that the language is javascript, then I'll play the "what a piece of junk!" line that Luke says when he 1st sees the Millenium Falcon, etc.
<fkchang> So I'll have to dig up a video link of the snow walker falling so I can have the dolby digital crashing sound
<elia> fkchang, another good one is the "gonna be a lot thinner" quote going from js to ruby :)
<adambeynon> elia, meh`, fkchang : by then my jsfiddle clone for opal should be ready, might be useful for quick coding/compiling/running routines without touching too many gems
<fkchang> elia: nice..
<meh`> adambeynon, kewl
<elia> going home
<fkchang> elia: bye
<fkchang> adambeynon: I was going to add some jsfiddle like things either/or opal-irb or inspector
<fkchang> adambeynon: on the note of rubyconf stuff, I'd love to show an opal-inspector w/method editing which all require the source/comment stuff I'm hoping to have added to the parser
elia has quit [Ping timeout: 264 seconds]
<adambeynon> fkchang: yeap. been thinking on that one. Best thing to do, is for me to hack away at a prototype of a simple way to get a json string of all the methods
<adambeynon> Opal::Parser#json_map
<adambeynon> or whatever
<adambeynon> and you think its best to combine all the comments and code together?
<fkchang> from the scenario of, "let me edit DomainObject#cool_method" in opal-irb, I'd want to see code and comments together, where I simply navigate to the method click on it, and see the code and methods together. Yes. I don't think you could easily interleave comments back into the code, coz you can put them anywhere
<meh`> I'd store the method information, the documentation metadata (documentation before the def) and the body (raw source)
<fkchang> ultimately, I guess that's like entry/show points, For inspector I don't need line by line, just "what's the code/comments for xyz method". Down the road, I'd like to build in Smalltalks, "code from the debugger feature", but that's a ways down
<adambeynon> fkchang: sure. well, I will have a go at it and let you know how im getting on
GitHub126 has joined #opal
GitHub126 has left #opal [#opal]
<GitHub126> [opal] adambeynon pushed 16 new commits to master: http://git.io/RH1xBQ
<GitHub126> opal/master ff86e14 Elia Schito: Try to provide an implementation for process_defined with :colon2
<GitHub126> opal/master 2a06296 Elia Schito: Unexpectedly is "class variable"
<GitHub126> opal/master 71ea9c0 Elia Schito: Change Opal.dispatch_super to be just a super finder
<fkchang> adambeynon: thanks. If you've a decent api, but suboptimal interface, I could run with that to implement those parts and just pull more recent versions as you improve it
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1105 (master - c559840 : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12579166
<adambeynon> fkchang: seems the best. It will serve initially just for you, so breaking changes doesnt bother me too much
<fkchang> cool, lemme know when there's something to try
<fkchang> dunno if there's a difference in server compile time vs in browser parse time, but of course I want to start an app w/the source prepared, as well as keep any changes I make on the browser
fntzr has joined #opal
fntzr has quit [Read error: Connection reset by peer]
fntzr has joined #opal
elia has joined #opal
elia has quit [Ping timeout: 245 seconds]
<adambeynon> brb
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
GitHub174 has joined #opal
GitHub174 has left #opal [#opal]
<GitHub174> [opal] adambeynon pushed 1 new commit to master: http://git.io/_Um-7A
<GitHub174> opal/master be34397 Adam Beynon: Add Opal::Sexp instead of using Arrays for sexps
adambeynon has joined #opal
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1106 (master - be34397 : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12583241
travis-ci has left #opal [#opal]
GitHub0 has left #opal [#opal]
<GitHub0> [opal] adambeynon pushed 1 new commit to master: http://git.io/zRZAkw
<GitHub0> opal/master 7038303 Adam Beynon: Remove last few edge cases still using arrays instead of sexps
GitHub0 has joined #opal
GitHub179 has joined #opal
<GitHub179> [opal] adambeynon pushed 1 new commit to master: http://git.io/ioUlTg
GitHub179 has left #opal [#opal]
<GitHub179> opal/master d2a17ad Adam Beynon: Rename core_ext.rb => sexp.rb
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1107 (master - 7038303 : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12583900
travis-ci has left #opal [#opal]
fntzr has quit [Quit: Leaving]
eventual_ has joined #opal
<eventual_> hey all, I found what appears to be a bug in Opal and I'd like to see if I can fix it. unfortunately when I cloned the repo just now and ran "bundle install" and "rake" per the instructions to run the tests I found that they don't pass. is that being worked on right now? I see that the latest commit was about 20 minutes ago
<meh`> eventual_, quite possible :)
<meh`> eventual_, what's the bug?
<eventual_> meh`: h=Hash.new(0);h[:a]+=1;puts(h[:a])
<eventual_> should output 1, actually outputs 0
<eventual_> looks like += isn't being handled properly when used with []/[]=
<eventual_> ($a = "a", $b = h, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, 1)));
<meh`> (here all specs pass)
<meh`> eventual_, tried `bundle update; bundle exec rake`?
<meh`> also yeah, it's indeed broken
<meh`> also good luck, the compiler is an abomination
<eventual_> lol. said lovingly or in a Stockholm Syndrome kind of way?
<eventual_> and no, that doesn't seem to help. the failure is: Time#day returns the day of the month for a UTC Time, Expected 31 to equal 1
<meh`> weird
<meh`> eventual_, in what timezone are you?
<eventual_> PDT
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12583973
<travis-ci> [travis-ci] opal/opal#1108 (master - d2a17ad : Adam Beynon): The build passed.
<meh`> also, the compiler is actually the shittiest I've ever seen
<meh`> but we all know that :P
<eventual_> thanks for the pointers. if nothing else I'll file a GH issue for it
<eventual_> gotta go
<meh`> cya
eventual_ has quit [Remote host closed the connection]
GitHub44 has joined #opal
<GitHub44> [opal] adambeynon pushed 1 new commit to master: http://git.io/VAkQcQ
GitHub44 has left #opal [#opal]
<GitHub44> opal/master 54321ed Adam Beynon: Sexps should use #type instead of dereference
GitHub142 has joined #opal
<GitHub142> opal/master 736f52a Adam Beynon: Some slight code clarity
<GitHub142> [opal] adambeynon pushed 1 new commit to master: http://git.io/u6-pwA
GitHub142 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12585353
<travis-ci> [travis-ci] opal/opal#1109 (master - 54321ed : Adam Beynon): The build passed.
travis-ci has left #opal [#opal]
elia has joined #opal
travis-ci has joined #opal
<travis-ci> [travis-ci] opal/opal#1110 (master - 736f52a : Adam Beynon): The build passed.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/12586079
travis-ci has left #opal [#opal]
adambeynon has quit [Quit: Textual IRC Client: www.textualapp.com]
eventual_ has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
<eventual_> meh`: so looks like my test failure is because Opal is turning Time.utc(1970, 1, 1) into a native Date instance which does not keep track of the timezone (UTC in this case)
<eventual_> so it to_s'trings as Wed Dec 31 1969 16:00:00 GMT-0800 (PST)
<meh`> eventual_, you just missed elia, he's the one who wrote all that time stuff
<eventual_> doh =)
<eventual_> I'm kinda surprised it passes for anyone *not* running their computer in UTC
<meh`> eventual_, I'm surprised as well
<meh`> I guess you'll win the honorary title of bugomancer too
<meh`> same goes for the x[] +=
<eventual_> yeah. not terribly uncommon
<eventual_> alright, here come the GH issues
elia has joined #opal
<meh`> elia, v
<meh`> 23:03:35 eventual_ >! meh`: so looks like my test failure is because Opal is turning Time.utc(1970, 1, 1) into a native Date instance which does not keep track of the timezone (UTC in this case)
<meh`> 23:03:56 eventual_ > so it to_s'trings as Wed Dec 31 1969 16:00:00 GMT-0800 (PST)
<eventual_> hey elia. I hear you wrote the Time code in Opal
adambeynon has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
<meh`> adambeynon, https://github.com/opal/opal/issues/402 thise one's pretty huge, fix asap
<meh`> eventual_, out of curiousity, what's your interest in opal?
elia has joined #opal
<adambeynon> hmm, strange that hasnt caused a problem before..
<meh`> adambeynon, indeed
<meh`> could be a recent regression
<eventual_> meh`: I was looking at coderpad.io and wondered what it would take to create something similar
<eventual_> I probably won't actually do it, since that's a massive time sink
<eventual_> but I think the language transpilation stuff is interesting
<elia> eventual_, meh`: sorry, cant look into it atm
<eventual_> elia: no worries. I don't have an immediate need for something like Opal
<eventual_> just wanted to play around with it
<elia> eventual_, having a way to reproduce would be valuable though :)
<eventual_> elia: I didn't do anything too special. clone, bundle, rake
<eventual_> if it helps, I'm on OS X 10.8 running with ruby 2.0.0-p195, bundler 1.3.5, phantomjs 1.9.2
<adambeynon> eventual_: http://opalrb.org/try/#code:p%20Time.utc(1970%2C%201%2C%201)%0Ap%20%60new%20Date(Date.UTC(1970%2C%200%2C%201))%60
<adambeynon> what results do you get with that test?
<eventual_> Wed Dec 31 1969 16:00:00 GMT-0800 (PST)
<eventual_> twicee=
<eventual_> err, twice
<adambeynon> ok
<eventual_> is that what you'd expect?
<adambeynon> eventual_: I dont know. was just checking whether Date.UTC() fixed it
<adambeynon> as it didnt, it means I have to go read up about javascript timezones :(
<meh`> adambeynon, have fun
<eventual_> oh they're a bloody mess
<eventual_> you may find moment.js useful in that regard. and perhaps http://pellepim.bitbucket.org/jstz/
elia has quit [Quit: Computer has gone to sleep.]
eventual_ has quit [Read error: Connection reset by peer]
eventual_ has joined #opal
adambeynon has quit [Quit: Textual IRC Client: www.textualapp.com]
ryanstout has joined #opal
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
meh` has quit [Ping timeout: 272 seconds]