############################## [2014-07-09] ############################## [22:48:55] ylluminate(@ylluminate):so that on-the-fly approach would leverage nodejs runner? ---------------------------------------------------------------------------------------------------- [22:49:04] Elia Schito(@elia):https://github.com/opal/opal/blob/master/stdlib/nodejs/require.rb ---------------------------------------------------------------------------------------------------- [22:50:14] Elia Schito(@elia):yep, the nodejs runner will need to require stuff at runtime (e.g. in `bin/opal -e 'puts 5’`) ---------------------------------------------------------------------------------------------------- [22:55:42] ylluminate(@ylluminate):hmm, so walk me through this mentally here. what roughly, in an outline, would need to be done to allow requires to operate on the fly in browser? ---------------------------------------------------------------------------------------------------- [22:56:59] Elia Schito(@elia):oh, wait, isn’t `require_remote` enough for that? ---------------------------------------------------------------------------------------------------- [22:57:14] Elia Schito(@elia):https://github.com/opal/opal/blob/master/stdlib/opal-parser.rb#L11-L18 ---------------------------------------------------------------------------------------------------- [22:57:19] ylluminate(@ylluminate):oh, wait... what's that? i've not looked into that ---------------------------------------------------------------------------------------------------- [22:58:33] Elia Schito(@elia):when you require opal-parser `require_remote` is added to Kernel ---------------------------------------------------------------------------------------------------- [22:58:38] Elia Schito(@elia):and takes a URL ---------------------------------------------------------------------------------------------------- [22:58:54] Elia Schito(@elia):that will be loaded via (A)JAX (synchronously) ---------------------------------------------------------------------------------------------------- [22:59:21] ylluminate(@ylluminate):interesting, then that's essentially the same thing; seems as though that if running in browser require could be an alias of require_remote with a little setup ---------------------------------------------------------------------------------------------------- [22:59:50] ylluminate(@ylluminate):so you could effectively say `require_remote "rb/my_include.rb"` to get an rb file from within the rb subfolder of the site ---------------------------------------------------------------------------------------------------- [23:01:14] Elia Schito(@elia):yes a custom require implementation with a base url + cdn fallback should work ---------------------------------------------------------------------------------------------------- [23:01:22] Elia Schito(@elia):and no MRI server ---------------------------------------------------------------------------------------------------- [23:03:39] ylluminate(@ylluminate):slick, require_remote worked a treat it appears for him ---------------------------------------------------------------------------------------------------- [23:04:39] Elia Schito(@elia):…which reminds me how much we need documentation ---------------------------------------------------------------------------------------------------- [23:04:53] ylluminate(@ylluminate):indeed ---------------------------------------------------------------------------------------------------- [23:06:07] ylluminate(@ylluminate):but yes, if we can add a little logic to use require_remote when in a non mri env, then this would be great and would preclude the need to tell ppl this, thus minimizing documentation on this aspect ---------------------------------------------------------------------------------------------------- [23:07:34] ylluminate(@ylluminate):it's silly that just such a simple thing caused such a head->wall bashing for so long earlier for him. ---------------------------------------------------------------------------------------------------- [23:07:40] Elia Schito(@elia):yeah, but it should be opt-in b/c ppl buiding in MRI single file via Opal::Builder ---------------------------------------------------------------------------------------------------- [23:08:05] Elia Schito(@elia):builder will coiplaint if it can’t find a file ---------------------------------------------------------------------------------------------------- [23:08:30] ylluminate(@ylluminate):well, can't we add an env test? crudely: if mri/builder, use std require; else use require_remote ---------------------------------------------------------------------------------------------------- [23:09:01] Elia Schito(@elia):> …such a simple thing… plz turn the pain into docs! ---------------------------------------------------------------------------------------------------- [23:09:23] ylluminate(@ylluminate):or vice-versa: if cdn, use require_remote, else just good old require ---------------------------------------------------------------------------------------------------- [23:09:34] ylluminate(@ylluminate):i imagine the latter is easier to test ---------------------------------------------------------------------------------------------------- [23:09:54] ylluminate(@ylluminate):lol ---------------------------------------------------------------------------------------------------- [23:09:55] Elia Schito(@elia):Need a code example to fully understand I guess ---------------------------------------------------------------------------------------------------- [23:10:38] ylluminate(@ylluminate):k, i will ponder on this as i get some time ---------------------------------------------------------------------------------------------------- [14:00:29] Elia Schito(@elia):@wstucco ``` def a(b=1,$options = undefined) c = $options.to_hash.fetch(:c, 2) p [b,options] end ``` ---------------------------------------------------------------------------------------------------- [19:30:07] ylluminate(@ylluminate):hey @elia @adambeynon we're going to work on throwing together a more automated update of the opal cdn mechanism if that's okay with you guys. we were thinking about putting a task into the rakefile to update it and then running it on one of our servers to check it out and to also update the main cdn page to show a listing of files as per: https://github.com/opal/opal-cdn/issues/1 -- of course we'd like to add in opal-jquery, opal-browser and any thing else from opal org that you'd like to pop in. ---------------------------------------------------------------------------------------------------- [19:31:24] ylluminate(@ylluminate):we are planning on throwing it onto one of our servers as a scheduled task that runs every X hours to make sure that master is updated and hopefully we can figure out a way to watch for version bumps keep `current` up-to-date as well ---------------------------------------------------------------------------------------------------- [19:31:33] ylluminate(@ylluminate):(on the cdn) ---------------------------------------------------------------------------------------------------- [22:36:48] Elia Schito(@elia):> re: require. i thought you'd implemented that in master such that we can require other .rb files within .rb scripts @ylluminate I did, but I don’t see how they can be useful for the cdn… ---------------------------------------------------------------------------------------------------- [22:39:03] ylluminate(@ylluminate):it's very useful for creating multi file projects. for example, my son is making a tutorial game in opal that is separated out into multiple files in js via require.js ---------------------------------------------------------------------------------------------------- [22:39:42] ylluminate(@ylluminate):he wants to likewise be able to use simple ruby requires the same way within this opal version so that he can demonstrate the power of using opal in browser as an introduction to folks ---------------------------------------------------------------------------------------------------- [22:40:23] ylluminate(@ylluminate):he is planning on creating several opal tutorials in this fashion and is loath to just embed it all within a singular file or even to include it via js includes in the html ---------------------------------------------------------------------------------------------------- [22:44:20] ylluminate(@ylluminate):@elia does that not make sense? ---------------------------------------------------------------------------------------------------- [22:44:45] Elia Schito(@elia):sorry, watching the world cup in the meanwhile :soccer: ---------------------------------------------------------------------------------------------------- [22:44:53] ylluminate(@ylluminate):lol ---------------------------------------------------------------------------------------------------- [22:47:43] Elia Schito(@elia):k, well, the require stuff is oriented to precompilation ---------------------------------------------------------------------------------------------------- [22:48:11] Elia Schito(@elia):but there’s already some support for the nodejs runner ---------------------------------------------------------------------------------------------------- [22:48:15] ylluminate(@ylluminate):do you have an idea of how to make it work as well for this scenario? ---------------------------------------------------------------------------------------------------- ############################## [2014-07-19] ############################## [10:55:41] Elia Schito(@elia):@ylluminate `https://gist.github.com/elia/0c12c3d7529e042a1503` ---------------------------------------------------------------------------------------------------- [10:57:25] Elia Schito(@elia):to generate it I did the following: ```bash gem install opal-browser --pre opal-build -ropal/browser -oopal-browser.js browser ``` ---------------------------------------------------------------------------------------------------- [13:35:02] Elia Schito(@elia):hey @adambeynon! ---------------------------------------------------------------------------------------------------- [17:26:07] ylluminate(@ylluminate):@elia thanks so much for looking into that. Unfortunately the resultant file is around 325k, which is like the opal-jquery result where it included opal proper as well. why is the previous syntax that worked for `opal-jquery` not working: `opal-build -r opal-browser -o opal-browser.js -- opal-browser` ---------------------------------------------------------------------------------------------------- [18:23:59] Elia Schito(@elia):@ylluminate the gist seems fine, the reason `opal-build -r opal-browser -o opal-browser.js -- opal-browser` doesn’t work is b/c in opal-land opal browser is named browser and after `--` you should put the opal lib you want to build ---------------------------------------------------------------------------------------------------- [18:24:28] Elia Schito(@elia):https://github.com/opal/opal-browser/tree/master/opal ---------------------------------------------------------------------------------------------------- [19:18:46] ylluminate(@ylluminate):@elia okay, gotcha, thanks. The size was worrying me since jquery was considerably smaller and I was fearful, without examining it, that opal proper was being included as with jquery when we were discussing it before. ---------------------------------------------------------------------------------------------------- ############################## [2014-07-21] ############################## [20:01:07] ylluminate(@ylluminate):@elia i'm curious, really great to see that you added some external lib support and documentation to opal-cdn. but, on the curiosity front, it appears that you added them to here: https://github.com/opal/opal-cdn/tree/gh-pages/external/0.6.2 -- why not have a `master` folder that these are in to support the accompanying `master` branch and then have them tagged also to support versions? will this present a compatibility problem when pulling opal from `master` vs `current`? ---------------------------------------------------------------------------------------------------- [20:01:58] ylluminate(@ylluminate):further, should this also not contain a `.min.js` and a `.min.js.gz` like unto the other primary opal libs within https://github.com/opal/opal-cdn/tree/gh-pages/opal/? ---------------------------------------------------------------------------------------------------- [21:25:21] Elia Schito(@elia):@ylluminate you’re right on every front, that was a kind of experiment done in spare time ---------------------------------------------------------------------------------------------------- [21:26:36] Elia Schito(@elia):A better and automatic workflow is necessary to have all that stuff and keep it up-to-date ---------------------------------------------------------------------------------------------------- [21:27:59] Elia Schito(@elia):also there’s another issue, currently the bower package for opal points to the cdn repo which ideally contains historical builds and version which is –at least– suboptimal ---------------------------------------------------------------------------------------------------- [23:37:27] ylluminate(@ylluminate):gotcha, thanks. wasn't sure your intention there ---------------------------------------------------------------------------------------------------- ############################## [2014-07-25] ############################## [10:37:44] Elia Schito(@elia):@wstucco ``` >> def a(b,c,*d,**e,&f);end; ?> method(:a) => # >> method(:a).parameters => [[:req, :b], [:req, :c], [:rest, :d], [:keyrest, :e], [:block, :f]] >> ``` ---------------------------------------------------------------------------------------------------- ############################## [2014-08-02] ############################## [16:51:17] Elia Schito(@elia):@meh welcome :panda_face: ---------------------------------------------------------------------------------------------------- [16:51:22] meh.(@meh):fico ---------------------------------------------------------------------------------------------------- ############################## [2014-08-05] ############################## [16:28:03] Ryan Stout(@ryanstout):@elia so is the glitter room separate from irc or the same? ---------------------------------------------------------------------------------------------------- [16:38:34] Elia Schito(@elia):@ryanstout it has irc access (via irc.gitter.im) but it’s a separate thing from freenode ---------------------------------------------------------------------------------------------------- [16:42:58] Elia Schito(@elia):@ryanstout the real value though resides in its deep integration with github ---------------------------------------------------------------------------------------------------- [16:43:23] Ryan Stout(@ryanstout):yea, it looks cool. Having GHFM is really nice. ---------------------------------------------------------------------------------------------------- [16:46:01] Elia Schito(@elia):and also off-line notifications and read confirmations are great ---------------------------------------------------------------------------------------------------- [17:32:45] ylluminate(@ylluminate):agreed on all counts. i kinda think this is a nice replacement for irc in such cases ---------------------------------------------------------------------------------------------------- [17:38:43] Elia Schito(@elia):and there’s always https://irc.gitter.im :smirk: ---------------------------------------------------------------------------------------------------- ############################## [2014-08-11] ############################## [09:19:35] Elia Schito(@elia):If anyone’s interested I published corelib docs to http://opal.github.io/opal/doc/opal/frames.html#!file.README.html ---------------------------------------------------------------------------------------------------- [09:20:29] Elia Schito(@elia):The idea is to have a service similar to rdoc.info but for opal-land ---------------------------------------------------------------------------------------------------- [14:03:21] Bernhard Weichel(@bwl21):@elia wrt to http://stackoverflow.com/questions/25233095/how-can-i-store-retrieve-files-in-owncloud-from-a-webapp-written-in-opal-ruby ---------------------------------------------------------------------------------------------------- [14:04:02] Bernhard Weichel(@bwl21):opal.org/try/# uses 0.6.2 and seems to return promises ... ---------------------------------------------------------------------------------------------------- [14:04:24] Elia Schito(@elia):@bwl21 yes, opalrb.org/try should be more up to date ---------------------------------------------------------------------------------------------------- [14:04:28] Bernhard Weichel(@bwl21):@elia but at the moment I cannot solve the authentication issue. ---------------------------------------------------------------------------------------------------- [14:04:47] Elia Schito(@elia):so, which versions are you using in your code? ---------------------------------------------------------------------------------------------------- [14:04:57] Bernhard Weichel(@bwl21):my code runs 0.6.2 ---------------------------------------------------------------------------------------------------- [14:05:13] Elia Schito(@elia):opal-jquery version? ---------------------------------------------------------------------------------------------------- [14:05:30] Bernhard Weichel(@bwl21):opal (0.6.2) opal-browser (0.2.0.beta1) opal-jquery (0.2.0) ---------------------------------------------------------------------------------------------------- [14:06:09] Bernhard Weichel(@bwl21):I think I do not need opal-browser for the HTTP stuff, right? ---------------------------------------------------------------------------------------------------- [14:06:22] Elia Schito(@elia):right ---------------------------------------------------------------------------------------------------- [14:06:36] Elia Schito(@elia):opal-browser has its implementation with different API ---------------------------------------------------------------------------------------------------- [14:07:11] Bernhard Weichel(@bwl21):HTTP.get("https://cloud.weichel21.de:61670/remote.php/webdav/", {username:"fooname", password:"foopass", } ).then do |response| puts "success" puts response.body end.fail do |response| puts "fail" puts response.status_code end puts "foo" ---------------------------------------------------------------------------------------------------- [14:07:36] Bernhard Weichel(@bwl21):result is always foo fail 401 ---------------------------------------------------------------------------------------------------- [14:08:04] Elia Schito(@elia):To have promises you need to get opal-jquery from git I think ---------------------------------------------------------------------------------------------------- [14:08:05] Bernhard Weichel(@bwl21):even if I provide the correct username password (here in the chat I did not post the same :-) ---------------------------------------------------------------------------------------------------- [14:08:33] Bernhard Weichel(@bwl21):I am just playing around in opal.org/try ---------------------------------------------------------------------------------------------------- [14:08:37] Elia Schito(@elia):wrt the auth problem could be plain bug, have you checked the request headers? ---------------------------------------------------------------------------------------------------- [14:08:51] Bernhard Weichel(@bwl21):if it does not work there, I do not expect it to work ---------------------------------------------------------------------------------------------------- [14:08:55] Elia Schito(@elia):another thing you can try is to use jquery to do it and see if it works ---------------------------------------------------------------------------------------------------- [14:08:58] Bernhard Weichel(@bwl21):the rquest headers are ---------------------------------------------------------------------------------------------------- [14:09:43] Bernhard Weichel(@bwl21):Remote Address:89.107.186.40:61670 Request URL:https://cloud.weichel21.de:61670/remote.php/webdav/ Request Method:GET Status Code:401 Unauthorized Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Host:cloud.weichel21.de:61670 Origin:http://opalrb.org Referer:http://opalrb.org/try/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 Response Headersview source Access-Control-Allow-Credentials:true Access-Control-Allow-Headers:Authorization,Destination,Content-type,Depth Access-Control-Allow-Methods:GET,POST,OPTIONS,DELETE,PUT,MKCOL,MOVE,COPY,PROPFIND Access-Control-Allow-Origin:* Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:Keep-Alive Content-Length:291 Content-Type:application/xml; charset=utf-8 Date:Mon, 11 Aug 2014 14:09:12 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive:timeout=2, max=100 Pragma:no-cache Server:Apache Set-Cookie:5244769ad951a=aa8ddb2ecbb4a0707f2a01a8937af7ba; path=/; secure; HttpOnly Strict-Transport-Security:max-age=31536000 WWW-Authenticate:Basic realm="ownCloud" X-Powered-By:PHP/5.3.28 ---------------------------------------------------------------------------------------------------- [14:10:25] Bernhard Weichel(@bwl21):It seems that the request does not provide the Authenfication headers ---------------------------------------------------------------------------------------------------- [14:10:53] Bernhard Weichel(@bwl21):http://stackoverflow.com/questions/10226333/ajax-authentication-with-jquery tells me that I have to create the basic authentication by myself ---------------------------------------------------------------------------------------------------- [14:10:54] Elia Schito(@elia):@bwl21 `/try` is a bit more limited, let me know how it goes with jquery directly ---------------------------------------------------------------------------------------------------- [14:10:57] Bernhard Weichel(@bwl21):can't believe that ---------------------------------------------------------------------------------------------------- [14:11:16] Elia Schito(@elia):indeed lol ---------------------------------------------------------------------------------------------------- [14:12:32] Bernhard Weichel(@bwl21):so what is the benefit if http://www.tutorialspoint.com/jquery/ajax-jquery-ajax.htm tells me that ajax takes username/password? ---------------------------------------------------------------------------------------------------- [14:12:51] Elia Schito(@elia):by _indeed_ I mean that I expect it to be something about jquery itself ---------------------------------------------------------------------------------------------------- [14:12:58] Elia Schito(@elia):@bwl21 I’d check with their official docs tho ---------------------------------------------------------------------------------------------------- [14:13:19] Bernhard Weichel(@bwl21):I will add the code to my app and see what happens ---------------------------------------------------------------------------------------------------- [14:13:33] Elia Schito(@elia):keep me posted ---------------------------------------------------------------------------------------------------- [14:44:43] Bernhard Weichel(@bwl21):@elia is it ok if we discuss this in the public opal chat? ---------------------------------------------------------------------------------------------------- [14:45:38] Bernhard Weichel(@bwl21):I tried it. I do not have Promise with the opal-jquery, i have. So I try the old fashioned callback hell :-) ---------------------------------------------------------------------------------------------------- [14:46:10] Bernhard Weichel(@bwl21):this is, what I get:GET https://cloud.weichel21.de:61670/remote.php/webdav/xx/ 401 (Unauthorized) jquery-1.11.1.min.js:4 m.ajaxTransport.send jquery-1.11.1.min.js:4 m.extend.ajax jquery-1.11.1.min.js:4 def.$send! http.js?body=1:149 $opal.defs.TMP_1 http.js?body=1:24 (anonymous function) controller.js?body=1:146 def.$handle_command controller.js?body=1:162 def.$setup_ui_listener.$a._p.TMP_8 controller.js?body=1:356 def.$on.wrapper element.js?body=1:400 m.event.dispatch jquery-1.11.1.min.js:3 m.event.add.r.handle jquery-1.11.1.min.js:3 returned 401 io.js?body=1:98 Sabre_DAV_Exception_NotAuthenticated No basic authentication headers were found 1.7.6 ---------------------------------------------------------------------------------------------------- [15:07:21] Elia Schito(@elia):@bwl21 fine by me, I just ask you to wrap long cheucks of stuff into triple backtics or indented by four spaces ---------------------------------------------------------------------------------------------------- [15:07:29] Elia Schito(@elia):so it won’t spam too much ---------------------------------------------------------------------------------------------------- [15:07:39] Elia Schito(@elia):gists would be good too ---------------------------------------------------------------------------------------------------- [15:18:12] Bernhard Weichel(@bwl21):Ok, I summarized it in a gist (never used gist before :-) ---------------------------------------------------------------------------------------------------- [15:18:14] Bernhard Weichel(@bwl21):https://gist.github.com/bwl21/fc4fb9a00a19768b5b54 ---------------------------------------------------------------------------------------------------- [15:21:41] Bernhard Weichel(@bwl21):note that the $log is my implementation of a logger class which writes to the console as well as to the log window in my Applciation ---------------------------------------------------------------------------------------------------- [16:52:15] Eric West(@edubkendo)::+1: definitely a gitter fan ---------------------------------------------------------------------------------------------------- [17:14:13] Artur Ostręga(@aost):I like that it can be accessed via IRC client ---------------------------------------------------------------------------------------------------- [17:14:41] Elia Schito(@elia):yep, it’s really nice to have it bothways ---------------------------------------------------------------------------------------------------- [17:20:05] Artur Ostręga(@aost):I need everything I use to be command line-accessible! ---------------------------------------------------------------------------------------------------- [17:21:26] Elia Schito(@elia)::raised_hands: ---------------------------------------------------------------------------------------------------- ############################## [2014-08-13] ############################## [06:02:47] Adam Beynon(@adambeynon):megaspeedy ---------------------------------------------------------------------------------------------------- [06:25:28] Adam Beynon(@adambeynon):I imagine they wont be a speed up in older browsers though.. ---------------------------------------------------------------------------------------------------- [06:25:30] Adam Beynon(@adambeynon):well I dont know ---------------------------------------------------------------------------------------------------- [06:25:41] Adam Beynon(@adambeynon):havent got and IE installs to test on ---------------------------------------------------------------------------------------------------- [07:14:57] Elia Schito(@elia):@adambeynon awesome! I'll finish breakfast and be online in a moment ---------------------------------------------------------------------------------------------------- [07:57:51] Elia Schito(@elia):@adambeynon I’m here, ready for the megaspeedy stuff ---------------------------------------------------------------------------------------------------- [08:55:35] Elia Schito(@elia):@adambeynon gonna switch location, be back in min ---------------------------------------------------------------------------------------------------- [06:02:25] Adam Beynon(@adambeynon):elia: when you're back later, I'll show you the code Ive worked on for inline operators: all method calls for +, -, /, *, <<, <, >, <=, >= are now inlined ---------------------------------------------------------------------------------------------------- [06:02:41] Adam Beynon(@adambeynon):jsperf show they run about 96-98% of a native operator call ---------------------------------------------------------------------------------------------------- ############################## [2014-08-14] ############################## [11:30:24] Adam Beynon(@adambeynon):sorry elia, had to leave quickly yesterday ---------------------------------------------------------------------------------------------------- [11:30:33] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [11:30:43] Adam Beynon(@adambeynon):I'll post the stuff a bit later ---------------------------------------------------------------------------------------------------- [11:30:48] Adam Beynon(@adambeynon):was having another thought today though ---------------------------------------------------------------------------------------------------- [11:30:51] Adam Beynon(@adambeynon):about require_tree ---------------------------------------------------------------------------------------------------- [11:30:57] Elia Schito(@elia):shoot ---------------------------------------------------------------------------------------------------- [11:31:04] Adam Beynon(@adambeynon):I think its best to keep it sprockets compatible, rather than trying to work with globs ---------------------------------------------------------------------------------------------------- [11:31:11] Adam Beynon(@adambeynon):for now, at least ---------------------------------------------------------------------------------------------------- [11:31:23] Elia Schito(@elia):+1 ---------------------------------------------------------------------------------------------------- [11:31:42] Adam Beynon(@adambeynon):working on it now, so I can finally remove all the .js files from my rails apps ---------------------------------------------------------------------------------------------------- [11:31:53] Elia Schito(@elia):@adambeynon awesome ---------------------------------------------------------------------------------------------------- [11:32:11] Elia Schito(@elia):I had a though too the other day ---------------------------------------------------------------------------------------------------- [11:32:22] Elia Schito(@elia):about module inclusion and prototype chains ---------------------------------------------------------------------------------------------------- [11:33:00] Elia Schito(@elia):there’s a way to replicate the inclusion mechanism of MRI by just switching prototypes? ---------------------------------------------------------------------------------------------------- [11:33:59] Elia Schito(@elia):I mean let’s say you have a class with proto p1, we can make all its instances inherit from a proxy proto p2 that inherits from p1 ---------------------------------------------------------------------------------------------------- [11:34:40] Adam Beynon(@adambeynon):elia, so each class has two prototypes: one for its class methods, and the other to shove all the modules into? ---------------------------------------------------------------------------------------------------- [11:34:46] Adam Beynon(@adambeynon):sorry ---------------------------------------------------------------------------------------------------- [11:34:48] Adam Beynon(@adambeynon):badly worded ---------------------------------------------------------------------------------------------------- [11:34:50] Elia Schito(@elia):and between p2 and p1 we can fit all modules ---------------------------------------------------------------------------------------------------- [11:34:59] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [11:35:30] Elia Schito(@elia):because I saw a couple of edge cases in which the “Donate” hacks surfaced as bugs ---------------------------------------------------------------------------------------------------- [11:36:12] Elia Schito(@elia):And that would probably also make easy to implement prepend ---------------------------------------------------------------------------------------------------- [11:38:47] Adam Beynon(@adambeynon):yes, its currently very buggy ---------------------------------------------------------------------------------------------------- [11:38:48] Adam Beynon(@adambeynon):but ---------------------------------------------------------------------------------------------------- [11:38:53] Adam Beynon(@adambeynon):yes, that seems a good solution ---------------------------------------------------------------------------------------------------- [11:39:01] Adam Beynon(@adambeynon):need to get familiar with runtime.js again ---------------------------------------------------------------------------------------------------- [11:39:13] Adam Beynon(@adambeynon):been so long since Ive got my head around it :P ---------------------------------------------------------------------------------------------------- [11:39:27] Elia Schito(@elia):lol, I feel less dumb now ---------------------------------------------------------------------------------------------------- [11:39:51] Elia Schito(@elia):I think I really understood the donate stuff for less than 10seconds :P ---------------------------------------------------------------------------------------------------- [15:23:52] Artur Ostręga(@aost):"all method calls for +, -, /, *, <<, <, >, <=, >= are now inlined" Awesome! ---------------------------------------------------------------------------------------------------- [16:28:26] Artur Ostręga(@aost):I thought I'd have to read the dragon book, fork Opal and implement that myself :suspect: ---------------------------------------------------------------------------------------------------- [17:18:36] Elia Schito(@elia):@skofo if you want something else to do you just have to ask :smile: ---------------------------------------------------------------------------------------------------- [17:19:13] Elia Schito(@elia):e.g. restoring source maps on master is key to the 0.7 release ---------------------------------------------------------------------------------------------------- [18:01:27] Artur Ostręga(@aost):The non-native math ops was the biggest pain point for me, though I would like to work on Opal! Can you recommend a light to medium guide to hacking on compilers? ---------------------------------------------------------------------------------------------------- [21:35:34] Artur Ostręga(@aost):http://opalrb.org/docs/compiler/ Good place to start :) ---------------------------------------------------------------------------------------------------- ############################## [2014-08-15] ############################## [10:45:26] Elia Schito(@elia):@skofo :+1: ---------------------------------------------------------------------------------------------------- [10:45:52] Elia Schito(@elia):if you want to try tackling source ---------------------------------------------------------------------------------------------------- [10:46:15] Elia Schito(@elia):Maps the starting point is builder.rb ---------------------------------------------------------------------------------------------------- ############################## [2014-08-18] ############################## [08:06:02] Adam Beynon(@adambeynon):If anyone is interested, I have been playing with a ruby lib to work with angularjs ---------------------------------------------------------------------------------------------------- [08:06:05] Adam Beynon(@adambeynon):a dsl layer on top ---------------------------------------------------------------------------------------------------- [08:06:11] Adam Beynon(@adambeynon):will post when I get to work.. ---------------------------------------------------------------------------------------------------- [08:06:15] Adam Beynon(@adambeynon):works quite nicely ---------------------------------------------------------------------------------------------------- [08:06:25] Adam Beynon(@adambeynon):(very experimental, and very broken atm..) ---------------------------------------------------------------------------------------------------- [21:01:51] ylluminate(@ylluminate):interesting ---------------------------------------------------------------------------------------------------- ############################## [2014-08-25] ############################## [04:01:32] Artur Ostręga(@aost):ditto ---------------------------------------------------------------------------------------------------- [04:01:58] Artur Ostręga(@aost):I think I might be able to stand Angular if it were in Ruby ---------------------------------------------------------------------------------------------------- [04:02:12] Artur Ostręga(@aost):Or front-end MV*, for that matter ---------------------------------------------------------------------------------------------------- [04:03:12] Artur Ostręga(@aost):I am quite happy that Lissio exists, thank you @meh ---------------------------------------------------------------------------------------------------- [04:08:12] Artur Ostręga(@aost):Also, holy crap, my game framework has nearly 400 stars ---------------------------------------------------------------------------------------------------- [04:08:23] Artur Ostręga(@aost):I couldn't have done it without you, Opal team. Thank you so much! ---------------------------------------------------------------------------------------------------- ############################## [2014-09-04] ############################## [08:13:15] Elia Schito(@elia):@skofo ^^^^ :heart_eyes: ---------------------------------------------------------------------------------------------------- ############################## [2014-09-09] ############################## [21:24:25] Artur Ostręga(@aost):With Opal::Server, is there any way to use a JS constant in the server's `main` *.erb code, or otherwise pass a variable from the server to `main`? ---------------------------------------------------------------------------------------------------- [21:27:41] Artur Ostręga(@aost):In other words, how to use a JS/server variable for the glob here https://github.com/opal/opal-rspec/blob/master/opal/opal/rspec/sprockets_runner.rb.erb#L7 ---------------------------------------------------------------------------------------------------- [22:16:36] Elia Schito(@elia):@skofo opal server is a standard sprockets env inside ---------------------------------------------------------------------------------------------------- [22:17:01] Elia Schito(@elia):so you should just be able to append another extension/processor as erb ---------------------------------------------------------------------------------------------------- [22:17:50] Elia Schito(@elia):or use an index.erb and put stuff in meta tags, I usually use them to fill ENV (opal-side) ---------------------------------------------------------------------------------------------------- ############################## [2014-09-10] ############################## [16:24:19] Artur Ostręga(@aost):@elia Thanks! ---------------------------------------------------------------------------------------------------- ############################## [2014-09-17] ############################## [20:29:11] CJ Lazell(@cj):hey, is it possible to use opal-jquery server side to manipulate html before it is loaded into the browser? ---------------------------------------------------------------------------------------------------- [20:31:09] Elia Schito(@elia):@cj no, opal-jquery wraps the real jquery, you’d better of with nokogiri and opal-browser that share the same api afaik ---------------------------------------------------------------------------------------------------- [20:31:26] Elia Schito(@elia):@cj that way you could share the code between the two ---------------------------------------------------------------------------------------------------- [20:32:32] CJ Lazell(@cj):@elia we are using nokogiri currently, just thought it would be nicer to use jquery for both instead of having two syntax's ---------------------------------------------------------------------------------------------------- [20:34:40] Elia Schito(@elia):@cj if you can giva a try to opal-browser (https://github.com/opal/opal-browser#readme), it covers everything you would do with jquery and much more ---------------------------------------------------------------------------------------------------- [20:35:29] CJ Lazell(@cj):@elia so you are saying to still use nokogiri server side and then opal-browser for client side? ---------------------------------------------------------------------------------------------------- [20:35:31] Elia Schito(@elia):and reusing code in the frontend (or vice-versa) is one of the most satisfying things with opal :) ---------------------------------------------------------------------------------------------------- [20:35:36] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [20:37:20] CJ Lazell(@cj):@elia thank you ---------------------------------------------------------------------------------------------------- [20:39:15] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [20:48:24] Elia Schito(@elia):@meh would be nice to generate yard docs for opal-browser too, it seems to be the better documented opal project around :) ---------------------------------------------------------------------------------------------------- [21:36:18] Eric West(@edubkendo)::+1: that ---------------------------------------------------------------------------------------------------- [21:37:40] Elia Schito(@elia):@edubkendo of course anyone’s invited and I’ll happily merge any PR for gh-pages :P ---------------------------------------------------------------------------------------------------- [21:38:12] Eric West(@edubkendo):;P ---------------------------------------------------------------------------------------------------- ############################## [2014-09-19] ############################## [07:02:18] Elia Schito(@elia):@elia replies to @ryanstout question on freenode ---------------------------------------------------------------------------------------------------- [07:02:57] Elia Schito(@elia):@ryanstout opal-build should work fine, but let me know about any bug you run into, or missing use cases ---------------------------------------------------------------------------------------------------- [21:13:30] Elia Schito(@elia):http://developer.telerik.com/featured/apples-biggest-announcement-yet-isnt-phones-watches/?utm_source=javascriptweekly&utm_medium=email ---------------------------------------------------------------------------------------------------- ############################## [2014-09-20] ############################## [02:19:32] Ryan Stout(@ryanstout):Question, what's the status on: https://github.com/opal/opal/issues/572 ---------------------------------------------------------------------------------------------------- [02:20:02] Ryan Stout(@ryanstout):I can fix it if you guys want. ---------------------------------------------------------------------------------------------------- [13:53:47] Loïc Boutet(@loicboutet):Hey, I sent a first pull request to a serie of improvement I though of for vienna ---------------------------------------------------------------------------------------------------- [13:53:54] Loïc Boutet(@loicboutet):Would be happy to discuss them :) ---------------------------------------------------------------------------------------------------- ############################## [2014-09-30] ############################## [17:35:20] George(@georgeu2000):Thank you so much for Opal. It is awesome!!! ---------------------------------------------------------------------------------------------------- ############################## [2014-10-01] ############################## [08:17:40] Elia Schito(@elia)::star: ---------------------------------------------------------------------------------------------------- [15:09:50] George(@georgeu2000):Regarding the purpose of Opal, do you have any notes about that? The more I work with it, the more I see that Ruby and JS are different. So it feels weird to write Ruby just to avoid writing JS. ---------------------------------------------------------------------------------------------------- [15:11:24] George(@georgeu2000):I wonder if there are other goals, such as making the server and browser one system, instead of 2 separate systems? ---------------------------------------------------------------------------------------------------- [16:45:47] Elia Schito(@elia):@georgeu2000 for me it’s about having all the features that make Ruby great instead of all the “bad parts” of javascript. But I see that the more you interact with other JS libs the more you’ll experience the gap between the two languages… ---------------------------------------------------------------------------------------------------- [17:20:46] George(@georgeu2000):Do you have any specific use cases? For example, sharing code between server and browser? ---------------------------------------------------------------------------------------------------- [17:21:46] Elia Schito(@elia):Did happen a couple of times that I moved code from one to the other with little or no modification ---------------------------------------------------------------------------------------------------- [17:51:32] George(@georgeu2000):Is it possible to take HTML string and create HTML objects, operate on them using Opal-jQuery, and then append to the DOM? For example: html = "
bar
" ---------------------------------------------------------------------------------------------------- [17:53:30] George(@georgeu2000):Here's my use case: Browser get JSON from the server, and has the html template (as above). ---------------------------------------------------------------------------------------------------- [17:54:20] George(@georgeu2000):I want to add the JSON data to the html, and then append it to the DOM. ---------------------------------------------------------------------------------------------------- [18:10:46] Elia Schito(@elia):gotta go, will reply later ---------------------------------------------------------------------------------------------------- [23:00:21] Elia Schito(@elia):@georgeu2000 sure, with opal-jquery you can do everything you can do with normal jquery ---------------------------------------------------------------------------------------------------- ############################## [2014-10-02] ############################## [14:53:41] George(@georgeu2000):@edubkendo - I see. ---------------------------------------------------------------------------------------------------- [14:55:32] Adam Beynon(@adambeynon):georgeu2000 - In relation to your sharing code question, I share quite a few "model validator" classes between the server and client, and that works really nicely. Both also use rspec for tests, so running those in the client as well is really reassuring ---------------------------------------------------------------------------------------------------- [14:55:57] Adam Beynon(@adambeynon):apart from that, the backend is just serving up JSON, and then the client uses Vienna::View for rendering the HAML templates ---------------------------------------------------------------------------------------------------- [15:17:41] George(@georgeu2000):@adambeynon - Cool. Do you write your own "model validator" classes? ---------------------------------------------------------------------------------------------------- [15:18:09] Elia Schito(@elia):@adambeynon please paste here one of them (or in a gist) I’m interested too :) ---------------------------------------------------------------------------------------------------- [15:18:28] George(@georgeu2000):Or use AR or other DB validators? ---------------------------------------------------------------------------------------------------- [15:21:38] Adam Beynon(@adambeynon):They used to be AR validations, but I extracted them because I also wanted them client side ---------------------------------------------------------------------------------------------------- [15:21:53] Adam Beynon(@adambeynon):e.g. the one Im working to refactor now just validates dates for a Holiday Reservation ---------------------------------------------------------------------------------------------------- [15:22:05] Adam Beynon(@adambeynon):so, I just implement them as simple Ruby classes.. ---------------------------------------------------------------------------------------------------- [15:22:15] Adam Beynon(@adambeynon):and for Rails, add them inside a before_update call ---------------------------------------------------------------------------------------------------- [15:22:23] Adam Beynon(@adambeynon):and for vienna, I have similar callback features ---------------------------------------------------------------------------------------------------- [15:22:36] Adam Beynon(@adambeynon):(I dont like packing everything inside the model implementation as much as I can) ---------------------------------------------------------------------------------------------------- [15:24:10] Elia Schito(@elia):extracting validations makes much sense, especially considering different context (same as what happened with strong parameters) ---------------------------------------------------------------------------------------------------- [15:25:39] Adam Beynon(@adambeynon):agreed. One thing I've also really got into recently is the Interactor pattern with rails controllers ---------------------------------------------------------------------------------------------------- [15:25:42] Adam Beynon(@adambeynon):gem I use: https://github.com/collectiveidea/interactor ---------------------------------------------------------------------------------------------------- [15:25:49] Adam Beynon(@adambeynon):converted most controllers to use that ---------------------------------------------------------------------------------------------------- [15:25:59] Adam Beynon(@adambeynon):so controller testing now is pretty much zero ---------------------------------------------------------------------------------------------------- [15:26:11] Adam Beynon(@adambeynon):even PORO make more sense ---------------------------------------------------------------------------------------------------- [20:03:47] George(@georgeu2000):How can I tell if the code is running in Javascript? ---------------------------------------------------------------------------------------------------- [20:04:17] George(@georgeu2000):Is there a var or method that exposes the environment? ---------------------------------------------------------------------------------------------------- [20:18:22] Adam Beynon(@adambeynon):RUBY_ENGINE == "opal" ---------------------------------------------------------------------------------------------------- [21:14:59] Elia Schito(@elia):@adambeynon interactor looks good, but I’d like to see one of the validators ---------------------------------------------------------------------------------------------------- [21:21:33] Adam Beynon(@adambeynon):elia: well, the one Im about to start rewriting: https://gist.github.com/adambeynon/dd86f787f53e0a878f40 ---------------------------------------------------------------------------------------------------- [21:22:45] Adam Beynon(@adambeynon):that doesnt currently work under opal/vienna... ---------------------------------------------------------------------------------------------------- [21:22:56] Adam Beynon(@adambeynon):its also quite tricky to make work under both :( ---------------------------------------------------------------------------------------------------- [21:23:05] Elia Schito(@elia):thanks, I was curious about error handling / storage ---------------------------------------------------------------------------------------------------- [21:23:25] Elia Schito(@elia):dates uh? ---------------------------------------------------------------------------------------------------- [21:31:43] Adam Beynon(@adambeynon):dealing with dates has ruined most of my day so far... ---------------------------------------------------------------------------------------------------- [21:34:03] Elia Schito(@elia):sorry about that :) ---------------------------------------------------------------------------------------------------- [21:35:47] Adam Beynon(@adambeynon):elia: do you use Vienna::Model at all? ---------------------------------------------------------------------------------------------------- [21:37:28] George(@georgeu2000):@adambeynon - Thanks. ---------------------------------------------------------------------------------------------------- [21:38:42] Elia Schito(@elia):I usually end up using plain classes, and mostly the Vienna inspired View class from this post ---------------------------------------------------------------------------------------------------- [21:38:50] Elia Schito(@elia):@elia is fetching the link ---------------------------------------------------------------------------------------------------- [21:39:30] Elia Schito(@elia):http://dev.mikamai.com/post/96967839924/dead-simple-view-layer-with-opal-and-jquery ---------------------------------------------------------------------------------------------------- [21:39:59] Elia Schito(@elia):@adambeynon on current project opal is off limits (seems to be at least) ---------------------------------------------------------------------------------------------------- [21:40:48] Elia Schito(@elia):here the code: https://gist.github.com/elia/50a723e6133a645b4858 ---------------------------------------------------------------------------------------------------- [21:42:35] Adam Beynon(@adambeynon):ahhh yeah, I remember reading that post ---------------------------------------------------------------------------------------------------- [21:43:02] Adam Beynon(@adambeynon):I think im starting to need a much more complete Model setup for my apps.. ---------------------------------------------------------------------------------------------------- [21:43:17] Adam Beynon(@adambeynon):lots of rails inspired callbacks, old attribute values etc ---------------------------------------------------------------------------------------------------- [21:43:21] Adam Beynon(@adambeynon):might make a new repo ---------------------------------------------------------------------------------------------------- [21:43:27] Adam Beynon(@adambeynon):and keep Vienna::Model simpler.. ---------------------------------------------------------------------------------------------------- [21:43:44] Loïc Boutet(@loicboutet):Isn't what he describes in this post pretty much the same as vienna::view? ---------------------------------------------------------------------------------------------------- [21:43:50] Elia Schito(@elia):you said AR callbacks? weren’t those bad? :P ---------------------------------------------------------------------------------------------------- [21:44:18] Elia Schito(@elia):@loicboutet pretty much, probably a stripped down version ---------------------------------------------------------------------------------------------------- [21:44:34] Loïc Boutet(@loicboutet):ok ^^ ---------------------------------------------------------------------------------------------------- [21:44:47] Adam Beynon(@adambeynon):lol, yes they are. but sometimes (just sometimes ;) ) they make sense ---------------------------------------------------------------------------------------------------- [21:44:50] Adam Beynon(@adambeynon):"sometimes" ---------------------------------------------------------------------------------------------------- [21:45:05] Elia Schito(@elia):agreed ;) ---------------------------------------------------------------------------------------------------- [21:45:24] Loïc Boutet(@loicboutet):I must admit I did not use the vienna::model at the moment, mainly because I always have a rails/sintra back end ---------------------------------------------------------------------------------------------------- [21:45:34] Loïc Boutet(@loicboutet):and I'm still figuring out what's the best way to integrate :) ---------------------------------------------------------------------------------------------------- [21:50:22] Loïc Boutet(@loicboutet):How do you guys do usually? ---------------------------------------------------------------------------------------------------- [23:15:46] Elia Schito(@elia):@adambeynon @meh we’re official AltRuby :P http://youtu.be/5FLrKg-b6o8?t=7m47s ---------------------------------------------------------------------------------------------------- [14:45:53] Eric West(@edubkendo):@georgeu2000 All it really took to sell me was being able to operate on collections of data using the Enumerable methods ---------------------------------------------------------------------------------------------------- [14:46:18] Eric West(@edubkendo):It's infinitely nicer than using javascripts nasty for loops ---------------------------------------------------------------------------------------------------- [14:47:41] Eric West(@edubkendo):Manipulating collections of data is such a huge, enormous part of what we do all the time, anything that makes that better/easier/cleaner is a big win ---------------------------------------------------------------------------------------------------- ############################## [2014-10-05] ############################## [01:39:19] George(@georgeu2000):@elia - What is the proper way to require files that get transcoded? ---------------------------------------------------------------------------------------------------- [01:40:42] George(@georgeu2000):I serving the transcoded file with: ``` def compile folder, file content_type "text/javascript" Opal.compile( File.read( "#{ folder }/#{ file }.rb" )) end ``` ---------------------------------------------------------------------------------------------------- [01:42:12] George(@georgeu2000):Is the require translated into a JS require? ---------------------------------------------------------------------------------------------------- [01:45:27] George(@georgeu2000):I don't see any require in the transcoded JS. ---------------------------------------------------------------------------------------------------- [08:47:58] Elia Schito(@elia):@georgeu2000 compile is pretty low level, you should use the builder to get required stuff in generated source ---------------------------------------------------------------------------------------------------- [13:34:35] George(@georgeu2000):OK, thanks. ---------------------------------------------------------------------------------------------------- ############################## [2014-10-07] ############################## [23:30:58] Loïc Boutet(@loicboutet):well phonegap is the cheap solution to do that ---------------------------------------------------------------------------------------------------- [23:31:18] George(@georgeu2000):I read an interesting post by DHH about Rubymotion and the Basecamp app... ---------------------------------------------------------------------------------------------------- [23:31:21] Loïc Boutet(@loicboutet):you can embed your website in it, but well it won't have a native feel except if you put a lot of effort ---------------------------------------------------------------------------------------------------- [23:31:27] Loïc Boutet(@loicboutet):oh? I missed that one ---------------------------------------------------------------------------------------------------- [23:31:34] George(@georgeu2000):Let me find it... ---------------------------------------------------------------------------------------------------- [23:32:07] George(@georgeu2000):https://signalvnoise.com/posts/3432-why-i-loved-building-basecamp-for-iphone-in-rubymotion ---------------------------------------------------------------------------------------------------- [23:32:22] Loïc Boutet(@loicboutet):thx ---------------------------------------------------------------------------------------------------- [23:32:36] Loïc Boutet(@loicboutet):I ll be able to try rubymotion at my next job ---------------------------------------------------------------------------------------------------- [23:32:47] George(@georgeu2000):It's pretty old, so I wonder if things have changed... ---------------------------------------------------------------------------------------------------- [23:32:49] George(@georgeu2000):Cool ---------------------------------------------------------------------------------------------------- [23:32:50] Loïc Boutet(@loicboutet):I am quite interested to try it :) ---------------------------------------------------------------------------------------------------- [23:32:56] George(@georgeu2000):I see it is by Nick, not DHH. ---------------------------------------------------------------------------------------------------- [23:33:06] Loïc Boutet(@loicboutet):OK ---------------------------------------------------------------------------------------------------- [23:33:34] George(@georgeu2000):It's interesting because it talks about integrating native controls with Ruby. ---------------------------------------------------------------------------------------------------- [23:33:59] George(@georgeu2000):But, with iOS 8, it seems that the UI has changed... ---------------------------------------------------------------------------------------------------- [23:34:21] Loïc Boutet(@loicboutet):well yes, they do that on iOS version change ---------------------------------------------------------------------------------------------------- [23:34:41] Loïc Boutet(@loicboutet):they changed quite a lot of the UI code between 6 and 7 ---------------------------------------------------------------------------------------------------- [23:35:00] George(@georgeu2000):I see... ---------------------------------------------------------------------------------------------------- [23:35:11] Loïc Boutet(@loicboutet):(I unfortunately had to do some light coding in objective c in a previous life lol) ---------------------------------------------------------------------------------------------------- [23:35:50] George(@georgeu2000):You didn't like it? ---------------------------------------------------------------------------------------------------- [23:35:59] Loïc Boutet(@loicboutet):not a bit lol ---------------------------------------------------------------------------------------------------- [23:36:24] Loïc Boutet(@loicboutet):the language is ugly as hell and the STI is pretty useless ---------------------------------------------------------------------------------------------------- [23:36:41] Loïc Boutet(@loicboutet):but well, I think ruby spoiled me ---------------------------------------------------------------------------------------------------- [23:37:30] Loïc Boutet(@loicboutet):ok ... need to go it's 1am here ;) ---------------------------------------------------------------------------------------------------- [23:37:41] Loïc Boutet(@loicboutet):see you ! ---------------------------------------------------------------------------------------------------- [23:41:33] George(@georgeu2000):Au revior ---------------------------------------------------------------------------------------------------- [22:17:28] Loïc Boutet(@loicboutet):so if you tell me I can put ruby in {{ }} ---------------------------------------------------------------------------------------------------- [22:17:31] Loïc Boutet(@loicboutet):I'm fine with it ---------------------------------------------------------------------------------------------------- [22:18:04] Loïc Boutet(@loicboutet):if you tell me the view template is similar to handlebar... I will think it will have the same downside ---------------------------------------------------------------------------------------------------- [22:18:12] Ryan Stout(@ryanstout):cool. Yea, now its (almost) any ruby in between {{ ... }} ---------------------------------------------------------------------------------------------------- [22:18:19] Loïc Boutet(@loicboutet):do you see what I mean? ---------------------------------------------------------------------------------------------------- [22:18:32] Loïc Boutet(@loicboutet):ok sounds good ! ---------------------------------------------------------------------------------------------------- [22:21:31] Loïc Boutet(@loicboutet):I'm quite excited at opal and the project building on top of it ---------------------------------------------------------------------------------------------------- [22:22:03] Loïc Boutet(@loicboutet):I feel like rails did not catch up to the new development of single app page and hope ruby in general will be able to catch up ---------------------------------------------------------------------------------------------------- [22:22:17] Loïc Boutet(@loicboutet):I'm glad to see new stuff like volt proposing solutions :) ---------------------------------------------------------------------------------------------------- [22:26:24] Ryan Stout(@ryanstout):yea, I think opal will play a big part in ruby's future :-) ---------------------------------------------------------------------------------------------------- [22:26:57] Loïc Boutet(@loicboutet):I think so too ---------------------------------------------------------------------------------------------------- [22:27:07] Loïc Boutet(@loicboutet):what was your motivation when starting volt? ---------------------------------------------------------------------------------------------------- [22:43:18] George(@georgeu2000):Why do you want to put the logic in the view? ---------------------------------------------------------------------------------------------------- [22:44:12] Loïc Boutet(@loicboutet):well I'm talking about if else / each function kind of logic ---------------------------------------------------------------------------------------------------- [22:44:45] George(@georgeu2000):I see. ---------------------------------------------------------------------------------------------------- [22:47:03] Ryan Stout(@ryanstout):@loicboutet I mostly build very front-end heavy apps, and I wasn't really happy with rails+angular (or ember) ---------------------------------------------------------------------------------------------------- [22:47:37] Ryan Stout(@ryanstout):@georgeu2000 yea, the idea isn't to put "logic" in there, but you can call methods and stuff from bindings ---------------------------------------------------------------------------------------------------- [22:48:06] Ryan Stout(@ryanstout):but it's not a logic-less templating language, though you could use it that way ---------------------------------------------------------------------------------------------------- [22:48:19] Loïc Boutet(@loicboutet):ok ! ---------------------------------------------------------------------------------------------------- [22:48:33] Loïc Boutet(@loicboutet):do you have things in production built with volt already? ---------------------------------------------------------------------------------------------------- [22:48:58] Ryan Stout(@ryanstout):@loicboutet nothing huge, just some small stuff ---------------------------------------------------------------------------------------------------- [22:49:07] Ryan Stout(@ryanstout):working on a larger one now ---------------------------------------------------------------------------------------------------- [22:49:13] Loïc Boutet(@loicboutet):ok ! ---------------------------------------------------------------------------------------------------- [22:50:05] Loïc Boutet(@loicboutet):hey, byt the way, something totally different ---------------------------------------------------------------------------------------------------- [22:50:10] Loïc Boutet(@loicboutet):but have you seen https://github.com/BrewhouseTeam/angular_sprinkles ? ---------------------------------------------------------------------------------------------------- [22:50:22] Loïc Boutet(@loicboutet):what do you think about it? ---------------------------------------------------------------------------------------------------- [22:50:47] Ryan Stout(@ryanstout):I haven't seen it ---------------------------------------------------------------------------------------------------- [22:50:54] Ryan Stout(@ryanstout):looks like its useful ---------------------------------------------------------------------------------------------------- [22:51:13] AstonJ(@AstonJ):I saw Sprinkles (think there’s a blog post about it as well) but it’s still Angular. I would prefer to use Opal/Volt ---------------------------------------------------------------------------------------------------- [22:53:02] AstonJ(@AstonJ):Going back to tempting - I think {{ }} will continue to have negative connotations. I reckon switching to <% is going to be a very positive move (of I will stop going on about it now lol) ---------------------------------------------------------------------------------------------------- [22:53:15] AstonJ(@AstonJ):of = ok ---------------------------------------------------------------------------------------------------- [22:54:12] Loïc Boutet(@loicboutet):well, I understand your point about <% in html... but I agree with Astonj, in term of user adoption I think <% is the way to go ---------------------------------------------------------------------------------------------------- [22:54:24] AstonJ(@AstonJ):Great conversation too - I reckon a blog post on the topic would be a neat idea. ---------------------------------------------------------------------------------------------------- [22:55:03] Loïc Boutet(@loicboutet):Ryan > do you think your ideas in volt could be ported to rails? ---------------------------------------------------------------------------------------------------- [22:55:31] Loïc Boutet(@loicboutet):a kind of volt-rails gem ? ---------------------------------------------------------------------------------------------------- [22:56:15] AstonJ(@AstonJ):Yeah @loicboutet I think it will help create less barriers. Plus we mustn’t forget so many of us dislike brackets-heavy languages, and {{}} seems to represent that (ok definitely shutting up now!) ---------------------------------------------------------------------------------------------------- [22:56:57] Loïc Boutet(@loicboutet):@AstonJ ahah yes ---------------------------------------------------------------------------------------------------- [22:57:59] AstonJ(@AstonJ):Interesting idea @loicboutet but I wonder if part of Volt’s appeal is that it’s a rack-app, built for the modern web - so might be less bloated and dare I say it, more scalable? (No idea if that’s actually the case) ---------------------------------------------------------------------------------------------------- [22:59:09] Loïc Boutet(@loicboutet):Well, I guess you can make the point that rails is bloated :) ---------------------------------------------------------------------------------------------------- [22:59:31] Ryan Stout(@ryanstout):@loicboutet Volt and rails kind of approach things differently, so I don't think it would make since to try to integrate it into rails ---------------------------------------------------------------------------------------------------- [22:59:31] Loïc Boutet(@loicboutet):but it is also the most used framework in ruby by a large margin ---------------------------------------------------------------------------------------------------- [22:59:45] Loïc Boutet(@loicboutet):@ryanstout OK ---------------------------------------------------------------------------------------------------- [23:00:10] Loïc Boutet(@loicboutet):I'm just trying to find a way to import new ideas in existing projects without rewriting everything :) ---------------------------------------------------------------------------------------------------- [23:00:26] Loïc Boutet(@loicboutet):I'm working on a project right now, and it begin to be really js heavy ---------------------------------------------------------------------------------------------------- [23:00:28] Ryan Stout(@ryanstout):yea, thats always tricky ---------------------------------------------------------------------------------------------------- [23:00:55] Loïc Boutet(@loicboutet):I would be glad if I had a way to make it nicer and keeping the rails part :) ---------------------------------------------------------------------------------------------------- [23:01:09] Loïc Boutet(@loicboutet):that s why I was thinking about a vienna integration ---------------------------------------------------------------------------------------------------- [23:01:11] AstonJ(@AstonJ):Maybe bloated wasn’t a good word to use - but Rails is getting on now, there may well be stuff there that is a little outdated. Having said that, I do love Rails. The only thing I currently dislike is that they haven’t or have no plans to adopt Opal. ---------------------------------------------------------------------------------------------------- [23:01:54] Loïc Boutet(@loicboutet):yeah, well the best thing to do for them to change their mind is to integrate well with them ;) ---------------------------------------------------------------------------------------------------- [23:02:50] AstonJ(@AstonJ):They have big apps on Rails, and switching to Opal might be a lot of work for them - but I feel ignoring it will mean something like Volt could well come in and steal their thunder. ---------------------------------------------------------------------------------------------------- [23:03:11] Loïc Boutet(@loicboutet):that is definitely something that could happen ---------------------------------------------------------------------------------------------------- [23:03:47] Loïc Boutet(@loicboutet):the framework which will be unifying the front and the back with the modern requirement for both will definitely have a good shot :) ---------------------------------------------------------------------------------------------------- [23:04:33] AstonJ(@AstonJ):I’m personally very excited about Volt - it _feels_ cutting edge, not just as good as Angular and the rest, but better, because it’s Ruby. I reckon we will see some awesome things with it :D ---------------------------------------------------------------------------------------------------- [23:05:18] Loïc Boutet(@loicboutet):Actually I will have to check it out more :) ---------------------------------------------------------------------------------------------------- [23:05:31] Loïc Boutet(@loicboutet):I was kind of falling in love with vienna those last weeks ---------------------------------------------------------------------------------------------------- [23:05:40] Loïc Boutet(@loicboutet):I like it s simplicity and its core principle ---------------------------------------------------------------------------------------------------- [23:05:56] Loïc Boutet(@loicboutet):Now I might have to reconsider lol ---------------------------------------------------------------------------------------------------- [23:06:00] AstonJ(@AstonJ):Vienna looks awesome too :+1: ---------------------------------------------------------------------------------------------------- [23:06:13] Loïc Boutet(@loicboutet):well vienna is less disruptive ---------------------------------------------------------------------------------------------------- [23:06:25] Loïc Boutet(@loicboutet):you an keep your existing habit for the back end ---------------------------------------------------------------------------------------------------- [23:06:34] Loïc Boutet(@loicboutet):and have a nice front end framework in ruby ---------------------------------------------------------------------------------------------------- [23:06:47] AstonJ(@AstonJ):Admittedly, I haven’t looked too much into Vienna right now - but should... ---------------------------------------------------------------------------------------------------- [23:07:02] Loïc Boutet(@loicboutet):I think all is lacking is a good integration with rails/sinatra ---------------------------------------------------------------------------------------------------- [23:07:25] Loïc Boutet(@loicboutet):like making it super easy to use inside those kind of project ---------------------------------------------------------------------------------------------------- [23:07:30] Loïc Boutet(@loicboutet):and it could have an audience ---------------------------------------------------------------------------------------------------- [23:08:04] Loïc Boutet(@loicboutet):What I like about vienna is that it just attach logic to your html elements ---------------------------------------------------------------------------------------------------- [23:08:24] AstonJ(@AstonJ):You should give that feedback to @adambeynon and @elia - though, they are probably already on it :D ---------------------------------------------------------------------------------------------------- [23:08:31] Loïc Boutet(@loicboutet):like you say "ok, now this table is my object and I will add attribute to it, and teach it its business logic" ---------------------------------------------------------------------------------------------------- [23:08:53] Loïc Boutet(@loicboutet):I like the simplicity in that ---------------------------------------------------------------------------------------------------- [23:09:03] Loïc Boutet(@loicboutet):and from what I see it s working quite well (for me at least) ---------------------------------------------------------------------------------------------------- [23:09:08] AstonJ(@AstonJ):I feel a new blog post coming on…. “Ruby is about to get cool again!" ---------------------------------------------------------------------------------------------------- [23:09:13] Loïc Boutet(@loicboutet):ah ah ---------------------------------------------------------------------------------------------------- [23:09:38] Loïc Boutet(@loicboutet):I did a presentation kind of like that at the paris ruby meet up :p ---------------------------------------------------------------------------------------------------- [23:09:47] Loïc Boutet(@loicboutet):"ruby is not only for your servers anymore" ---------------------------------------------------------------------------------------------------- [23:10:01] AstonJ(@AstonJ):have you got the slides up anywhere? :page_facing_up: ---------------------------------------------------------------------------------------------------- [23:10:04] AstonJ(@AstonJ)::p ---------------------------------------------------------------------------------------------------- [23:10:28] Loïc Boutet(@loicboutet):kind of, http://www.rubyparis.org/videos/ruby-not-only-for-servers-loic-boutet ---------------------------------------------------------------------------------------------------- [23:10:38] Loïc Boutet(@loicboutet):but the talk is in french ^^ ---------------------------------------------------------------------------------------------------- [23:10:54] Loïc Boutet(@loicboutet):the slides are in english thought ---------------------------------------------------------------------------------------------------- [23:11:21] AstonJ(@AstonJ):Cool - thanks! My French is very rusty lol good to know the slides are in English ---------------------------------------------------------------------------------------------------- [23:11:43] AstonJ(@AstonJ):Nice chatting with you! I need to reboot (little snitch update) catch you laters ---------------------------------------------------------------------------------------------------- [23:11:53] Loïc Boutet(@loicboutet):sure :) ---------------------------------------------------------------------------------------------------- [23:18:39] Loïc Boutet(@loicboutet):In my talk I'm just using opal (and vienna) to make a very simple tic tac toe ---------------------------------------------------------------------------------------------------- [23:18:52] Loïc Boutet(@loicboutet):and then use the same code ---------------------------------------------------------------------------------------------------- [23:19:00] Loïc Boutet(@loicboutet):to have the tictactoe run in the browser ---------------------------------------------------------------------------------------------------- [23:19:20] Loïc Boutet(@loicboutet):then embed it in atom-shell to make a desktop app ---------------------------------------------------------------------------------------------------- [23:19:31] Loïc Boutet(@loicboutet):and then send it to the phonegap cloud to make a mobile app ---------------------------------------------------------------------------------------------------- [23:19:56] Loïc Boutet(@loicboutet):and then you have a working app running everywhere with the same base code in ruby :) ---------------------------------------------------------------------------------------------------- [23:27:35] George(@georgeu2000):@loicboutet - Wow, that's awesome. ---------------------------------------------------------------------------------------------------- [23:28:24] Loïc Boutet(@loicboutet):thx, well opal is doing all the heavy lifting ---------------------------------------------------------------------------------------------------- [23:28:36] Loïc Boutet(@loicboutet):after that it's just using already existing js tools ---------------------------------------------------------------------------------------------------- [23:29:00] Loïc Boutet(@loicboutet):the code is there if you want to look at it https://github.com/loicboutet/opal-tictactoe ---------------------------------------------------------------------------------------------------- [23:29:07] George(@georgeu2000):Cool. Thanks. ---------------------------------------------------------------------------------------------------- [23:29:09] Loïc Boutet(@loicboutet):it needs some clean up ---------------------------------------------------------------------------------------------------- [23:29:27] Loïc Boutet(@loicboutet):(I started from the vienna todo app and all the readme and stuff have not changed lol) ---------------------------------------------------------------------------------------------------- [23:30:00] George(@georgeu2000):I think a major pain point is that a lot of work is required to take a web app and convert to iOS and Android. And it is difficult to share code between them. ---------------------------------------------------------------------------------------------------- [23:30:00] Loïc Boutet(@loicboutet):I used some existing tictactoe class for the game logic ---------------------------------------------------------------------------------------------------- [23:30:12] Loïc Boutet(@loicboutet):made from another member of the ruby paris meetup ---------------------------------------------------------------------------------------------------- [23:30:18] Loïc Boutet(@loicboutet):just to prove you can reuse code in opal ---------------------------------------------------------------------------------------------------- [23:30:32] Loïc Boutet(@loicboutet):yes definitely ---------------------------------------------------------------------------------------------------- [21:03:25] Loïc Boutet(@loicboutet):Has anyone made a vienna app inside a rails app? ---------------------------------------------------------------------------------------------------- [21:04:00] Loïc Boutet(@loicboutet):I'm thinking that rails is quite useful when dealing with normal, mainly static webpage ---------------------------------------------------------------------------------------------------- [21:04:17] Loïc Boutet(@loicboutet):but not so much when you want a javascript heavy page ---------------------------------------------------------------------------------------------------- [21:04:31] Loïc Boutet(@loicboutet):vienna could be useful for handling this case ---------------------------------------------------------------------------------------------------- [21:05:09] Loïc Boutet(@loicboutet):you would made a small vienna app for handling the necessary js ---------------------------------------------------------------------------------------------------- [21:05:45] Loïc Boutet(@loicboutet):anyone has used it in such a fashion? ---------------------------------------------------------------------------------------------------- [21:46:49] AstonJ(@AstonJ):Sounds like a good idea @loicboutet - though you may want to look at voltframework.com as well :) ---------------------------------------------------------------------------------------------------- [21:47:47] Loïc Boutet(@loicboutet):well I like volt ---------------------------------------------------------------------------------------------------- [21:48:08] Loïc Boutet(@loicboutet):but personally I cannot think of a lot of use case to use it ---------------------------------------------------------------------------------------------------- [22:07:17] Ryan Stout(@ryanstout):@loicboutet going to put in my $0.02 on Volt. Its a bit early, but you will be able to build anything in it. The live updating is only one small feature. You can also do bindings that don't live update (here's a video showing that: https://www.youtube.com/watch?v=c478sMlhx1o) ---------------------------------------------------------------------------------------------------- [22:08:14] Ryan Stout(@ryanstout):I think the big win with volt is sharing code between client and server. I'm working on a demo that should the sharing better ---------------------------------------------------------------------------------------------------- [22:08:14] Loïc Boutet(@loicboutet):hmm ok ---------------------------------------------------------------------------------------------------- [22:08:38] Loïc Boutet(@loicboutet):Sharing code would definitly be a big plus ---------------------------------------------------------------------------------------------------- [22:08:55] Loïc Boutet(@loicboutet):I admit I probably should look more into it ---------------------------------------------------------------------------------------------------- [22:08:55] Ryan Stout(@ryanstout):not needing to do REST api's to sync data between client and server is also nice, imho ---------------------------------------------------------------------------------------------------- [22:09:32] Loïc Boutet(@loicboutet):When I saw it I kind of thought it is a sort of meteorjs for ruby ---------------------------------------------------------------------------------------------------- [22:09:57] Ryan Stout(@ryanstout):it is similar, but I think meteor failed to make it easy to build the usual CRUD apps. Volt's buffers make CRUD stuff really easy. ---------------------------------------------------------------------------------------------------- [22:10:06] Ryan Stout(@ryanstout):(again, imho) ---------------------------------------------------------------------------------------------------- [22:10:10] Loïc Boutet(@loicboutet):OK ---------------------------------------------------------------------------------------------------- [22:10:15] Loïc Boutet(@loicboutet):I agree with you with meteor ---------------------------------------------------------------------------------------------------- [22:10:24] Loïc Boutet(@loicboutet):and kind of thought that volt would have the same problem ---------------------------------------------------------------------------------------------------- [22:10:35] Ryan Stout(@ryanstout):I'm with you, realtime apps aren't that common ---------------------------------------------------------------------------------------------------- [22:10:43] Loïc Boutet(@loicboutet):since I understood the use case it was trying to solve was the live application stuff ---------------------------------------------------------------------------------------------------- [22:11:14] Loïc Boutet(@loicboutet):ok, we agree, and that mean I really have to dig deeper in volt ---------------------------------------------------------------------------------------------------- [22:11:41] Ryan Stout(@ryanstout):hit me up if you have any questions :-) hopefully I can get some more demo videos out soon ---------------------------------------------------------------------------------------------------- [22:12:01] Loïc Boutet(@loicboutet):can I ask you why the views use a custom templating language? ---------------------------------------------------------------------------------------------------- [22:12:27] Loïc Boutet(@loicboutet):is it necessary for the automatic dom update? ---------------------------------------------------------------------------------------------------- [22:13:19] Ryan Stout(@ryanstout):yea, the views got changed recently (the video's not updated). Now the views are basically just ruby in {{ and }} ---------------------------------------------------------------------------------------------------- [22:13:38] Loïc Boutet(@loicboutet):oh nice ! ---------------------------------------------------------------------------------------------------- [22:14:01] Loïc Boutet(@loicboutet):I was a bit put off by the templating to be honnest, never been a big fan of handlebars ---------------------------------------------------------------------------------------------------- [22:14:20] Ryan Stout(@ryanstout):I'm still considering switching to erb style. I personally like {{ and }} over <% and %>, but most rubyists seem to like erb style (because it's familiar I think) ---------------------------------------------------------------------------------------------------- [22:15:04] Loïc Boutet(@loicboutet):in my experience yes it is way more familiar, and I have been extremely frustrated when using mustache/handlebar ---------------------------------------------------------------------------------------------------- [22:15:26] Ryan Stout(@ryanstout):is part of the issue the {{ and }} ? ---------------------------------------------------------------------------------------------------- [22:15:41] Ryan Stout(@ryanstout):I always just thought doing <% in a html attribute seems weird (since your already in a tag) ---------------------------------------------------------------------------------------------------- [22:15:53] Loïc Boutet(@loicboutet):personnally it s not the {{ }} in themselve ---------------------------------------------------------------------------------------------------- [22:16:02] Loïc Boutet(@loicboutet):but the fact that I associate them with handlebar ---------------------------------------------------------------------------------------------------- [22:16:15] Loïc Boutet(@loicboutet):and handlebar is good when you juste want to put value in the template ---------------------------------------------------------------------------------------------------- [22:16:26] Loïc Boutet(@loicboutet):but sucks (imho) for logic stuff ---------------------------------------------------------------------------------------------------- [22:16:59] Ryan Stout(@ryanstout):yea, I agree on that ---------------------------------------------------------------------------------------------------- [22:17:06] Ryan Stout(@ryanstout):doing #each /each is weird too ---------------------------------------------------------------------------------------------------- [22:17:08] Loïc Boutet(@loicboutet):so when I had to use it I was kind of frustrated, so now I'm wincing at the sight lol ---------------------------------------------------------------------------------------------------- [22:17:12] Loïc Boutet(@loicboutet):yeah ---------------------------------------------------------------------------------------------------- ############################## [2014-10-08] ############################## [22:03:00] George(@georgeu2000):@elia - Do you know why `puts` statements converted to JS and run in tests with poltergeist print to the console? ---------------------------------------------------------------------------------------------------- [22:03:13] George(@georgeu2000):Is this coming from Poltergeist or Opal? ---------------------------------------------------------------------------------------------------- [22:03:45] George(@georgeu2000):Is there a way I can distinguish between code running in Poltergeist and running in a browser? ---------------------------------------------------------------------------------------------------- [22:04:07] George(@georgeu2000):I checked RUBY_ENGINE. It is "Opal" in both cases. ---------------------------------------------------------------------------------------------------- [22:20:26] George(@georgeu2000):Actually it is "opal". ---------------------------------------------------------------------------------------------------- ############################## [2014-10-10] ############################## [16:13:37] Elia Schito(@elia):@georgeu2000 I guess you need to check for something specific to poltergeist, just as you’d need to distinguish using vanilla js ---------------------------------------------------------------------------------------------------- [17:45:11] George(@georgeu2000):Yes, this worked:``` RUBY_ENGINE == 'opal' && ! `!!window.callPhantom` ``` ---------------------------------------------------------------------------------------------------- [17:47:18] George(@georgeu2000):Thank you. ---------------------------------------------------------------------------------------------------- ############################## [2014-10-15] ############################## [18:25:54] Bernhard Weichel(@bwl21):hi ---------------------------------------------------------------------------------------------------- [18:26:10] Bernhard Weichel(@bwl21):[1,2,3].product([4,5]) yields an error. ---------------------------------------------------------------------------------------------------- [18:26:55] Bernhard Weichel(@bwl21):product is a method of Array; any idea? ---------------------------------------------------------------------------------------------------- ############################## [2014-10-16] ############################## [08:51:54] Elia Schito(@elia):@bwl21 can you be more specific about the raised error? ---------------------------------------------------------------------------------------------------- ############################## [2014-10-29] ############################## [04:55:41] George Plymale II(@ylluminarious):@elia i've been looking at this article: http://spin.atomicobject.com/2013/11/05/opal-ruby-browser/ and i've been trying to duplicate the example myself (with the cdn), but i keep getting an error in the console saying: https://gist.github.com/6022ccc12b1993c72856 i understand why this error is happening, because what it's saying is that `window.PIXI` is undefined and the code in the x-string is trying to get a property from `window.PIXI` (`Stage`). what i'm wondering is why the article says that the example worked. i don't think that the example should have worked; `window.PIXI` is not defined and calling a property from it would just cause problems. am i missing something as to why the example is supposedly working? ---------------------------------------------------------------------------------------------------- [18:05:10] Artur Ostręga(@aost):It looks like you'll need to include pixi.js first, since that's a wrapper around it. ---------------------------------------------------------------------------------------------------- [19:58:15] George Plymale II(@ylluminarious):@skofo yeah, you're right. i had a discussion on the irc too, and the only real problem was that i forgot to include pixi.js. :P ---------------------------------------------------------------------------------------------------- [20:59:56] AstonJ(@AstonJ):Hi Everyone - if you get a moment, please take a look at this post on AltRubies and the forthcoming new Fire framework from the Opal team. If you have any feedback or think I need to add anything, please let me know. Please also feel free to leave a comment http://astonj.com/tech/ruby-is-about-to-get-red-hot-again ---------------------------------------------------------------------------------------------------- [21:04:22] AstonJ(@AstonJ):Here are a couple of deskptop wallpapers if anyone wants em ;) ---------------------------------------------------------------------------------------------------- [21:04:26] AstonJ(@AstonJ):https://files.gitter.im//6did/car-fire.jpg ---------------------------------------------------------------------------------------------------- [21:04:56] AstonJ(@AstonJ):https://files.gitter.im//lpWW/helicopter-fire.jpg ---------------------------------------------------------------------------------------------------- ############################## [2014-10-30] ############################## [18:07:04] Andrew Havens(@andrewhavens):@AstonJ Just read that "red hot ruby" post and am curious to learn more about Fire...there's a broken link to a blog post on the homepage. Know where I can read more about Fire? ---------------------------------------------------------------------------------------------------- [18:59:32] AstonJ(@AstonJ):Hi @andrewhavens, the link is meant to go to the same post http://astonj.com/tech/ruby-is-about-to-get-red-hot-again/ but @adambeynon hasn’t updated the page yet. If you have any questions or suggestions about Fire feel free to post them here :) ---------------------------------------------------------------------------------------------------- [18:59:57] Andrew Havens(@andrewhavens):Okay...what is Fire? =] ---------------------------------------------------------------------------------------------------- [19:01:28] AstonJ(@AstonJ):A fourthcoming frontend Ruby framework. Vienna is more of a backbone styly library but Fire is intended to be a full framework. ---------------------------------------------------------------------------------------------------- [19:01:47] Andrew Havens(@andrewhavens):So more like Ember? ---------------------------------------------------------------------------------------------------- [19:02:11] AstonJ(@AstonJ):Yeah - Ruby’s answer to Angular and Ember :) ---------------------------------------------------------------------------------------------------- [19:02:17] Andrew Havens(@andrewhavens):Ah okay ---------------------------------------------------------------------------------------------------- [19:02:25] Andrew Havens(@andrewhavens):that's a good way to put it ---------------------------------------------------------------------------------------------------- [19:03:11] Andrew Havens(@andrewhavens):Is it intended to be more like Volt/Meteor? Or more like Angular/Ember? ---------------------------------------------------------------------------------------------------- [19:03:29] AstonJ(@AstonJ):Good point - I’ll see if I can add that to the post later. ---------------------------------------------------------------------------------------------------- [19:04:13] AstonJ(@AstonJ):More like A/E but I think @adambeynon has plans to incorporate some reactive stuff (from Volt) too ---------------------------------------------------------------------------------------------------- [19:06:50] AstonJ(@AstonJ):What would you like to see in Fire? When we spoke about it initially the general consensus was to be Ruby’s answer to Angular and Ember, but going a step beyond what they do too. ---------------------------------------------------------------------------------------------------- [19:09:59] Andrew Havens(@andrewhavens):Well, I would think "Ruby's answer to Angular/Ember" would mean simpler syntax, more integrated with Ruby frameworks. Not sure if there is truly a "Ruby way" that a front-end framework should be... ---------------------------------------------------------------------------------------------------- [19:10:34] Andrew Havens(@andrewhavens):For example, I personally prefer Backbone over Angular and Ember. But many people prefer the latter for certain reasons ---------------------------------------------------------------------------------------------------- [19:13:01] Andrew Havens(@andrewhavens):I like the simplicity of Backbone. It's easy to learn and sprinkle into your project without assuming you're building a single-page app. I like the Rails-like conventions with Ember, and I strongly dislike the Angular approach to custom HTML attributes and mixing javascript in the HTML. There's also a lot to learn with Ember/Angular. ---------------------------------------------------------------------------------------------------- [19:16:34] Andrew Havens(@andrewhavens):I'm not sure what you have already discussed in terms of things that would make it "a step beyond A/E" but I'm guessing that making a strong statement about the types of problems Fire is intended to solve will help clarify the features of the framework. I don't think it is wise to assume it will be **the** Ruby front-end framework. Kind of like Rails/Sinatra...there is a place for both. It's best to clarify the problems you are trying to solve. ---------------------------------------------------------------------------------------------------- [19:45:29] ylluminate(@ylluminate):well written article @AstonJ! :) ---------------------------------------------------------------------------------------------------- [20:20:10] verdi327(@verdi327):Read the article, great stuff. ---------------------------------------------------------------------------------------------------- [20:20:22] verdi327(@verdi327):Excited about Ruby's future ---------------------------------------------------------------------------------------------------- [20:22:09] Andrew Havens(@andrewhavens):trying to read through the opal-jquery source, and am confused about this line: https://github.com/opal/opal-jquery/blob/master/opal/opal-jquery/element.rb#L1 (where can I find the source of “native”?) ---------------------------------------------------------------------------------------------------- [20:28:06] Adam Beynon(@adambeynon):hi @andrewhavens ---------------------------------------------------------------------------------------------------- [20:28:07] Adam Beynon(@adambeynon):https://github.com/opal/opal/blob/master/stdlib/native.rb ---------------------------------------------------------------------------------------------------- [20:28:23] Adam Beynon(@adambeynon):that is the Native module, it makes it nicer to deal with wrapped js objects ---------------------------------------------------------------------------------------------------- [20:30:00] Adam Beynon(@adambeynon):we use it inside Element for wrapping #offset() from jquery ---------------------------------------------------------------------------------------------------- [20:30:02] Andrew Havens(@andrewhavens):ah ok, couldnt find it because i was looking in corelib ---------------------------------------------------------------------------------------------------- [20:30:42] Adam Beynon(@adambeynon):opal-browser (an alternative, jquery-less, dom library) uses it a lot to great avail ---------------------------------------------------------------------------------------------------- [20:31:36] Andrew Havens(@andrewhavens):Next question…what does this mean? `$$[:jQuery]` https://github.com/opal/opal-jquery/blob/master/opal/opal-jquery/constants.rb#L5 ---------------------------------------------------------------------------------------------------- [20:34:29] Adam Beynon(@adambeynon):`$$` is a global defined inside `native.rb`. It is a wrapped `window` object, aka the `global` object ---------------------------------------------------------------------------------------------------- [20:34:43] Adam Beynon(@adambeynon):so we are essentially checking if `jQuery` is defined on `window` ---------------------------------------------------------------------------------------------------- [20:35:06] Adam Beynon(@adambeynon):if not, then we check for zepto, otherwise raise an error ---------------------------------------------------------------------------------------------------- [20:35:33] Andrew Havens(@andrewhavens):Oh I see https://github.com/opal/opal/blob/master/stdlib/native.rb#L532 ---------------------------------------------------------------------------------------------------- [20:36:12] Adam Beynon(@adambeynon):there was some debate about using `$$`, but Im getting to like it more and more ---------------------------------------------------------------------------------------------------- [20:36:16] Adam Beynon(@adambeynon):works with method calls as well ---------------------------------------------------------------------------------------------------- [20:36:27] Adam Beynon(@adambeynon):`$$.alert “foo”` => `window.alert(“foo”)` ---------------------------------------------------------------------------------------------------- [20:37:15] Andrew Havens(@andrewhavens):that’s interesting ---------------------------------------------------------------------------------------------------- [20:39:36] Adam Beynon(@adambeynon):of course, docs are something that are missing in opal :( ---------------------------------------------------------------------------------------------------- [20:39:38] Andrew Havens(@andrewhavens):So what is the difference between `$$.jQuery` and `$$[:jQuery]`? ---------------------------------------------------------------------------------------------------- [20:40:27] Adam Beynon(@adambeynon):yes, the first form will actually call the `jQuery` function, where as the second form will just return it (or nil if it doesnt exist) ---------------------------------------------------------------------------------------------------- [20:44:00] Andrew Havens(@andrewhavens):Okay, seems like the magic is in Native(\`Opal.global\`)…where is the source of that? ---------------------------------------------------------------------------------------------------- [20:44:48] Adam Beynon(@adambeynon):https://github.com/opal/opal/blob/master/opal/corelib/runtime.js#L26 ---------------------------------------------------------------------------------------------------- [20:45:03] Adam Beynon(@adambeynon):`runtime.js` is where most of the magic happens ---------------------------------------------------------------------------------------------------- [20:46:50] Andrew Havens(@andrewhavens):oh weird! ---------------------------------------------------------------------------------------------------- [20:49:28] Andrew Havens(@andrewhavens):What is `this` in this context? It looks like it gets set to `window` https://github.com/opal/opal/blob/master/opal/corelib/runtime.js#L1239 ---------------------------------------------------------------------------------------------------- [20:51:41] Andrew Havens(@andrewhavens):I expexted `Opal.global` to be some object which handled the translation of ruby method/accessor syntax into javascript. But it’s just `window` so now it really seems like magic ---------------------------------------------------------------------------------------------------- [20:59:10] Brandon Zylstra(@brandondrew):@adambeynon : the problem of missing docs is the reason (IMHO) we don't see more people jumping into Opal. I discovered it several months ago and was very excited, but gave up when it seemed like there were just a few important pieces either missing or undocumented. ---------------------------------------------------------------------------------------------------- [21:15:21] Jamon Holmgren(@jamonholmgren):Excellent documentation is one of the most critical parts to systems like this, IMHO. It's one of the reasons our RubyMotion framework ProMotion has gained traction...people like the docs. ---------------------------------------------------------------------------------------------------- [21:43:43] AstonJ(@AstonJ):Sorry @andrewhavens I didn’t mean to run off like that but I was at the pool/sauna. ---------------------------------------------------------------------------------------------------- [21:43:47] AstonJ(@AstonJ):Thanks @ylluminate ! ---------------------------------------------------------------------------------------------------- [21:44:25] AstonJ(@AstonJ):I agree @brandondrew and @jamonholmgren - I hope to help out with Fire docs as much as I can ---------------------------------------------------------------------------------------------------- [22:47:35] Andrew Havens(@andrewhavens):@AstonJ No worries ---------------------------------------------------------------------------------------------------- [22:54:43] AstonJ(@AstonJ):I think it would be a good idea to set a forum up soon, particularly for Fire, Volt and Opal discussions. Perhaps at metaruby.com (in a subdomain) ---------------------------------------------------------------------------------------------------- [23:00:33] Andrew Havens(@andrewhavens):haven’t heard of metaruby.com…who runs that? What’s it for? ---------------------------------------------------------------------------------------------------- [23:56:08] AstonJ(@AstonJ):@andrewhavens I planned on putting a Ruby forum there a while back but never got around to it. I’m now thinking about putting a forum in a subdomain, and putting screencasts on the main site - not sure yet tbh. I’d like it to be somewhere anyone can upload screencasts ideally - a place to learn and share what you know. ---------------------------------------------------------------------------------------------------- ############################## [2014-10-31] ############################## [00:03:35] Andrew Havens(@andrewhavens):It’s a little bit of a ghost town right now =] ---------------------------------------------------------------------------------------------------- [00:03:49] Andrew Havens(@andrewhavens):Also it’s missing a ton of basic features ---------------------------------------------------------------------------------------------------- [00:04:06] AstonJ(@AstonJ)://Off-topic//That’s a wicked idea - definitely a topic that we don’t hear enough of :) ---------------------------------------------------------------------------------------------------- [00:05:10] AstonJ(@AstonJ):If you’re going to be a forum (discussion platform) I recommend using one of the leading apps - my two current faves are Discourse, and Xenforo - they really do help foster a community and facilitate discussion ---------------------------------------------------------------------------------------------------- [00:05:23] AstonJ(@AstonJ):My latest forum is www.forum.breedia.com (xenforo) ---------------------------------------------------------------------------------------------------- [00:07:04] AstonJ(@AstonJ):I also coded a forum/twitter app for an old gaming forum (in about two weeks) but haven’t had time to go any further with it (to the point where I feel we should just move back to a more fully featured forum app) www.gameslurp.com ---------------------------------------------------------------------------------------------------- [00:07:48] Andrew Havens(@andrewhavens):I definitely looked into Discourse and Forem, but they weren’t right for where I’m planning to go with it…would have needed to customize too much ---------------------------------------------------------------------------------------------------- [00:08:23] AstonJ(@AstonJ):How is your forum different to conventional forums (like DC)? ---------------------------------------------------------------------------------------------------- [00:09:38] AstonJ(@AstonJ):A forum built in Volt or Fire would be pretty neat :D ---------------------------------------------------------------------------------------------------- [00:09:47] Andrew Havens(@andrewhavens):It’s not really meant to be a “forum”…more like a combination of a wiki, reddit, stackoverflow, and ruby toolbox ---------------------------------------------------------------------------------------------------- [00:11:06] Andrew Havens(@andrewhavens):The idea is to centralize all of these different things into a central location based on a specific topic (ruby game programming) ---------------------------------------------------------------------------------------------------- [00:11:52] Andrew Havens(@andrewhavens):I recently redesigned the homepage so that it appears as a single list (looks more like a forum that way I guess) but it used to be much more separate ---------------------------------------------------------------------------------------------------- [00:12:09] AstonJ(@AstonJ):Ah right, cool. From the link it looks like a list of topics and comments : / ---------------------------------------------------------------------------------------------------- [00:12:33] AstonJ(@AstonJ):Can you mark answers as best, vote up comments etc? ---------------------------------------------------------------------------------------------------- [00:12:47] Andrew Havens(@andrewhavens):one day, maybe =] ---------------------------------------------------------------------------------------------------- [00:13:23] Andrew Havens(@andrewhavens):I welcome any and all contributions: http://github.com/ruby-rcade/RubyGameDev.com ---------------------------------------------------------------------------------------------------- [00:13:35] AstonJ(@AstonJ):So currently it’s like a forum? (Topics/replies)? ---------------------------------------------------------------------------------------------------- [00:14:18] Andrew Havens(@andrewhavens):Right now, it looks like a forum, but that’s not the end-goal ---------------------------------------------------------------------------------------------------- [00:15:23] Andrew Havens(@andrewhavens):Anyway, need to head home now, we should continue this discussion in the RubyGameDev.com Gitter room: https://gitter.im/ruby-rcade/RubyGameDev.com ---------------------------------------------------------------------------------------------------- [00:15:26] Andrew Havens(@andrewhavens):=] ---------------------------------------------------------------------------------------------------- [00:15:37] AstonJ(@AstonJ):Cool ---------------------------------------------------------------------------------------------------- [00:17:57] Dan McGuire(@dgmcguire):I'm an intermediate ruby dev, how hard would it be to port my basic emberJS blog over too vienna? Would you suggest I go ahead and try fire? ---------------------------------------------------------------------------------------------------- [00:18:45] Dan McGuire(@dgmcguire):All I'm doing is authentication and basic crud, I used a few JS plugins, but they aren't that important to me ---------------------------------------------------------------------------------------------------- [00:21:45] AstonJ(@AstonJ):Hi @dgmcguire, Adam ( @adambeynon can provide you with a better answer) but he’s currently working on a very early alpha of Fire - I’d say wait for that and see how you feel - your three options are Vienna, Fire and Volt ---------------------------------------------------------------------------------------------------- [00:31:15] Dan McGuire(@dgmcguire):@AstonJ cool, I'm messing with vienna now, any place to find a tutorial yet? ---------------------------------------------------------------------------------------------------- [00:55:58] AstonJ(@AstonJ):Unfortunately not yet. However this might contain some general Opal tips: http://www.youtube.com/watch?v=GH9FAfKG-qY @dgmcguire ---------------------------------------------------------------------------------------------------- [11:27:06] Dan McGuire(@dgmcguire): holy wow. That multi-line editor irb-thingy with built in gist links etc looked so feature complete. ---------------------------------------------------------------------------------------------------- [12:26:22] Kleber Shimabuku(@klebershimabuku):thank you for sharing this video with us! =D ---------------------------------------------------------------------------------------------------- [12:31:20] AstonJ(@AstonJ):It’s been so long since I watched - I need to watch it again :D (I think it’s the one where I can say I have been on stage at a Ruby Conf with DHH haha) ---------------------------------------------------------------------------------------------------- [14:17:19] Jikku Jose(@JikkuJose):Where can I find some Opal apps in production? ---------------------------------------------------------------------------------------------------- [14:21:48] Elia Schito(@elia):@adambeynon we should put up a list of apps using opal in prod ---------------------------------------------------------------------------------------------------- [14:22:41] Elia Schito(@elia):@JikkuJose the ones I developed I can’t tell about, but I can say they have milions of users and work on desktop and mobile ---------------------------------------------------------------------------------------------------- [14:45:01] Jikku Jose(@JikkuJose):Nice to know! ---------------------------------------------------------------------------------------------------- [14:45:11] Jikku Jose(@JikkuJose):So its pretty solid now? ---------------------------------------------------------------------------------------------------- [14:45:34] Elia Schito(@elia):I’d say so :) ---------------------------------------------------------------------------------------------------- [14:46:26] Jikku Jose(@JikkuJose):Frankly, I would like to confess: I don't anything in JS. I am seeing Opal finally as a way to skip learning that, is that a bad decision? Should I go and learn some JS or else will I end up messing too much? ---------------------------------------------------------------------------------------------------- [14:47:11] Elia Schito(@elia):@JikkuJose problem is even with opal you need to learn DOM if you work in the browser ---------------------------------------------------------------------------------------------------- [14:48:57] Elia Schito(@elia):also it’s still good to know a bit of JS for debugging, the more you’ll learn JS the more you’ll appreciate opal ---------------------------------------------------------------------------------------------------- [14:49:43] Elia Schito(@elia):@JikkuJose but I’d like to hear how it goes if you start doing opal without prior js knowledge ---------------------------------------------------------------------------------------------------- [14:56:57] AstonJ(@AstonJ):I actually think this is a great oppourtunity for Opal - to allow people to bypass JS. I think it would nurture a new mindset in browser development as people won’t feel they need to ‘think’ in JS. So yeah, agree with @elia it’s probably best to learn about the DOM, CSS, HTML and just enough about JS so you have a good enough idea about it.. ---------------------------------------------------------------------------------------------------- [14:58:05] Elia Schito(@elia):@AstonJ also if tooling gets better that could really become viable, by this I mean source-maps and the like ---------------------------------------------------------------------------------------------------- [19:32:20] Jon Frisby(@MrJoy):Can anyone let me know what the state-of-the-world is for VoltRB's `precompile` command? ---------------------------------------------------------------------------------------------------- [19:35:06] Jon Frisby(@MrJoy):I just submitted a PR to fix a few issues with it, but it doesn't appear to be using Sprockets, etc yet. Wondering if that's planned, partially-implemented-but-not-working, or if environments are a factor. ---------------------------------------------------------------------------------------------------- [19:35:54] Andrew Havens(@andrewhavens):@MrJoy Perhaps you intended this message to be posted in the Volt room? ---------------------------------------------------------------------------------------------------- [19:36:13] Jon Frisby(@MrJoy):The Volt repo links here, so I thought the discussions were unified? ---------------------------------------------------------------------------------------------------- [19:36:28] Andrew Havens(@andrewhavens):Oh interesting ---------------------------------------------------------------------------------------------------- [19:36:55] Jon Frisby(@MrJoy):Errr... ---------------------------------------------------------------------------------------------------- [19:37:00] Jon Frisby(@MrJoy):Ok, something VoltRB linked here. >.< ---------------------------------------------------------------------------------------------------- [19:37:08] Jon Frisby(@MrJoy):The README on the repo links to the proper room. ---------------------------------------------------------------------------------------------------- [19:37:13] Andrew Havens(@andrewhavens):oh haha, okay ---------------------------------------------------------------------------------------------------- [19:38:03] Jon Frisby(@MrJoy):I'll dig up where I got the link from and prod them to update it. ---------------------------------------------------------------------------------------------------- [19:40:59] Jon Frisby(@MrJoy):Ohhh. I'm an idjit. RubyFire page links here. ---------------------------------------------------------------------------------------------------- [19:41:05] Jon Frisby(@MrJoy):Is that intentional/proper? ---------------------------------------------------------------------------------------------------- [19:44:54] Andrew Havens(@andrewhavens):I’ll let someone else answer that question, but I think it was intentional ---------------------------------------------------------------------------------------------------- [19:49:47] Jon Frisby(@MrJoy):@MrJoy nods ---------------------------------------------------------------------------------------------------- [19:50:04] Jon Frisby(@MrJoy):The RubyFire page has a link for a blog post that goes nowhere. Is that something that hasn't been published yet? ---------------------------------------------------------------------------------------------------- [20:43:56] AstonJ(@AstonJ):It’s the red hot ruby post http://astonj.com/tech/ruby-is-about-to-get-red-hot-again/ ---------------------------------------------------------------------------------------------------- [20:44:01] AstonJ(@AstonJ):@MrJoy ---------------------------------------------------------------------------------------------------- [20:44:12] Jon Frisby(@MrJoy):@AstonJ: Ah, thanks! ---------------------------------------------------------------------------------------------------- [20:45:32] Adam Beynon(@adambeynon):@AstonJ eeek, will fix that link now ---------------------------------------------------------------------------------------------------- [20:46:52] Adam Beynon(@adambeynon):and done. ---------------------------------------------------------------------------------------------------- [20:58:13] AstonJ(@AstonJ)::-) ---------------------------------------------------------------------------------------------------- [00:02:27] Andrew Havens(@andrewhavens):@AstonJ I kind of started a site like that for Ruby game programming: http://rubygamedev.com ---------------------------------------------------------------------------------------------------- [00:03:15] Andrew Havens(@andrewhavens):I’ve thought about expanding into other topics, but still a lot of work to do to make rubygamedev.com successful first ---------------------------------------------------------------------------------------------------- ############################## [2014-11-01] ############################## [00:55:38] Elia Schito(@elia):this one’s errr… hot ---------------------------------------------------------------------------------------------------- [00:55:40] Elia Schito(@elia):https://twitter.com/yukihiro_matz/status/528169677994745856 ---------------------------------------------------------------------------------------------------- [00:56:27] AstonJ(@AstonJ):Yeah - good on Matz! ---------------------------------------------------------------------------------------------------- [00:56:42] AstonJ(@AstonJ)::) ---------------------------------------------------------------------------------------------------- [01:00:11] AstonJ(@AstonJ):If anyone’s curious about some of the hype on twitter, check out my faves: https://twitter.com/astonj/favorites ---------------------------------------------------------------------------------------------------- [01:00:26] AstonJ(@AstonJ):Massive interest in Fire & Volt :) ---------------------------------------------------------------------------------------------------- ############################## [2014-11-03] ############################## [12:43:36] Ricardo Otero(@rikas):hi guys. is there any place where I can see what Fire is? ---------------------------------------------------------------------------------------------------- [12:43:40] Ricardo Otero(@rikas):Fire is not Opal, is it? ---------------------------------------------------------------------------------------------------- [12:43:58] Adam Beynon(@adambeynon):Hi @rikas ---------------------------------------------------------------------------------------------------- [12:44:02] Adam Beynon(@adambeynon):Fire is a work in progress ---------------------------------------------------------------------------------------------------- [12:44:07] Adam Beynon(@adambeynon):It is based on vienna ---------------------------------------------------------------------------------------------------- [12:44:11] Adam Beynon(@adambeynon):kinda a rewrite ---------------------------------------------------------------------------------------------------- [12:44:19] Adam Beynon(@adambeynon):plus some integrations with rails ---------------------------------------------------------------------------------------------------- [12:44:29] Adam Beynon(@adambeynon):(but it can be used completely independently of rails) ---------------------------------------------------------------------------------------------------- [12:44:44] Ricardo Otero(@rikas):but can I try it? or not yet? ---------------------------------------------------------------------------------------------------- [12:45:26] Adam Beynon(@adambeynon):Im still putting it together. It will be very similar to Vienna (on github) ---------------------------------------------------------------------------------------------------- [12:45:34] Adam Beynon(@adambeynon):Currently extracting it from some apps that use it ---------------------------------------------------------------------------------------------------- [12:45:36] Ricardo Otero(@rikas):ok ---------------------------------------------------------------------------------------------------- [12:45:42] Ricardo Otero(@rikas):thanks for your time! ---------------------------------------------------------------------------------------------------- [14:33:18] Emad Elsaid(@emad-elsaid):guys, what is the progress of the implementation of corelib and stdlib ? ---------------------------------------------------------------------------------------------------- [14:40:05] Adam Beynon(@adambeynon):@blazeeboy Corelib is mostly there. A few odd bugs, and anything not implemented probably wont be ---------------------------------------------------------------------------------------------------- [14:40:13] Adam Beynon(@adambeynon):e.g. threads etc, which wont work in js ---------------------------------------------------------------------------------------------------- [14:40:28] Adam Beynon(@adambeynon):As for stdlib, I have added things as I needed them ---------------------------------------------------------------------------------------------------- [14:40:45] Adam Beynon(@adambeynon):again, anything missing is probably because it doesnt have much use in a browser content, or wont work in js ---------------------------------------------------------------------------------------------------- [14:41:19] Adam Beynon(@adambeynon):might make a doc about it for the website. maybe we can get a % coverage for each part ---------------------------------------------------------------------------------------------------- ############################## [2014-11-04] ############################## [22:15:55] Adam Beynon(@adambeynon):some failures ---------------------------------------------------------------------------------------------------- [22:16:05] Ryan Stout(@ryanstout):humm, weird ---------------------------------------------------------------------------------------------------- [22:16:09] Ryan Stout(@ryanstout):maybe some load order issue? ---------------------------------------------------------------------------------------------------- [22:16:20] Ryan Stout(@ryanstout):not sure how that would happen ---------------------------------------------------------------------------------------------------- [22:16:45] Adam Beynon(@adambeynon):dont know. we are using “real” requires now, so *hopefully* the order should be sorted automatically ---------------------------------------------------------------------------------------------------- [22:16:46] Adam Beynon(@adambeynon):111 examples, 24 failures ---------------------------------------------------------------------------------------------------- [22:17:05] Ryan Stout(@ryanstout):ok, let me mess around with it a bit and see what I can find. thanks! ---------------------------------------------------------------------------------------------------- [22:17:11] Adam Beynon(@adambeynon):expected: "html_tidy" got: "\\1_\\2dy" ---------------------------------------------------------------------------------------------------- [22:17:13] Ryan Stout(@ryanstout):it's weird, it all worked in 0.6 ---------------------------------------------------------------------------------------------------- [22:17:21] Adam Beynon(@adambeynon):looks like there are perhaps some regressions on regexps ---------------------------------------------------------------------------------------------------- [22:17:36] Ryan Stout(@ryanstout):humm, I'm not using regex's much ---------------------------------------------------------------------------------------------------- [22:17:51] Adam Beynon(@adambeynon):thats coming from #camelize specs ---------------------------------------------------------------------------------------------------- [22:17:54] Ryan Stout(@ryanstout):oh, I guess on that one ---------------------------------------------------------------------------------------------------- [22:17:55] Ryan Stout(@ryanstout):humm ---------------------------------------------------------------------------------------------------- [22:18:09] Ryan Stout(@ryanstout):yea, that one was passing ---------------------------------------------------------------------------------------------------- [22:18:11] Adam Beynon(@adambeynon):setImmediate is not defined ---------------------------------------------------------------------------------------------------- [22:18:15] Adam Beynon(@adambeynon):thats popping up a few times too ---------------------------------------------------------------------------------------------------- [22:18:18] Ryan Stout(@ryanstout):humm ---------------------------------------------------------------------------------------------------- [22:18:26] Ryan Stout(@ryanstout):I'll try adding the requires and see if I can fix the others ---------------------------------------------------------------------------------------------------- [22:18:54] Adam Beynon(@adambeynon):infact, setImmediate and the camelize method are the only failures ---------------------------------------------------------------------------------------------------- [22:19:07] Adam Beynon(@adambeynon):It took me 3 or 4 days to get my last app onto 0.7 ---------------------------------------------------------------------------------------------------- [22:19:11] Adam Beynon(@adambeynon):so not too bad ;) ---------------------------------------------------------------------------------------------------- [22:19:56] Ryan Stout(@ryanstout):yea, all of my capybara tests passed right away (once I got one thing fixed) ---------------------------------------------------------------------------------------------------- [22:19:58] Ryan Stout(@ryanstout):which is pretty awesome ---------------------------------------------------------------------------------------------------- [22:20:05] Ryan Stout(@ryanstout):that basically means it all works in the browser ---------------------------------------------------------------------------------------------------- [22:20:15] Ryan Stout(@ryanstout):did you switch the way opal-rspec runs tests? ---------------------------------------------------------------------------------------------------- [22:20:20] Ryan Stout(@ryanstout):is it using node now? ---------------------------------------------------------------------------------------------------- [22:20:25] Ryan Stout(@ryanstout):(instead of phantom) ---------------------------------------------------------------------------------------------------- [22:21:42] Adam Beynon(@adambeynon):ahh, I added a config.ru to run the specs inside a browser - easier to debug errors ---------------------------------------------------------------------------------------------------- [22:21:52] Adam Beynon(@adambeynon):when I run through the rake task, setImmediate errors dont show up ---------------------------------------------------------------------------------------------------- [22:22:03] Ryan Stout(@ryanstout):actually, I think maybe it has to do with my spec_helper ---------------------------------------------------------------------------------------------------- [22:22:33] Ryan Stout(@ryanstout):for some reason I wasn't running Volt.spec_setup in opal ---------------------------------------------------------------------------------------------------- [22:22:39] Ryan Stout(@ryanstout):not sure how that worked in 0.6 ---------------------------------------------------------------------------------------------------- [22:22:52] Ryan Stout(@ryanstout):that takes me down to 4 issues which are all regex ---------------------------------------------------------------------------------------------------- [22:23:02] Adam Beynon(@adambeynon):sweet ---------------------------------------------------------------------------------------------------- [22:23:08] Ryan Stout(@ryanstout):let me push that up ---------------------------------------------------------------------------------------------------- [22:24:09] Ryan Stout(@ryanstout):pushed ---------------------------------------------------------------------------------------------------- [22:24:14] Ryan Stout(@ryanstout):so I guess that regex issue is the only regression ---------------------------------------------------------------------------------------------------- [22:24:31] Ryan Stout(@ryanstout):(that my tests found, hehe) ---------------------------------------------------------------------------------------------------- [22:25:35] Ryan Stout(@ryanstout):want me to make an issue for the regex? ---------------------------------------------------------------------------------------------------- [22:25:47] Adam Beynon(@adambeynon):please ---------------------------------------------------------------------------------------------------- [22:25:48] Adam Beynon(@adambeynon):http://opalrb.org/try/#code:p%20%22HTMLTidy%22.gsub(%2F(%5BA-Z%5D%2B)(%5BA-Z%5D%5Ba-z%5D)%2F%2C%20'%5C1_%5C2').%0A%20%20gsub(%2F(%5Ba-z%5Cd%5D)(%5BA-Z%5D)%2F%2C%20'%5C1_%5C2').downcase ---------------------------------------------------------------------------------------------------- [22:26:03] Adam Beynon(@adambeynon):yeap ^^ must have happened farily recently ---------------------------------------------------------------------------------------------------- [22:26:04] Adam Beynon(@adambeynon)::( ---------------------------------------------------------------------------------------------------- [22:27:10] Ryan Stout(@ryanstout):https://github.com/opal/opal/issues/646 ---------------------------------------------------------------------------------------------------- [22:43:26] Ryan Stout(@ryanstout):@adambeynon or @elia so I'm working on my rubyconf talk, are there any benchmarks comparing opal to straight JS? ---------------------------------------------------------------------------------------------------- [22:46:32] Adam Beynon(@adambeynon):the benchmarks looks very good when we enable inlined operators ---------------------------------------------------------------------------------------------------- [22:46:42] Adam Beynon(@adambeynon):but I was overuled about having them on by default :( ---------------------------------------------------------------------------------------------------- [22:52:32] Ryan Stout(@ryanstout):would you send me some urls for benchmarks? (with inline operators is fine :-) ---------------------------------------------------------------------------------------------------- [23:22:11] Adam Beynon(@adambeynon):@ryanstout okay, that should be sorted now on master ---------------------------------------------------------------------------------------------------- [23:22:20] Adam Beynon(@adambeynon):still need to fix some specs for it though ---------------------------------------------------------------------------------------------------- [23:25:56] Ryan Stout(@ryanstout):the regex issue? ---------------------------------------------------------------------------------------------------- [23:26:16] Ryan Stout(@ryanstout):cool, thanks ---------------------------------------------------------------------------------------------------- [23:30:28] Ryan Stout(@ryanstout):ok, running master fixed the regex, but broke two others :-) ---------------------------------------------------------------------------------------------------- [23:30:32] Ryan Stout(@ryanstout):I'll track it down ---------------------------------------------------------------------------------------------------- [23:34:24] Ryan Stout(@ryanstout):@elia had a question about sourcemaps if your around ---------------------------------------------------------------------------------------------------- [23:34:39] Adam Beynon(@adambeynon):ughh ---------------------------------------------------------------------------------------------------- [23:34:46] Adam Beynon(@adambeynon):@ryanstout regexp related? ---------------------------------------------------------------------------------------------------- [23:34:58] Ryan Stout(@ryanstout):no ---------------------------------------------------------------------------------------------------- [23:35:05] Ryan Stout(@ryanstout):object_id related maybe? ---------------------------------------------------------------------------------------------------- [23:35:08] Ryan Stout(@ryanstout):or maybe equality ---------------------------------------------------------------------------------------------------- [23:35:13] Ryan Stout(@ryanstout):might take me a little while to track it down ---------------------------------------------------------------------------------------------------- [23:35:21] Ryan Stout(@ryanstout):I can push it up if your curious ---------------------------------------------------------------------------------------------------- [23:35:39] Adam Beynon(@adambeynon):ok, sure. I will look tomorrow though, its too late for me :) ---------------------------------------------------------------------------------------------------- [23:35:42] Adam Beynon(@adambeynon):push it up though ---------------------------------------------------------------------------------------------------- [23:35:47] Adam Beynon(@adambeynon):I will tackle it in the monring ---------------------------------------------------------------------------------------------------- [23:35:51] Adam Beynon(@adambeynon):morning* ---------------------------------------------------------------------------------------------------- [23:37:20] Ryan Stout(@ryanstout):pushed. I can try to track it down more. Thanks ---------------------------------------------------------------------------------------------------- [23:37:29] Ryan Stout(@ryanstout):thanks for all of your help. Really a pretty seamless transition ---------------------------------------------------------------------------------------------------- [21:04:02] Ryan Stout(@ryanstout):@elia if you want to see it in action, here's the url for my test: http://69.163.83.151/ ---------------------------------------------------------------------------------------------------- [21:04:15] Ryan Stout(@ryanstout):http://69.163.83.151/assets/volt/page/page.js has the require first ---------------------------------------------------------------------------------------------------- [21:04:33] Ryan Stout(@ryanstout):it looks like there is def.$const_missing in there, so maybe it's a load order issue ---------------------------------------------------------------------------------------------------- [21:05:01] Ryan Stout(@ryanstout):or maybe this.base isn't set right on that part ---------------------------------------------------------------------------------------------------- [21:07:41] Elia Schito(@elia):@ryanstout you’re checking for RUBY_PLATFORM before having required ‘opal’ ---------------------------------------------------------------------------------------------------- [21:07:58] Ryan Stout(@ryanstout):I thought that check was in the precompilation stage? ---------------------------------------------------------------------------------------------------- [21:08:03] Ryan Stout(@ryanstout):(it worked in 0.6) ---------------------------------------------------------------------------------------------------- [21:08:10] Elia Schito(@elia):that means that, even if runtime.js is loaded, the whole corelib is missing ---------------------------------------------------------------------------------------------------- [21:09:06] Elia Schito(@elia):js files are being ran directly (runtime.js) but .rb only via require ---------------------------------------------------------------------------------------------------- [21:09:41] Ryan Stout(@ryanstout):sorry, I don't follow. So can I still use if RUBY_PLATFORM == 'opal' ---------------------------------------------------------------------------------------------------- [21:10:16] Elia Schito(@elia):it’s probably better to: ```rb require ‘opal' require ‘opal-jquery’ if RUBY_PLATFORM == ‘opal’ ``` ---------------------------------------------------------------------------------------------------- [21:10:32] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:10:36] Ryan Stout(@ryanstout):let me try that I guess ---------------------------------------------------------------------------------------------------- [21:10:51] Elia Schito(@elia):that way you’ll have opal required in cruby too, but shouldn’t be a problem ;) ---------------------------------------------------------------------------------------------------- [21:11:50] Ryan Stout(@ryanstout):sweet, that fixed it ---------------------------------------------------------------------------------------------------- [21:11:52] Ryan Stout(@ryanstout):thanks! ---------------------------------------------------------------------------------------------------- [21:12:04] Ryan Stout(@ryanstout):that was easy, nice work! ---------------------------------------------------------------------------------------------------- [21:12:42] Ryan Stout(@ryanstout):just curious, what's the eta for the final version of 0.7 going out? ---------------------------------------------------------------------------------------------------- [21:15:05] Elia Schito(@elia):I guess days, @adambeynon is in bug smashing rage, let’s say a week at most ---------------------------------------------------------------------------------------------------- [21:16:19] Ryan Stout(@ryanstout):cool ---------------------------------------------------------------------------------------------------- [21:16:39] Ryan Stout(@ryanstout):a speaker dropped, so I get to talk on volt/opal at rubyconf ---------------------------------------------------------------------------------------------------- [21:16:43] Ryan Stout(@ryanstout):wanted to show off sourcemaps ---------------------------------------------------------------------------------------------------- [21:16:53] Elia Schito(@elia):woooo! ---------------------------------------------------------------------------------------------------- [21:17:31] Ryan Stout(@ryanstout):so my capybara specs all pass, but my opal-rspec's fail. ---------------------------------------------------------------------------------------------------- [21:17:39] Ryan Stout(@ryanstout):got a bunch of these: WARNING: LoadError: cannot load such file -- stringio ---------------------------------------------------------------------------------------------------- [21:22:38] Elia Schito(@elia):weird, any idea where it’s being required? ---------------------------------------------------------------------------------------------------- [21:23:12] Ryan Stout(@ryanstout):let me check one thing ---------------------------------------------------------------------------------------------------- [21:25:40] Ryan Stout(@ryanstout):I'm also seeing this: File is already part of corelib now, you don't need to require it anymore. ---------------------------------------------------------------------------------------------------- [21:25:44] Ryan Stout(@ryanstout):but it doesn't say what file ---------------------------------------------------------------------------------------------------- [21:26:15] Elia Schito(@elia):wdy mean? > but it doesn't say what file ---------------------------------------------------------------------------------------------------- [21:26:43] Ryan Stout(@ryanstout):so when running my opal-rspecs I see that message, but I'm not sure where it happens or what file it is talking about ---------------------------------------------------------------------------------------------------- [21:27:16] Elia Schito(@elia):this? `warn "File is already part of corelib now, you don't need to require it anymore.”` ---------------------------------------------------------------------------------------------------- [21:27:37] Elia Schito(@elia):https://github.com/opal/opal/blob/0f3b9a27cf49ac7ec265ab7b3a4a2860ac0ce334/stdlib/file.rb ---------------------------------------------------------------------------------------------------- [21:27:54] Elia Schito(@elia):so it shouldn’t be a problem ---------------------------------------------------------------------------------------------------- [21:28:28] Ryan Stout(@ryanstout):oh ---------------------------------------------------------------------------------------------------- [21:28:39] Ryan Stout(@ryanstout):I thought it was saying some specific file was part of corelib ---------------------------------------------------------------------------------------------------- [21:28:40] Ryan Stout(@ryanstout)::-) ---------------------------------------------------------------------------------------------------- [21:28:56] Elia Schito(@elia):maybe the message can be improved then :P ---------------------------------------------------------------------------------------------------- [21:28:59] Ryan Stout(@ryanstout):the weird thing is I don't think I am requiring it ---------------------------------------------------------------------------------------------------- [21:29:05] Ryan Stout(@ryanstout):maybe opal-jquery is? ---------------------------------------------------------------------------------------------------- [21:31:18] Ryan Stout(@ryanstout):ok, one other thing (that I think was an issue in 0.6) ---------------------------------------------------------------------------------------------------- [21:32:38] Ryan Stout(@ryanstout):if I do this: ``` if RUBY_PLATFORM == 'opal' else ... some code ... end ``` it works, but if I do this: ``` if RUBY_PLATFORM != 'opal' ... some code ... end ``` I get ```Error: SyntaxError: Cannot handle dynamic require :volt/config``` ---------------------------------------------------------------------------------------------------- [21:32:45] Ryan Stout(@ryanstout):so it sounds like the pre-processor doesn't pickup on the != ---------------------------------------------------------------------------------------------------- [21:33:20] Elia Schito(@elia):that’s correct, only `==` with if/unless/else ---------------------------------------------------------------------------------------------------- [21:38:00] Ryan Stout(@ryanstout):any chance you can add != ---------------------------------------------------------------------------------------------------- [21:38:20] Ryan Stout(@ryanstout):oh, sorry, didn't realize unless worked ---------------------------------------------------------------------------------------------------- [21:38:23] Elia Schito(@elia):not atm, but should be quite easy ---------------------------------------------------------------------------------------------------- [21:38:23] Ryan Stout(@ryanstout):I thought it was just if ---------------------------------------------------------------------------------------------------- [21:38:35] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [21:44:26] Adam Beynon(@adambeynon):I do occasionally type != as well. Should add it really ---------------------------------------------------------------------------------------------------- [21:44:36] Ryan Stout(@ryanstout):sometimes I think != is clearer ---------------------------------------------------------------------------------------------------- [21:45:00] Ryan Stout(@ryanstout):unless only reads like english in some cases (imho) ---------------------------------------------------------------------------------------------------- [21:45:14] Ryan Stout(@ryanstout):@adambeynon btw, great work on 0.7 :-) ---------------------------------------------------------------------------------------------------- [21:46:42] Adam Beynon(@adambeynon)::D ---------------------------------------------------------------------------------------------------- [21:46:50] Adam Beynon(@adambeynon):reading the above now ---------------------------------------------------------------------------------------------------- [21:46:57] Adam Beynon(@adambeynon):hows the -> 0.7 transition going ---------------------------------------------------------------------------------------------------- [21:47:19] Adam Beynon(@adambeynon):regarding opal-rspec, I think you will need to run it straight from git as well ---------------------------------------------------------------------------------------------------- [21:48:34] Ryan Stout(@ryanstout):@adambeynon I was running the beta gem, but are there updates on git? ---------------------------------------------------------------------------------------------------- [21:49:25] Adam Beynon(@adambeynon):@ryanstout yeap. There are fixes from stuff that was fixed in opal ---------------------------------------------------------------------------------------------------- [21:49:34] Ryan Stout(@ryanstout):ok, let me try that ---------------------------------------------------------------------------------------------------- [21:49:45] Adam Beynon(@adambeynon):really need to release another beta gem, but git/master is pretty sturdy ---------------------------------------------------------------------------------------------------- [21:49:52] Adam Beynon(@adambeynon):also, awesome news on rubyconf (Y) ---------------------------------------------------------------------------------------------------- [21:49:59] Ryan Stout(@ryanstout):thanks, I'll talk up opal :-) ---------------------------------------------------------------------------------------------------- [21:51:01] Ryan Stout(@ryanstout):dumb question, I'm using opal-rspec to test volt, if I put the git repo in the Gemfile, do I need to remove it from the gemspec? ---------------------------------------------------------------------------------------------------- [21:51:53] Adam Beynon(@adambeynon):dont think so. I always assumed a gemfile entry would override a gemspec ---------------------------------------------------------------------------------------------------- [21:52:01] Adam Beynon(@adambeynon):that might be completely false though ^_- ---------------------------------------------------------------------------------------------------- [21:52:34] Ryan Stout(@ryanstout):I'll try it :-) ---------------------------------------------------------------------------------------------------- [21:52:50] Adam Beynon(@adambeynon):@ryanstout the github repo is on the same version as the latest gem though, so it shouldnt cause versioning issues ---------------------------------------------------------------------------------------------------- [21:52:58] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [22:00:29] Ryan Stout(@ryanstout):@adambeynon or @elia so I've got a weird issue running specs, I was hoping maybe you guys might have an idea. Basically, I've got this file loading: https://github.com/voltrb/volt/blob/opal7/lib/volt/reactive/computation.rb with opal-rspec and it's giving me: ```NameError: uninitialized constant Volt::Computation``` from line 119 ---------------------------------------------------------------------------------------------------- [22:00:33] Ryan Stout(@ryanstout):but that's loaded before that ---------------------------------------------------------------------------------------------------- [22:03:08] Adam Beynon(@adambeynon):@ryanstout very strange. I just tried it locally and it works.. ---------------------------------------------------------------------------------------------------- [22:03:14] Ryan Stout(@ryanstout):really? ---------------------------------------------------------------------------------------------------- [22:03:20] Adam Beynon(@adambeynon):@ryanstout is the github repo up to date? ---------------------------------------------------------------------------------------------------- [22:03:21] Ryan Stout(@ryanstout):just on that file? ---------------------------------------------------------------------------------------------------- [22:03:23] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:03:28] Ryan Stout(@ryanstout):pull it and run: bundle exec rake ---------------------------------------------------------------------------------------------------- [22:03:36] Ryan Stout(@ryanstout):it runs in mri, then opal ---------------------------------------------------------------------------------------------------- [22:03:49] Ryan Stout(@ryanstout):(it's on that branch) ---------------------------------------------------------------------------------------------------- [22:05:40] Adam Beynon(@adambeynon):@ryanstout obviosuly I have to uncomment the opal gems so they come from github ---------------------------------------------------------------------------------------------------- [22:05:54] Adam Beynon(@adambeynon):just checking your not using adambeynon/opal-rspec instead of opal/opal-rspec ---------------------------------------------------------------------------------------------------- [22:06:04] Adam Beynon(@adambeynon):Gemfile lists it as adambeynon/... ---------------------------------------------------------------------------------------------------- [22:06:58] Ryan Stout(@ryanstout):^ try the opal7 branch ---------------------------------------------------------------------------------------------------- [22:07:34] Ryan Stout(@ryanstout):I do need to cleanup that gemfile though :-) ---------------------------------------------------------------------------------------------------- [22:07:45] Ryan Stout(@ryanstout):but branch opal7 has the right stuff in there ---------------------------------------------------------------------------------------------------- [22:08:07] Adam Beynon(@adambeynon):ahhh, I see ---------------------------------------------------------------------------------------------------- [22:08:08] Adam Beynon(@adambeynon):got it ---------------------------------------------------------------------------------------------------- [22:08:21] Adam Beynon(@adambeynon):but yes, seeing that same issue ---------------------------------------------------------------------------------------------------- [22:10:29] Ryan Stout(@ryanstout):it's weird because if I uncomment line 119, it gives me different errors ---------------------------------------------------------------------------------------------------- [22:10:35] Ryan Stout(@ryanstout):(so thats where the first error is) ---------------------------------------------------------------------------------------------------- [22:10:43] Ryan Stout(@ryanstout):also, everything runs fine in the browser ---------------------------------------------------------------------------------------------------- [22:11:01] Ryan Stout(@ryanstout):(well, my capybara tests at least, but it definitely loads right in the browser) ---------------------------------------------------------------------------------------------------- [22:14:13] Adam Beynon(@adambeynon):@ryanstout inside computation_spec.rb, If I manually require volt/reactive/computation then it works ---------------------------------------------------------------------------------------------------- [22:14:19] Adam Beynon(@adambeynon):but complains dependency is missing ---------------------------------------------------------------------------------------------------- [22:14:28] Adam Beynon(@adambeynon):it must not be loading those files for some reason ---------------------------------------------------------------------------------------------------- [22:14:32] Adam Beynon(@adambeynon):well, not requiring them ---------------------------------------------------------------------------------------------------- [22:14:49] Ryan Stout(@ryanstout):then why does commenting the stuff in class Proc change things? ---------------------------------------------------------------------------------------------------- [22:15:39] Adam Beynon(@adambeynon):dont know.. still trying to work it out ---------------------------------------------------------------------------------------------------- [22:15:44] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- [22:15:53] Adam Beynon(@adambeynon):so, the specs now run If I require those two files inside computation_spec.rb ---------------------------------------------------------------------------------------------------- [05:49:20] Ryan Stout(@ryanstout):(copying in from irc) so I’m finally getting around to trying opal 0.7 on volt, I’m getting this though: Uncaught TypeError: undefined is not a function . It’s on https://github.com/opal/opal/blob/0f3b9a27cf49ac7ec265ab7b3a4a2860ac0ce334/opal/corelib/runtime.js#L51 It doesn’t see $const_missing. am I supposed to load something else in first now? on 0.7.0.beta1 - thanks ---------------------------------------------------------------------------------------------------- [08:20:15] SicutDominus(@SicutDominus):I'm just hearing about Ruby Fire, there really doesn't seem much info about it, but am I right in thinking it means I can do AngularJS type stuff wired straight into my existing Rails application? ---------------------------------------------------------------------------------------------------- [09:39:01] Adam Beynon(@adambeynon):@ryanstout ping me when you’re back online, and I’ll try and walk through to find out why that error is happening ---------------------------------------------------------------------------------------------------- [17:42:16] Ryan Stout(@ryanstout):@adambeynon you around? ---------------------------------------------------------------------------------------------------- [20:58:36] Elia Schito(@elia):@ryanstout you’re not supposed to load anything else but opal ---------------------------------------------------------------------------------------------------- [20:58:58] Ryan Stout(@ryanstout):@elia what do you mean? :-) ---------------------------------------------------------------------------------------------------- [20:59:15] Elia Schito(@elia):> am I supposed to load something else in first now? ---------------------------------------------------------------------------------------------------- [20:59:25] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [21:00:15] Elia Schito(@elia):@ryanstout you was just loading ‘opal.rb’ when you got the error? ---------------------------------------------------------------------------------------------------- [21:00:45] Ryan Stout(@ryanstout):the JS file it loads requires 'opal' first ---------------------------------------------------------------------------------------------------- [21:00:58] Ryan Stout(@ryanstout):but I can see that nothing is setting up $const_missing ---------------------------------------------------------------------------------------------------- [21:01:50] Elia Schito(@elia):@ryanstout it’s `Module#const_missing` from `corelib/module.rb` ---------------------------------------------------------------------------------------------------- [21:02:07] Ryan Stout(@ryanstout):let me check one thing real quick ---------------------------------------------------------------------------------------------------- ############################## [2014-11-05] ############################## [00:21:21] Elia Schito(@elia):@ryanstout sourcemaps, I have 2min ---------------------------------------------------------------------------------------------------- [00:25:57] Ryan Stout(@ryanstout):Is there an example using sourcemaps with 0.7. I couldn't get it to work with what's in /examples ---------------------------------------------------------------------------------------------------- [00:26:09] Ryan Stout(@ryanstout):i might be doing something wrong though. ---------------------------------------------------------------------------------------------------- ############################## [2014-11-08] ############################## [05:01:13] Ryan Stout(@ryanstout):does opal have a high res logo I can use in a talk? ---------------------------------------------------------------------------------------------------- ############################## [2014-11-09] ############################## [03:42:19] Dan Reynolds(@danReynolds):anyone around? ---------------------------------------------------------------------------------------------------- ############################## [2014-11-10] ############################## [09:12:30] Elia Schito(@elia):@ryanstout I should have the original pixelmator somewhere, too bad’s not vectorial ---------------------------------------------------------------------------------------------------- [15:13:10] Brian Glusman(@bglusman):I mentioned this over in volt room, but wondering if opal is the more appropriate place to ask whether it’d be possible/practical/useful to incorporate [virtual dom](https://github.com/Matt-Esch/virtual-dom) and/or the [tools for working with it](https://github.com/Matt-Esch/virtual-dom/wiki) into opal or some kind of opal-extension? I’d love to work on it if so, but no idea if it’s practical or been considered already etc…. ---------------------------------------------------------------------------------------------------- [15:27:36] Adam Beynon(@adambeynon):hey @bglusman - It could be incorporated, of course. We would probably need a very thin wrapper around it to handle ruby hashes => js objects for configuring the elements, but it should work fine ---------------------------------------------------------------------------------------------------- [15:27:54] Adam Beynon(@adambeynon):I did play around with an opal + reactjs bridge, which I guess is the same direction ---------------------------------------------------------------------------------------------------- [15:28:30] Adam Beynon(@adambeynon):@bglusman the reactjs bridge was actually a HAML => jsx compiler ---------------------------------------------------------------------------------------------------- [15:28:42] Adam Beynon(@adambeynon):to avoid ruby hashes => js object conversion ---------------------------------------------------------------------------------------------------- [15:31:56] Elia Schito(@elia):@adambeynon you _have to_ to share it :) ---------------------------------------------------------------------------------------------------- [15:41:00] Adam Beynon(@adambeynon):@elia sure! it needs a lot of work, so contributions would be welcome! ;) ---------------------------------------------------------------------------------------------------- [15:41:36] Elia Schito(@elia):@adambeynon just gimme a repo :shipit: ---------------------------------------------------------------------------------------------------- [20:04:51] Brian Glusman(@bglusman):@adambeynon thanks, just curious if a useful direction to think to make volt/opal higher performance etc, not sure where/how it makes sense to consider… I don’t think react makes sense for volt, but other virtual dom wrapper might. I also just had idea this mornign to try to make volt components into general web components that can be integrated freely into rails and sinatra apps which would be awesome, but dunno how big a lift it would be :-) ---------------------------------------------------------------------------------------------------- [21:27:37] Jared White(@jaredcwhite):Just heard about RubyFire - very interested! I worked on some code a while back that provided some simple front-end controller pieces and a view-model layer that was a wrapper around KnockoutJS, but ended up putting it all on hold because I don't want to be dependent on Knockout. My overall goal was to provide a nice modular client-side framework to compliment Rails well. But I think I'll be happy now to wait to check out Fire's repo and maybe contribute any ideas if applicable at that point. :) ---------------------------------------------------------------------------------------------------- ############################## [2014-11-12] ############################## [21:24:32] Ryan Stout(@ryanstout):Is anyone around who can help me with sourcemaps? I can't seem to get them working in beta2 ---------------------------------------------------------------------------------------------------- ############################## [2014-11-16] ############################## [21:42:04] Adam Beynon(@adambeynon):https://github.com/opal/opal-rails/blob/master/lib/opal/rails/engine.rb#L38-L41 ---------------------------------------------------------------------------------------------------- [21:42:14] Elia Schito(@elia):@ryanstout cascade seems a good choice ---------------------------------------------------------------------------------------------------- [21:42:53] Ryan Stout(@ryanstout):@elia cool, I think I realized what I'm doing wrong. The only thing that is weird is that I need to serve my own index files, that won't conflict will it? ---------------------------------------------------------------------------------------------------- [21:44:07] Elia Schito(@elia):shold “Cascade” to the next app when finds a 404 ---------------------------------------------------------------------------------------------------- [21:56:21] Ryan Stout(@ryanstout):ok, cool ---------------------------------------------------------------------------------------------------- [21:56:35] Ryan Stout(@ryanstout):I think I need to just get some time and change around stuff in volt to get it to work :-) ---------------------------------------------------------------------------------------------------- [01:23:17] Elia Schito(@elia):@ryanstout just pushed to master, should be fixed by opal/opal@578911b ---------------------------------------------------------------------------------------------------- [01:57:29] Ryan Stout(@ryanstout):Awesome, thanks a bunch! ---------------------------------------------------------------------------------------------------- [11:04:32] Elia Schito(@elia):https://github.com/josh/sprockets-es6 ---------------------------------------------------------------------------------------------------- [21:18:26] Ryan Stout(@ryanstout):@elia you around by chance? ---------------------------------------------------------------------------------------------------- [21:38:57] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [21:39:03] Adam Beynon(@adambeynon):@ryanstout anything I can help with? ---------------------------------------------------------------------------------------------------- [21:39:22] Ryan Stout(@ryanstout):@adambeynon still having a few problems with sourcemaps, but I have the feeling it's related to how I'm mounting the app ---------------------------------------------------------------------------------------------------- [21:40:04] Adam Beynon(@adambeynon):@ryanstout are they coming through at all? ---------------------------------------------------------------------------------------------------- [21:40:32] Ryan Stout(@ryanstout):the map is, but it's not loading the actual .rb files (the urls are wrong) ---------------------------------------------------------------------------------------------------- [21:40:57] Ryan Stout(@ryanstout):I think I need to use Rack::Cascade or something to mount it. I'm using app.map '/assets' do ... ---------------------------------------------------------------------------------------------------- [21:41:04] Ryan Stout(@ryanstout):which I think is putting it under /assets twice ---------------------------------------------------------------------------------------------------- [21:41:28] Ryan Stout(@ryanstout):anyway, I need to just mess with it a bit more on my end :-) ---------------------------------------------------------------------------------------------------- [21:41:42] Ryan Stout(@ryanstout):@adambeynon btw, I'll be saying some good things about opal in my rubyconf talk :-) ---------------------------------------------------------------------------------------------------- [21:42:02] Adam Beynon(@adambeynon):@ryanstout elia is the right person to ask, but looking at opal-rails we use Cascade there ---------------------------------------------------------------------------------------------------- ############################## [2014-11-21] ############################## [00:00:40] Ryan Stout(@ryanstout):hey everyone. I gave opal a pretty good promotion in my rubyconf talk (should be on video in the next month @confreaks) ---------------------------------------------------------------------------------------------------- [00:00:41] Ryan Stout(@ryanstout):quick question ---------------------------------------------------------------------------------------------------- [00:00:58] Ryan Stout(@ryanstout):what's the best way to detect that I have an opal object (as opposed to a normal JS object) ---------------------------------------------------------------------------------------------------- [00:44:00] Jared White(@jaredcwhite):At one point before I was checking for the presence of _klass (aka `typeof xyz['_klass'] != 'undefined'`) but it looks like that was recently refactored away so that approach is probably not wise. Is there some common method on Object that can be checked instead maybe? ---------------------------------------------------------------------------------------------------- [05:38:35] Damian Esteban(@damianesteban):So I'm starting to like Opal. Any time-frame on when Fire will be useable? ---------------------------------------------------------------------------------------------------- [08:58:59] Elia Schito(@elia):> should be on video in the next month ---------------------------------------------------------------------------------------------------- [08:59:08] Elia Schito(@elia):@ryanstout can't wait ---------------------------------------------------------------------------------------------------- [09:01:04] Elia Schito(@elia):@ryanstout @jaredcwhite `_klass` and other internal properties have all been refactored to use a double dollar prefix instead, so it's still there, but named `$$class` ---------------------------------------------------------------------------------------------------- [09:03:33] Elia Schito(@elia):that said, another way to check is to `require "native"` and use `#native?` which is defined on Kernel and thus available everywhere ---------------------------------------------------------------------------------------------------- [17:17:34] Elia Schito(@elia):@adambeynon @meh https://www.dartlang.org/articles/js-dart-interop/ that’s how they do it, just saying ---------------------------------------------------------------------------------------------------- [17:22:21] Adam Beynon(@adambeynon):@elia interesting, haven’t seen that before ---------------------------------------------------------------------------------------------------- [17:22:30] Adam Beynon(@adambeynon):I assumed they didnt use a proxy ---------------------------------------------------------------------------------------------------- [17:25:56] Elia Schito(@elia):@adambeynon didn’t read in detail, but seems that we do better already :) ---------------------------------------------------------------------------------------------------- [17:56:45] Jared White(@jaredcwhite):@elia Thanks for the tip! I'll check that out :) ---------------------------------------------------------------------------------------------------- ############################## [2014-11-22] ############################## [20:23:19] Bernhard Weichel(@bwl21):I have a request to provide my zupfnoter as desktop applicatIon. I think of using node-webkit for that. Is there some experience about this? ---------------------------------------------------------------------------------------------------- ############################## [2014-11-23] ############################## [22:58:39] Ryan Stout(@ryanstout):@elia so for primitives, you pass in the type and value (string, number, etc) to the hash, for arrays, you pass in the hash of the nodes, and for hashes you do the key and value's hashes ---------------------------------------------------------------------------------------------------- [22:59:11] Ryan Stout(@ryanstout):(and be sure to include type for array and hash) ---------------------------------------------------------------------------------------------------- [22:59:42] Elia Schito(@elia):still there’s the problem of making them order independent ---------------------------------------------------------------------------------------------------- [23:00:10] Ryan Stout(@ryanstout):oh, because hash comparison in ruby is order independant? ---------------------------------------------------------------------------------------------------- [23:00:17] Elia Schito(@elia):I think I’ll try to make it work as it is for now, and try the numeric hashing on a different branch ---------------------------------------------------------------------------------------------------- [23:00:27] Elia Schito(@elia):no, just for Hash#hash I think ---------------------------------------------------------------------------------------------------- [23:00:46] Ryan Stout(@ryanstout):yea, you would need to sort them first ---------------------------------------------------------------------------------------------------- [23:00:51] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [23:00:59] Elia Schito(@elia):no other way ---------------------------------------------------------------------------------------------------- [23:01:10] Ryan Stout(@ryanstout):is it possible to x-or all of them together or something weird? ---------------------------------------------------------------------------------------------------- [23:01:15] Ryan Stout(@ryanstout):probably faster to sort ---------------------------------------------------------------------------------------------------- [23:01:22] Elia Schito(@elia):well excluding the code above from rubinius ---------------------------------------------------------------------------------------------------- [23:01:44] Ryan Stout(@ryanstout):yea, actually, that's probably faster ---------------------------------------------------------------------------------------------------- [23:01:57] Ryan Stout(@ryanstout):just compute the hash for each key/value, and x-or together ---------------------------------------------------------------------------------------------------- [23:02:04] Elia Schito(@elia):all hashes are strings right now, which makes sense bc we’re using objects as hash tables ---------------------------------------------------------------------------------------------------- [23:02:15] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [23:02:23] Ryan Stout(@ryanstout):so you would have to convert the number to a string ---------------------------------------------------------------------------------------------------- [23:02:27] Ryan Stout(@ryanstout):but thats doable ---------------------------------------------------------------------------------------------------- [23:02:44] Elia Schito(@elia):to avoid conflicts we have a separate table for strings which are used as hashes directly ---------------------------------------------------------------------------------------------------- [23:03:09] Ryan Stout(@ryanstout):@elia strings used as hashes? ---------------------------------------------------------------------------------------------------- [23:03:57] Elia Schito(@elia):yes, a js object literal is a hash-table after all ---------------------------------------------------------------------------------------------------- [23:04:09] Elia Schito(@elia):and keys must be strings ---------------------------------------------------------------------------------------------------- [23:04:45] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [23:04:47] Elia Schito(@elia):that’s why in 0.6 `a = {}; a[1] = 123; a[‘1’] #=> 123` ---------------------------------------------------------------------------------------------------- [23:05:02] Ryan Stout(@ryanstout):yea, the ruby semantics are so much better, hehe ---------------------------------------------------------------------------------------------------- [23:05:29] Ryan Stout(@ryanstout):I just didn't understand what the separate table was for ---------------------------------------------------------------------------------------------------- [23:05:35] Elia Schito(@elia):now trying a simple js .sort() on keys ---------------------------------------------------------------------------------------------------- [23:06:22] Elia Schito(@elia):btw locally your example works correctly now ---------------------------------------------------------------------------------------------------- [23:08:35] Ryan Stout(@ryanstout):Cool ---------------------------------------------------------------------------------------------------- [23:13:38] Ryan Stout(@ryanstout):let me know if I can help with anything else on it. Thanks for working on it. ---------------------------------------------------------------------------------------------------- [23:19:37] Elia Schito(@elia):@ryanstout currently I’m stuck on circular hashes ---------------------------------------------------------------------------------------------------- [23:19:57] Ryan Stout(@ryanstout):humm ---------------------------------------------------------------------------------------------------- [23:20:03] Ryan Stout(@ryanstout):yea, thats tricky ---------------------------------------------------------------------------------------------------- [23:20:18] Elia Schito(@elia):it’s easier to output ‘{…}’ than to get a hash :) ---------------------------------------------------------------------------------------------------- [23:20:26] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [23:20:45] Ryan Stout(@ryanstout):I guess you need to stop once you've seen something already ---------------------------------------------------------------------------------------------------- [23:20:50] Ryan Stout(@ryanstout):how does rubinius do it? ---------------------------------------------------------------------------------------------------- [20:51:47] Gustaf Lindqvist(@gustaflindqvist):Hi, how close is the Rubyfire alpha or beta? ---------------------------------------------------------------------------------------------------- [20:59:50] Adam Beynon(@adambeynon):@gustaflindqvist very early alpha atm. The core parts (model/router) are based off Vienna ---------------------------------------------------------------------------------------------------- [20:59:55] Adam Beynon(@adambeynon):http://github.com/opal/vienna ---------------------------------------------------------------------------------------------------- [21:00:03] Adam Beynon(@adambeynon):its kind of the successor to vienna ---------------------------------------------------------------------------------------------------- [21:03:00] Adam Beynon(@adambeynon):@gustaflindqvist the biggest difference is that in RubyFire, the views can be compiled inside rails (for seo), as well as on the client side ---------------------------------------------------------------------------------------------------- [21:03:33] Adam Beynon(@adambeynon):once you have the views loaded, the API for the client is pretty much what Vienna offers now ---------------------------------------------------------------------------------------------------- [21:04:27] Gustaf Lindqvist(@gustaflindqvist):@adambeynon nice, looking forward to test RubyFire. :) ---------------------------------------------------------------------------------------------------- [21:14:02] Ryan Stout(@ryanstout):@adambeynon just curious what the timeline looks like on opal7 (no rush, just trying to plan volt versions around it) ---------------------------------------------------------------------------------------------------- [21:17:33] Adam Beynon(@adambeynon):@ryanstout. ASAP really. Once the caching is done, another beta then final release. Hopefully caching will be done tomorrow or Tuesday ---------------------------------------------------------------------------------------------------- [21:17:56] Ryan Stout(@ryanstout):@adambeynon cool. thanks for the info :-) ---------------------------------------------------------------------------------------------------- [21:38:26] Elia Schito(@elia):@adambeynon @ryanstout was about to ask the same :P ---------------------------------------------------------------------------------------------------- [21:51:11] Ryan Stout(@ryanstout):@adambeynon or @elia have you guys seen this issue: https://github.com/opal/opal/issues/655 ---------------------------------------------------------------------------------------------------- [21:51:34] Ryan Stout(@ryanstout):took me a while to isolate ---------------------------------------------------------------------------------------------------- [21:52:34] Elia Schito(@elia):surely my fault :D, looking into it ---------------------------------------------------------------------------------------------------- [21:53:19] Ryan Stout(@ryanstout):@elia thanks! ---------------------------------------------------------------------------------------------------- [21:54:08] Ryan Stout(@ryanstout):I can try to simplify the key if you want ---------------------------------------------------------------------------------------------------- [21:54:31] Elia Schito(@elia):@ryanstout could be (IMO) 2 things ---------------------------------------------------------------------------------------------------- [21:55:05] Elia Schito(@elia):1. some class has a bad implementation for #hash 2. there’s some js local var leaking inside Hash ---------------------------------------------------------------------------------------------------- [21:59:05] Ryan Stout(@ryanstout):@elia it can be simplified to: ---------------------------------------------------------------------------------------------------- [21:59:08] Ryan Stout(@ryanstout):```ruby a = {} a[{}] = 'awesome' puts a[{}].inspect ``` ---------------------------------------------------------------------------------------------------- [22:01:21] Ryan Stout(@ryanstout):the weird thing is the equality check works ---------------------------------------------------------------------------------------------------- [22:04:14] Elia Schito(@elia):@ryanstout was n.1 Hash#hash is not implemented :\ ---------------------------------------------------------------------------------------------------- [22:05:25] Ryan Stout(@ryanstout):a ---------------------------------------------------------------------------------------------------- [22:05:26] Ryan Stout(@ryanstout):h ---------------------------------------------------------------------------------------------------- [22:06:21] Ryan Stout(@ryanstout):@elia did you redo how .hash worked? ---------------------------------------------------------------------------------------------------- [22:06:36] Elia Schito(@elia):I’ll go look at rubionius impl :smile: ---------------------------------------------------------------------------------------------------- [22:07:20] Ryan Stout(@ryanstout):I checked out [1].hash Are you doing something so you don't have to compute a real hash? ---------------------------------------------------------------------------------------------------- [22:09:15] Elia Schito(@elia):yep, there’s a naive impl. on Object (or Kernel) ---------------------------------------------------------------------------------------------------- [22:09:36] Elia Schito(@elia):that includes object_id ---------------------------------------------------------------------------------------------------- [22:10:32] Ryan Stout(@ryanstout):cool ---------------------------------------------------------------------------------------------------- [22:11:04] Ryan Stout(@ryanstout):if you ever need a real hash, let me know. I had a project where I benchmarked a bunch of JS hash code ---------------------------------------------------------------------------------------------------- [22:11:25] Elia Schito(@elia):yes I need it now :P ---------------------------------------------------------------------------------------------------- [22:11:31] Ryan Stout(@ryanstout):it's surprisingly fast in everything except safari (though they might have caught up now) ---------------------------------------------------------------------------------------------------- [22:12:05] Ryan Stout(@ryanstout):oh, are you going to compute a real hash on opal hashes? ---------------------------------------------------------------------------------------------------- [22:12:25] Elia Schito(@elia):rubinius code looks like this btw ```ruby def hash val = size Thread.detect_outermost_recursion self do each_item do |item| val ^= item.key.hash val ^= item.value.hash end end val end ``` ---------------------------------------------------------------------------------------------------- [22:13:43] Adam Beynon(@adambeynon):So, we just need a Thread impl first? ;) ---------------------------------------------------------------------------------------------------- [22:13:55] Ryan Stout(@ryanstout):why is the thread stuff there? ---------------------------------------------------------------------------------------------------- [22:14:27] Ryan Stout(@ryanstout):humm. there isn't a way to do like your doing on array? (obviously the hash stuff will have some performance impact) ---------------------------------------------------------------------------------------------------- [22:14:30] Elia Schito(@elia):lol, nope, a closure js var works well enough ---------------------------------------------------------------------------------------------------- [22:14:50] Ryan Stout(@ryanstout):@elia sorry, I don't follow ---------------------------------------------------------------------------------------------------- [22:15:01] Elia Schito(@elia):was replying to @adambeynon ---------------------------------------------------------------------------------------------------- [22:15:04] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [22:15:48] Elia Schito(@elia):the thread stuff is there to detect loops, like: `a = {}; a[a] = 123` ---------------------------------------------------------------------------------------------------- [22:16:49] Elia Schito(@elia):you can look at how #inspect is implemented to see an example ---------------------------------------------------------------------------------------------------- [22:17:20] Ryan Stout(@ryanstout):ah ---------------------------------------------------------------------------------------------------- [22:17:22] Ryan Stout(@ryanstout):interesting ---------------------------------------------------------------------------------------------------- [22:17:40] Ryan Stout(@ryanstout):anyway, let me know if you want me to see what hash algorithm I used ---------------------------------------------------------------------------------------------------- [22:17:47] Ryan Stout(@ryanstout):I might still have my benchmark code around somewhere ---------------------------------------------------------------------------------------------------- [22:22:23] Elia Schito(@elia):I’ll put up a working impl, send the hashing code if you have it at hand ---------------------------------------------------------------------------------------------------- [22:47:00] Ryan Stout(@ryanstout):ok, let me find it :-) ---------------------------------------------------------------------------------------------------- [22:48:50] Elia Schito(@elia):@ryanstout I think we’ll probably need to switch to numeric hashes ---------------------------------------------------------------------------------------------------- [22:49:04] Ryan Stout(@ryanstout):@elia you mean computing a real hash? ---------------------------------------------------------------------------------------------------- [22:49:22] Elia Schito(@elia):heh, yes, for now was some kind of string ---------------------------------------------------------------------------------------------------- [22:49:25] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:49:46] Ryan Stout(@ryanstout):are you using .hash for comparisons also? ---------------------------------------------------------------------------------------------------- [22:50:30] Elia Schito(@elia):you mean in ==, eql? and friends? ---------------------------------------------------------------------------------------------------- [22:51:11] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:51:21] Ryan Stout(@ryanstout):ok, this was the fastest one I had seen: https://github.com/garycourt/murmurhash-js ---------------------------------------------------------------------------------------------------- [22:51:25] Elia Schito(@elia):let me check ---------------------------------------------------------------------------------------------------- [22:52:07] Ryan Stout(@ryanstout):a 32bit hash should work right? ---------------------------------------------------------------------------------------------------- [22:53:04] Elia Schito(@elia):I think so, isn’t all js numbers 32bit anyway? ---------------------------------------------------------------------------------------------------- [22:53:19] Ryan Stout(@ryanstout):I think they are all 64 bit floats ---------------------------------------------------------------------------------------------------- [22:53:38] Ryan Stout(@ryanstout):so newer browsers have typed arrays ---------------------------------------------------------------------------------------------------- [22:54:18] Elia Schito(@elia):maybe we can pass class object_id as seed, wdyt? ---------------------------------------------------------------------------------------------------- [22:54:28] Ryan Stout(@ryanstout):so at some point you may want to do some more benchmarks. I thought I tested more implementations, but I only did two murmurhashes and an xxhash version ---------------------------------------------------------------------------------------------------- [22:54:52] Ryan Stout(@ryanstout):how is object_id computed now? ---------------------------------------------------------------------------------------------------- [22:54:58] Ryan Stout(@ryanstout):just an incrementing value? ---------------------------------------------------------------------------------------------------- [22:55:03] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [22:55:17] Elia Schito(@elia):via Opal.uid() ---------------------------------------------------------------------------------------------------- [22:55:31] Ryan Stout(@ryanstout):so I don't think you want to have different seeds, because then different objects with the same "value" would be different ---------------------------------------------------------------------------------------------------- [22:55:46] Ryan Stout(@ryanstout):you need to be passing in the unique content of the value ---------------------------------------------------------------------------------------------------- [22:55:57] Joiey Seeley(@bigtunacan):@ryanstout, I have a numericality validator working now ---------------------------------------------------------------------------------------------------- [22:56:02] Ryan Stout(@ryanstout):so for primitives, it's just the type and value ---------------------------------------------------------------------------------------------------- [22:56:10] Joiey Seeley(@bigtunacan):I'm going to write some tests for it still ---------------------------------------------------------------------------------------------------- [22:56:13] Ryan Stout(@ryanstout):@bigtunacan in volt? ---------------------------------------------------------------------------------------------------- [22:56:18] Joiey Seeley(@bigtunacan):I'll submit the pull request tomorrow ---------------------------------------------------------------------------------------------------- [22:56:22] Joiey Seeley(@bigtunacan):Yeah; wrote it tonight ---------------------------------------------------------------------------------------------------- [22:56:44] Ryan Stout(@ryanstout):@bigtunacan cool, this is the opal chat, fyi (easy to get confused) ---------------------------------------------------------------------------------------------------- [22:57:27] Joiey Seeley(@bigtunacan):@ryanstout Ack! Sorry guys! I always have both open, meant to send this in the other ---------------------------------------------------------------------------------------------------- ############################## [2014-11-24] ############################## [05:46:21] Damian Esteban(@damianesteban):that would be fantastic to see a demo of Fire on video next month. ---------------------------------------------------------------------------------------------------- ############################## [2014-11-25] ############################## [19:18:10] ylluminate(@ylluminate):Might throw your 2¢ in over here for Opal support for Peppermint on my comment: http://www.macupdate.com/app/mac/52446/peppermint ---------------------------------------------------------------------------------------------------- [20:09:20] Jared White(@jaredcwhite):Hi everyone, I just started committing in earnest to a new gem called opal-shimmer. Shimmer is an "application state and configuration management library" -- right now all it does is provide some Hashie-like value saving/retrieving, but I have additional ideas. Would love your input: https://github.com/jaredcwhite/opal-shimmer ---------------------------------------------------------------------------------------------------- [20:09:40] Jared White(@jaredcwhite):You can look at the spec file to get a sense of what it currently supports ---------------------------------------------------------------------------------------------------- [21:23:49] ylluminate(@ylluminate):so raptor was passenger 5. who'd a thunk it? http://blog.phusion.nl/2014/11/25/introducing-phusion-passenger-5-beta-1-codename-raptor/ ---------------------------------------------------------------------------------------------------- [21:24:05] ylluminate(@ylluminate):exciting time to be a ruby dev ---------------------------------------------------------------------------------------------------- [21:24:33] Jared White(@jaredcwhite):Yeah, that caught me by surprise as well. Cheeky bastards. :) ---------------------------------------------------------------------------------------------------- [21:31:46] ylluminate(@ylluminate):Well I had asked them about passenger plans for performance a month or so ago and was just told "wait and see"... LOL, I'm pleasantly surprised. ---------------------------------------------------------------------------------------------------- [21:32:34] ylluminate(@ylluminate):I'm thrilled because I just moved back from TorqueBox to Passenger and now I don't have nearly that much work to upgrade! :smile: ---------------------------------------------------------------------------------------------------- [21:38:11] Jared White(@jaredcwhite):Yeah, I recently started inching towards using unicorn for new projs rather than passenger, but now with the raptor release I'm definitely going to check that out. ---------------------------------------------------------------------------------------------------- ############################## [2014-11-28] ############################## [15:29:15] Jikku Jose(@JikkuJose):Hello, whats your opinion about Spider? http://spiderlang.org/#why-spider ---------------------------------------------------------------------------------------------------- [15:35:40] Adam Beynon(@adambeynon):"Instead of bringing a completely new indentation-based syntax like CoffeeScript, Spider preserves JavaScript's familiar syntax that we all use everyday." ---------------------------------------------------------------------------------------------------- [15:35:45] Adam Beynon(@adambeynon):for me, there is problem number 1. ---------------------------------------------------------------------------------------------------- [15:36:02] Adam Beynon(@adambeynon):each to their own, though. ---------------------------------------------------------------------------------------------------- ############################## [2014-12-01] ############################## [16:19:31] AstonJ(@AstonJ):Agree with @adambeynon …it’s not Ruby. Opal on the other hand is an official AltRuby :D ---------------------------------------------------------------------------------------------------- [20:05:58] Bernhard Weichel(@bwl21):HI ---------------------------------------------------------------------------------------------------- [20:06:16] Bernhard Weichel(@bwl21):I try to use "confstruct" gem. It has the following sequence: ---------------------------------------------------------------------------------------------------- [20:06:20] Bernhard Weichel(@bwl21): if false #::RUBY_VERSION < '1.9' begin require 'active_support/ordered_hash' class HashWithStructAccess < DelegateClass(ActiveSupport::OrderedHash); @@ordered = true; @@hash_class = ActiveSupport::OrderedHash; end rescue LoadError, NameError class HashWithStructAccess < DelegateClass(Hash); @@ordered = false; @@hash_class = Hash; end end else class HashWithStructAccess < DelegateClass(Hash); @@ordered = true; @@hash_class = Hash; end end ---------------------------------------------------------------------------------------------------- [20:10:23] Bernhard Weichel(@bwl21):any idea how to handle such a situation ... ---------------------------------------------------------------------------------------------------- [21:28:26] Adam Beynon(@adambeynon):@bwl21 Opal doesn’t support the #DelegateClass method ---------------------------------------------------------------------------------------------------- [21:28:30] Adam Beynon(@adambeynon):(yet) ---------------------------------------------------------------------------------------------------- [21:28:48] Adam Beynon(@adambeynon):there is an open issue for it, but it hasnt been worked on afaik ---------------------------------------------------------------------------------------------------- ############################## [2014-12-03] ############################## [20:10:57] Andrew Havens(@andrewhavens):Beginner Opal/Sprockets question…what are source maps for, and why is there a route for them? ---------------------------------------------------------------------------------------------------- [20:12:10] Andrew Havens(@andrewhavens):I just noticed in the Sinatra docs that you specifically need to set them up. ``` map opal.source_maps.prefix do run opal.source_maps end ``` ---------------------------------------------------------------------------------------------------- [20:17:01] Andrew Havens(@andrewhavens):Oh, and by the way, I want to write an `opal-backbone` library so that I can better understand how to use opal in my projects. ---------------------------------------------------------------------------------------------------- [20:17:55] Andrew Havens(@andrewhavens):I’m guessing that opal-jquery will be the best example to imitate since it provides an opal API for an already existing javascript library ---------------------------------------------------------------------------------------------------- [20:23:37] Gustaf Lindqvist(@gustaflindqvist):What is the status of the support for 'date' in Opal? ---------------------------------------------------------------------------------------------------- [20:24:32] Gustaf Lindqvist(@gustaflindqvist):Ah I got the answer from @ryanstout https://github.com/opal/opal/blob/master/stdlib/date.rb :) ---------------------------------------------------------------------------------------------------- [22:01:59] Adam Beynon(@adambeynon):@andrewhavens source maps are used by browsers when debugging. so instead of having to step through compiled javascripts, the source maps will make the code line up to the original ruby code ---------------------------------------------------------------------------------------------------- [22:02:05] Adam Beynon(@adambeynon):line by line, column by column ---------------------------------------------------------------------------------------------------- [22:02:54] Adam Beynon(@adambeynon):@gustaflindqvist just read up the stuff from volt r.e date support. any takers are welcome for the parsing part ;) pull requests are always merged as soon as we can ---------------------------------------------------------------------------------------------------- [22:04:27] Andrew Havens(@andrewhavens):@adambeynon Oh! Source maps are a newer browser feature…I didn’t know about that. Thanks! ---------------------------------------------------------------------------------------------------- [22:06:39] Ryan Stout(@ryanstout):@adambeynon looks like jruby has a mostly pure ruby date & parse implementation: https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/date.rb ---------------------------------------------------------------------------------------------------- [22:06:50] Ryan Stout(@ryanstout):seems like a ton of things in date that no one uses though ---------------------------------------------------------------------------------------------------- [22:07:44] Adam Beynon(@adambeynon):@ryanstout yeah, that was my take away from it. the whole implementation is huge. maybe we could implement the most common parsing parts, and have an add-in for the rest/extra bits ---------------------------------------------------------------------------------------------------- [22:07:48] Ryan Stout(@ryanstout):here's jruby's parse: https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/date/format.rb ---------------------------------------------------------------------------------------------------- [22:08:04] Adam Beynon(@adambeynon):eek ---------------------------------------------------------------------------------------------------- [22:08:06] Adam Beynon(@adambeynon):"1239 lines (1123 sloc) 34.34 kb" ---------------------------------------------------------------------------------------------------- [22:08:13] Ryan Stout(@ryanstout):@adambeynon I like that idea. Part of me thought maybe it should be something you require either way. ---------------------------------------------------------------------------------------------------- [22:08:22] Ryan Stout(@ryanstout):since some apps won't need date/time ---------------------------------------------------------------------------------------------------- [22:08:33] Ryan Stout(@ryanstout):but I like the date-basic idea ---------------------------------------------------------------------------------------------------- [22:09:11] Adam Beynon(@adambeynon):@ryanstout yep. Im very keen on working on ways to make a lot of even core lib requirable. @elia and I talked about having 2 or 3 seperate “main” entry files ---------------------------------------------------------------------------------------------------- [22:09:16] Adam Beynon(@adambeynon):like we have “opal.rb” now ---------------------------------------------------------------------------------------------------- [22:09:22] Adam Beynon(@adambeynon):maybe opal-mini and opal-full as well ---------------------------------------------------------------------------------------------------- [22:09:29] Ryan Stout(@ryanstout):@adambeynon cool, I think thats a great idea ---------------------------------------------------------------------------------------------------- [22:09:58] Adam Beynon(@adambeynon):@ryanstout I remember showing elia the corelib when it was like 20kb in full ---------------------------------------------------------------------------------------------------- [22:10:03] Adam Beynon(@adambeynon):those days are long gone :( ---------------------------------------------------------------------------------------------------- [22:10:14] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:10:29] Ryan Stout(@ryanstout):though it's still not terrible. Someone was telling me scalajs is like 1.5Mb's min ---------------------------------------------------------------------------------------------------- [22:10:37] Ryan Stout(@ryanstout)::-) ---------------------------------------------------------------------------------------------------- [22:10:49] Ryan Stout(@ryanstout):but yea, having opal-mini would be really nice, then people could just require in what they need ---------------------------------------------------------------------------------------------------- [22:11:10] Ryan Stout(@ryanstout):and most people could just start with normal opal, then switch to opal-mini if they need the space ---------------------------------------------------------------------------------------------------- [22:11:41] Ryan Stout(@ryanstout):@adambeynon does rspec have specs for parsing dates? ---------------------------------------------------------------------------------------------------- [22:14:29] Adam Beynon(@adambeynon):Rspec? You mean rubyspec? ---------------------------------------------------------------------------------------------------- [22:14:36] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:18:29] Adam Beynon(@adambeynon):They moved the stdlib stuff out into separate repos, under the rubysl project ---------------------------------------------------------------------------------------------------- [22:19:10] Adam Beynon(@adambeynon):https://github.com/rubysl/rubysl-date ---------------------------------------------------------------------------------------------------- [22:19:59] Adam Beynon(@adambeynon):Looks like quite a few specs on there for praying. ---------------------------------------------------------------------------------------------------- [22:20:08] Adam Beynon(@adambeynon):Parsing** ---------------------------------------------------------------------------------------------------- [22:20:28] Adam Beynon(@adambeynon):On my phone :/ ---------------------------------------------------------------------------------------------------- [22:43:56] Andrew Havens(@andrewhavens):On the subject of date/time parsing...I was recently working on a project (using coffeescript) and needed to parse a datetime and format it into something human readable. Date formatting in JavaScript is seriously lacking. I considered adding the moment.js library just so I could do some basic date formatting, but decided at 11k gzipped for formatting my date, it just wasn’t worth it…I just decided to format the date on the server side using Ruby before passing it to JavaScript :pensive: ---------------------------------------------------------------------------------------------------- ############################## [2014-12-04] ############################## [23:14:41] Jared White(@jaredcwhite):@brandondrew I don't see why it would be ridiculous. Most likely the connection points between your custom app code and the grid component will be fairly contained (or should be!), in which case you simply write an adapter to cross the divide between the JS and the Ruby code. I haven't made much use of the Native wrapper stuff but that might get you a fair ways along. ---------------------------------------------------------------------------------------------------- [17:03:48] Brandon Zylstra(@brandondrew):Would it be insanely ridiculous to try to make write an opal app that includes an Angular component, like the UI-Grid? ---------------------------------------------------------------------------------------------------- [17:03:51] Brandon Zylstra(@brandondrew):http://ui-grid.info/docs/#/tutorial/401_AllFeatures ---------------------------------------------------------------------------------------------------- ############################## [2014-12-06] ############################## [17:22:13] Can Edremitoglu(@cantonic):hi everybody. i am using the stable version of opal-rails from rubygems (0.6.3) because I want to run it in production. would you recommend to use the 0.7 even if it is in beta? ---------------------------------------------------------------------------------------------------- [17:26:43] Can Edremitoglu(@cantonic):since i am totally new to opal i have no clue how stable the beta or even the master branch on github is ---------------------------------------------------------------------------------------------------- ############################## [2014-12-07] ############################## [22:48:33] Ryan Stout(@ryanstout):@adambeynon nice work on keyword args :-) ---------------------------------------------------------------------------------------------------- [23:09:10] Adam Beynon(@adambeynon)::metal: ---------------------------------------------------------------------------------------------------- ############################## [2014-12-08] ############################## [04:04:02] Ryan Stout(@ryanstout):@adambeynon @elia does subclassing Hash work in opal? ---------------------------------------------------------------------------------------------------- [04:04:10] Ryan Stout(@ryanstout):I know it didn't work at one point ---------------------------------------------------------------------------------------------------- [08:15:06] Adam Beynon(@adambeynon):@ryanstout yep, subclassing hash works just fine now ---------------------------------------------------------------------------------------------------- ############################## [2014-12-13] ############################## [14:36:23] Brandon Zylstra(@brandondrew):@jaredcwhite : thanks! (and sorry for the delayed response) ---------------------------------------------------------------------------------------------------- [17:57:34] Ryan Stout(@ryanstout):@adambeynon or @elia (or anyone else) I've got one thing I want to try, I was wondering if there's an easy way to do AST transforms on opal code during compilation? ---------------------------------------------------------------------------------------------------- ############################## [2014-12-15] ############################## [06:52:42] Elia Schito(@elia):@ryanstout I think you can do it hooking into the Compiler see also lib/opal/nodes ---------------------------------------------------------------------------------------------------- [06:53:37] Ryan Stout(@ryanstout):@elia thanks. Sorry I should have said I figured it out. ---------------------------------------------------------------------------------------------------- [06:55:04] Elia Schito(@elia):no prob :) looking forward to your super powerful ast transformations! ;P ---------------------------------------------------------------------------------------------------- [06:56:49] Ryan Stout(@ryanstout):It was just an experiment. Probably won't go anywhere. ---------------------------------------------------------------------------------------------------- ############################## [2014-12-18] ############################## [23:51:51] Ryan Stout(@ryanstout):@elia @adambeynon just curious how things are going for opal0.7? ---------------------------------------------------------------------------------------------------- ############################## [2014-12-19] ############################## [08:25:06] Adam Beynon(@adambeynon):@ryanstout been busy so haven't been able to push it out as soon as I would have liked. It's pretty much there though, just got to merge in caching support for builder ---------------------------------------------------------------------------------------------------- ############################## [2014-12-20] ############################## [04:30:11] Brandon Zylstra(@brandondrew):@elia @adambeynon I'm sorry if this should be obvious to me, but I can't tell from the README whether opal-node is a joke or not. There's so much sarcasm in it that it seems it may be, but the idea is interesting enough that I'm not so sure... ---------------------------------------------------------------------------------------------------- [04:30:23] Brandon Zylstra(@brandondrew):https://github.com/opal/opal-node#readme ---------------------------------------------------------------------------------------------------- [21:14:17] Joe Martinez(@capitalist):@brandondrew look at the commit history. It's probably not as current as you'd like, but they're awfully committed to the joke if that's all it is. ---------------------------------------------------------------------------------------------------- [21:14:45] Joe Martinez(@capitalist):@brandondrew If you're interested in node's sweet spot, using ruby and opal, watch this talk http://confreaks.com/videos/5014-RubyConf2014-6-reasons-jubilee-could-be-a-rubyist-s-new-best-friend ---------------------------------------------------------------------------------------------------- [21:58:23] Brandon Zylstra(@brandondrew):@capitalist thanks! I'm watching that now. ---------------------------------------------------------------------------------------------------- [22:41:12] Elia Schito(@elia):I’m a bit late at the party :) ---------------------------------------------------------------------------------------------------- [22:44:09] Elia Schito(@elia):@brandondrew @capitalist opal-node is outdated, the preferred way nowadays is to compile the app and run it with node ---------------------------------------------------------------------------------------------------- [22:45:10] Elia Schito(@elia):we imported all the useful stuff in the stdlib ---------------------------------------------------------------------------------------------------- [22:45:43] Elia Schito(@elia):https://github.com/opal/opal/blob/master/stdlib/nodejs.rb ---------------------------------------------------------------------------------------------------- [22:55:26] Brandon Zylstra(@brandondrew):@elia: it would be worth making a note of that on the README ---------------------------------------------------------------------------------------------------- [22:58:44] Elia Schito(@elia):you right ---------------------------------------------------------------------------------------------------- [23:10:00] Elia Schito(@elia):@brandondrew done https://github.com/opal/opal-node/commit/8c0ed86e8c21cca6d962033d261c14a27fb9de92 ---------------------------------------------------------------------------------------------------- ############################## [2014-12-21] ############################## [03:16:42] Joe Martinez(@capitalist):nice ---------------------------------------------------------------------------------------------------- [08:57:19] Elia Schito(@elia):@adambeynon @ryanstout would be' nice ---------------------------------------------------------------------------------------------------- [08:58:04] Elia Schito(@elia):If we ship just before Christmas ---------------------------------------------------------------------------------------------------- [10:34:49] Adam Beynon(@adambeynon):@elia yep. I haven't tested the caching that much. So I would prefer to either not include it in 0.8, or to turn it off by default so it doesn't break anything. ---------------------------------------------------------------------------------------------------- [15:20:30] Ryan Stout(@ryanstout):What ever you guys think, but it would be nice to have caching in 0.7. Let me know if I can help with testing or something. Thanks! ---------------------------------------------------------------------------------------------------- [15:29:54] Ryan Stout(@ryanstout):Off by default would be fine too though. :-) ---------------------------------------------------------------------------------------------------- [17:30:22] Elia Schito(@elia):@adambeynon @ryanstout being in 0.x I'd be open to ship it on by default and be prepared to fix and release when/if issues pop up for it ---------------------------------------------------------------------------------------------------- [17:30:30] Elia Schito(@elia):wdyt? ---------------------------------------------------------------------------------------------------- ############################## [2014-12-22] ############################## [04:44:04] Brandon Zylstra(@brandondrew):@elia : thanks! ---------------------------------------------------------------------------------------------------- [04:48:18] Brandon Zylstra(@brandondrew):I think whether caching should be on or off by default depends on what could go wrong. If there's a bug in caching could the result possibly be worse than just having performance be the same as if caching is off? Or could worse things happen that would confuse people trying it for the first time? ---------------------------------------------------------------------------------------------------- [08:25:38] Elia Schito(@elia):just to clarify, I didn't mean to skip decent testing on some apps etc. :D ---------------------------------------------------------------------------------------------------- ############################## [2014-12-23] ############################## [04:51:58] Brandon Zylstra(@brandondrew):@elia: I found your "3 tricks to debug Opal code from your browser" very helpful, but I found a bug (or perhaps a casualty of an API change?) ---------------------------------------------------------------------------------------------------- [04:52:05] Brandon Zylstra(@brandondrew):Opal.$puts('hello world'); ---------------------------------------------------------------------------------------------------- [04:52:10] Brandon Zylstra(@brandondrew):does not work. ---------------------------------------------------------------------------------------------------- [04:53:02] Brandon Zylstra(@brandondrew):on a hunch, I tried `Opal.Kernel.$puts("hello world");` instead and it worked just as expected. ---------------------------------------------------------------------------------------------------- [04:53:56] Brandon Zylstra(@brandondrew):Was this changed from a previous version of Opal? Was the decision made that `.Kernel` had to be explicit, to avoid too many global methods getting tacked onto Opal, or to avoid a collision, perhaps? ---------------------------------------------------------------------------------------------------- [21:06:05] Brandon Zylstra(@brandondrew):Any news on Fire? ---------------------------------------------------------------------------------------------------- ############################## [2014-12-27] ############################## [03:11:41] ylluminate(@ylluminate):hope everyone had happy holidays so far and have a great new year! ---------------------------------------------------------------------------------------------------- [03:12:36] Can Edremitoglu(@cantonic):wish you the same! ---------------------------------------------------------------------------------------------------- [04:48:32] ylluminate(@ylluminate):thanks! ---------------------------------------------------------------------------------------------------- [13:01:01] Elia Schito(@elia):@brandondrew (catching up with chats after Christmas…) ---------------------------------------------------------------------------------------------------- [13:01:59] Elia Schito(@elia):you're right, not sure when the change happened, an alternative to using the Kernel module directly is to use the top level object, like this: `Opal.top.$puts("hi!")` ---------------------------------------------------------------------------------------------------- [20:24:51] Sean Culver(@seanculver):is there support for Matrix objects in opal? ---------------------------------------------------------------------------------------------------- [20:26:37] Sean Culver(@seanculver):http://www.ruby-doc.org/stdlib-2.0/libdoc/matrix/rdoc/Matrix.html ---------------------------------------------------------------------------------------------------- [23:25:46] Elia Schito(@elia):@seanculver nope, but I'd be glad to accept a PR for it, the list of stuff already in the stdlib is this: https://github.com/opal/opal/tree/master/stdlib ---------------------------------------------------------------------------------------------------- [23:37:12] Brandon Zylstra(@brandondrew):@adambeynon @elia are you the people to direct questions to about Fire? ---------------------------------------------------------------------------------------------------- [23:37:31] Elia Schito(@elia):@brandondrew, just @adambeynon ---------------------------------------------------------------------------------------------------- [23:38:04] Elia Schito(@elia):it's basically a rewrite of Vienna, so in the meantime I guess you can have a look at it ---------------------------------------------------------------------------------------------------- [23:38:44] Brandon Zylstra(@brandondrew):you mean the features and API will mirror those of Vienna? ---------------------------------------------------------------------------------------------------- [23:39:16] Brandon Zylstra(@brandondrew):or is it a completely new approach? ---------------------------------------------------------------------------------------------------- ############################## [2014-12-28] ############################## [00:13:43] Elia Schito(@elia):@brandondrew, not sure actually, that's why @adambeynon is your man, anyway iirc it stems from a modified version of it he had in one of his applications ---------------------------------------------------------------------------------------------------- [00:15:15] Elia Schito(@elia):@brandondrew, with a much more integrated support for rails out of the box, like for models, routes etc ---------------------------------------------------------------------------------------------------- [01:34:21] Sean Culver(@seanculver):@elia I'm willing to look into it, Javascript doesn't natively have a Matrix object. Can we use third party libraries to support stdlib, http://mathjs.org/docs/datatypes/matrices.html seems like a partial fit. Any docs that you can point me towards writing stdlib classes? ---------------------------------------------------------------------------------------------------- [11:24:59] Elia Schito(@elia):@seanculver best approach I think is to look at other files already in stdlib, as for the external lib I think it would be generally ok, but would be preferable to keep size and feature set of the imported lib as small as possible ---------------------------------------------------------------------------------------------------- ############################## [2014-12-30] ############################## [23:05:37] Ryan Stout(@ryanstout):I'm sure someone has asked this before, but is there a way I can call a JS func from opal and pass a block as a function? ---------------------------------------------------------------------------------------------------- [23:54:18] Luke Barbuto(@lexun):Are you talking about passing a ruby block as an argument to a javascript function that should treat the block like a function? something like this? ``` b = proc { return 'hi' } ` f = function(block) { console.log(block()) }; f(b) ` ``` ---------------------------------------------------------------------------------------------------- [23:57:31] Luke Barbuto(@lexun):because as far as I can see blocks just get compiled to functions ---------------------------------------------------------------------------------------------------- ############################## [2014-12-31] ############################## [00:13:50] Ryan Stout(@ryanstout):@lexun thats what I thought, but it wasn't working for me for some reason. Probably some other issue. ---------------------------------------------------------------------------------------------------- [09:39:15] Elia Schito(@elia):@ryanstout, let me know if you need anything ---------------------------------------------------------------------------------------------------- ############################## [2015-01-01] ############################## [21:59:51] Can Edremitoglu(@cantonic):happy new year to all of you :) Short question: i have defined an element with `@calendar = Element.find("#fullcalendar”)` and now I want to bind fullCalendar on it. in JS i would do `$(‘#fullcalendar’).fullCalendar()`. How can I achieve this with opal? `@calendar.fullCalendar` is not working ---------------------------------------------------------------------------------------------------- [22:07:49] Can Edremitoglu(@cantonic):found it out. I forgot to use Element#expose ---------------------------------------------------------------------------------------------------- [22:22:37] Ryan Stout(@ryanstout):@adambeynon how's it going? have you had any chance to check out the "Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL" issue on opal-rspec with the new phantom version? ---------------------------------------------------------------------------------------------------- [22:23:56] Adam Beynon(@adambeynon):@cantonic yep, Element.expose() is the way to go. from Opal 0.7, element#method_misisng should do the trick though ---------------------------------------------------------------------------------------------------- [22:24:46] Adam Beynon(@adambeynon):@ryanstout I havent yet sorry. I havent studied phantom API much, but it should be pretty simple ---------------------------------------------------------------------------------------------------- [22:25:08] Ryan Stout(@ryanstout):@adambeynon cool, thanks ---------------------------------------------------------------------------------------------------- [22:25:52] Adam Beynon(@adambeynon):@ryanstout got a dealine for some work stuff for Monday, but then next week im back to Opal action, so its on my list of things to fix up ---------------------------------------------------------------------------------------------------- [22:25:55] Adam Beynon(@adambeynon):as well as 0.7 ---------------------------------------------------------------------------------------------------- [22:26:23] Ryan Stout(@ryanstout):@adambeynon cool. Keep up the good work :-) ---------------------------------------------------------------------------------------------------- [22:31:23] Ryan Stout(@ryanstout):@adambeynon is there a quick (monkey patch maybe?) way for me to keep the task from returning a 1 exit code? ---------------------------------------------------------------------------------------------------- ############################## [2015-01-04] ############################## [20:15:33] Can Edremitoglu(@cantonic):Hi there. I am using gon in order to pass ActiveRecord objects/collections from controller actions to opal. I can access it in the chrome developer js console by just calling `gon`, but I cannot manage to load it in opal ---------------------------------------------------------------------------------------------------- ############################## [2015-01-05] ############################## [23:51:02] Adam Beynon(@adambeynon):will pop up a branch tomorrow (few quirks need to be fixed before merging into master) ---------------------------------------------------------------------------------------------------- [23:51:20] Elia Schito(@elia):adambeynon, I count on it ;) ---------------------------------------------------------------------------------------------------- [23:51:37] Adam Beynon(@adambeynon)::smile: ---------------------------------------------------------------------------------------------------- [23:52:18] Elia Schito(@elia):and if you get a chance publish those webview + opal examples, I guess they'd be good for "marketing" ---------------------------------------------------------------------------------------------------- [23:52:19] Andrew Havens(@andrewhavens):haha, is it kind of the opal version of mruby? ;) ---------------------------------------------------------------------------------------------------- [23:53:12] Elia Schito(@elia):andrewhavens, exactly that, but less detached from the full version I guess :) ---------------------------------------------------------------------------------------------------- [23:53:42] Andrew Havens(@andrewhavens):that’s pretty cool ---------------------------------------------------------------------------------------------------- [23:54:39] Andrew Havens(@andrewhavens):I really want to use Opal, but haven’t been able to integrate it in a project yet ---------------------------------------------------------------------------------------------------- [23:55:10] Andrew Havens(@andrewhavens):I’m working on a CoffeeScript/Backbone project right now ---------------------------------------------------------------------------------------------------- [23:56:27] Andrew Havens(@andrewhavens):I’m using a sort of HAML with CoffeeScript template compilation for JST templates right now…I’m curious…do you know of any Opal template libraries? ---------------------------------------------------------------------------------------------------- [23:57:25] Andrew Havens(@andrewhavens):like a gem you can install which makes it so you can write ERB or HAML templates using Opal? ---------------------------------------------------------------------------------------------------- [23:59:50] Adam Beynon(@adambeynon):The opal gem supports compiling erb and we have opal-haml as well. Some docs on website but they need some TLC to cleanup ---------------------------------------------------------------------------------------------------- [00:06:41] Jamie Gaskins(@jgaskins):@cantonic I've been thinking of writing a gon wrapper myself. It's just a global hash, so it should be pretty simple. ---------------------------------------------------------------------------------------------------- [04:03:57] Can Edremitoglu(@cantonic):@jgaskins ```ruby gon = Native(`window`)[:gon] ```did the trick for me ---------------------------------------------------------------------------------------------------- [04:05:35] Jamie Gaskins(@jgaskins):@cantonic The reason I was thinking about making a wrapper for it was so you could do something like `Gon.foo` ---------------------------------------------------------------------------------------------------- [04:05:52] Can Edremitoglu(@cantonic):makes sense ---------------------------------------------------------------------------------------------------- [04:09:35] Can Edremitoglu(@cantonic):@jgaskins feel free to share the repo with me. maybe I can help ---------------------------------------------------------------------------------------------------- [23:38:00] George(@georgeu2000):Do I need to source the opal.js file in the HTML file? I believe it is quite large ~800K. ---------------------------------------------------------------------------------------------------- [23:39:08] Adam Beynon(@adambeynon):@georgeu2000 opal needs to be present to run any compiled code. The best practive is to `require ‘opal’` somewhere inside your .rb file ---------------------------------------------------------------------------------------------------- [23:39:41] George(@georgeu2000):So, does that load ~800KB of javascript into the browser? ---------------------------------------------------------------------------------------------------- [23:40:31] Adam Beynon(@adambeynon):Last time I used opal.js directly it was about 200-300kb un-minified ---------------------------------------------------------------------------------------------------- [23:40:48] Adam Beynon(@adambeynon):800kb sounds like you have the compiler included in that as well ---------------------------------------------------------------------------------------------------- [23:40:53] Adam Beynon(@adambeynon):where is this opal.js file from? ---------------------------------------------------------------------------------------------------- [23:41:37] George(@georgeu2000):I think I compiled it myself...worked on it a few months ago so I forgot... ---------------------------------------------------------------------------------------------------- [23:42:06] Adam Beynon(@adambeynon):Ah ok. ---------------------------------------------------------------------------------------------------- [23:42:10] Adam Beynon(@adambeynon):We do supply pre compiled files ---------------------------------------------------------------------------------------------------- [23:42:11] Adam Beynon(@adambeynon):http://cdn.opalrb.org/ ---------------------------------------------------------------------------------------------------- [23:42:37] Adam Beynon(@adambeynon):but, I still recommend just requiring the runtime into your app/code to make sure its up to date with the compiler version ---------------------------------------------------------------------------------------------------- [23:43:33] George(@georgeu2000):So 200-300kb is the size of the Opal code that is sent to the browser? ---------------------------------------------------------------------------------------------------- [23:45:18] Elia Schito(@elia):georgeu2000, yes, unless you use the minified or minified+gz version which will be under 40k ---------------------------------------------------------------------------------------------------- [23:46:23] George(@georgeu2000):OK, got it. Thanks. I thought 800kb meant I was doing something wrong. ---------------------------------------------------------------------------------------------------- [23:46:38] George(@georgeu2000):@adambeynon - Thanks for the help! ---------------------------------------------------------------------------------------------------- [23:50:38] Adam Beynon(@adambeynon):@elia on a related note, I have made some changes to core lib to make it more “pick and choose” - can make corelib very light weight - I needed it for a site that needs to be as small as possible ---------------------------------------------------------------------------------------------------- [23:50:42] Adam Beynon(@adambeynon):require "opal-mini" ---------------------------------------------------------------------------------------------------- ############################## [2015-01-06] ############################## [00:02:56] Andrew Havens(@andrewhavens):hmm….just found the docs you were referring to… ---------------------------------------------------------------------------------------------------- [00:04:56] Andrew Havens(@andrewhavens):So I guess my question is, if I add the `opal` gem to the Gemfile of my Rails app, can I create a file like `app/assets/templates/myfile.erb` and reference it with `JST[‘myfile’]` ---------------------------------------------------------------------------------------------------- [00:07:18] Andrew Havens(@andrewhavens):…and pass some variables into the template: `JST[‘myfile’]({user: {name: ‘Andrew'}})` ---------------------------------------------------------------------------------------------------- [01:48:52] Can Edremitoglu(@cantonic):@andrewhavens afaik you cannot use JST, but opal has a `Template` class which does what you need. Look here: http://opalrb.org/docs/templates/ ---------------------------------------------------------------------------------------------------- [01:49:10] Can Edremitoglu(@cantonic):@andrewhavens By the way: i am also switching from backbone to opal currently ---------------------------------------------------------------------------------------------------- [11:00:45] Bernhard Weichel(@bwl21): ---------------------------------------------------------------------------------------------------- [11:01:08] Bernhard Weichel(@bwl21):There is a class "JsonErrorx" and I cannot find out where it comes from ... ---------------------------------------------------------------------------------------------------- [18:46:12] Jared White(@jaredcwhite):@andrewhavens Yes, it's very easy to use erb templates using the Template class in Opal. I'm doing exactly that on a project. :sparkles: ---------------------------------------------------------------------------------------------------- [18:47:21] Jared White(@jaredcwhite):Hey folks, excited to announce the first public release of my new gem Shimmer. https://github.com/jaredcwhite/opal-shimmer ---------------------------------------------------------------------------------------------------- [18:47:50] Jared White(@jaredcwhite):it provides an easy, "Hashie"-like way to set and load values, use nested namespaces, and even persist values across browser sessions using localStorage. Soon, I will add an observer feature so you can hook into configuration value changes to update UI in real-time, etc. ---------------------------------------------------------------------------------------------------- [19:05:26] Can Edremitoglu(@cantonic):Hi there. I try to render a haml template with opal, but keep getting `parse error on value "." (tDOT) :form_modal:1`. Does anyone have an idea what the problem could be? ---------------------------------------------------------------------------------------------------- [20:10:09] Adam Beynon(@adambeynon):@cantonic can you gist your haml file? (or maybe just a part of it which fails so I can try here) ---------------------------------------------------------------------------------------------------- [20:37:14] Can Edremitoglu(@cantonic):@adambeynon: I just added `.foobar` to it ---------------------------------------------------------------------------------------------------- [20:38:13] Can Edremitoglu(@cantonic):@adambeynon but i will put together a gist of all files involved ---------------------------------------------------------------------------------------------------- [20:59:31] Can Edremitoglu(@cantonic):@adambeynon https://gist.github.com/cantonic/448eac317b518bed5b8a ---------------------------------------------------------------------------------------------------- [22:37:51] Can Edremitoglu(@cantonic):when I change `.foobar` to `#foobar` it doesn’t complain anymore. using dots for defining element classes in the HAML way seems to not work ---------------------------------------------------------------------------------------------------- [22:42:58] Can Edremitoglu(@cantonic):@adambeynon Using opal-haml from github instead of rubygems solved the problem ---------------------------------------------------------------------------------------------------- [23:27:03] Andrew Havens(@andrewhavens):@cantonic Interesting…what was the diff between versions? ---------------------------------------------------------------------------------------------------- [23:44:20] Can Edremitoglu(@cantonic):@andrewhavens https://github.com/opal/opal-haml/compare/ea15b55999b1e6e1fbf8f0264e2a3dd9bb377b20...master … but I am not sure which change fixed that problem. The main diff I see is the addition of `lib/opal/haml/builder.rb` ---------------------------------------------------------------------------------------------------- [23:44:32] Adam Beynon(@adambeynon):I think the git versions uses the new beta of opal. 0.7 ---------------------------------------------------------------------------------------------------- [23:45:01] Can Edremitoglu(@cantonic):right. it was 0.5.0 before ---------------------------------------------------------------------------------------------------- [23:45:48] Adam Beynon(@adambeynon):Ahh. The git version of opal haml defines a handler for the new builder system. Without it Builder tried to compile it as a normal ruby file ---------------------------------------------------------------------------------------------------- [23:46:40] Andrew Havens(@andrewhavens):ah, interesting ---------------------------------------------------------------------------------------------------- [23:47:43] Can Edremitoglu(@cantonic):you are talking about the changes in `lib/opal/haml.rb`, right? ---------------------------------------------------------------------------------------------------- ############################## [2015-01-13] ############################## [17:46:51] ylluminate(@ylluminate):nice work @jaredcwhite on shimmer! ---------------------------------------------------------------------------------------------------- [23:52:57] Jared White(@jaredcwhite):@ylluminate Thanks!! ---------------------------------------------------------------------------------------------------- ############################## [2015-01-14] ############################## [19:21:30] Ryan Stout(@ryanstout):anyone know how to add more paths to $LOAD_PATH with opal-rspec? ---------------------------------------------------------------------------------------------------- [19:37:42] Ryan Stout(@ryanstout):nevermind, figured it out :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-01-16] ############################## [00:11:05] Ryan Stout(@ryanstout):@adambeynon you around by chance? ---------------------------------------------------------------------------------------------------- [00:37:37] Ryan Stout(@ryanstout):Anyone know more about this: https://github.com/opal/opal-rspec#things-to-fix ---------------------------------------------------------------------------------------------------- [00:37:42] Ryan Stout(@ryanstout):I don't see these files in opal-rspec ---------------------------------------------------------------------------------------------------- [01:01:04] Can Edremitoglu(@cantonic):@ryanstout generated on the fly: https://github.com/opal/opal-rspec/blob/v0.4.0.beta3/Rakefile#L24-L43 ---------------------------------------------------------------------------------------------------- [01:01:30] Ryan Stout(@ryanstout):@cantonic cool, good to know ---------------------------------------------------------------------------------------------------- [01:03:56] Can Edremitoglu(@cantonic):@ryanstout but it is not in master anymore ---------------------------------------------------------------------------------------------------- [01:04:06] Ryan Stout(@ryanstout):ok, humm ---------------------------------------------------------------------------------------------------- [17:32:16] CJ Lazell(@cj):morning. is there an updated example of http://opalrb.org/docs/sinatra/ for 0.7.0 beta3 ? right now I'm getting undefined method `source_maps' for # ---------------------------------------------------------------------------------------------------- [17:35:16] Adam Beynon(@adambeynon):@cj there isn’t unfortunately. This is how we do it in rails though: ---------------------------------------------------------------------------------------------------- [17:35:17] Adam Beynon(@adambeynon):https://github.com/opal/opal-rails/blob/master/lib/opal/rails/engine.rb#L38-L41 ---------------------------------------------------------------------------------------------------- [17:35:43] Adam Beynon(@adambeynon):you basically need to create a source map object yourself: Opal::SourceMapServer.new ---------------------------------------------------------------------------------------------------- [17:38:50] CJ Lazell(@cj):@adambeynon hmmm, ok. is it still ok to do run opal.sprockets? or should I build that up myself too? ---------------------------------------------------------------------------------------------------- [17:40:58] CJ Lazell(@cj):@adambeynon thank you for the quick response btw, it was driving me nuts :) ---------------------------------------------------------------------------------------------------- [20:52:53] CJ Lazell(@cj):@adambeynon so app.assetswould just be opal.sprockets, what would prefix be? ---------------------------------------------------------------------------------------------------- [20:54:35] CJ Lazell(@cj):jsut the path to the file right? ---------------------------------------------------------------------------------------------------- [21:00:34] CJ Lazell(@cj):so this is what I have https://gist.github.com/cj/8e363e15ab9b3db0c775 it's actually giving me the correct line number in the console http://i.imgur.com/jUhZGmk.png but when I click on it the file is empty ---------------------------------------------------------------------------------------------------- [21:03:28] CJ Lazell(@cj):hmm seems like the reason is because the path it is trying to access is /assets/components/login.map/login.rb ---------------------------------------------------------------------------------------------------- ############################## [2015-01-17] ############################## [22:59:13] Jamie Gaskins(@jgaskins):@adambeynon @elia Do you guys know when the next opal-jquery release might be? For Clearwater, I'm relying on the latest commit to avoid treating Cmd clicks on links as navigation. ---------------------------------------------------------------------------------------------------- ############################## [2015-01-18] ############################## [22:35:52] Elia Schito(@elia):@jgaskins you mean the next beta or a release? ---------------------------------------------------------------------------------------------------- [22:36:46] Elia Schito(@elia):I can do the prerelease tomorrow (11pm here, right now), but the release would need to get out opal 0.7 first ---------------------------------------------------------------------------------------------------- ############################## [2015-01-19] ############################## [00:37:32] Jamie Gaskins(@jgaskins):@elia Probably the beta. I was just wondering how long it'd be before I could remove the `github: 'opal/opal-jquery'` part from my Gemfile. :-) ---------------------------------------------------------------------------------------------------- [09:53:35] Elia Schito(@elia):@jgaskins, https://twitter.com/rubygems/status/557113514524180480 ---------------------------------------------------------------------------------------------------- [09:53:37] Elia Schito(@elia):;) ---------------------------------------------------------------------------------------------------- [13:43:28] Jamie Gaskins(@jgaskins):@elia You are a gentleman and a scholar, sir. ---------------------------------------------------------------------------------------------------- [13:44:11] Elia Schito(@elia):@jgaskins, and you're too kind ;) ---------------------------------------------------------------------------------------------------- ############################## [2015-01-27] ############################## [03:52:04] CJ Lazell(@cj):evening. is https://github.com/opal/opal-browser being deprecated? ---------------------------------------------------------------------------------------------------- [04:59:35] ylluminate(@ylluminate):@cj I cannot see why it would be. It's exceptionally useful (we use it a good bit). I realize that @meh is busy about other things at the moment, but if you're having some specific problems, please be sure to open an issue or ask around as I'm sure someone will be more than happy to chime in as they have time. ---------------------------------------------------------------------------------------------------- [14:22:33] Slee Woo(@sleewoo):hey, when feeding a proc to javascript it is called like function_name(), right? ---------------------------------------------------------------------------------------------------- [14:23:04] Slee Woo(@sleewoo):how to make it to be called like function_name.apply(this) ---------------------------------------------------------------------------------------------------- [14:23:40] Slee Woo(@sleewoo):so instance_exec(&block) rather than block.call ---------------------------------------------------------------------------------------------------- [14:24:43] Slee Woo(@sleewoo):have a scenario where i get a block at class level and need it to be run inside instance rather than class :) ---------------------------------------------------------------------------------------------------- [14:24:47] Slee Woo(@sleewoo):any clue? ---------------------------------------------------------------------------------------------------- [14:25:36] Adam Beynon(@adambeynon):hi @sleewoo - the ugly way to do it would be the same as instance_exec ---------------------------------------------------------------------------------------------------- [14:25:38] Adam Beynon(@adambeynon):https://github.com/opal/opal/blob/master/opal/corelib/basic_object.rb#L47-L49 ---------------------------------------------------------------------------------------------------- [14:31:07] Slee Woo(@sleewoo):@adambeynon, thanks, trying ---------------------------------------------------------------------------------------------------- [15:38:17] Slee Woo(@sleewoo):@adambeynon, any tricks on overriding `new Something`? ) ---------------------------------------------------------------------------------------------------- [15:39:02] Slee Woo(@sleewoo):meant how to make `new` run my code :) ---------------------------------------------------------------------------------------------------- [15:40:15] Slee Woo(@sleewoo):`Something` is a Ruby class ---------------------------------------------------------------------------------------------------- [15:42:22] Slee Woo(@sleewoo):ok, stupid question, ignore ---------------------------------------------------------------------------------------------------- [15:47:53] Adam Beynon(@adambeynon)::smile: ---------------------------------------------------------------------------------------------------- [15:47:58] Adam Beynon(@adambeynon):building anything fun with opal? ---------------------------------------------------------------------------------------------------- [15:50:08] Slee Woo(@sleewoo):yep, trying to map Ractive.js... ---------------------------------------------------------------------------------------------------- [23:23:56] Elia Schito(@elia):adambeynon, you around? ---------------------------------------------------------------------------------------------------- ############################## [2015-01-28] ############################## [15:58:25] Slee Woo(@sleewoo):oh, it’s because requiring opar twice, once in Rakefile and then in file to be built ---------------------------------------------------------------------------------------------------- [15:58:38] Slee Woo(@sleewoo):opal* ---------------------------------------------------------------------------------------------------- [16:00:58] Adam Beynon(@adambeynon):ahh right. on master branch we have added a thing to stop double inclusion. good to know its resolved though ---------------------------------------------------------------------------------------------------- [16:15:49] Slee Woo(@sleewoo):@adambeynon, ok Environement deprecated and Server is not a subclass of Sprockets::Environement, how to build files? were using `environment_instance#[filename]` ---------------------------------------------------------------------------------------------------- [16:21:36] Slee Woo(@sleewoo):nevermind, it’s obvious that it’s #sprockets[file] :) ---------------------------------------------------------------------------------------------------- [19:14:06] Slee Woo(@sleewoo):hey, looks like 0.7 brings lot of improvements! it were not seeing crossfile constants at load time, only at runtime and it were not seeing class methods right after definition, only at runtime too also were issues with enumerators, like `some_hash.each {|(k,v)| }` now everything works seamlessly! you guys rock! congrats on such a tremendous work ---------------------------------------------------------------------------------------------------- [19:19:32] Slee Woo(@sleewoo):meh went underground? :) ---------------------------------------------------------------------------------------------------- [20:17:01] Adam Beynon(@adambeynon):@sleewoo he pops up now and again ;) busy atm I think ---------------------------------------------------------------------------------------------------- [20:17:05] Adam Beynon(@adambeynon):glad youre enjoying Opal ---------------------------------------------------------------------------------------------------- [20:17:12] Adam Beynon(@adambeynon):trying to get 0,7 released asap ---------------------------------------------------------------------------------------------------- [20:23:46] Slee Woo(@sleewoo):@adambeynon, great ---------------------------------------------------------------------------------------------------- [20:24:47] Slee Woo(@sleewoo):will see if i can freeup some time for opal-browser ---------------------------------------------------------------------------------------------------- [20:25:10] Slee Woo(@sleewoo):basically it needs tests and docs to be released? ---------------------------------------------------------------------------------------------------- [20:28:02] Adam Beynon(@adambeynon):@sleewoo not sure really. opal-browser is all meh’s work. but those will surely help :+1: ---------------------------------------------------------------------------------------------------- [20:35:12] Slee Woo(@sleewoo):@adambeynon what’s rubyfire? :) ---------------------------------------------------------------------------------------------------- [05:36:20] ylluminate(@ylluminate):@sleewoo nice selection with ractive. let us know if you have any questions! ---------------------------------------------------------------------------------------------------- [15:46:35] Slee Woo(@sleewoo):hey, just built beta3 and getting `undefined method `merge' for # app.js' ---------------------------------------------------------------------------------------------------- ############################## [2015-01-31] ############################## [09:51:18] Loïc Boutet(@loicboutet):OK ---------------------------------------------------------------------------------------------------- [09:52:16] Loïc Boutet(@loicboutet):I'll try my hand with it :) ---------------------------------------------------------------------------------------------------- [09:52:30] Loïc Boutet(@loicboutet):Is there any reason you prefer to fswatch to guard? (I have never heard of it before) ---------------------------------------------------------------------------------------------------- [14:08:36] Elia Schito(@elia):@loicboutet no, even if I don't like guard very ---------------------------------------------------------------------------------------------------- [14:13:37] Elia Schito(@elia):@elia started to type the messaga above on an iphone, gitter decided it was time to submit it ---------------------------------------------------------------------------------------------------- [14:15:07] Elia Schito(@elia):@loicboutet fswatch was a simple way to demonstrate a one liner ---------------------------------------------------------------------------------------------------- [14:15:44] Elia Schito(@elia):Also I'm not a fan of Guard (in fact I built github.com/elia/spectator) :) ---------------------------------------------------------------------------------------------------- [14:16:57] Elia Schito(@elia):anyway there's a Guardfile in opal if you want some inspiration: https://github.com/opal/opal/blob/master/Guardfile ---------------------------------------------------------------------------------------------------- [14:36:44] Adam Beynon(@adambeynon):@elia: found a ridiculous bug in the keyword arg stuff - all variable names were leaking to the global scope. It took me all day to work out why using “location” as a keyword arg name was breaking all routing in my app :( ---------------------------------------------------------------------------------------------------- [14:37:15] Elia Schito(@elia):ahhaha, just saw that, great catch! ---------------------------------------------------------------------------------------------------- [14:38:59] Elia Schito(@elia):adambeynon, just tried to run rspec suite with warnings turned on, like to catch unused vars, …LOL ---------------------------------------------------------------------------------------------------- [14:39:34] Elia Schito(@elia):brb, coffee time :) ---------------------------------------------------------------------------------------------------- [14:43:48] Elia Schito(@elia):adambeynon, are we going to release today or you think it's better to give it some more time? ---------------------------------------------------------------------------------------------------- [14:46:54] Elia Schito(@elia):@adambeynon ^^^ ---------------------------------------------------------------------------------------------------- [17:09:24] Adam Beynon(@adambeynon):@elia Im happy to release now. thats the only bug I found when testing me apps ---------------------------------------------------------------------------------------------------- [17:09:26] Adam Beynon(@adambeynon):my* ---------------------------------------------------------------------------------------------------- [18:17:25] Elia Schito(@elia):@adambeynon let's do it then :) ---------------------------------------------------------------------------------------------------- [18:27:15] Elia Schito(@elia):@adambeynon you think you can write a couple lines for a post in the next couple days? listing the stuff from the issue on the 0.7 milestone would be enough imo ---------------------------------------------------------------------------------------------------- ############################## [2015-02-01] ############################## [23:33:24] Elia Schito(@elia):@adambeynon you around? ---------------------------------------------------------------------------------------------------- ############################## [2015-02-02] ############################## [00:38:20] CJ Lazell(@cj):evening. is there a way to get the base sourceMappingURL? right now if I call /assets/components/menu.js the sourceMappingURL is just set to sourceMappingURL=menu.map instead of sourceMappingURL=/assets/components/menu.map ---------------------------------------------------------------------------------------------------- [20:29:34] Can Edremitoglu(@cantonic):I also have cannot get source maps working with opal-rails. The files show up in chrome developer tools, but return a 500 error when trying to view them: `GET http://localhost:3000/assets/events_edit.rb 500 (Internal Server Error)` ---------------------------------------------------------------------------------------------------- [20:31:52] Can Edremitoglu(@cantonic):i am using the latest version from the master branch with rails 4.1.9 and sprockets-rails 2.2.4 ---------------------------------------------------------------------------------------------------- [22:53:09] Elia Schito(@elia):@cantonic I'd like to add a failing spec for that to opal-rails, feel free to prepare a PR or send me more details on how to reproduce ---------------------------------------------------------------------------------------------------- ############################## [2015-02-03] ############################## [00:26:29] Elia Schito(@elia):/all http://opalrb.org/blog/2015/02/02/opal-0-7-0/ ---------------------------------------------------------------------------------------------------- [16:11:00] CJ Lazell(@cj):Morning, Opal.const_get doesn't seem to work with namespacing http://opalrb.org/try/?code:module%20Test%0A%20%20class%20User%0A%20%20%20%20attr_accessor%20%3Aname%0A%20%20%0A%20%20%20%20def%20initialize(name)%0A%20%20%20%20%20%20%40name%20%3D%20name%0A%20%20%20%20end%0A%20%20%0A%20%20%20%20def%20admin%3F%0A%20%20%20%20%20%20%40name%20%3D%3D%20%27Admin%27%0A%20%20%20%20end%0A%20%20end%0Aend%0A%0Auser%20%3D%20Object.const_get(%27Test%3A%3AUser%27).new(%27Bob%27)%0Aputs%20user%0Aputs%20user.admin%3F ---------------------------------------------------------------------------------------------------- [16:19:19] Slee Woo(@sleewoo):@cj, nor Ruby 1.9 does :) ---------------------------------------------------------------------------------------------------- [16:19:55] Slee Woo(@sleewoo):you can try this for now ---------------------------------------------------------------------------------------------------- [16:19:59] Slee Woo(@sleewoo):`'Test::User'.split('::').inject(Object) {|o,c| o.const_get(c)}` ---------------------------------------------------------------------------------------------------- [16:20:34] Slee Woo(@sleewoo):though i guess it is a must fix ---------------------------------------------------------------------------------------------------- [16:22:40] CJ Lazell(@cj):@sleewoo thank you for the response. yee that's what I ended up doing for now. should I open up a ticket about it? ---------------------------------------------------------------------------------------------------- [16:23:57] Slee Woo(@sleewoo):well, i’m not a collaborator, but i guess it is a good catch to report ---------------------------------------------------------------------------------------------------- ############################## [2015-02-04] ############################## [08:56:43] Elia Schito(@elia):@krainboltgreene, still around? ---------------------------------------------------------------------------------------------------- [20:05:44] ylluminate(@ylluminate):https://twitter.com/ylluminate/status/562731982283870209 ---------------------------------------------------------------------------------------------------- ############################## [2015-02-05] ############################## [16:39:23] Slee Woo(@sleewoo):@cj, to be honest i have only vague clues why this is needed :) took that from here ---------------------------------------------------------------------------------------------------- [16:39:24] Slee Woo(@sleewoo):https://github.com/opal/opal/blob/dc8f5fa5545ccb46b48753e1ea6e471591346dc6/opal/corelib/basic_object.rb#L58 ---------------------------------------------------------------------------------------------------- [16:48:58] CJ Lazell(@cj):@sleewoo got it working! :D ---------------------------------------------------------------------------------------------------- [16:49:05] CJ Lazell(@cj):that code link helped :P ---------------------------------------------------------------------------------------------------- [16:49:19] Slee Woo(@sleewoo):perfect ---------------------------------------------------------------------------------------------------- [16:50:26] Slee Woo(@sleewoo):let us see your homework? :) ---------------------------------------------------------------------------------------------------- [16:50:28] CJ Lazell(@cj):@sleewoo @adambeynon @elia https://gist.github.com/cj/02aadefe59370780eb46 is the code that works :) ---------------------------------------------------------------------------------------------------- [16:51:17] Slee Woo(@sleewoo):oh, sure, i were executing it in a anonymous function and returning nothing ---------------------------------------------------------------------------------------------------- [16:52:08] Slee Woo(@sleewoo):great catch ---------------------------------------------------------------------------------------------------- [16:53:11] CJ Lazell(@cj):cheers, thanks for helping :) ---------------------------------------------------------------------------------------------------- [16:53:23] Slee Woo(@sleewoo):yw, thanks for fixing :) ---------------------------------------------------------------------------------------------------- [16:53:46] CJ Lazell(@cj):another note too, you do need to do escape.call and not just escape :) ---------------------------------------------------------------------------------------------------- [16:54:09] Slee Woo(@sleewoo):yep, i mentioned that :) ---------------------------------------------------------------------------------------------------- [16:54:33] CJ Lazell(@cj):yee :) ---------------------------------------------------------------------------------------------------- [18:15:29] CJ Lazell(@cj):@sleewoo so I ended up with this https://gist.github.com/02aadefe59370780eb46 it keeps you in the same context as your class, but allows you to call @this inside function to get the current javascript this :D ---------------------------------------------------------------------------------------------------- [18:22:33] Slee Woo(@sleewoo):@cj, nice! ---------------------------------------------------------------------------------------------------- [18:23:51] Slee Woo(@sleewoo):@cj, what if try `self.this = Native(`this`)` ---------------------------------------------------------------------------------------------------- [18:24:13] Slee Woo(@sleewoo):theoretically you should be able to to use `this` instead of `@this` ---------------------------------------------------------------------------------------------------- [18:24:16] Slee Woo(@sleewoo):ops ---------------------------------------------------------------------------------------------------- [18:24:32] Slee Woo(@sleewoo):`self[‘$this’] = Native(`this`)` ---------------------------------------------------------------------------------------------------- [18:26:39] CJ Lazell(@cj):that just gives you undefined method `[]=' ---------------------------------------------------------------------------------------------------- [18:26:57] Slee Woo(@sleewoo):mm ---------------------------------------------------------------------------------------------------- [18:41:05] Slee Woo(@sleewoo):yeah, that was supposed to be called inside `%x{` ---------------------------------------------------------------------------------------------------- [18:41:56] Slee Woo(@sleewoo):but a bad idea anyway cause it would set a class variable which later may have unpredictable consequences ---------------------------------------------------------------------------------------------------- [18:43:45] CJ Lazell(@cj):yee, I would think @this is a more 'ruby' way to call it anyway, given what `this` is :) ---------------------------------------------------------------------------------------------------- [18:45:52] Slee Woo(@sleewoo):yep, but this way you actually set a class variable… ---------------------------------------------------------------------------------------------------- [18:46:19] Slee Woo(@sleewoo):which will stay there to kill your day someday :) ---------------------------------------------------------------------------------------------------- [04:59:43] CJ Lazell(@cj):evening, what would be the best way to do something like https://gist.github.com/03229378e5f05b0b7a1a ? ---------------------------------------------------------------------------------------------------- [05:04:24] Jared White(@jaredcwhite):Congrats on the official 0.7.0 release! I'll try it out soon. Good job all around :) ---------------------------------------------------------------------------------------------------- [09:20:25] Slee Woo(@sleewoo):@cj, you can try this ---------------------------------------------------------------------------------------------------- [09:20:26] Slee Woo(@sleewoo):https://gist.github.com/sleewoo/8d785061fc0cfbe5675d ---------------------------------------------------------------------------------------------------- [09:21:30] Slee Woo(@sleewoo):`function` is a sort of `instance_exec` for calls from javascript ---------------------------------------------------------------------------------------------------- [09:23:28] Slee Woo(@sleewoo):`to_n` is to convert the hash into a js object ---------------------------------------------------------------------------------------------------- [14:57:15] Jared White(@jaredcwhite):Hey, that little function helper looks really cool! Maybe that should be in a PR for the opal native module? ---------------------------------------------------------------------------------------------------- [15:03:22] CJ Lazell(@cj):@sleewoo looks awesome, thank you. I'll try it out today :) ---------------------------------------------------------------------------------------------------- [15:08:37] Slee Woo(@sleewoo):yeah, saying Opal is pretty awesome it is to say nothing. it is monumental :) ---------------------------------------------------------------------------------------------------- [15:41:45] Slee Woo(@sleewoo):@jaredcwhite, did not think about ---------------------------------------------------------------------------------------------------- [15:42:00] Slee Woo(@sleewoo):let’s ask gurus :) ---------------------------------------------------------------------------------------------------- [15:43:00] Slee Woo(@sleewoo):@adambeynon, @elia does it makes sense to have something like this in Native? ---------------------------------------------------------------------------------------------------- [15:43:04] Slee Woo(@sleewoo):def function *args, &block args.any? && raise(ArgumentError, '`function` does not accept arguments') block || raise(ArgumentError, 'block required') proc do |*a| a.map! {|x| Native(`x`)} instance = Native(`this`) %x{ (function() { var bs = block.$$s; block.$$s = null; block.apply(instance, a); block.$$s = bs; })(); } end end ---------------------------------------------------------------------------------------------------- [15:43:32] Slee Woo(@sleewoo):oh, sorry for flood :) i were sure gitter will format the code ---------------------------------------------------------------------------------------------------- [15:43:51] Slee Woo(@sleewoo):https://gist.github.com/sleewoo/8d785061fc0cfbe5675d ---------------------------------------------------------------------------------------------------- [15:57:27] CJ Lazell(@cj):@sleewoo so I have, https://gist.github.com/03229378e5f05b0b7a1a still not working yet, I'm getting `Uncaught TypeError: no implicit conversion of NilClass into String` I'm debugging it right now to see what it could be ---------------------------------------------------------------------------------------------------- [15:58:49] Slee Woo(@sleewoo):not sure `escape(item.name)` may work ---------------------------------------------------------------------------------------------------- [15:58:55] Slee Woo(@sleewoo):try `escape.call(item.name)` ---------------------------------------------------------------------------------------------------- [16:02:45] CJ Lazell(@cj):@sleewoo that led to a different error to do with the plugin itself http://i.imgur.com/zQRBpiL.png, which I'm guessing it means it's not returning correctly ---------------------------------------------------------------------------------------------------- [16:05:13] Slee Woo(@sleewoo):@cj, try put ``debugger;`` inside one of that `function` and see what `item` and `escape` are ---------------------------------------------------------------------------------------------------- [16:06:38] Slee Woo(@sleewoo):https://gist.github.com/sleewoo/58f98ac9e1804dafab7a ---------------------------------------------------------------------------------------------------- [16:07:30] Slee Woo(@sleewoo):it will stop the universe just in the place you inserted debugger and you’ll can access `item` by `self.$item` in console ---------------------------------------------------------------------------------------------------- [16:09:34] CJ Lazell(@cj):@sleewoo it doesn't even seem to be getting in there ---------------------------------------------------------------------------------------------------- [16:10:36] Slee Woo(@sleewoo):then it’s not the function :) ---------------------------------------------------------------------------------------------------- [16:11:17] CJ Lazell(@cj):if I put the raw code in in `%x{}` it works just fine though ---------------------------------------------------------------------------------------------------- [16:12:37] Slee Woo(@sleewoo):oh, try without `to_n`, that’s for cases when you insert the hash directly into js ---------------------------------------------------------------------------------------------------- [16:15:46] CJ Lazell(@cj):@sleewoo ok, so no error now. it's turning the select into a selectizie but the functions are just not executed ---------------------------------------------------------------------------------------------------- [16:18:15] Slee Woo(@sleewoo):weird :) ---------------------------------------------------------------------------------------------------- [16:20:00] CJ Lazell(@cj):@sleewoo http://i.imgur.com/C2uLRls.png is never triggered but the other puts are ---------------------------------------------------------------------------------------------------- [16:22:26] Slee Woo(@sleewoo):@cj, try replace `function { |item…` with `proc { |item…` and see either it is executed ---------------------------------------------------------------------------------------------------- [16:22:43] Slee Woo(@sleewoo):if not it’s just not called by the plugin ---------------------------------------------------------------------------------------------------- [16:25:42] CJ Lazell(@cj):yee, it's never triggered ---------------------------------------------------------------------------------------------------- [16:27:02] CJ Lazell(@cj):@sleewoo it's only called if I add .to_n, but then I'm back to getting the other errors ---------------------------------------------------------------------------------------------------- [16:28:11] CJ Lazell(@cj):so adding to_n gets inside the proc, but it never executes the code inside the `function` ---------------------------------------------------------------------------------------------------- [16:36:47] CJ Lazell(@cj):@sleewoo so removing `block.$$s = null;` from your method now gets inside `function` and I can console.log item values and they are correct but it says escape doesn't exist ---------------------------------------------------------------------------------------------------- ############################## [2015-02-06] ############################## [22:25:06] Damian Esteban(@damianesteban):has there been any update on the status of Fire recently? ---------------------------------------------------------------------------------------------------- [22:27:09] Damian Esteban(@damianesteban):also, can anyone recommend any decent materials for learning Opal? ---------------------------------------------------------------------------------------------------- ############################## [2015-02-07] ############################## [01:19:47] Elia Schito(@elia):@cj @sleewoo great stuff btw (even if I didn't had time to read in detail) ---------------------------------------------------------------------------------------------------- [01:21:37] Elia Schito(@elia):@estebanrules the site primarily (http://opalrb.org), you can also have a look at various posts from my previous company blog: https://duckduckgo.com/?q=opal+site:dev.mikamai.com&t=osx ---------------------------------------------------------------------------------------------------- [01:22:45] Elia Schito(@elia):@estebanrules of course there's very much to improve, let's call it a low hanging fruit for pull-requests ---------------------------------------------------------------------------------------------------- [05:52:17] Damian Esteban(@damianesteban):Thank you ---------------------------------------------------------------------------------------------------- ############################## [2015-02-09] ############################## [01:16:49] Karim Tarek(@karimmtarek):any news when Fire is coming out? ---------------------------------------------------------------------------------------------------- [17:22:41] Slee Woo(@sleewoo):hey ---------------------------------------------------------------------------------------------------- [17:23:05] Slee Woo(@sleewoo):would be hard to update to Tilt 2? ---------------------------------------------------------------------------------------------------- [17:23:49] Slee Woo(@sleewoo):i’d put a hand on this if one gives me general directions so i do not break it ---------------------------------------------------------------------------------------------------- [17:25:31] Slee Woo(@sleewoo):@adambeynon @elia @meh? ---------------------------------------------------------------------------------------------------- [17:44:37] Slee Woo(@sleewoo):when using opal-browser ---------------------------------------------------------------------------------------------------- [17:44:50] Slee Woo(@sleewoo):opal-browser/lib/ is not added to load path ---------------------------------------------------------------------------------------------------- [17:44:58] Slee Woo(@sleewoo):only opal-browser/opal/ is ---------------------------------------------------------------------------------------------------- [17:45:25] Slee Woo(@sleewoo):so `require 'opal-browser’` does not work ---------------------------------------------------------------------------------------------------- [17:45:43] Slee Woo(@sleewoo):only `require ‘browser’` does ---------------------------------------------------------------------------------------------------- [17:45:56] Slee Woo(@sleewoo):which may lead to confusions ---------------------------------------------------------------------------------------------------- [18:26:20] Slee Woo(@sleewoo):oh, i see, sprockets depends on Tilt v1, weird ---------------------------------------------------------------------------------------------------- [18:26:57] Slee Woo(@sleewoo):i have libs depending on tilt v2, have to downgrade them to use with opal ---------------------------------------------------------------------------------------------------- [22:06:33] Elia Schito(@elia):@sleewoo next sprockets won't depend on tilt anymore, so we're keeping it as long as sprockets does ---------------------------------------------------------------------------------------------------- [22:21:10] Elia Schito(@elia):@sleewoo I opened a PR for @meh on opal-browser to add the file https://github.com/opal/opal-browser/pull/28 ---------------------------------------------------------------------------------------------------- [22:21:48] Elia Schito(@elia):@karimmtarek only @adambeynon knows ---------------------------------------------------------------------------------------------------- ############################## [2015-02-10] ############################## [04:50:26] Slee Woo(@sleewoo):@elia thanks ---------------------------------------------------------------------------------------------------- [19:16:57] Slee Woo(@sleewoo):@elia around? ---------------------------------------------------------------------------------------------------- [19:17:18] Slee Woo(@sleewoo):any way to pass some data into wrapper function? ---------------------------------------------------------------------------------------------------- [19:18:08] Slee Woo(@sleewoo):``` (function(Opal) { ... })(Opal, some, vars, here?); ``` ---------------------------------------------------------------------------------------------------- [19:19:47] Slee Woo(@sleewoo):or ---------------------------------------------------------------------------------------------------- [19:21:13] Slee Woo(@sleewoo):even better ``` (function(Opal, more) { // some.obj })(Opal, {some: ‘obj'}); ``` ---------------------------------------------------------------------------------------------------- [19:21:32] Slee Woo(@sleewoo):ops ---------------------------------------------------------------------------------------------------- [19:22:16] Slee Woo(@sleewoo):``` (function(Opal, more) { // more.data.here })(Opal, {data: “hete”} ); ``` ---------------------------------------------------------------------------------------------------- [19:23:26] Slee Woo(@sleewoo):doh, seems sort of tired :) ---------------------------------------------------------------------------------------------------- [19:23:56] Slee Woo(@sleewoo):anyway, you got the point, passing some data as second arg ---------------------------------------------------------------------------------------------------- [19:42:08] Slee Woo(@sleewoo):mm, however, this could offer more flexibility at no price ---------------------------------------------------------------------------------------------------- [19:42:18] Slee Woo(@sleewoo):``` (function(Opal) { ... }).apply(this, [Opal]); ``` ---------------------------------------------------------------------------------------------------- [19:43:27] Slee Woo(@sleewoo):so users can wrap opal’s code and have access to their data ---------------------------------------------------------------------------------------------------- [20:03:03] Slee Woo(@sleewoo):nah, it can not be easily accessed from ruby anyway... ---------------------------------------------------------------------------------------------------- [20:04:03] Slee Woo(@sleewoo):thinking about a clean way to pass data into wrapper and have direct clean access to it... ---------------------------------------------------------------------------------------------------- ############################## [2015-02-11] ############################## [09:59:19] Adam Beynon(@adambeynon):sleewoo - hard coded data, or dynamic data? ---------------------------------------------------------------------------------------------------- [17:03:28] Slee Woo(@sleewoo):@adambeynon initially were thinking about hard coded ---------------------------------------------------------------------------------------------------- [17:04:23] Slee Woo(@sleewoo):but ended up using events to pass dynamic data ---------------------------------------------------------------------------------------------------- [17:05:12] Slee Woo(@sleewoo):lol, a piece of humor here :) ---------------------------------------------------------------------------------------------------- [17:05:12] Slee Woo(@sleewoo):> ... results of their bug creation process, aka programming ---------------------------------------------------------------------------------------------------- [17:05:38] Slee Woo(@sleewoo):that’s from Toptal newsfeed ---------------------------------------------------------------------------------------------------- ############################## [2015-02-12] ############################## [01:11:58] Karim Tarek(@karimmtarek):hey @adambeynon any news about FIre? ---------------------------------------------------------------------------------------------------- [18:34:24] Jared White(@jaredcwhite):I'm pretty sure @adambeynon is about ready to do a faceplant everytime someone asks him that question. :grin: :shipit: ---------------------------------------------------------------------------------------------------- [18:35:03] Slee Woo(@sleewoo)::) ---------------------------------------------------------------------------------------------------- [18:36:09] Slee Woo(@sleewoo):looks like he knows very well how to render a tactical silence :shipit: ---------------------------------------------------------------------------------------------------- [18:55:04] AstonJ(@AstonJ):I’m not Adam, but :fire: is coming along nicely :smile: I am sure we are all going to be in for a real treat :sparkles: ---------------------------------------------------------------------------------------------------- [20:26:25] CJ Lazell(@cj):has anyone played around with compressing, minimizing and caching the opal response? if so what solution did you find worked out best? ---------------------------------------------------------------------------------------------------- [22:05:01] Slee Woo(@sleewoo):mm, enumerators are wrapped in functions, so `return` will return from wrapper... ---------------------------------------------------------------------------------------------------- [23:56:33] Ryan Stout(@ryanstout):just wanted to say again how great of a job you guys have done with opal. I expected .arity not to work and it does :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-02-13] ############################## [18:50:38] Jikku Jose(@JikkuJose):Hey, a quick question! How do I split my source file into number of files? require 'filename' doesn't seem to work? ---------------------------------------------------------------------------------------------------- [18:54:01] Jikku Jose(@JikkuJose):I wish to split this file: https://github.com/JikkuJose/Conway-Game-of-Life/blob/master/app/conway.rb into some pieces for manageability. ---------------------------------------------------------------------------------------------------- [18:56:02] Jikku Jose(@JikkuJose):Since my Rakefile had some problems I modified it like so: https://github.com/JikkuJose/Conway-Game-of-Life/blob/master/Rakefile ---------------------------------------------------------------------------------------------------- [18:56:28] Jikku Jose(@JikkuJose):Seems thats the reason for this weird behavior. ---------------------------------------------------------------------------------------------------- [20:38:44] Bernhard Weichel(@bwl21):@JikkuJose This is how I build my app; application.rb contains a bunch of requires ``` desc "Build our app to #{ZUPFNOTER_JS}" task :build do env = Opal::Environment.new env.append_path "." env.use_gem "vector2d" File.open(ZUPFNOTER_JS, "w+") do |out| out << env["application"].to_s end end ``` ---------------------------------------------------------------------------------------------------- ############################## [2015-02-14] ############################## [00:42:55] Elia Schito(@elia):JikkuJose, have a look at the examples folder in https://github.com/opal/opal ---------------------------------------------------------------------------------------------------- [03:13:23] Jikku Jose(@JikkuJose):``` . ├── Gemfile ├── Gemfile.lock ├── Guardfile ├── README.markdown ├── Rakefile ├── app │   ├── conway.rb │   └── helpers.rb ├── conway.js ├── index.html ├── opal.js ├── style.css └── twistd.pid 1 directory, 12 files ``` ---------------------------------------------------------------------------------------------------- [03:14:27] Jikku Jose(@JikkuJose):This is my directory structure and following is the contents of the Rakefile: ``` ruby require 'opal' require 'opal-jquery' desc "Compile Ruby to JS" task :build do env = Opal::Environment.new env.append_path "app" File.open("conway.js", "w+") do |out| out << env["conway"].to_s end end ``` ---------------------------------------------------------------------------------------------------- [03:28:21] Jikku Jose(@JikkuJose):One more question: Does the above Rakefile compile `opal.js` also to the generated file or just the contents of the Ruby file that I wrote? I was trying to make it work by having the `opal.js` ---------------------------------------------------------------------------------------------------- [03:35:18] Jikku Jose(@JikkuJose):And this is one of the lines I see in generated JS: ` Opal.dynamic_require_severity = "error";` ---------------------------------------------------------------------------------------------------- [03:47:00] Jikku Jose(@JikkuJose):When I run `rake build`, I am getting this following error: ``` rake aborted! NameError: uninitialized constant Opal::Environment ``` ---------------------------------------------------------------------------------------------------- [04:02:07] Jikku Jose(@JikkuJose):Just required `opal` in `pry` and tried to access `Opal::Environment`, it too says `NameError: uninitialized constant Opal::Environment` ---------------------------------------------------------------------------------------------------- ############################## [2015-02-15] ############################## [21:18:13] Bernhard Weichel(@bwl21):did you install opal? did you `require "opal"`in pry? ---------------------------------------------------------------------------------------------------- ############################## [2015-02-16] ############################## [20:37:38] Luke Barbuto(@lexun):I noticed there is a `require 'opal-parser'` here: https://github.com/opal/opalrb.org/blob/master/source/javascripts/try_opal.rb#L2 ---------------------------------------------------------------------------------------------------- [20:38:32] Luke Barbuto(@lexun):When I try to require that I just get a `LoadError` ---------------------------------------------------------------------------------------------------- [21:59:27] Luke Barbuto(@lexun):Whew, just discovered http://cdn.opalrb.org/opal/current/opal-parser.min.js ---------------------------------------------------------------------------------------------------- [21:59:36] Luke Barbuto(@lexun):I guess that's probably what I'm looking for ---------------------------------------------------------------------------------------------------- [22:00:54] Ryan Stout(@ryanstout):@lexun you used to be able to do: require 'parser' or something to include that from ruby ---------------------------------------------------------------------------------------------------- [22:00:59] Ryan Stout(@ryanstout):not sure if that still works ---------------------------------------------------------------------------------------------------- [22:06:12] Luke Barbuto(@lexun):Hey @ryanstout, thanks for the suggestion. Unfortunately I tried `require 'parser'` and `require 'opal-parser'` as seen here https://github.com/opal/opalrb.org/blob/master/source/javascripts/try_opal.rb#L2 ---------------------------------------------------------------------------------------------------- [22:06:22] Luke Barbuto(@lexun):Either way I just get a load error when I start the volt server ---------------------------------------------------------------------------------------------------- [22:06:24] Ryan Stout(@ryanstout):opal/parser ---------------------------------------------------------------------------------------------------- [22:06:25] Ryan Stout(@ryanstout):? ---------------------------------------------------------------------------------------------------- [22:06:37] Ryan Stout(@ryanstout):yea, maybe its an issue with volt ---------------------------------------------------------------------------------------------------- [22:06:54] Elia Schito(@elia):https://github.com/opal/opal/blob/master/stdlib/opal-parser.rb ---------------------------------------------------------------------------------------------------- [22:07:34] Luke Barbuto(@lexun):@ryanstout That didn't blow it up... but still no Opal.compile ---------------------------------------------------------------------------------------------------- [22:07:45] Ryan Stout(@ryanstout):humm ---------------------------------------------------------------------------------------------------- [22:07:53] Ryan Stout(@ryanstout):the opal guys will know more ---------------------------------------------------------------------------------------------------- [22:07:56] Ryan Stout(@ryanstout):they probably changed some things ---------------------------------------------------------------------------------------------------- [22:10:06] Luke Barbuto(@lexun):Hey @elia - Do you know off hand why https://github.com/opal/opalrb.org is getting the parser and others aren't? Even on your website I can just pop open the javascript console and use it, every Volt or Rails app using Opal I've tried just gets undefined, and nothing happens when you require the parser - or it blows up. ---------------------------------------------------------------------------------------------------- [22:14:16] Luke Barbuto(@lexun):I thought maybe it was a version thing, but I can `require 'opal-parser'` from irb just fine, it just doesn't seem to work in the browser for some reason ---------------------------------------------------------------------------------------------------- [22:14:29] Luke Barbuto(@lexun):Except for on opalrb.org lol ---------------------------------------------------------------------------------------------------- [22:15:47] Elia Schito(@elia):well, the parser is the heavist piece and it's not part of the corelib by default ---------------------------------------------------------------------------------------------------- [22:16:41] Luke Barbuto(@lexun):ahhh, this sounds like the info I've been searching for ---------------------------------------------------------------------------------------------------- [22:16:46] Elia Schito(@elia):opalrb.org should work with a simple sprockets environment, don't see why it shouldn't work in rails or volt ---------------------------------------------------------------------------------------------------- [22:17:44] Luke Barbuto(@lexun):I'm just working on something similar to try opal, but with running specs ---------------------------------------------------------------------------------------------------- [22:17:51] Luke Barbuto(@lexun):I see you had something very similar in opalrb.org ---------------------------------------------------------------------------------------------------- [22:18:37] Luke Barbuto(@lexun):How would I go about getting the parser included into the corelib, so overriding the default? ---------------------------------------------------------------------------------------------------- [22:19:17] Elia Schito(@elia):you should `require "opal-parser"` in your app code ---------------------------------------------------------------------------------------------------- [22:21:54] Luke Barbuto(@lexun):Hmm, for some reason that doesn't seem to work in my Volt project - but maybe I don't even need to do this anyway.... The whole point was to try to compile the user input ruby and eval it with javascript to try to simulate another process - so as the specs are run over and over and code changes it doesn't pollute the loaded classes. ---------------------------------------------------------------------------------------------------- [22:23:46] Luke Barbuto(@lexun):Would that even work though? Or is there a better way to do that? It didn't look like any simulation of Open3 has been implemented... ---------------------------------------------------------------------------------------------------- [22:44:55] Luke Barbuto(@lexun):Just confirmed it doesn't work. I'll need to come up with another way to run some user provided ruby in isolation. Thanks for the help troubleshooting Ryan and Elia ---------------------------------------------------------------------------------------------------- [23:44:18] Elia Schito(@elia):@lexun seems to work in 0.7.1 from console: ``` > opal -ropal-parser -e 'puts Opal.compile("puts 5")' /* Generated by Opal 0.7.1 */ (function(Opal) { Opal.dynamic_require_severity = "error"; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$puts']); return self.$puts(5) })(Opal); ``` ---------------------------------------------------------------------------------------------------- [02:27:58] Jikku Jose(@JikkuJose):Yes, I did, seems the class is deprecated. ---------------------------------------------------------------------------------------------------- [13:12:39] Slee Woo(@sleewoo):@JikkuJose use `env = Opal::Server.new` instead ---------------------------------------------------------------------------------------------------- [13:13:07] Slee Woo(@sleewoo):then to compile a file use `env.sprockets[‘somefile’].to_s` ---------------------------------------------------------------------------------------------------- [14:36:43] Andrzej Krzywda(@andrzejkrzywda):has anyone tried Opal with ReactJS? ---------------------------------------------------------------------------------------------------- [14:37:24] Elia Schito(@elia):I think @adambeynon and some other started some work, I even think I saw a gem… ---------------------------------------------------------------------------------------------------- [14:39:17] Elia Schito(@elia):@andrzejkrzywda almost: https://rubygems.org/gems/opal-ractive ---------------------------------------------------------------------------------------------------- [14:40:41] Andrzej Krzywda(@andrzejkrzywda):right :) ---------------------------------------------------------------------------------------------------- [20:32:05] Luke Barbuto(@lexun):Hey folks - I'm trying to compile some user provided ruby in the browser with opal, but Opal.compile is coming back as undefined. I've been inspecting the try opal code trying to figure out what's different but haven't been able to find anything obvious. ---------------------------------------------------------------------------------------------------- [20:32:38] Luke Barbuto(@lexun):This is in the context of a Volt context, so Opal is already loaded... is there something I need to require maybe? ---------------------------------------------------------------------------------------------------- ############################## [2015-02-17] ############################## [06:51:05] Luke Barbuto(@lexun):Thanks @elia ---------------------------------------------------------------------------------------------------- [15:50:57] CJ Lazell(@cj):morning guys, looks like I found a pretty big bug https://github.com/opal/opal-jquery/issues/68 ---------------------------------------------------------------------------------------------------- [20:54:15] CJ Lazell(@cj):@elia moved it to opal ---------------------------------------------------------------------------------------------------- [21:27:08] Elia Schito(@elia)::+1: thanks ---------------------------------------------------------------------------------------------------- [21:27:25] CJ Lazell(@cj):np ---------------------------------------------------------------------------------------------------- ############################## [2015-02-19] ############################## [01:45:17] Jamie Gaskins(@jgaskins):Has anyone used Opal with Roda? It looks like the `require` method isn't bringing in the other features. Am I missing something? ```javascript /* Generated by Opal 0.7.1 */ (function(Opal) { Opal.dynamic_require_severity = "error"; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("clearwater/application"); return self.$require("opal-slim"); })(Opal); ``` ---------------------------------------------------------------------------------------------------- [02:26:59] CJ Lazell(@cj):does this look right? https://gist.github.com/cj/6c5d214c47114bac52cc ---------------------------------------------------------------------------------------------------- [02:27:42] CJ Lazell(@cj):trying to get http://nanobar.micronube.com/ to work natively and it should with ^ but for some reason it's not ---------------------------------------------------------------------------------------------------- [02:53:00] Jikku Jose(@JikkuJose):@jgaskins wow, was thinking to use it with Roda! How is it going? ---------------------------------------------------------------------------------------------------- [02:57:17] Jamie Gaskins(@jgaskins):@JikkuJose The `assets` plugin compiles the Opal scripts, but the `require` statement doesn't act as a directive, so I'm not sure how to get that working yet. Once I do, I'll probably be using Opal and Roda together a lot. :-) ---------------------------------------------------------------------------------------------------- [03:00:04] CJ Lazell(@cj):@JikkuJose I have a roda-components plugin coming out soon that uses Opal :) ---------------------------------------------------------------------------------------------------- [03:01:49] CJ Lazell(@cj):@jgaskins ^ ---------------------------------------------------------------------------------------------------- [04:21:16] Jamie Gaskins(@jgaskins):@cj I did notice that plugin, but I couldn't see how it works with Roda to bring in dependencies. ---------------------------------------------------------------------------------------------------- [04:22:01] CJ Lazell(@cj):@jgaskins there's going to be a gitbook with full documentation in the next few weeks ---------------------------------------------------------------------------------------------------- [04:25:00] Jamie Gaskins(@jgaskins):@cj :+1: ---------------------------------------------------------------------------------------------------- [04:33:51] Jikku Jose(@JikkuJose):@cj @jgaskins That would be a great combination! ---------------------------------------------------------------------------------------------------- [09:22:40] Elia Schito(@elia):@cj https://gist.github.com/cj/6c5d214c47114bac52cc#comment-1396710 ---------------------------------------------------------------------------------------------------- [16:11:13] Bernhard Weichel(@bwl21):Are there any performance benchmarks out for Opal 0.7.1 compared to 0.6.3? ---------------------------------------------------------------------------------------------------- [16:13:10] Bernhard Weichel(@bwl21):Is there rally no one taking benefits from sourcemaps while debugging? http://stackoverflow.com/questions/28499511/how-can-i-utilize-sourcemaps-when-debugging-opalrb ---------------------------------------------------------------------------------------------------- [19:58:38] Ryan Stout(@ryanstout):@adambeynon how are you? have you had any time to update opal-jquery and opal-rspec to opal 0.7.1? (no worries if not) ---------------------------------------------------------------------------------------------------- [20:17:19] Ryan Stout(@ryanstout): ---------------------------------------------------------------------------------------------------- [20:17:32] Ryan Stout(@ryanstout):^ sorry, wrong window ---------------------------------------------------------------------------------------------------- [20:55:53] Ryan Stout(@ryanstout):@adambeynon or @elia did caching make it into 0.7? ---------------------------------------------------------------------------------------------------- [20:56:05] Ryan Stout(@ryanstout):for compiled files ---------------------------------------------------------------------------------------------------- [20:56:51] Adam Beynon(@adambeynon):@ryanstout no. I think we went the wrong way with them. they were built on top of sprockets caching, but only disk based caching ---------------------------------------------------------------------------------------------------- [20:56:59] Adam Beynon(@adambeynon):I wasnt able to get them to cache in-memory ---------------------------------------------------------------------------------------------------- [20:57:16] Adam Beynon(@adambeynon):the solution is to build a non-sprockets related cache, I think ---------------------------------------------------------------------------------------------------- [20:59:54] Adam Beynon(@adambeynon):@ryanstout I am also looking at how some of the js based build tools (gulp, etc) work with sprockets to handle the caching ---------------------------------------------------------------------------------------------------- [21:03:14] Ryan Stout(@ryanstout):@adambeynon cool, I can probably help some if you want. Basically you need to invalidate when any required files changes right? (or any of their dependencies) ---------------------------------------------------------------------------------------------------- ############################## [2015-02-20] ############################## [09:02:15] Adam Beynon(@adambeynon):@ryanstout yeap. Another tricky one is handling require_tree(), which needs to watch each directory (both itself, and any directories inside) ---------------------------------------------------------------------------------------------------- ############################## [2015-02-21] ############################## [01:16:09] ylluminate(@ylluminate):@elia did you resolve the source map issue on the .7 release? Looks like we're still having issues on it at the moment here. ---------------------------------------------------------------------------------------------------- [10:54:51] Elia Schito(@elia):@ylluminate nope, still wip ---------------------------------------------------------------------------------------------------- [16:16:16] Can Edremitoglu(@cantonic):@elia @ylluminate I am trying to debug it currently too ---------------------------------------------------------------------------------------------------- [16:17:08] Can Edremitoglu(@cantonic):if anyone is bored, feel free to join me :) ---------------------------------------------------------------------------------------------------- [20:40:15] Can Edremitoglu(@cantonic):i think i should give it up... ---------------------------------------------------------------------------------------------------- ############################## [2015-02-22] ############################## [00:49:34] Elia Schito(@elia):@cantonic not an easy one uh :) sorry I couldn't join you, would have been fun ---------------------------------------------------------------------------------------------------- [01:47:47] Can Edremitoglu(@cantonic):@elia it is still ongoing :D ---------------------------------------------------------------------------------------------------- [03:54:55] Karim Tarek(@karimmtarek):Hi guys, what's the equivalent to jquery's $(this) in opal? ---------------------------------------------------------------------------------------------------- [04:06:17] Can Edremitoglu(@cantonic):@karimmtarek `Element.find(self)` i would say ---------------------------------------------------------------------------------------------------- [04:07:49] Karim Tarek(@karimmtarek):when I try it I get main as the element ---------------------------------------------------------------------------------------------------- [04:08:23] Can Edremitoglu(@cantonic):i don’t know what your `this` is ---------------------------------------------------------------------------------------------------- [04:08:40] Karim Tarek(@karimmtarek):and when I try `self` alone i get `main` as well ---------------------------------------------------------------------------------------------------- [04:08:55] Karim Tarek(@karimmtarek):one sec ---------------------------------------------------------------------------------------------------- [04:09:19] Can Edremitoglu(@cantonic):ok ---------------------------------------------------------------------------------------------------- [04:09:45] Karim Tarek(@karimmtarek):``` ele = Element['.message .close'] ele.on :click do ele.closest('.message').effect(:slide_up) end ``` ---------------------------------------------------------------------------------------------------- [04:10:38] Karim Tarek(@karimmtarek):I want to write it like this: ``` Element['.message .close'].on :click do self.closest('.message').effect(:slide_up) end ``` ---------------------------------------------------------------------------------------------------- [04:11:47] Karim Tarek(@karimmtarek):but `self ` refers to main ---------------------------------------------------------------------------------------------------- [04:12:11] Karim Tarek(@karimmtarek):in jquery using $(this) refers to the element ---------------------------------------------------------------------------------------------------- [04:15:56] Karim Tarek(@karimmtarek):thanks anyway :) ---------------------------------------------------------------------------------------------------- [04:20:13] Can Edremitoglu(@cantonic):@karimmtarek ``` Element['.message .close'].on :click do |event| # now you would need to get the target from the event end ``` ---------------------------------------------------------------------------------------------------- [04:22:04] Can Edremitoglu(@cantonic):@karimmtarek ``` Element['.message .close'].on :click do |event| event.current_target.closest('.message').effect(:slide_up) end ``` ---------------------------------------------------------------------------------------------------- [05:13:23] Karim Tarek(@karimmtarek):@cantonic thanks a lot, really appreciate it ---------------------------------------------------------------------------------------------------- [05:14:31] Can Edremitoglu(@cantonic):you’re welcome ---------------------------------------------------------------------------------------------------- [16:34:28] Elia Schito(@elia):@cantonic around? ---------------------------------------------------------------------------------------------------- [16:34:41] Elia Schito(@elia):any progress on sm? ---------------------------------------------------------------------------------------------------- [18:52:48] Can Edremitoglu(@cantonic):@elia: not really :( ---------------------------------------------------------------------------------------------------- [23:18:14] Elia Schito(@elia):@channel https://twitter.com/zetachang/status/569554820320768000 ---------------------------------------------------------------------------------------------------- [23:31:22] AstonJ(@AstonJ):Excellent news @elia - so that’s two down one to go! C’mon Ember!! haha ---------------------------------------------------------------------------------------------------- [23:31:47] Elia Schito(@elia):: ) ---------------------------------------------------------------------------------------------------- ############################## [2015-02-23] ############################## [21:45:47] Adam Beynon(@adambeynon):lol, sure :+1: ---------------------------------------------------------------------------------------------------- [22:00:09] Ryan Stout(@ryanstout):@adambeynon ok, one other question that I asked a while ago. It wasn't really possible then, but I figured I would get your thoughts again. So with volt there's some file that I'm requiring by convention (instead of having an explicit require) So I almost need a way that I can have a url that when hit returns a list of required files as if it was hitting a file with a bunch of requires in it. I would just put a ton of .js files on the page, but it takes the browsers way longer to process and results in a lot more requests (even in dev its a big performance hit) ---------------------------------------------------------------------------------------------------- [22:00:12] Ryan Stout(@ryanstout):does that make any since? ---------------------------------------------------------------------------------------------------- [22:06:15] Ryan Stout(@ryanstout):like is there somewhere I could patch into the code that "reads" a file and just return my own code? (that requires in the main files) Right now I'm just reading the files I need myself for components then doing Opal.compile, but thats not great because it doesn't support source maps ---------------------------------------------------------------------------------------------------- [22:09:13] Adam Beynon(@adambeynon):@ryanstout not sure I completely understand. For example, if foo_controller.rb gets required, volt would also want a foo_view.rb, if it exists? (just as an example) ---------------------------------------------------------------------------------------------------- [22:11:01] Ryan Stout(@ryanstout):so its a bit complicated, basically in volt there are components, which is a mix of server and client code, and assets. One component can require another by name in a dependencies.rb file. And components might be in gems also. So basically I need a way to programmatically require in things from volt code without the user needing to use require directly. ---------------------------------------------------------------------------------------------------- [22:11:35] Ryan Stout(@ryanstout):does that help explain it? ---------------------------------------------------------------------------------------------------- [22:11:41] Ryan Stout(@ryanstout):sorry, kind of hard to explain ---------------------------------------------------------------------------------------------------- [22:11:55] Adam Beynon(@adambeynon):@ryanstout right, ok. I get it now ---------------------------------------------------------------------------------------------------- [22:12:08] Adam Beynon(@adambeynon):I think this is similar to what I want to do for opal-0.8 ---------------------------------------------------------------------------------------------------- [22:12:30] Adam Beynon(@adambeynon):I’ve been thinking about making Opal::Builder use some manifest type file ---------------------------------------------------------------------------------------------------- [22:12:34] Adam Beynon(@adambeynon):Opalfile for example ---------------------------------------------------------------------------------------------------- [22:12:39] Ryan Stout(@ryanstout):can you think of a good way to patch it in in the mean time? ---------------------------------------------------------------------------------------------------- [22:12:42] Adam Beynon(@adambeynon):to control what gets compiled ---------------------------------------------------------------------------------------------------- [22:12:53] Ryan Stout(@ryanstout):my problem is it needs to actually run volt code to decide what gets compiled ---------------------------------------------------------------------------------------------------- [22:13:19] Ryan Stout(@ryanstout):because it depends on a bunch of files with its own require dsl ---------------------------------------------------------------------------------------------------- [22:13:38] Adam Beynon(@adambeynon):@ryanstout would the code it runs also get run client side? ---------------------------------------------------------------------------------------------------- [22:13:51] Ryan Stout(@ryanstout):no, just the server to decide which files to send to the client ---------------------------------------------------------------------------------------------------- [22:14:31] Adam Beynon(@adambeynon):@ryanstout ok, well for 0.8 this will be easy, it will be able to hook into a revamped Builder, instead of using an Opalfile ---------------------------------------------------------------------------------------------------- [22:14:34] Adam Beynon(@adambeynon):for 0.7 though ---------------------------------------------------------------------------------------------------- [22:14:40] Adam Beynon(@adambeynon):I guess it is possible ---------------------------------------------------------------------------------------------------- [22:14:50] Adam Beynon(@adambeynon):does volt use Opal::Builder currently? ---------------------------------------------------------------------------------------------------- [22:15:00] Adam Beynon(@adambeynon):(sorry, havent managed to keep track with volt internals) ---------------------------------------------------------------------------------------------------- [22:15:01] Ryan Stout(@ryanstout):no, but it could ---------------------------------------------------------------------------------------------------- [22:15:05] Ryan Stout(@ryanstout):no worries ---------------------------------------------------------------------------------------------------- [22:17:48] Adam Beynon(@adambeynon):@ryanstout let me have a think about it. it is something I want to be able to support with opal 0.7, which would then go on to influence the changes for 0.8 ---------------------------------------------------------------------------------------------------- [22:17:59] Adam Beynon(@adambeynon):it probably easier with volt as you’re not using sprockets directly ---------------------------------------------------------------------------------------------------- [22:18:14] Adam Beynon(@adambeynon):bit more flexability for handling the compile chain ---------------------------------------------------------------------------------------------------- [22:18:24] Ryan Stout(@ryanstout):yea, I mean I'm using sprockets for a few things ---------------------------------------------------------------------------------------------------- [22:18:52] Ryan Stout(@ryanstout):so what is Opal::Builder used for? ---------------------------------------------------------------------------------------------------- [22:20:09] Adam Beynon(@adambeynon):You give Opal::Builder a single file name, which should be inside the opal load path, and then it will go through the code, compiling every dependency it can find for that file (via #require statements), and gives you back a long string of compiled javascript and a source map for it ---------------------------------------------------------------------------------------------------- [22:20:29] Adam Beynon(@adambeynon):but, it only currently handles hard coded require and require_tree statements ---------------------------------------------------------------------------------------------------- [22:21:42] Adam Beynon(@adambeynon):Opal::Builder.build(“application”) is the simple rake task I use for building my apps for production (when not using rails asset pipeline) ---------------------------------------------------------------------------------------------------- [22:26:06] Adam Beynon(@adambeynon):@ryanstout https://gist.github.com/adambeynon/4feee9cb0a282a513203 ---------------------------------------------------------------------------------------------------- [22:26:16] Adam Beynon(@adambeynon):that is something that I have in my head for what I want ---------------------------------------------------------------------------------------------------- [22:26:24] Ryan Stout(@ryanstout):yea, that would be awesome ---------------------------------------------------------------------------------------------------- [22:26:26] Adam Beynon(@adambeynon):but volt could generate something automatically ---------------------------------------------------------------------------------------------------- [22:26:59] Ryan Stout(@ryanstout):in the mean time you think I could just patch where it reads a file and have it return the code as if it was in a file that required in everything? ---------------------------------------------------------------------------------------------------- [22:27:42] Adam Beynon(@adambeynon):@ryanstout yes, I think that can work ---------------------------------------------------------------------------------------------------- [22:29:23] Adam Beynon(@adambeynon):@ryanstout will give it some thought in the morning ---------------------------------------------------------------------------------------------------- [22:29:33] Ryan Stout(@ryanstout):cool, thanks a bunch ---------------------------------------------------------------------------------------------------- [22:29:39] Ryan Stout(@ryanstout):sorry, I realize this isn't a normal use case ---------------------------------------------------------------------------------------------------- [22:29:39] Adam Beynon(@adambeynon):I will also spend some time inside volt’s source to see how you’re doing compiling etc now ---------------------------------------------------------------------------------------------------- [22:30:01] Ryan Stout(@ryanstout):right now the compiling for components is just reading the files and doing Opal.compile ---------------------------------------------------------------------------------------------------- [22:30:19] Ryan Stout(@ryanstout):the framework its self's code is just on the asset_path ---------------------------------------------------------------------------------------------------- [22:30:41] Ryan Stout(@ryanstout):I'm hoping just generating something with requires will simplify things. ---------------------------------------------------------------------------------------------------- [22:52:00] Ryan Stout(@ryanstout):@adambeynon also, I can add in caching if you can point me in the right direction. Not having it really slows things down for volt, so I'll do anything I can to get it back in :-) ---------------------------------------------------------------------------------------------------- [00:47:55] Can Edremitoglu(@cantonic):wow,really great news ---------------------------------------------------------------------------------------------------- [21:40:14] Ryan Stout(@ryanstout):random question, would it be possible in the future to make ```require_tree``` take a glob pattern? ---------------------------------------------------------------------------------------------------- [21:42:45] Adam Beynon(@adambeynon):@ryanstout yeap. we opted for a sprockets friendly tree for the initial implementation, but for 0.8 the plan is to use sprockets purely as an entry point, so things like require_tree will become much better suited ---------------------------------------------------------------------------------------------------- [21:42:57] Adam Beynon(@adambeynon):so yes, globs are the plan ---------------------------------------------------------------------------------------------------- [21:43:16] Adam Beynon(@adambeynon):(but they still need to belong to the opal load path) ---------------------------------------------------------------------------------------------------- [21:43:24] Ryan Stout(@ryanstout):@adambeynon ok, cool. Yea, that makes since. ---------------------------------------------------------------------------------------------------- [21:44:37] Ryan Stout(@ryanstout):is it something I could monkey-patch in in the mean time? (not sure if thats a good idea, just thinking through options) ---------------------------------------------------------------------------------------------------- [21:45:20] Adam Beynon(@adambeynon):@ryanstout it should be possible. you will need something in the runtime.js to support it as well ---------------------------------------------------------------------------------------------------- [21:45:28] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:45:41] Adam Beynon(@adambeynon):a simple glob => regexp type thing should be enough to check against each Opal.module entry ---------------------------------------------------------------------------------------------------- [21:45:41] Ryan Stout(@ryanstout):let me think through a few things then :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-02-24] ############################## [22:35:55] Ryan Stout(@ryanstout):@adambeynon you around? ---------------------------------------------------------------------------------------------------- ############################## [2015-02-25] ############################## [10:55:08] Adam Beynon(@adambeynon):hi @ryanstout, im here for the next few hours if you’re about (not sure what the time difference is between us ;) ) ---------------------------------------------------------------------------------------------------- [10:55:38] Elia Schito(@elia):probably still asleep :) ---------------------------------------------------------------------------------------------------- [11:19:59] Elia Schito(@elia):@krainboltgreene, https://github.com/krainboltgreene/hackerlife/blob/master/lib/hacklife/terminal.rb#L1 mispelled :D ---------------------------------------------------------------------------------------------------- [11:20:26] Elia Schito(@elia):*misspelled ---------------------------------------------------------------------------------------------------- [17:18:56] Elia Schito(@elia):@adambeynon, still early, but seems to work more or less: https://gist.github.com/elia/e330d92d8b826d089c4f ---------------------------------------------------------------------------------------------------- [17:52:54] Ryan Stout(@ryanstout):@elia whats that last code for? ---------------------------------------------------------------------------------------------------- [18:10:27] ylluminate(@ylluminate):@elia it's too bad that the react wrapper was done as it is. Could become a real maintenance headache after a quick glance. ---------------------------------------------------------------------------------------------------- [18:14:23] ylluminate(@ylluminate):@cantonic @elia so where does the source maps effort stand at present in terms of the roadblocks you're hitting @cantonic? We have hit some spots where it would be enormously useful to have sm's back. ---------------------------------------------------------------------------------------------------- [18:31:54] ylluminate(@ylluminate):if you've documented what you've done so far and the general issue, we might be able to pitch in and help get it resolved ---------------------------------------------------------------------------------------------------- [20:12:22] Ryan Stout(@ryanstout):question if anyone has a second. So I need a .deep_clone, any ideas on the best approach. (Is there any performance advantage to just doing JSON.parse(obj.to_json) ?) Thanks ---------------------------------------------------------------------------------------------------- [22:01:24] Adam Beynon(@adambeynon):@elia no, no progress on sourcemaps - haven’t looked at them. not sure whats gone wrong with them tbh ---------------------------------------------------------------------------------------------------- [22:35:53] Elia Schito(@elia):@adambeynon about sourcemaps I think it's the concatenation, they're preobably as fine as they were before taken singularly ---------------------------------------------------------------------------------------------------- [22:36:47] Elia Schito(@elia):@ryanstout the code is to support `require 'foo'` where foo is `foo.js.coffee` in sprockets context ---------------------------------------------------------------------------------------------------- [22:37:02] Ryan Stout(@ryanstout):ah, cool. Was just curious ---------------------------------------------------------------------------------------------------- [22:37:39] Elia Schito(@elia):I want to require js files with they're (sprockets) dependencies from the usual application.js.rb in rails ---------------------------------------------------------------------------------------------------- [22:39:35] Elia Schito(@elia):@adambeynon I started some work to ensure the (identity) source maps for js files is sound some days ago, but time is really scarce here these days ---------------------------------------------------------------------------------------------------- [22:41:10] Adam Beynon(@adambeynon):@elia yeah. when I run the source maps individually, they are fine. you’re right, its something with the concatenation that seems to be the issue ---------------------------------------------------------------------------------------------------- [22:50:42] Elia Schito(@elia):@adambeynon e.g. last new line should be counted? and how, are we generating maps for js files correctly (e.g. runtime.js) etc. ---------------------------------------------------------------------------------------------------- [22:51:36] Elia Schito(@elia):@adambeynon not unlikely that I misunderstood something while coding that part :\ ---------------------------------------------------------------------------------------------------- ############################## [2015-02-26] ############################## [19:51:55] Ryan Stout(@ryanstout):@adambeynon how are you? Did you have a chance to think about if there is an easy way for me to serve generated code and get source maps out of the files the generated code requires? ---------------------------------------------------------------------------------------------------- [21:41:56] Ryan Stout(@ryanstout):@adambeynon ok, I think I've got everything working with Opal::Builder, except its not outputting the special comment that points to the map file. ---------------------------------------------------------------------------------------------------- [21:42:01] Ryan Stout(@ryanstout):any ideas? ---------------------------------------------------------------------------------------------------- [21:43:54] Adam Beynon(@adambeynon):hi @ryanstout ---------------------------------------------------------------------------------------------------- [21:44:00] Adam Beynon(@adambeynon):so we do this inside a sprockets processor ---------------------------------------------------------------------------------------------------- [21:44:01] Adam Beynon(@adambeynon):https://github.com/opal/opal/blob/master/lib/opal/sprockets/processor.rb#L68-L83 ---------------------------------------------------------------------------------------------------- [21:44:11] Ryan Stout(@ryanstout):@adambeynon hey, just found that :-) ---------------------------------------------------------------------------------------------------- [21:44:14] Ryan Stout(@ryanstout):cool, I can just add that in manually then and I should be good to go :-) ---------------------------------------------------------------------------------------------------- [21:44:27] Adam Beynon(@adambeynon):yeap yeap :D ---------------------------------------------------------------------------------------------------- [21:44:35] Can Edremitoglu(@cantonic):source maps problem is fixed?? ---------------------------------------------------------------------------------------------------- [21:44:37] Adam Beynon(@adambeynon):is Builder handling things as you needed? ---------------------------------------------------------------------------------------------------- [21:44:51] Ryan Stout(@ryanstout):yea, I think so ---------------------------------------------------------------------------------------------------- [21:44:56] Can Edremitoglu(@cantonic):yay!!! thank you @ryanstout !! ---------------------------------------------------------------------------------------------------- [21:45:00] Ryan Stout(@ryanstout):@cantonic I'm still seeing some other issues, just getting the basics working now ---------------------------------------------------------------------------------------------------- [21:45:08] Ryan Stout(@ryanstout):(and redoing the way it works in volt) ---------------------------------------------------------------------------------------------------- [21:45:41] Can Edremitoglu(@cantonic):can’t wait using opal with source maps support ---------------------------------------------------------------------------------------------------- [21:47:41] Ryan Stout(@ryanstout):@adambeynon are the .rb files rendered through sprockets as well? ---------------------------------------------------------------------------------------------------- [21:47:50] Ryan Stout(@ryanstout):when the source map pulls it in ---------------------------------------------------------------------------------------------------- [22:03:26] Adam Beynon(@adambeynon):@ryanstout nope, we have to create some middleware ---------------------------------------------------------------------------------------------------- [22:03:27] Adam Beynon(@adambeynon):https://github.com/opal/opal/blob/master/lib/opal/sprockets/server.rb#L15-L63 ---------------------------------------------------------------------------------------------------- [22:03:46] Adam Beynon(@adambeynon):that serves the source map itself, and all the *.rb files ---------------------------------------------------------------------------------------------------- [22:04:04] Adam Beynon(@adambeynon):Opal::Server (a basic rack server) creates this automatically ---------------------------------------------------------------------------------------------------- [22:04:11] Adam Beynon(@adambeynon):and in rails we have to add it manually ---------------------------------------------------------------------------------------------------- [22:04:29] Adam Beynon(@adambeynon):sprockets doesn’t do sourcemaps too well, we have to handle everything ---------------------------------------------------------------------------------------------------- [22:04:32] Ryan Stout(@ryanstout):ok, cool. So I'll need to serve the rb files manually if I'm doing builder.build_str right? ---------------------------------------------------------------------------------------------------- [22:05:08] Adam Beynon(@adambeynon):yeap. we can’t serve them directly through sprockets, as sprockets won’t know if you are requesting the compiled version, or the actual version ---------------------------------------------------------------------------------------------------- [22:05:14] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:05:23] Ryan Stout(@ryanstout):cool, I think I got it. Thanks for the help. ---------------------------------------------------------------------------------------------------- [22:05:46] Adam Beynon(@adambeynon):np. i enjoyed the break. currently fighting with Faye in a Rails app ---------------------------------------------------------------------------------------------------- [22:06:03] Ryan Stout(@ryanstout):ah, yea, I've been working to integrate faye into volt also :-) ---------------------------------------------------------------------------------------------------- [22:06:15] Ryan Stout(@ryanstout):though haven't worked on that for a few days ---------------------------------------------------------------------------------------------------- [22:07:17] Adam Beynon(@adambeynon):I left it as the last thing to finish for this app. just glad I actally have enough time left for forcing it into place ---------------------------------------------------------------------------------------------------- [22:07:36] Adam Beynon(@adambeynon):I can see the good side though - it does fit nicely (when it plays nicely_ ---------------------------------------------------------------------------------------------------- ############################## [2015-02-27] ############################## [07:59:44] Bernhard Weichel(@bwl21):I try to turn on inline_operators in my app. my rackup-file is ``` # config.ru require 'bundler' Bundler.require Opal::Processor.inline_operators_enabled = true run Opal::Server.new { |s| s.append_path 'public' s.append_path 'src' Opal.use_gem "vector2d" Opal.paths.each { |p| s.append_path(p) } #s.use_gem 'vector2d' s.debug = true s.source_map = true s.main = 'application' s.index_path = 'index_opal.html.erb' } ``` I observe no effect, in particular no performance improvement. ---------------------------------------------------------------------------------------------------- ############################## [2015-02-28] ############################## [05:25:00] Sean Culver(@seanculver):I'm wanting to create a wrapper for the Ace Editor, Is there any docs that point me in the direction on how best to do that? ---------------------------------------------------------------------------------------------------- [06:21:37] Sean Culver(@seanculver):That was way easier that I thought it would be, I'd still like to package this into a gem. Are there any conventions that need to be followed when building a wrapper gem in Opal? ---------------------------------------------------------------------------------------------------- [21:02:02] Bernhard Weichel(@bwl21):I have such a wrapper in my project https://github.com/bwl21/zupfnoter/blob/master/30_sources/SRC_Zupfnoter/src/text_pane.rb ---------------------------------------------------------------------------------------------------- ############################## [2015-03-02] ############################## [18:07:05] ylluminate(@ylluminate):anyone put together any recent opal vs js vs es6 vs clojure, etc. benchmarks? ---------------------------------------------------------------------------------------------------- [18:08:27] ylluminate(@ylluminate):if not, i'd like to get a project together to do that. been having a debate / discussion with someone seemingly entirely resting their opposition to opal on performance ---------------------------------------------------------------------------------------------------- [18:24:29] ylluminate(@ylluminate):so far i have been pointed to this: http://jsperf.com/js-react-vs-opal-react/4 ---------------------------------------------------------------------------------------------------- ############################## [2015-03-03] ############################## [02:17:45] Jonathan Cutrell(@jcutrell):Hi Opal people. Can someone tell me in short, what the ES6 support looks like in Opal? What I'd love to see is Opal -> ES6 -> (transpile) -> JS ---------------------------------------------------------------------------------------------------- [02:17:50] Jonathan Cutrell(@jcutrell):Is that the case, currently? ---------------------------------------------------------------------------------------------------- [02:18:00] Jonathan Cutrell(@jcutrell):Or is there a fork in which that is the case? ---------------------------------------------------------------------------------------------------- [09:11:54] Elia Schito(@elia):@jcutrell Opal compiles to js directly and tries to span browser support as much as possible, going through ES6 would be cool but I don't see any pactical advantage in doing so (also it would have double step sourcemaps and more indirection). I'm not aware of any fork trying to do that. :) ---------------------------------------------------------------------------------------------------- [09:13:03] Elia Schito(@elia):@ylluminate I don't think there's anything, but if you come up with something would be cool to see ---------------------------------------------------------------------------------------------------- [14:30:50] Fred Mitchell(@flajann2):A question for all: How does Opal and Angular get along these days? I am thinking of switching away from CoffeeScript and completely into Opal, but will need to interact with D3 and Angular. Anyone with experience with this combination? ---------------------------------------------------------------------------------------------------- [20:53:32] Ryan Stout(@ryanstout):@meh if your around, I wanted to confirm what I think is a bug in the promise implementation (though it might be intentional): ```ruby Promise.new.resolve(5).then { nil }.then { |v| puts v.inspect } ``` ^ that should print nil, but I get 5. Is that intentional? Thanks ---------------------------------------------------------------------------------------------------- [20:54:24] Ryan Stout(@ryanstout):if I do a falsy value, it doesn't pass it ---------------------------------------------------------------------------------------------------- ############################## [2015-03-04] ############################## [02:17:08] Can Edremitoglu(@cantonic):is the source maps problem in rails is still existing or am I missing something? ---------------------------------------------------------------------------------------------------- [03:12:02] ylluminate(@ylluminate):@cantonic I think @ryanstout fixed the main issue, but I've not given it a go yet to verify. ---------------------------------------------------------------------------------------------------- [03:12:45] Can Edremitoglu(@cantonic):@ylluminate i tried using the opal-rails master branch from github, but no success unfortunately ---------------------------------------------------------------------------------------------------- [03:12:47] ylluminate(@ylluminate):@elia yeah, i'll share them when we come up with something in the next couple days. ---------------------------------------------------------------------------------------------------- [03:13:40] ylluminate(@ylluminate):@cantonic hmm. so you're certain that opal-rails is pulling in opal master? ---------------------------------------------------------------------------------------------------- [03:14:31] Can Edremitoglu(@cantonic):@ylluminate i have added `gem 'opal', github: 'opal/opal’` to my Gemfile as well ---------------------------------------------------------------------------------------------------- [03:15:33] ylluminate(@ylluminate):alright, i'm not sure unfortunately as i've not yet tried it. @gabrielrios @ylluminarious, either of you tried source maps since the other day? ---------------------------------------------------------------------------------------------------- [03:17:16] Can Edremitoglu(@cantonic):maybe opal-rails is still using the rubygems version of opal... ---------------------------------------------------------------------------------------------------- [03:18:47] ylluminate(@ylluminate):what's your lockfile saying about the dependency versions? ---------------------------------------------------------------------------------------------------- [03:19:32] Can Edremitoglu(@cantonic):``` GIT remote: git://github.com/opal/opal-rails.git revision: f05d36a4fcdc68e6ebb90e7adc28cbecc0b3e542 specs: opal-rails (0.7.1) jquery-rails opal (~> 0.7.0) opal-activesupport (>= 0.0.5) opal-jquery (~> 0.3.0) opal-rspec (~> 0.4.0) rails (>= 3.2, < 5.0) ``` ---------------------------------------------------------------------------------------------------- [03:23:06] ylluminate(@ylluminate):i'ts obviously pulling the newer version and i suspect .7.1 even though it's showing "at least" .7.0 ---------------------------------------------------------------------------------------------------- [03:23:58] ylluminate(@ylluminate):you know though, i don't see any commits from ryan in the commits list ---------------------------------------------------------------------------------------------------- [03:24:07] ylluminate(@ylluminate):so perhaps his update hasn't actually made it in yet? ---------------------------------------------------------------------------------------------------- [03:28:01] Can Edremitoglu(@cantonic):@ylluminate you’re right. I can’t see any commits from him ---------------------------------------------------------------------------------------------------- [15:43:48] AstonJ(@AstonJ):@flajann2 check this out: https://github.com/OpalOnAngularities/opal_on_angularities ---------------------------------------------------------------------------------------------------- [15:45:09] Elia Schito(@elia):@cantonic I started some work on source maps that should make things a bit better, not sure when I'll be able to finish it tho (cc: @ryanstout @adambeynon) ---------------------------------------------------------------------------------------------------- [15:59:09] Can Edremitoglu(@cantonic):@elia I wish I could be of any help… ---------------------------------------------------------------------------------------------------- [16:00:03] Elia Schito(@elia):we'll see how it goes, maybe I'll push a WIP branch ---------------------------------------------------------------------------------------------------- [16:01:37] Can Edremitoglu(@cantonic):@elia I just read that [catmando might have found a solution](https://github.com/opal/opal/issues/720#issuecomment-77180028) ---------------------------------------------------------------------------------------------------- [16:03:54] Elia Schito(@elia):lol, I think I mixed up the two nicnames in my head (@catmando and @cantonic), that's the problem with replying to issues at 2am :P ---------------------------------------------------------------------------------------------------- [16:08:28] Can Edremitoglu(@cantonic)::D ---------------------------------------------------------------------------------------------------- [17:24:10] Elia Schito(@elia):https://github.com/opal/opal/pull/722 ---------------------------------------------------------------------------------------------------- [17:56:17] Fred Mitchell(@flajann2):@AstonJ Thanks a lot. This is encouraging. And I can finally say byebye to CoffeeScript. :D ---------------------------------------------------------------------------------------------------- [19:27:53] Ryan Stout(@ryanstout):@meh you around? ---------------------------------------------------------------------------------------------------- ############################## [2015-03-05] ############################## [00:58:07] Ricardo Mendes(@locks):hi, is the rubygem the only way to compile ruby code? ---------------------------------------------------------------------------------------------------- [00:59:00] Ricardo Mendes(@locks):I want to integrate opal into a node.js build pipe ---------------------------------------------------------------------------------------------------- [01:01:27] Elia Schito(@elia):@locks you can compile opal-parser and use it inside node to parse on the fly ---------------------------------------------------------------------------------------------------- [01:01:45] Elia Schito(@elia):not that easy working with node require system and modules tho ---------------------------------------------------------------------------------------------------- [01:02:05] Elia Schito(@elia):you need to parse / eval everything in a global context somehow ---------------------------------------------------------------------------------------------------- [01:02:22] Elia Schito(@elia):my advice is to use a rake task if possible ---------------------------------------------------------------------------------------------------- [01:13:41] Ricardo Mendes(@locks):thanks for the advice @elia ---------------------------------------------------------------------------------------------------- [01:15:12] Ricardo Mendes(@locks):now I just need ES6 module support O:) ---------------------------------------------------------------------------------------------------- [01:20:19] Elia Schito(@elia):heh, the real question is how that translates to ruby? ---------------------------------------------------------------------------------------------------- [01:22:03] Ricardo Mendes(@locks):good question ---------------------------------------------------------------------------------------------------- [01:22:14] Ricardo Mendes(@locks):well I mean ---------------------------------------------------------------------------------------------------- [01:22:17] Ricardo Mendes(@locks):you just export everything ---------------------------------------------------------------------------------------------------- [01:22:20] Ricardo Mendes(@locks):that's what Ruby does ---------------------------------------------------------------------------------------------------- [01:23:00] Elia Schito(@elia):I guess it would work ---------------------------------------------------------------------------------------------------- [01:23:45] Ricardo Mendes(@locks):I saw https://github.com/movableink/ember-cli-emscripten and thought of doing something for opalrb ---------------------------------------------------------------------------------------------------- [01:24:52] Elia Schito(@elia):having compiled gems would be really much fun ---------------------------------------------------------------------------------------------------- [01:25:15] Ricardo Mendes(@locks):something like https://github.com/ef4/ember-browserify ---------------------------------------------------------------------------------------------------- [01:25:33] Ricardo Mendes(@locks):would be bonkers ---------------------------------------------------------------------------------------------------- [01:37:19] Ricardo Mendes(@locks):in the homepage example there´s a line `user = User.new('Bob')`, that `user` variable isn't accessible in the JS runtime is it? ---------------------------------------------------------------------------------------------------- [01:40:08] Elia Schito(@elia):it is ---------------------------------------------------------------------------------------------------- [01:40:17] Elia Schito(@elia):opalrb.org/try ---------------------------------------------------------------------------------------------------- [01:40:22] Elia Schito(@elia):to see the compiled code live ---------------------------------------------------------------------------------------------------- [01:41:53] Ricardo Mendes(@locks):yeah, the compile code is all inside an iife ---------------------------------------------------------------------------------------------------- [22:06:32] Karim Tarek(@karimmtarek):Hi guys ---------------------------------------------------------------------------------------------------- [22:06:50] Karim Tarek(@karimmtarek):I'm having hard time convert this ``` ---------------------------------------------------------------------------------------------------- [22:06:52] Karim Tarek(@karimmtarek):``` $('html, body').animate({ # scrollTop: $(x).offset().top # }, 1500); ---------------------------------------------------------------------------------------------------- [22:07:09] Karim Tarek(@karimmtarek):to opal ---------------------------------------------------------------------------------------------------- [22:07:38] Karim Tarek(@karimmtarek):I tried this ``` Element['html, body'].animate(scroll_top: Element[x].offset().top, 1500) ``` ---------------------------------------------------------------------------------------------------- [22:08:24] Karim Tarek(@karimmtarek):but its no good ---------------------------------------------------------------------------------------------------- [22:09:53] Karim Tarek(@karimmtarek):any advice? ---------------------------------------------------------------------------------------------------- [23:06:19] Elia Schito(@elia):@karimmtarek try with `scrollTop` instead ---------------------------------------------------------------------------------------------------- ############################## [2015-03-06] ############################## [01:17:00] Karim Tarek(@karimmtarek):@elia you were right, thanks, I was messing the '{}' as well ---------------------------------------------------------------------------------------------------- [01:17:24] Karim Tarek(@karimmtarek):this what worked for me ``` Element['body'].animate({ scrollTop: Element[x].offset().top }, 2000) ``` ---------------------------------------------------------------------------------------------------- ############################## [2015-03-12] ############################## [16:41:28] George Plymale II(@ylluminarious):hey everyone, i was recently working on something with opal and i was having problems accessing the `body` element from the `document` object: https://developer.mozilla.org/en-US/docs/Web/API/Document/body i was using this code to try and access `body`: ``` $$[:document].body.appendChild(dom_element) ``` `$$[:document]` is working fine, but the `.body` part is coming out as nil. how do i access the `body` element through `$$[:document]`, then? ---------------------------------------------------------------------------------------------------- [16:44:40] Elia Schito(@elia):@ylluminarious try with `$$[:document][:body]` ---------------------------------------------------------------------------------------------------- [16:46:56] George Plymale II(@ylluminarious):@elia yeah, i already did, it returns nil :disappointed: ---------------------------------------------------------------------------------------------------- [17:55:26] Adam Beynon(@adambeynon):@ylluminarious has the document loaded? `document.body` will be null (thus returning nil) until the document has fully loaded ---------------------------------------------------------------------------------------------------- [17:55:39] Adam Beynon(@adambeynon):hence jquery needing `$(function() { … })` ---------------------------------------------------------------------------------------------------- [18:03:06] George Plymale II(@ylluminarious):@adambeynon it looks like it hasn't loaded yet where i'm calling it, so i'll see if i can fix that and then see if the issue persists ---------------------------------------------------------------------------------------------------- [18:03:52] Adam Beynon(@adambeynon):@ylluminarious any reason not to use opal-jquery or opal-browser? (just curious) ---------------------------------------------------------------------------------------------------- [18:05:04] George Plymale II(@ylluminarious):@adambeynon i am using opal-browser ---------------------------------------------------------------------------------------------------- [18:05:36] George Plymale II(@ylluminarious):is there a different way to implement what i said in opal-browser? ---------------------------------------------------------------------------------------------------- [18:05:53] Adam Beynon(@adambeynon):@ylluminarious ah ok. I think @meh added a helper for the browser being ready, which works cross browser ---------------------------------------------------------------------------------------------------- [18:06:02] Adam Beynon(@adambeynon):document being ready* ---------------------------------------------------------------------------------------------------- [18:06:44] George Plymale II(@ylluminarious):hmm, that's interesting ---------------------------------------------------------------------------------------------------- [18:07:27] Adam Beynon(@adambeynon):found it: `$document.ready { puts “document.body exists!” }` ---------------------------------------------------------------------------------------------------- [18:15:21] George Plymale II(@ylluminarious):@adambeynon hmm, i got a strange error: https://gist.github.com/ylluminarious/00239c47d1f63706f301 ---------------------------------------------------------------------------------------------------- [18:15:47] George Plymale II(@ylluminarious):i guess that means that the document isn't ready ---------------------------------------------------------------------------------------------------- [18:17:18] Adam Beynon(@adambeynon):@ylluminarious ummm, not sure on that one. I haven;t done any work on opal-browser, so Im not sure how it works ---------------------------------------------------------------------------------------------------- [18:17:25] Adam Beynon(@adambeynon):@meh is the guy to ask - usually on IRC as well ---------------------------------------------------------------------------------------------------- [18:18:25] George Plymale II(@ylluminarious):alright. i'll check on there and see if he can offer any help. ---------------------------------------------------------------------------------------------------- [20:57:35] George Plymale II(@ylluminarious):@adambeynon @elia @meh i think i've fixed that particular issue myself. i tried using `$document.body` instead of `$$[:document].body`, and that seems to have solved the problem. thanks, though, for the help ---------------------------------------------------------------------------------------------------- ############################## [2015-03-13] ############################## [23:28:05] Can Edremitoglu(@cantonic):oh no. ignore my message. now another error is there :) ---------------------------------------------------------------------------------------------------- [22:22:15] Can Edremitoglu(@cantonic):guys, when renaming `application.js` to `application.js.rb`, the require statements should be changed to ruby's `require` as well, right? (in Rails) ---------------------------------------------------------------------------------------------------- [22:24:46] Elia Schito(@elia):@cantonic to some extent it should work as it reaches the sprockets directive processor anyway, but "Sprockets requires" won't be known by the opal builder and thus you can end up adding something twice ---------------------------------------------------------------------------------------------------- [22:26:34] Can Edremitoglu(@cantonic):@elia so changing them to “ruby requires” is recommended then? I will update the README in opal-rails accordingly in that case ---------------------------------------------------------------------------------------------------- [22:26:52] Elia Schito(@elia):yes please : ) ---------------------------------------------------------------------------------------------------- [22:27:59] Can Edremitoglu(@cantonic):@elia I just changed my application.js to js.rb and also changed the requires, but some required libraries throw errors now. I am getting `An error occurred while compiling: s3_direct_upload negative argument`. Do you have an idea what the reason might be? ---------------------------------------------------------------------------------------------------- [22:28:36] Elia Schito(@elia):I saw the negative arg error once, but right now don't remember what it was ---------------------------------------------------------------------------------------------------- [22:29:32] Elia Schito(@elia):anyway you can try keep sprockets requires as long as you don't require them in ruby land too ---------------------------------------------------------------------------------------------------- [22:32:31] Can Edremitoglu(@cantonic):gotcha. I will tell in the readme that both ways are possible. Thank you a lot ---------------------------------------------------------------------------------------------------- [23:11:52] Can Edremitoglu(@cantonic):@elia is it possible that the `negative argument` error happens when opal has to deal with js.coffee files? I took the error causing file `s3_direct_upload.js.coffee`, changes it to plain JS using js2coffee and renamed it accordingly: error gone ---------------------------------------------------------------------------------------------------- ############################## [2015-03-14] ############################## [20:04:40] Can Edremitoglu(@cantonic):@elia when using opal As a template (like described in https://github.com/opal/opal-rails#as-a-template), do i have to name my view file `create.js.opal`? `js.rb` gives a “Missing Template” error back ---------------------------------------------------------------------------------------------------- [20:10:08] Can Edremitoglu(@cantonic):@elia: the reason I am asking is that I cannot get my `create.js.opal` to work. no matter what I write into it, it throws a “Stack level too deep” error. can’t even do `puts “foo"` ---------------------------------------------------------------------------------------------------- ############################## [2015-03-15] ############################## [17:10:57] Fred Mitchell(@flajann2):Is there an coffeescript to opal converter anywhere? I could not seem to find one. ---------------------------------------------------------------------------------------------------- [18:54:43] Adam Beynon(@adambeynon):@flajann2 nope. going from coffeescript -> opal doesnt make sense. opal comes with its own libraries and core lib, which are vastly different from those in javascript/coffeescript ---------------------------------------------------------------------------------------------------- ############################## [2015-03-16] ############################## [08:08:45] Fred Mitchell(@flajann2):@adambeynon , thanks. Yes, I know it does not make much since for anything large scale, but I just have a couple of coffeescripts I want to convert over before getting started. Guess I'll just have to rewrite them. Thanks. ---------------------------------------------------------------------------------------------------- [09:01:31] Adam Beynon(@adambeynon):@flajann2 no problem. let me know if you hit any issues ---------------------------------------------------------------------------------------------------- ############################## [2015-03-17] ############################## [18:24:53] Jared White(@jaredcwhite):@flajann2 @adambeynon It'd be cool if someone wrote a comprehensive article/tutorial on how to take CoffeeScript code and rewrite it in Opal. I never got into CoffeeScript so that someone isn't me, but I think CoffeeScript'ers are a great demographic for Opal adoption because many of them came from the Ruby/Rails world and they're already used to the idea of source-to-JS compilation. ---------------------------------------------------------------------------------------------------- [18:30:07] Adam Beynon(@adambeynon):@jaredcwhite yeah, I can see that. maybe worth looking into. I have drafted a backbone -> vienna style blog post as well a while ago ---------------------------------------------------------------------------------------------------- [18:30:22] Adam Beynon(@adambeynon):I guess foo.js -> opal style guides might be a nice section on the website ---------------------------------------------------------------------------------------------------- [22:09:25] Elia Schito(@elia):@adambeynon I'm seriously considering going back to `context.require_asset` for the processor, with a final `Opal.load('application')` ---------------------------------------------------------------------------------------------------- [22:09:47] Elia Schito(@elia):that would solve a ton of issues and difficulties ---------------------------------------------------------------------------------------------------- ############################## [2015-03-18] ############################## [23:25:21] Elia Schito(@elia):glad to be helpful ---------------------------------------------------------------------------------------------------- [07:16:16] Adam Beynon(@adambeynon):@elia morning! what issues? (I haven’t dived into the builder too much lately) ---------------------------------------------------------------------------------------------------- [08:56:36] Elia Schito(@elia):@adambeynon good morning! I always end up mixing and matching js coffee and opal, plus maybe erb etc. ---------------------------------------------------------------------------------------------------- [08:57:03] Elia Schito(@elia):also that would help in isolating sourcemaps per file, thus making them slower but more precise ---------------------------------------------------------------------------------------------------- [08:58:02] Elia Schito(@elia):@adambeynon that knowing that I could probably fix everything given enough time, which I don't have :smile_cat: ---------------------------------------------------------------------------------------------------- [08:59:50] Adam Beynon(@adambeynon):@elia time is the problem :D so, just to check, are you on about going back to a more standard sprockets based setup? and letting sprockets handle everything? ---------------------------------------------------------------------------------------------------- [09:02:07] Elia Schito(@elia):that's the idea, or let's say at least give chioce ---------------------------------------------------------------------------------------------------- [09:02:29] Elia Schito(@elia):it's surely easier than supporting every possible sprockets extension combination ---------------------------------------------------------------------------------------------------- [09:03:01] Elia Schito(@elia):would also be easier to understand for a sprockets user (con is the Opal.load part of course) ---------------------------------------------------------------------------------------------------- [09:04:23] Elia Schito(@elia):@adambeynon but for `Opal.load` I was thinking about overloading `javascripts_include_tag` to add Opal.load if Opal is defined and 'application' is a module ---------------------------------------------------------------------------------------------------- [09:05:29] Elia Schito(@elia):@adambeynon but I want to hear your opinion on this… ---------------------------------------------------------------------------------------------------- [09:05:34] Elia Schito(@elia):btw the source map fixing branch seem to work fine for serving them correctly, but the contents are still messed up ---------------------------------------------------------------------------------------------------- [09:18:03] Adam Beynon(@adambeynon):@elia for convenience, I think this is a good way to go. agreed with overriding the script tag as well. I do have some time tomorrow, so I can spend a couple of hours looking through the current code and seeing how things will pan out ---------------------------------------------------------------------------------------------------- [09:18:47] Elia Schito(@elia):@adambeynon thanks, I'll push my initial code to a branch then ---------------------------------------------------------------------------------------------------- [09:19:23] Elia Schito(@elia):I think this would also benefit caching, cc @ryanstout ---------------------------------------------------------------------------------------------------- [09:19:38] Adam Beynon(@adambeynon)::+1: yes, that’s true ---------------------------------------------------------------------------------------------------- [09:20:17] Adam Beynon(@adambeynon):@elia I went to the Bath Ruby conference on the weekend, and got some interesting feedback into people who have looked at opal before, and why/how the havent used it ---------------------------------------------------------------------------------------------------- [09:20:28] Adam Beynon(@adambeynon):it all comes down to some misconceptions about how it works ---------------------------------------------------------------------------------------------------- [09:20:36] Elia Schito(@elia):@adambeynon Also I think it can be done just in the processor without affecting the builder which can than be freed from some "sprockets" burden ---------------------------------------------------------------------------------------------------- [09:20:49] Adam Beynon(@adambeynon):so, I am going to focus some time clearing the docs up, to avoid this confusion ---------------------------------------------------------------------------------------------------- [09:21:05] Elia Schito(@elia):@adambeynon awesome™! ---------------------------------------------------------------------------------------------------- [09:21:51] Elia Schito(@elia):alas, marketing is fundamental, few will go beyond first impression and "discover reality" ---------------------------------------------------------------------------------------------------- [09:22:25] Elia Schito(@elia):@adambeynon so I saw a prev tweet of you mentioning stickers, ever printed any? ---------------------------------------------------------------------------------------------------- [09:26:58] Elia Schito(@elia):@adambeynon https://github.com/opal/opal/tree/elia/wip-back-to-sprockets ---------------------------------------------------------------------------------------------------- [09:27:19] Elia Schito(@elia):it's based on https://github.com/opal/opal/tree/elia/source-maps-fix, which is probably time to merge ---------------------------------------------------------------------------------------------------- [10:05:14] Adam Beynon(@adambeynon):@elia nope, not done any printing before ---------------------------------------------------------------------------------------------------- [10:06:10] Elia Schito(@elia):@adambeynon will be glad to send a bunch of them once they're viable (last batch was on paper instead of vinyl) ---------------------------------------------------------------------------------------------------- [10:07:51] Adam Beynon(@adambeynon):@elia sure! I will save some space on my new retina macbook for one ;) ---------------------------------------------------------------------------------------------------- [10:08:08] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [10:08:15] Elia Schito(@elia):13 or 15? ---------------------------------------------------------------------------------------------------- [10:08:41] Adam Beynon(@adambeynon):@elia my move from cordova -> WKWebView was going really well until WebSQL seems to be broken on WKWebView ---------------------------------------------------------------------------------------------------- [10:08:46] Adam Beynon(@adambeynon):@elia noooo, the NEW one ---------------------------------------------------------------------------------------------------- [10:08:47] Adam Beynon(@adambeynon):12 ---------------------------------------------------------------------------------------------------- [10:08:48] Adam Beynon(@adambeynon):http://www.apple.com/macbook/ ---------------------------------------------------------------------------------------------------- [10:09:03] Adam Beynon(@adambeynon):ultra portablz ---------------------------------------------------------------------------------------------------- [10:09:08] Elia Schito(@elia):@elia drops jaw ---------------------------------------------------------------------------------------------------- [10:09:36] Elia Schito(@elia):yeah watched the whole preso, already shipped? ---------------------------------------------------------------------------------------------------- [10:09:49] Elia Schito(@elia):@adambeynon is it good for development ---------------------------------------------------------------------------------------------------- [10:09:51] Elia Schito(@elia):? ---------------------------------------------------------------------------------------------------- [10:10:24] Adam Beynon(@adambeynon):April 10th I think, need to pre-order it. Im hoping the processor is ok for dev. I still run various rails stuff on the original macbook air, and thats fine ---------------------------------------------------------------------------------------------------- [10:10:33] Elia Schito(@elia):btw I got a 15 at new workplace but really a fan of 13" (or less) ---------------------------------------------------------------------------------------------------- [10:11:10] Adam Beynon(@adambeynon):ah I didn’t realise you moved work. Still ruby dev? ---------------------------------------------------------------------------------------------------- [10:11:17] Elia Schito(@elia):ok, know confess the color of choice :) ---------------------------------------------------------------------------------------------------- [10:11:29] Elia Schito(@elia):yes, still ruby, and more opal (thankfully) ---------------------------------------------------------------------------------------------------- [10:12:28] Adam Beynon(@adambeynon):woop! ---------------------------------------------------------------------------------------------------- [10:12:43] Elia Schito(@elia):@adambeynon ever tried leveldb & co instead of sql? (I didn't) ---------------------------------------------------------------------------------------------------- [10:12:44] Adam Beynon(@adambeynon):Im not brave enough for gold, going for a classic apple silver colour I think ---------------------------------------------------------------------------------------------------- [10:13:40] Elia Schito(@elia):heh, yeah, gold is for tough guys only… (or not? not sure here lol) ---------------------------------------------------------------------------------------------------- [12:26:27] Adam Beynon(@adambeynon):@elia I have been using optimised math operators in my app now since 0.7, I think we should enable it by default as discussed before ---------------------------------------------------------------------------------------------------- [12:26:34] Adam Beynon(@adambeynon):seems pretty sturdy ---------------------------------------------------------------------------------------------------- [12:57:13] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [12:57:54] Elia Schito(@elia):@adambeynon at this point I wonder if it still makes sense to stay on 0.7 instead of bumping version to 0.8… ---------------------------------------------------------------------------------------------------- [12:58:14] Elia Schito(@elia):enough stuff has been added already imo ---------------------------------------------------------------------------------------------------- [13:00:51] Adam Beynon(@adambeynon):@elia sounds good to me :ok_hand: ---------------------------------------------------------------------------------------------------- [13:53:36] Elia Schito(@elia):I'll push a 0-7-stable branch from the latest release, just in case ---------------------------------------------------------------------------------------------------- [14:04:22] Adam Beynon(@adambeynon):@elia okies. As we work on the changes for sprockets etc, I think it would be a good idea to keep checking opal-rspec works well with it. That is a huge pain with requires, so it might be easier than going back retrospectively to fix new issues ---------------------------------------------------------------------------------------------------- [14:04:56] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [20:15:59] Mitch VanDuyn(@catmando):Quick question (I hope)... I have a gem that I want to "opal-ize". I have tested the gem by copying its files to the javascript directory, as well as the test specs, and all is well. Is there a trick I can use to reference the "master" gem inside the "opal" gem? ---------------------------------------------------------------------------------------------------- [20:16:49] Mitch VanDuyn(@catmando):For now I am just copying the files over to the opal version, but long term obviously I don't want to do that! ---------------------------------------------------------------------------------------------------- [21:45:28] Mitch VanDuyn(@catmando):And actually if anybody wants to look, and see if did this right please do so: ---------------------------------------------------------------------------------------------------- [21:45:52] Mitch VanDuyn(@catmando):https://github.com/catprintlabs/opal-cannonbol ---------------------------------------------------------------------------------------------------- [21:46:53] Mitch VanDuyn(@catmando):It seems to work fine, but it also seems to be treating the files differently than the standard opal libraries. I am wondering if I am doing something wrong... I just stole the whole gem structure from opal-jquery... ---------------------------------------------------------------------------------------------------- [22:15:22] Elia Schito(@elia):@catmando struct seems right, you have any stacktrace or specific error? ---------------------------------------------------------------------------------------------------- [22:27:04] Kurtis Rainbolt-Greene(@krainboltgreene):Is there a good writeup on how to use third party js libraries inside opal? ---------------------------------------------------------------------------------------------------- [22:27:38] Kurtis Rainbolt-Greene(@krainboltgreene):Like, one function in javscript is function(FUNCTION, OPTIONS), but in Ruby that doesn't make sense as blocks are always the last argument.. ---------------------------------------------------------------------------------------------------- [22:27:53] Kurtis Rainbolt-Greene(@krainboltgreene):And it doesn't seem to work in reverse. ---------------------------------------------------------------------------------------------------- [22:30:23] Elia Schito(@elia):nope, but basically you have two strategies: bridging js classes (as opal-jquery does) or wrapping with Native(`jsObject`) ---------------------------------------------------------------------------------------------------- [22:34:00] Kurtis Rainbolt-Greene(@krainboltgreene):I see writing about using `expose` with other jquery plugins, but nothing so far on handling common js practices. ---------------------------------------------------------------------------------------------------- [22:34:36] Elia Schito(@elia):Opal::Browser is a great example of using native ---------------------------------------------------------------------------------------------------- [22:35:28] Elia Schito(@elia):@krainboltgreene https://duckduckgo.com/?q=opal+site:dev.mikamai.com&t=osx ---------------------------------------------------------------------------------------------------- [22:36:21] Kurtis Rainbolt-Greene(@krainboltgreene):Yeah, I've been reading that. ---------------------------------------------------------------------------------------------------- [22:39:07] Kurtis Rainbolt-Greene(@krainboltgreene):Okay, the opal-jquery has details on how to do HTTP requests, which has a similar arity to what I'm dealing with, but it seems like instead of passing a hash with functions (mirroring the js Object with functions) it's got a block, and then has setter properties. ---------------------------------------------------------------------------------------------------- [22:40:14] Kurtis Rainbolt-Greene(@krainboltgreene):Hmm not setters. ---------------------------------------------------------------------------------------------------- [22:47:28] Elia Schito(@elia):@krainboltgreene try with the Element#animate source, probably a better example iirc ---------------------------------------------------------------------------------------------------- [22:49:50] Kurtis Rainbolt-Greene(@krainboltgreene):Gotta say, the internal documentation for these projects is top notch. ---------------------------------------------------------------------------------------------------- [22:51:34] Kurtis Rainbolt-Greene(@krainboltgreene):Looks like jquery.terminal is just doing things wrong. ---------------------------------------------------------------------------------------------------- [22:51:46] Kurtis Rainbolt-Greene(@krainboltgreene):But I can use #animate to do my own thing. ---------------------------------------------------------------------------------------------------- [22:53:58] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Is there a way to see the ruby source of a method generated via expose? ---------------------------------------------------------------------------------------------------- [22:54:51] Elia Schito(@elia):expose uses the js function as is ---------------------------------------------------------------------------------------------------- [22:55:26] Elia Schito(@elia):so, say the function returns undefined it could give trouble ---------------------------------------------------------------------------------------------------- [22:59:10] Kurtis Rainbolt-Greene(@krainboltgreene):Woot! ---------------------------------------------------------------------------------------------------- [22:59:24] Kurtis Rainbolt-Greene(@krainboltgreene):It had something to do with the fact that I was using a Ruby hash. ---------------------------------------------------------------------------------------------------- [22:59:39] Kurtis Rainbolt-Greene(@krainboltgreene):As soon as I used `` to generate a JS Object the options were recognized. ---------------------------------------------------------------------------------------------------- [23:13:26] Kurtis Rainbolt-Greene(@krainboltgreene):Are there any Ruby native object to Javascript native object methods? ---------------------------------------------------------------------------------------------------- [23:14:06] Kurtis Rainbolt-Greene(@krainboltgreene):AKA: `{ "key" => "value" }.to_native == ```{ "key": "value" }```` ---------------------------------------------------------------------------------------------------- [23:14:41] Kurtis Rainbolt-Greene(@krainboltgreene)::| ---------------------------------------------------------------------------------------------------- [23:15:39] Elia Schito(@elia):require 'native' and #to_n ---------------------------------------------------------------------------------------------------- [23:15:48] Kurtis Rainbolt-Greene(@krainboltgreene):Awesome. ---------------------------------------------------------------------------------------------------- [23:15:55] Kurtis Rainbolt-Greene(@krainboltgreene):Thanks @elia. ---------------------------------------------------------------------------------------------------- ############################## [2015-03-19] ############################## [04:01:44] Mitch VanDuyn(@catmando):@elia re: opal-cannonbol, no errors, all tests pass. Its just seems like it is deliverying the code differently than say opal-jquery. opal-jquery comes down to the browser as a separate request, but opal-cannonbol seems to be bundled up inside the main app. ---------------------------------------------------------------------------------------------------- [04:22:44] Mitch VanDuyn(@catmando):@elia, I guess what I am not getting is what the difference is between what happens when you do a "rake release" on the cannonbol gem and the opal-cannonbol gem. Both directories look almost exactly the same, the only difference I can spot is the extra :dist rake task... does the release task somehow hook into this, to build the js file? How does this work (he said scratching his head, until he was bald :-) ---------------------------------------------------------------------------------------------------- [08:50:33] Elia Schito(@elia):@catmando `rake release` should be the vanilla gem building task from bundler (as in `bundle gem YOURNAME`) ---------------------------------------------------------------------------------------------------- [08:51:47] Elia Schito(@elia):@catmando can you explain how do you see they're different? (…browser requests, gem open, something else) seems something easily fixable anyway ---------------------------------------------------------------------------------------------------- [09:49:40] Elia Schito(@elia):@adambeynon I think I'm on the right way with requires and stuff ---------------------------------------------------------------------------------------------------- [09:50:53] Adam Beynon(@adambeynon):@elia nice! just checking out the commits now ---------------------------------------------------------------------------------------------------- [09:51:20] Elia Schito(@elia):right know I'm looking into opal-haml ---------------------------------------------------------------------------------------------------- [11:29:06] Elia Schito(@elia):@adambeynon I think it's done, just need to push the overridden javascript_include_tag to opal-rails ---------------------------------------------------------------------------------------------------- [11:29:23] Elia Schito(@elia):``` def javascript_include_tag(*sources) sources_copy = sources.dup.tap(&:extract_options!) sprockets = Rails.application.assets script_tags = super sources_copy.map do |source| loading_code = Opal::Processor.load_asset_code(sprockets, source) script_tags << javascript_tag(loading_code) end script_tags end ``` ---------------------------------------------------------------------------------------------------- [11:30:12] Elia Schito(@elia):_not sure why gitter messes up newlines :(_ ---------------------------------------------------------------------------------------------------- [11:49:04] Mitch VanDuyn(@catmando):@elia, Its NOT messing up! I just don't understand how it works. I see no dfference between a gem that runs the code on the server and a gem that runs the code in opal! The only differences I see is that opal is required in the gemspec (makes sense) and the rake file has this extra "dist" task. ---------------------------------------------------------------------------------------------------- [11:49:30] Mitch VanDuyn(@catmando):So how can the gem release process "know" to do the right thing with the code?? ---------------------------------------------------------------------------------------------------- [11:50:13] Elia Schito(@elia):@catmando I'll show you the trick in a moment… ---------------------------------------------------------------------------------------------------- [11:50:40] Elia Schito(@elia):https://github.com/opal/opal-jquery/blob/master/lib/opal/jquery.rb#L1 ---------------------------------------------------------------------------------------------------- [11:53:23] Mitch VanDuyn(@catmando):yeah i saw that, but i don't get it... let me look again... ---------------------------------------------------------------------------------------------------- [11:56:11] Mitch VanDuyn(@catmando):so basically let me get this: ---------------------------------------------------------------------------------------------------- [11:56:47] Mitch VanDuyn(@catmando):1) the gem puts all the files into the the gem package ---------------------------------------------------------------------------------------------------- [11:58:52] Mitch VanDuyn(@catmando):nah I don't get it at all. ---------------------------------------------------------------------------------------------------- [11:59:49] Mitch VanDuyn(@catmando):In one case the same files (in my case) are treated as normal files and run on the server, in the other case they become assets and served up... ---------------------------------------------------------------------------------------------------- [12:01:52] Adam Beynon(@adambeynon):@elia awesome! :metal: ---------------------------------------------------------------------------------------------------- [12:01:58] Mitch VanDuyn(@catmando):WAIT... so let me guess... there is NO difference, except that someplace some opal code does a "require opal-cannonbol", and that AUTOMAGICALLY grabs the right files, and compiles them ---------------------------------------------------------------------------------------------------- [12:02:13] Adam Beynon(@adambeynon):so for a static build, or non rails environment, we just need a manual Opal.load(‘application’) which does the bootstrapping? ---------------------------------------------------------------------------------------------------- [12:03:15] Elia Schito(@elia):@adambeynon yes, plus the mark_as_required when requiring unwrapped js files ---------------------------------------------------------------------------------------------------- [12:04:08] Elia Schito(@elia):(but corelib/runtime.js is already marked required) ---------------------------------------------------------------------------------------------------- [12:04:45] Elia Schito(@elia):@adambeynon also the Builder still works as before ---------------------------------------------------------------------------------------------------- [12:05:32] Elia Schito(@elia):@catmando the code I linked requires different files basing on the fact that it's inside opal or inside MRI ---------------------------------------------------------------------------------------------------- [12:06:29] Elia Schito(@elia):@catmando also Opal considers `if RUBY_ENGINE == 'opal'` in a special way, discarding the else part entirely ---------------------------------------------------------------------------------------------------- [12:07:39] Elia Schito(@elia):@adambeynon should we try rspec on it and merge? I think stubs still need to be forwarded to sprockets… ---------------------------------------------------------------------------------------------------- [12:08:05] Elia Schito(@elia):_lunchtime! :spaghetti:_ ---------------------------------------------------------------------------------------------------- [12:08:11] Mitch VanDuyn(@catmando):@elia, yes understood... that is the same code in my gem (stolen from this file in fact.) Understand that it includes different things depending... Just did not quite believe the magic that lets opal get the files compiled etc. just because they are there... I guess I would like to understand better! ---------------------------------------------------------------------------------------------------- [12:08:27] Mitch VanDuyn(@catmando):@elia... COFFEE TIME... sun just rose here :-) ---------------------------------------------------------------------------------------------------- [12:47:32] Elia Schito(@elia):@catmando whoa, what time exactly? ---------------------------------------------------------------------------------------------------- [12:48:37] Elia Schito(@elia):@catmando sorry if I restate stuff you know already, maybe the missing piece is that opal parses all require statements and precompiles all required files statically so they're ready for when they'll actually be required ---------------------------------------------------------------------------------------------------- [16:03:18] Mitch VanDuyn(@catmando):@elia, no problem. Here is what I am not understanding: ---------------------------------------------------------------------------------------------------- [16:10:21] Mitch VanDuyn(@catmando):I am not seeing how the following lines work ---------------------------------------------------------------------------------------------------- [16:10:25] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [16:10:46] Mitch VanDuyn(@catmando):if RUBY_ENGINE == 'opal' require 'opal/cannonbol/cannonbol' else require 'opal' require 'opal/cannonbol/version' Opal.append_path File.expand_path('../..', __FILE__).untaint end ---------------------------------------------------------------------------------------------------- [16:12:27] Elia Schito(@elia):if the ruby engine is opal it requires the code that should run in the browser ---------------------------------------------------------------------------------------------------- [16:13:12] Elia Schito(@elia):otherwise it will add the gem lib folder to the paths the opal compiler will look into (this happens in MRI/CRuby, not in the browser) ---------------------------------------------------------------------------------------------------- [16:13:29] Elia Schito(@elia):@catmando does it help? ---------------------------------------------------------------------------------------------------- [16:14:12] Mitch VanDuyn(@catmando):right, so when I do a require 'opal-cannonbol' in a .js.rb file in my assets folder, that is running with RUBY_ENGINE=='opal' correct? ---------------------------------------------------------------------------------------------------- [16:14:22] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [16:14:48] Mitch VanDuyn(@catmando):So here is what my other "non" opal file looks like: ---------------------------------------------------------------------------------------------------- [16:15:12] Mitch VanDuyn(@catmando):well it just has the ruby code in it, no require or anything ---------------------------------------------------------------------------------------------------- [16:15:27] Mitch VanDuyn(@catmando):so lets say instead of the above code, i just had: ---------------------------------------------------------------------------------------------------- [16:15:34] Mitch VanDuyn(@catmando):puts 'hello world' ---------------------------------------------------------------------------------------------------- [16:16:42] Mitch VanDuyn(@catmando):i.e. my whole gem just consists of 1 line: ---------------------------------------------------------------------------------------------------- [16:16:48] Mitch VanDuyn(@catmando):puts 'hello world' ---------------------------------------------------------------------------------------------------- [16:17:30] Mitch VanDuyn(@catmando):sorry, I am not being clear... I will have to make a simple test case ---------------------------------------------------------------------------------------------------- [16:17:53] Mitch VanDuyn(@catmando):but what I am not getting now is why if I just do a require 'some-gem' inside of foo.js.rb ---------------------------------------------------------------------------------------------------- [16:17:58] Mitch VanDuyn(@catmando):it doesn't seem to work ---------------------------------------------------------------------------------------------------- [16:18:34] Elia Schito(@elia):you need to require the gem in MRI first, to trigger the `append_path` part ---------------------------------------------------------------------------------------------------- [16:19:37] Mitch VanDuyn(@catmando):let me try hang on ---------------------------------------------------------------------------------------------------- [16:22:27] Mitch VanDuyn(@catmando):So is it possible to create a gem that will run both on the server and in opal? ---------------------------------------------------------------------------------------------------- [16:22:41] Elia Schito(@elia):sure ---------------------------------------------------------------------------------------------------- [16:23:10] Elia Schito(@elia):e.g. that's what volt does to some extent ---------------------------------------------------------------------------------------------------- [16:23:17] Mitch VanDuyn(@catmando):right ---------------------------------------------------------------------------------------------------- [16:23:58] Mitch VanDuyn(@catmando):so if I do this: ---------------------------------------------------------------------------------------------------- [16:24:36] Mitch VanDuyn(@catmando):if RUBY_ENGINE == 'opal' require 'opal/cannonbol/cannonbol' else require 'opal' require 'opal/cannonbol/version' require 'opal/cannonbol/cannonbol' # ADD THIS LINE ---------------------------------------------------------------------------------------------------- [16:24:51] Mitch VanDuyn(@catmando): Opal.append_path File.expand_path('../..', __FILE__).untaint end ---------------------------------------------------------------------------------------------------- [16:24:55] Mitch VanDuyn(@catmando):will that work? ---------------------------------------------------------------------------------------------------- [16:28:02] Elia Schito(@elia):yes ---------------------------------------------------------------------------------------------------- [16:28:06] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [23:09:49] Mitch VanDuyn(@catmando):@elia, thanks for all the help... In the end it was sooo easy. ---------------------------------------------------------------------------------------------------- [23:09:56] Mitch VanDuyn(@catmando):```ruby ---------------------------------------------------------------------------------------------------- [23:10:13] Mitch VanDuyn(@catmando):```rubyrequire_relative 'cannonbol/cannonbol' require_relative 'cannonbol/version' unless RUBY_ENGINE == 'opal' begin require 'opal' Opal.append_path File.expand_path('..', __FILE__).untaint rescue LoadError end end ---------------------------------------------------------------------------------------------------- [23:12:30] Mitch VanDuyn(@catmando):```ruby ---------------------------------------------------------------------------------------------------- [23:12:31] Elia Schito(@elia):@catmando simple questions can be very hard to answer at times :) ---------------------------------------------------------------------------------------------------- [23:12:55] Mitch VanDuyn(@catmando):yes like typing markdown into this chat window :-) ---------------------------------------------------------------------------------------------------- [23:13:06] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [23:13:42] Mitch VanDuyn(@catmando):anyway if you like I will update the docs someplace appropriate, as its a good usecase (i.e. a gem that runs fine on both server or browser) ---------------------------------------------------------------------------------------------------- [23:14:16] Elia Schito(@elia):@catmando that would be awesome :sparkles: ---------------------------------------------------------------------------------------------------- [23:35:21] Mitch VanDuyn(@catmando):Do you think it makes sense to create a section on the opalrb.org docs at the end called "Configuring gems to run in opal" ? ---------------------------------------------------------------------------------------------------- [23:36:08] Elia Schito(@elia):@catmando yes, opalrb really needs those kinds of docs ---------------------------------------------------------------------------------------------------- [23:36:48] Mitch VanDuyn(@catmando):Okay will do... it should just be a quick page or so. ---------------------------------------------------------------------------------------------------- ############################## [2015-03-20] ############################## [16:46:17] Elia Schito(@elia):kept the PR on hold until I'll finish, but you can try the `elia/wip-back-to-sprockets` on both opal and opal-rails ---------------------------------------------------------------------------------------------------- [19:23:21] Forrest Chang(@fkchang):@catmando I submitted 2 talks that are opal related to goruco ---------------------------------------------------------------------------------------------------- [19:24:41] Mitch VanDuyn(@catmando):@fkchang ahhh! what were your subjects? ---------------------------------------------------------------------------------------------------- [19:44:45] CJ Lazell(@cj):Afternoon. Using https://github.com/opal/opal/blob/master/lib/opal/compiler.rb is there anyway to append_path? like you do with Opal::Sprockets ---------------------------------------------------------------------------------------------------- [19:57:26] CJ Lazell(@cj):I guess this works https://gist.github.com/71879f2d0d6a3971c60b ---------------------------------------------------------------------------------------------------- [21:02:08] Forrest Chang(@fkchang):@catmando one was "Game NOT over!" where I'll talk about opal and jubilee/vert.x allowing people to do things in ruby that they have been leaving ruby to do and the other was about how my browser code is better in Ruby than in JS and why ---------------------------------------------------------------------------------------------------- [21:16:54] Mitch VanDuyn(@catmando):Sounds like great talks... ---------------------------------------------------------------------------------------------------- [21:17:15] Mitch VanDuyn(@catmando):Do you want me to tell them to remove my talk in favor of yours? ---------------------------------------------------------------------------------------------------- [21:17:38] Mitch VanDuyn(@catmando):I don't care as long as Opal gets promoted! ---------------------------------------------------------------------------------------------------- [23:00:38] Forrest Chang(@fkchang):@catmando Submit yours, no telling who gets picked ---------------------------------------------------------------------------------------------------- [00:30:02] Elia Schito(@elia):@fkchang ---------------------------------------------------------------------------------------------------- [00:31:11] Forrest Chang(@fkchang):@elia here now ---------------------------------------------------------------------------------------------------- [00:32:25] Forrest Chang(@fkchang):besides the other things I was discussing, also want to fix the error that if you have syntax error in an opal-rspec file, that the test runs red. My guess is that opal doesn't compile the file, so the spec runner doesn't run it. ---------------------------------------------------------------------------------------------------- [00:32:53] Forrest Chang(@fkchang):Now that I described it, I guess I could check that compiled files match spec files, but not certain if I can catch the compile error ---------------------------------------------------------------------------------------------------- [12:02:53] Mitch VanDuyn(@catmando):@elia, that doc page is in a pull request I just made... ---------------------------------------------------------------------------------------------------- [12:26:41] Adam Beynon(@adambeynon):@catmando looks great! I will have a read over it at lunch, but looks good skimming through ---------------------------------------------------------------------------------------------------- [14:38:19] Elia Schito(@elia):@adambeynon @catmando merged :+1: ---------------------------------------------------------------------------------------------------- [14:40:55] Elia Schito(@elia):@adambeynon crazy react experiment: https://gist.github.com/elia/fad23026831a817e3526 / https://github.com/zetachang/react.rb/issues/13 ---------------------------------------------------------------------------------------------------- [15:26:43] Mitch VanDuyn(@catmando):ALL: I am thinking of presenting our use of Opal on our website at Goruco (NYC ruby conf.) I don't want to overlap if anybody has already submitted a talk on Opal... ---------------------------------------------------------------------------------------------------- [15:31:40] Mitch VanDuyn(@catmando):But I am figuring no, since a lot of folks are not close to NYC :-) ---------------------------------------------------------------------------------------------------- [15:32:33] Elia Schito(@elia):I'm quite sure I won't make it :P ---------------------------------------------------------------------------------------------------- [15:35:35] Mitch VanDuyn(@catmando):Well then if nobody has an objection, I will submit a proposal anyway. I am sure its pretty competitive to get in, so wish me luck :-) ---------------------------------------------------------------------------------------------------- [15:45:00] Mitch VanDuyn(@catmando):Okay, here is my draft of talk, please let me know if this sounds appealing, as I think it will help Opal's visibility, if I can get accepted as a speaker. (its a 30 minute talk) ---------------------------------------------------------------------------------------------------- [15:45:32] Mitch VanDuyn(@catmando):Opal is a Ruby to Javascript compiler that is rapidly maturing. We have about 1 million lines of code running our website and manufacturing backend. The code is all ruby with the exception of Javascript. Opal opens a path to making our code base 100% pure ruby with the obvious benefits of having a single development language. This talk will give a brief overview of Opal, and its current status, and then will focus on our experience using Opal in a production environment, with emphasis on doing an evolutionary transition. ---------------------------------------------------------------------------------------------------- [15:46:07] Mitch VanDuyn(@catmando):. ---------------------------------------------------------------------------------------------------- [15:46:12] Mitch VanDuyn(@catmando):. ---------------------------------------------------------------------------------------------------- [15:59:03] Elia Schito(@elia):@catmando I think that seeing someone using it in production will make people more comfortable in trying it in they're own projects :+1: ---------------------------------------------------------------------------------------------------- [16:16:12] Mitch VanDuyn(@catmando):good... I am so appreciative of the teams work on Opal. ---------------------------------------------------------------------------------------------------- [16:17:55] Mitch VanDuyn(@catmando):I found it to be almost flawless. I found just a few issues with pretty obscure stuff, and the source mapping is rough. However the ability to use rspec and TDD makes up for that. ---------------------------------------------------------------------------------------------------- [16:19:18] Mitch VanDuyn(@catmando):It might be good to have some kind of gist collection of real world classes etc. I have a couple that are not quite ready to be gems, but might make useful examples. ---------------------------------------------------------------------------------------------------- [16:20:59] Mitch VanDuyn(@catmando):The Cannonbol gem I just released runs on opal with just a couple of changes (all documented as issues), and it does some heavy duty meta programming. I was really impressed. ---------------------------------------------------------------------------------------------------- [16:30:29] Elia Schito(@elia):great to hear that, also good source mapping is on its way back to opal ---------------------------------------------------------------------------------------------------- [16:44:57] Mitch VanDuyn(@catmando):Yeah I did a pull requests with some basic fixes, but I think its waiting for me to go back and do a bit more work, or perhaps somebody else is working the issue. ---------------------------------------------------------------------------------------------------- [16:45:19] Elia Schito(@elia)::) I am ---------------------------------------------------------------------------------------------------- ############################## [2015-03-21] ############################## [00:02:37] Elia Schito(@elia):@fkchang @catmando :+1: the more proposals the better ---------------------------------------------------------------------------------------------------- [23:03:54] Kurtis Rainbolt-Greene(@krainboltgreene):@adambeynon: Hey, I'd like to improve vienna. What are some of the sore points? ---------------------------------------------------------------------------------------------------- ############################## [2015-03-23] ############################## [04:53:25] Kurtis Rainbolt-Greene(@krainboltgreene):Would there be a way for opal to check gems for metadata in a gemspec to see if it's compatible with opal.rb? ---------------------------------------------------------------------------------------------------- [04:54:06] Kurtis Rainbolt-Greene(@krainboltgreene):That way gem owners can mark their gem as opal-compatible. ---------------------------------------------------------------------------------------------------- [09:16:27] Elia Schito(@elia):@adambeynon I think the back-to-sprockets branch is good (both for opal and opal-rails, which implies opal-rspec) ---------------------------------------------------------------------------------------------------- [09:21:48] Adam Beynon(@adambeynon):@elia nice one! So opal-rails overrides the script tag helper? ---------------------------------------------------------------------------------------------------- [09:22:38] Elia Schito(@elia):yep, but the code loading generation is delegated to Processor so it should be easy to use the code elsewhere (sinatra etc) ---------------------------------------------------------------------------------------------------- [09:22:45] Elia Schito(@elia):@adambeynon ---------------------------------------------------------------------------------------------------- [09:23:08] Adam Beynon(@adambeynon):@elia ah, thats good. Does it fix the sourcemaps issues, or shall I take a look at that? ---------------------------------------------------------------------------------------------------- [09:23:41] Elia Schito(@elia):They seem to be fixed, apprently having clear boundaries between files helps a lot ---------------------------------------------------------------------------------------------------- [09:24:15] Elia Schito(@elia):@adambeynon I guess we'll just wait for sprockets 4 to get them merged into a single map ---------------------------------------------------------------------------------------------------- [09:24:54] Elia Schito(@elia):right now was about to give a try to the sprockets 3 beta10 (quasi rc1) ---------------------------------------------------------------------------------------------------- [09:25:06] Adam Beynon(@adambeynon):@elia ahhh I see. Yeah, working closer with sprockets on that should make it a bit more robust. I figure they will be pouring lots of work into it for es6 and coffeescript support ---------------------------------------------------------------------------------------------------- [09:25:41] Elia Schito(@elia):@adambeynon yep, who needs to ewinvent the wheel after all :) ---------------------------------------------------------------------------------------------------- [09:27:54] Adam Beynon(@adambeynon):@elia ha, yeap ---------------------------------------------------------------------------------------------------- [09:27:56] Adam Beynon(@adambeynon):@elia https://github.com/opal/opal-rails/pull/40/files ---------------------------------------------------------------------------------------------------- [09:28:04] Adam Beynon(@adambeynon):I can’t see where you override the script helper? ---------------------------------------------------------------------------------------------------- [09:28:10] Adam Beynon(@adambeynon):am I just being blind? ---------------------------------------------------------------------------------------------------- [09:28:26] Elia Schito(@elia):never opened a PR, and even called the branch WIP ---------------------------------------------------------------------------------------------------- [09:28:33] Adam Beynon(@adambeynon):ohhhhhh ---------------------------------------------------------------------------------------------------- [09:28:48] Adam Beynon(@adambeynon):right, makes sense ---------------------------------------------------------------------------------------------------- [09:29:35] Elia Schito(@elia):https://github.com/opal/opal-rails/pull/43 ---------------------------------------------------------------------------------------------------- [09:31:32] Elia Schito(@elia):@adambeynon https://github.com/opal/opal/pull/773 ---------------------------------------------------------------------------------------------------- [09:36:04] Adam Beynon(@adambeynon):@elia :metal: fantastic! ---------------------------------------------------------------------------------------------------- [09:36:22] Adam Beynon(@adambeynon):it all looks good to me, so merge it :+1: ---------------------------------------------------------------------------------------------------- [09:36:52] Adam Beynon(@adambeynon):@elia Im going to merge in the template variables pull request as well later, makes templating a lot more convenient ---------------------------------------------------------------------------------------------------- [09:37:02] Elia Schito(@elia):@adambeynon let's rock then! :) ---------------------------------------------------------------------------------------------------- [09:43:14] Elia Schito(@elia):@adambeynon both merged 🎉 ---------------------------------------------------------------------------------------------------- [09:53:56] Adam Beynon(@adambeynon):@elia :clap: woop! Going to upgrade to this today I hope, was really missing the source maps ---------------------------------------------------------------------------------------------------- [09:54:14] Adam Beynon(@adambeynon):@elia Do you think 0.8 is close? there are some good changes since 0.7 ---------------------------------------------------------------------------------------------------- [09:54:26] Elia Schito(@elia):I do ---------------------------------------------------------------------------------------------------- [09:54:58] Elia Schito(@elia):@adambeynon we'll have to do the usual round up for open issues first tho ---------------------------------------------------------------------------------------------------- [09:55:27] Elia Schito(@elia):especially those marked 0.8, probably pushing them to next release ---------------------------------------------------------------------------------------------------- [09:55:51] Adam Beynon(@adambeynon):@elia yeap. Just working on some last minute code here, but I will take a good look later today at what is open atm, and give the new sprockets stuff a thorough testing. ---------------------------------------------------------------------------------------------------- [09:56:06] Adam Beynon(@adambeynon):and opal-rspec, to ensure that still works ok ---------------------------------------------------------------------------------------------------- [09:56:09] Elia Schito(@elia):@adambeynon :+1: ---------------------------------------------------------------------------------------------------- [17:56:13] Can Edremitoglu(@cantonic):hmm… I just upgraded opal and opal-rails to the latest master version and now I keep getting `Uncaught TypeError: Cannot set property '$$p' of undefined` for a file which only contains a simple `alert` function ---------------------------------------------------------------------------------------------------- [17:58:02] Elia Schito(@elia):Try deleting tmp/cache/assets and restart the app (and spring) ---------------------------------------------------------------------------------------------------- [17:58:10] Can Edremitoglu(@cantonic):alright… turns out that I have to change Sprocket’s `//= require` statements in application.js.rb to Ruby's ---------------------------------------------------------------------------------------------------- [17:58:44] Can Edremitoglu(@cantonic):@elia ok. let me revert the changes to application.js.rb and try your suggestion to make sure ---------------------------------------------------------------------------------------------------- [17:59:27] Elia Schito(@elia):please paste the broken code so that I know how to fix it in case someone else gets the error ---------------------------------------------------------------------------------------------------- [18:00:35] Can Edremitoglu(@cantonic):@elia the broken code is a simple `alert “foo”` ---------------------------------------------------------------------------------------------------- [18:01:12] Can Edremitoglu(@cantonic):I know changed my application.js.rb back to application.js and used Sprocket’s require statements: broken ---------------------------------------------------------------------------------------------------- [18:01:25] Can Edremitoglu(@cantonic):I will create a github issue explaining it further if you want ---------------------------------------------------------------------------------------------------- [18:01:37] Adam Beynon(@adambeynon):@cantonic If you comment out that line, does it then work? ---------------------------------------------------------------------------------------------------- [18:02:02] Adam Beynon(@adambeynon):do you define alert() ? ---------------------------------------------------------------------------------------------------- [18:02:12] Adam Beynon(@adambeynon):(might be a Native issue, for example) ---------------------------------------------------------------------------------------------------- [18:02:29] Can Edremitoglu(@cantonic):@adambeynon when commenting it out the error is gone, but the same errors happens for any kind of code. ---------------------------------------------------------------------------------------------------- [18:02:49] Can Edremitoglu(@cantonic):I also get a `WARNING: LoadError: cannot load such file -- application` from `runtime.js` ---------------------------------------------------------------------------------------------------- [18:04:22] Can Edremitoglu(@cantonic):now i am renaming application.js to application.js.rb ---------------------------------------------------------------------------------------------------- [18:04:29] Can Edremitoglu(@cantonic):one sec ---------------------------------------------------------------------------------------------------- [18:04:38] Adam Beynon(@adambeynon):@cantonic are you running pow? or anything similar? After such big changes to Opal, I often need to clear the asset cache, as per @elia suggestion, but I also need to restart the server (touch tmp/restart.txt for pow) ---------------------------------------------------------------------------------------------------- [18:06:08] Can Edremitoglu(@cantonic):after renaming to application.js.rb the WARNING is gone, but `Uncaught TypeError: Cannot set property '$$p' of undefined` is still there (application.js.rb uses Sprocket’s //= require statements) ---------------------------------------------------------------------------------------------------- [18:06:29] Can Edremitoglu(@cantonic):@adambeynon i don’t use pow and already cleared the assets directory ---------------------------------------------------------------------------------------------------- [18:07:40] Can Edremitoglu(@cantonic):now i am changing Sprocket’s //= require methods to Ruby’s require methods in application.js.rb ---------------------------------------------------------------------------------------------------- [18:08:27] Can Edremitoglu(@cantonic):works now ---------------------------------------------------------------------------------------------------- [18:08:51] Can Edremitoglu(@cantonic):looks like it is now required to change application.js to application.js.rb and use ruby’s require methods instead of sprocket’s. ---------------------------------------------------------------------------------------------------- [18:09:06] Can Edremitoglu(@cantonic):we should update the README accordingly if this is the way it works now ---------------------------------------------------------------------------------------------------- [18:09:25] Adam Beynon(@adambeynon):hmm, that is odd ---------------------------------------------------------------------------------------------------- [18:10:11] Adam Beynon(@adambeynon):@cantonic I was going to update an app to latest opal master this evening, so I will have a look to see if I run into the same issue ---------------------------------------------------------------------------------------------------- [18:10:41] Adam Beynon(@adambeynon):I don’t quite understand why its breaking for you - we have moved back to a more basic integration with sprockets - should have made the bridge smaller ---------------------------------------------------------------------------------------------------- [18:10:48] Adam Beynon(@adambeynon):anyway, I will have a look on my app this side ---------------------------------------------------------------------------------------------------- [18:13:04] Can Edremitoglu(@cantonic):@adambeynon thank you. if you are using Ruby’s require methods in your app, try to change them to the Sprocket’s `//= require` in order to reproduce my error ---------------------------------------------------------------------------------------------------- [18:13:47] Adam Beynon(@adambeynon):@cantonic will do :+1: ---------------------------------------------------------------------------------------------------- [18:18:59] Elia Schito(@elia):@cantonic does it change anything if you switch sprockets requires from //= to #= ? ---------------------------------------------------------------------------------------------------- [18:21:32] Can Edremitoglu(@cantonic):will try ---------------------------------------------------------------------------------------------------- [20:31:20] Can Edremitoglu(@cantonic):@elia same error with `#=` ---------------------------------------------------------------------------------------------------- [20:31:28] Elia Schito(@elia):good to know ---------------------------------------------------------------------------------------------------- [22:41:02] Elia Schito(@elia):@cantonic can you paste the contents? I can't reproduce… ---------------------------------------------------------------------------------------------------- ############################## [2015-03-24] ############################## [18:13:37] Elia Schito(@elia):@cj yes sprockets on master seem to work fine, it's a rails app? ---------------------------------------------------------------------------------------------------- [18:15:43] CJ Lazell(@cj):@elia it's not, it's roda https://gist.github.com/cj/d18b3424685c4510fefa ---------------------------------------------------------------------------------------------------- [18:17:26] Elia Schito(@elia):Ok so in addition to retrieving an asset from sprockets you need to bootstrap it ---------------------------------------------------------------------------------------------------- [18:18:17] Elia Schito(@elia):@cj have a look at the opal_helper in Opal-rails master ---------------------------------------------------------------------------------------------------- [18:18:46] CJ Lazell(@cj):@elia so build.source_map in master won't have the correct mappings? ---------------------------------------------------------------------------------------------------- [18:21:02] Elia Schito(@elia):It has the same broken mapping it had before ---------------------------------------------------------------------------------------------------- [18:23:35] CJ Lazell(@cj):@elia so this example is broken too? https://github.com/opal/opal/blob/master/examples/sinatra/config.ru ---------------------------------------------------------------------------------------------------- [18:25:08] Elia Schito(@elia):Possibly, the merge is pretty recent and the examples are the first being left behind ---------------------------------------------------------------------------------------------------- [18:26:25] Elia Schito(@elia):Try looking at Opal-rails engine.rb to have an example on how to integrate in rack ---------------------------------------------------------------------------------------------------- [18:31:48] CJ Lazell(@cj):@elia man this is a lot more complicated that I thought lol... I'll take a look and try to make a basic rack example ---------------------------------------------------------------------------------------------------- [18:43:14] Elia Schito(@elia):I'm on mobile other wise I'd be more precise sorry ---------------------------------------------------------------------------------------------------- [18:43:53] Elia Schito(@elia):search the file for "rout" as in routing ---------------------------------------------------------------------------------------------------- [18:44:18] Elia Schito(@elia):thats the part regarding rack ---------------------------------------------------------------------------------------------------- [18:54:02] CJ Lazell(@cj):@elia no worries, thank you for all your help ---------------------------------------------------------------------------------------------------- [17:19:41] CJ Lazell(@cj):afternoon, is there anyway to do this? Opal::Builder.build(path, { source_map: true}) ? ---------------------------------------------------------------------------------------------------- [17:21:37] CJ Lazell(@cj):well Opal::Builder.build(path, { debug: true, source_map: true}) ? ---------------------------------------------------------------------------------------------------- [17:25:45] Elia Schito(@elia):@cj `Opal::Builder.new(…).source_map` https://github.com/opal/opal/blob/1e7559a6f641472c0bb8c98ee5984d9deebea59d/lib/opal/builder.rb#L56-L58 ---------------------------------------------------------------------------------------------------- [17:25:49] Elia Schito(@elia):it's always on ---------------------------------------------------------------------------------------------------- [17:26:25] Elia Schito(@elia):but not very reliable (there's an issue with the concatenation of multiple maps) ---------------------------------------------------------------------------------------------------- [17:27:10] Ryan Stout(@ryanstout):@elia how are you? ---------------------------------------------------------------------------------------------------- [17:30:10] Elia Schito(@elia):bit tired, as usual, but good :) ---------------------------------------------------------------------------------------------------- [17:30:26] Elia Schito(@elia):@ryanstout you fine? how the conf? ---------------------------------------------------------------------------------------------------- [17:30:45] Ryan Stout(@ryanstout):@elia it was good, too bad you couldn't make it :-) ---------------------------------------------------------------------------------------------------- [17:31:11] Ryan Stout(@ryanstout):@elia sorry I haven't had time to help with the sourcemap stuff, I'm hoping to find some more time to test soon. Did I see you are switching back to sprockets? ---------------------------------------------------------------------------------------------------- [17:32:55] CJ Lazell(@cj):@elia thank you for the response... I know how to get the source map code, I just wanted the generated javascript to append the #map stuff to the end i.e. when you do Opal::Server.new { |s| s.debug = true; s.source_map = true} ---------------------------------------------------------------------------------------------------- [17:37:30] CJ Lazell(@cj):I guess that's just a thing from opal server... I can just append the source_maps code to the end of the javascript code I guess ---------------------------------------------------------------------------------------------------- [17:52:05] CJ Lazell(@cj):@elia why when I use mappings do I get this error http://i.imgur.com/N9pcZZJ.png ? If I don't include the .map the js doesn't throw an error ---------------------------------------------------------------------------------------------------- [18:08:15] CJ Lazell(@cj):nm, I have it working now :) thank you again ---------------------------------------------------------------------------------------------------- [18:08:50] Elia Schito(@elia):About the map magic comment the builder doesn't know how you'll serve the map so it cant know its path ---------------------------------------------------------------------------------------------------- [18:11:07] Elia Schito(@elia):Anyway maps with builder are kinda broken due to concatenation, the issues should be solved in master ---------------------------------------------------------------------------------------------------- [18:11:21] Elia Schito(@elia):if you're using sprockets ---------------------------------------------------------------------------------------------------- [18:12:39] Elia Schito(@elia):@ryanstout not coming was the right decision after all as we had to bring the baby to the hospital that Sunday ---------------------------------------------------------------------------------------------------- [18:12:42] CJ Lazell(@cj):@elia so I'd have to be using sprockets for maps to be 100%? ---------------------------------------------------------------------------------------------------- [18:12:49] Elia Schito(@elia):(she's ok now) ---------------------------------------------------------------------------------------------------- [18:13:15] Ryan Stout(@ryanstout):@elia sorry to hear that. Glad to hear everything is ok. ---------------------------------------------------------------------------------------------------- ############################## [2015-03-25] ############################## [14:04:01] Can Edremitoglu(@cantonic):@elia sorry for my very late reply regarding the application.js.rb: changing `//= require` to `#= require` works, but I get some warnings like `WARNING: LoadError: cannot load such file -- grade_level_classes_new` (grade_level_classes_new.js is a javascript file which is not required in application.js.rb but loaded separately) ---------------------------------------------------------------------------------------------------- [14:06:55] Elia Schito(@elia):> but loaded separately how? ---------------------------------------------------------------------------------------------------- [15:11:24] Can Edremitoglu(@cantonic):@elia we are having a javascript_include_tag for the application.js.rb and another one for controller specific js files. ---------------------------------------------------------------------------------------------------- [15:12:03] Can Edremitoglu(@cantonic):since we don’t want to load controller specific assets in all pages, we don’t require it in application.js. Instead we have an additional javasceript_include_tag for it ---------------------------------------------------------------------------------------------------- [15:13:03] Elia Schito(@elia):@cantonic and the error comes from which include tag? ---------------------------------------------------------------------------------------------------- [15:13:53] Can Edremitoglu(@cantonic):from the controller specific one in this case ---------------------------------------------------------------------------------------------------- [15:13:59] Can Edremitoglu(@cantonic):but the files are working fine ---------------------------------------------------------------------------------------------------- [15:14:07] Can Edremitoglu(@cantonic):I just get the warning message i posted above ---------------------------------------------------------------------------------------------------- [15:14:19] Can Edremitoglu(@cantonic):it says it cannot load the file but it can ---------------------------------------------------------------------------------------------------- [15:14:45] Can Edremitoglu(@cantonic):@elia Do you want me to set up a rails application and push it on github in order to help you to reproduce it? ---------------------------------------------------------------------------------------------------- [15:15:11] Elia Schito(@elia):would be much easier that way ---------------------------------------------------------------------------------------------------- [15:15:16] Elia Schito(@elia):@cantonic thanks ---------------------------------------------------------------------------------------------------- [15:21:12] Can Edremitoglu(@cantonic):alright ---------------------------------------------------------------------------------------------------- [17:06:43] Can Edremitoglu(@cantonic):@elia https://github.com/cantonic/opal_demo ---------------------------------------------------------------------------------------------------- [17:06:59] Can Edremitoglu(@cantonic):i have created different branches for testing different combinations. see the README ---------------------------------------------------------------------------------------------------- [17:07:52] Can Edremitoglu(@cantonic):especially variant5 is interesting for you i guess ---------------------------------------------------------------------------------------------------- [17:10:22] Elia Schito(@elia):@cantonic thanks will have a look as soon as I can ---------------------------------------------------------------------------------------------------- [23:19:08] Elia Schito(@elia):@cantonic (checked master so far) the problem is the following: if you use application as a manifest (i.e. plain js with a list of requires) you are responsible for loading opal code ---------------------------------------------------------------------------------------------------- [23:19:39] Elia Schito(@elia):with `Opal.load('opal'); Opal.load('home_view')` ---------------------------------------------------------------------------------------------------- [23:24:20] Elia Schito(@elia):@cantonic variant1 should be fixed on master (`AssetFilteredError`) ---------------------------------------------------------------------------------------------------- ############################## [2015-03-26] ############################## [11:35:18] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: It seems like a lot of the opal projects have pretty weird dependencies. ---------------------------------------------------------------------------------------------------- [11:35:39] Elia Schito(@elia):what do you mean? ---------------------------------------------------------------------------------------------------- [11:36:05] Elia Schito(@elia):@krainboltgreene ^ ---------------------------------------------------------------------------------------------------- [11:45:48] Kurtis Rainbolt-Greene(@krainboltgreene):Like, why does opal/opal need tilt? ---------------------------------------------------------------------------------------------------- [11:46:33] Adam Beynon(@adambeynon):@krainboltgreene I think Sprockets depends on it ---------------------------------------------------------------------------------------------------- [11:46:56] Adam Beynon(@adambeynon):and Opal uses sprockets for easier building with rails/sinatra/other-rack-framework ---------------------------------------------------------------------------------------------------- [11:47:37] Kurtis Rainbolt-Greene(@krainboltgreene):It's specified as an explicit dependency in opal, but yes sprockets does apparently explicitly require tilt. Weird. ---------------------------------------------------------------------------------------------------- [11:48:54] Kurtis Rainbolt-Greene(@krainboltgreene):And opal/opal-browser has paggio as an explicit dependency. ---------------------------------------------------------------------------------------------------- [11:50:07] Adam Beynon(@adambeynon):That I do find strange. Pagio relies on opal-browser, but Im not sure why the dependencies are that way around ---------------------------------------------------------------------------------------------------- [11:51:26] Kurtis Rainbolt-Greene(@krainboltgreene):It also looks like I was seeing a "lot" of weird dependencies because of middleman. Somehow my eyes missed the divide. ---------------------------------------------------------------------------------------------------- [11:56:49] Kurtis Rainbolt-Greene(@krainboltgreene):What's you all's prefered way to handle stand alone opal apps? I tried jekyll, with a pure opal thing, and now attempting middleman for this vienna. ---------------------------------------------------------------------------------------------------- [11:58:19] Elia Schito(@elia):@krainboltgreene @adambeynon tilt is there because it's going to be removed from deps in sprockets 3, the same goes with hike ---------------------------------------------------------------------------------------------------- [11:59:00] Elia Schito(@elia):that's the reason for keeping them explicit, because we're using them directly and don't want to break when sprockets 3 will be out (soon) ---------------------------------------------------------------------------------------------------- [11:59:03] Kurtis Rainbolt-Greene(@krainboltgreene):Ahhh. ---------------------------------------------------------------------------------------------------- [12:22:24] Kurtis Rainbolt-Greene(@krainboltgreene):Bleh, gave up middleman. Stasis uses an old version of tilt. Nanoc uses a directory called "lib". ---------------------------------------------------------------------------------------------------- [12:34:33] Adam Beynon(@adambeynon):@krainboltgreene We use middleman + opal for the website, opalrb.org ---------------------------------------------------------------------------------------------------- [12:34:46] Adam Beynon(@adambeynon):I think they have a sprockets plugin which we just tag onto ---------------------------------------------------------------------------------------------------- [16:38:11] Elia Schito(@elia):@adambeynon so you haven't been interviewed at bath ruby… :D https://www.youtube.com/watch?v=Em49QAJF-7Q ---------------------------------------------------------------------------------------------------- [18:03:57] George Plymale II(@ylluminarious):hey everyone, i was using 0.7.1 on a project of mine and it looks like something went wrong with loading some files. i was attempting to load files in the following way (which was working fine when i used 0.6.3): ``` require './file1' require './file2' require './file3' ``` i got an error that said: `Error: Opal::Builder::MissingRequire: A file required by "main" wasn't found.` and then it had a bunch of other information after it that said where it was getting messed up in requiring the files. i scratched my head for a bit after i saw this and then i decided to switch back to 0.6.3 and the error disappeared. i figured i should let you folks know about this in case someone accidentally broke something in 0.7.1 ---------------------------------------------------------------------------------------------------- [19:48:13] Kurtis Rainbolt-Greene(@krainboltgreene):@elia So with the availability of opal-react and my copy of React.js Native, I guess I can do ruby development on iPhone ;) ---------------------------------------------------------------------------------------------------- [19:49:08] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [21:12:10] George Plymale II(@ylluminarious):@elia concerning that problem that i reported above earlier: https://github.com/opal/opal/issues/778 ---------------------------------------------------------------------------------------------------- ############################## [2015-03-27] ############################## [15:48:49] Elia Schito(@elia):otherwise we could try to detect if they're used in the view ---------------------------------------------------------------------------------------------------- [15:49:02] Elia Schito(@elia):hackish but probably do-able ---------------------------------------------------------------------------------------------------- [15:49:33] Elia Schito(@elia):last option–which i don't like– would be to make it a config flag ---------------------------------------------------------------------------------------------------- [15:57:45] Can Edremitoglu(@cantonic):@elia I like the first solution. saves resources, even though one could expect view templates to have access to ivars since they are also available in html or js.erb template views. ---------------------------------------------------------------------------------------------------- [15:57:59] Can Edremitoglu(@cantonic):@elia hey, what about .js.opal.erb? :D ---------------------------------------------------------------------------------------------------- [15:58:34] Elia Schito(@elia):> .js.opal.erb what do you mean? ---------------------------------------------------------------------------------------------------- [15:59:36] Elia Schito(@elia):for the first solution the only problem would be detecting locals, but probably if locals are set we can trust it's done intentionally ---------------------------------------------------------------------------------------------------- [16:00:25] Elia Schito(@elia):@cantonic can you open an issue on opal-rails as a reminder for this change? feel free to copy/paste the whole transcript :) ---------------------------------------------------------------------------------------------------- [16:01:32] Can Edremitoglu(@cantonic):@elia js.opal.erb was meant as a joke so you could do `Element[“#file_<%= @file.id %>”]` for example :) ---------------------------------------------------------------------------------------------------- [16:03:08] Can Edremitoglu(@cantonic):actually that wouldn’t be too bad… we wouldn’t have to compile the whole instance variable and one could use erb to get values from an instance variable into the code before it gets compiled. Additionally to this you could pass local variables to the template like usual and described in https://github.com/opal/opal-rails#as-a-template ---------------------------------------------------------------------------------------------------- [16:03:09] Elia Schito(@elia):@cantonic lol, yeah, would make sense if it wasn't so meta… `` ---------------------------------------------------------------------------------------------------- [16:03:24] Can Edremitoglu(@cantonic):hehehe ---------------------------------------------------------------------------------------------------- [16:06:28] Can Edremitoglu(@cantonic):i would say: if you need an instance variable or parts of it you should pass it in like `render type: :js, locals: {post: @post}` ---------------------------------------------------------------------------------------------------- [16:06:38] Can Edremitoglu(@cantonic):will create an issue for it ---------------------------------------------------------------------------------------------------- [16:09:29] Elia Schito(@elia):I think `locals:` should still produce locals in the view, but skipping unwanted ivars makes sense, even if it would break crazy code such as `class << self; attr_accessor :foo; end; p foo` ---------------------------------------------------------------------------------------------------- [16:09:40] Elia Schito(@elia):@adambeynon any thoughts on this? ---------------------------------------------------------------------------------------------------- [16:27:23] Adam Beynon(@adambeynon):@elia, @cantonic I like the opt-in approach using `locals: …` ---------------------------------------------------------------------------------------------------- [16:28:57] Can Edremitoglu(@cantonic):@elia, @adambeynon in that case it is as easy as removing https://github.com/opal/opal-rails/blob/master/lib/opal/rails/template_handler.rb#L24-L28 right? ---------------------------------------------------------------------------------------------------- [16:32:59] Elia Schito(@elia):@cantonic :+1: yes and update line 13, wanna do a PR for that? ---------------------------------------------------------------------------------------------------- [16:33:42] Can Edremitoglu(@cantonic):yep. i’ll take care of it right now ---------------------------------------------------------------------------------------------------- [16:37:33] Can Edremitoglu(@cantonic):just want to do one or two tests before to make sure the ivars are really breaking it ---------------------------------------------------------------------------------------------------- [16:48:22] Can Edremitoglu(@cantonic):wow, when trying to debug the template handler my editor crashes… must have to do with the “stack level too deep” error which somehow leaves the question if there is just a logical mistake in the handler... ---------------------------------------------------------------------------------------------------- [16:50:23] Can Edremitoglu(@cantonic):``` SystemStackError - stack level too deep: activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `block in as_json' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `each' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `map' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `as_json' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:50:in `as_json' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `block in as_json' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `each' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `map' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:159:in `as_json' activesupport (4.1.9) lib/active_support/core_ext/object/json.rb:50:in `as_json’ … and so on ``` ---------------------------------------------------------------------------------------------------- [16:59:18] Elia Schito(@elia):seems there's just a loop in as_json, you can check lib/active_support/core_ext/object/json.rb at the stacktrace lines to see which class is that `as_json` from ---------------------------------------------------------------------------------------------------- [17:05:57] Can Edremitoglu(@cantonic):@elia does this have to do with it? https://github.com/rspec/rspec-rails/issues/1309 ---------------------------------------------------------------------------------------------------- [17:06:41] Can Edremitoglu(@cantonic):excerpt from https://github.com/rspec/rspec-rails/commit/9f6f9bda183b86bf50dcc7a657fb1757e19bf7bd : Rails adds a nearly global monkey patch to make converting objects into JSON easier. It adds both `to_json` and `as_json` methods on nearly all core object types; including `Object` but not `BasicObject`. ---------------------------------------------------------------------------------------------------- [17:08:35] Elia Schito(@elia):yep, tldr, but given it's recursive that's probably the culprit ---------------------------------------------------------------------------------------------------- [17:10:51] Can Edremitoglu(@cantonic):okay. maybe I can solve it with a little help of you from time to time :) ---------------------------------------------------------------------------------------------------- [17:11:40] Elia Schito(@elia):sure thing ---------------------------------------------------------------------------------------------------- [17:13:39] Elia Schito(@elia):> make sure the ivars are really breaking it forgot to mention that the problem is not ivars per se but the `to_json` transformation, going from ivars to locals (which is good anyway) won't help as locals are still treated with `to_json` ---------------------------------------------------------------------------------------------------- [17:15:14] Can Edremitoglu(@cantonic):@elia so `render type: :js, locals: {directory: @directory}` should produce the same error, right? ---------------------------------------------------------------------------------------------------- [17:16:20] Elia Schito(@elia):I think so ---------------------------------------------------------------------------------------------------- [17:17:29] Can Edremitoglu(@cantonic):yeah it does ---------------------------------------------------------------------------------------------------- [17:21:18] Can Edremitoglu(@cantonic):in that case removing `Opal::Rails::TemplateHandler#assigns` wouldn’t solve the problem since people would run into that problem pretty quickly. ---------------------------------------------------------------------------------------------------- [18:07:26] Elia Schito(@elia):@cantonic properly implementing to_json would solve, helping understand that to_json will be called on all ivars/locals is another option, but I don't know how we could do that ---------------------------------------------------------------------------------------------------- [18:08:38] Can Edremitoglu(@cantonic):me neither :( ---------------------------------------------------------------------------------------------------- [19:19:30] Can Edremitoglu(@cantonic):ok, the error happens for `@_assigns`, not for `local_assigns`. the latter can call `to_json` without problem. I am removing the `assigns` method like we discussed earlier ---------------------------------------------------------------------------------------------------- [19:47:17] Elia Schito(@elia):K, was hacky (but cool) from the beginning ---------------------------------------------------------------------------------------------------- [20:29:12] Elia Schito(@elia):@cantonic looking again at the code, seems odd that there's no difference between using ivars and locals, just saying… ---------------------------------------------------------------------------------------------------- [20:29:58] Can Edremitoglu(@cantonic):@elia well the locals are simple and not as deeply nested as ‘@_assigns' ---------------------------------------------------------------------------------------------------- [20:31:21] Can Edremitoglu(@cantonic):but removing the ivars and going with locals is also not optimal. i passed in an activerecord object as a local, but in the template file it is just a json string. You cannot use its methods which you can with erb ---------------------------------------------------------------------------------------------------- [20:31:47] Elia Schito(@elia):it's a different beast ---------------------------------------------------------------------------------------------------- [20:32:29] Elia Schito(@elia):The idea is that youre passing (controlled) attributes to opal and there possibly use them to instantiate a clientside model ---------------------------------------------------------------------------------------------------- [20:33:21] Elia Schito(@elia):you can wrap them in OpenStruct or Struct ---------------------------------------------------------------------------------------------------- [20:34:00] Elia Schito(@elia):you can also pass the values you need as locals/ivars calling the methods (aka preparing the data) in the controller ---------------------------------------------------------------------------------------------------- [20:37:21] Can Edremitoglu(@cantonic):yep right. you can get done what you need to get done but in a more inconvenient way as with coffee+erb templates. somehow at some time it would be good to be able to be able to use the locals and ivars like you can with erb I think. ---------------------------------------------------------------------------------------------------- [20:38:18] Can Edremitoglu(@cantonic):@elia using OpenStruct? like `render locals: {post: OpenStruct.new(@post)` ? ---------------------------------------------------------------------------------------------------- [20:38:26] Elia Schito(@elia):I'm ok with that as long as the solution is not super confusing, the problem is that you're mixing server and clientside stuff ---------------------------------------------------------------------------------------------------- [20:39:33] Elia Schito(@elia):it's a problem of serialization/deserialization; would be serialized in MRI and deserialized in Opal ---------------------------------------------------------------------------------------------------- [20:40:10] Elia Schito(@elia):the safest thing I came up was hash/array/…->json->hash/array/… ---------------------------------------------------------------------------------------------------- [20:40:50] Elia Schito(@elia):as all the types used by json are guaranteed to be available on the client, ---------------------------------------------------------------------------------------------------- [20:41:11] Elia Schito(@elia):not sure how it could play out with OpenStruct ---------------------------------------------------------------------------------------------------- [20:41:13] Can Edremitoglu(@cantonic):therefore I thought about bringing erb into the game so you can use both: locals for client side stuff and erb for server side ---------------------------------------------------------------------------------------------------- [20:42:25] Can Edremitoglu(@cantonic):you could prepare your locals in the controller but also quickly do a `<% if @post.new_record? %>` if you quickly need it ---------------------------------------------------------------------------------------------------- [20:42:28] Elia Schito(@elia):if you want to take a knack at implementing that :+1:, after all anyone adding `.opal.erb` as an extension is supposed to know what he's doing ---------------------------------------------------------------------------------------------------- [20:43:36] Elia Schito(@elia):I'll help of course, even if I'm not completely aware of how chaining multiple templates works in app/views ---------------------------------------------------------------------------------------------------- [01:31:27] Can Edremitoglu(@cantonic):@elia thx for the answer ---------------------------------------------------------------------------------------------------- [01:35:24] Can Edremitoglu(@cantonic):what do you guys think of extending opal-jquery’s `Element#expose` so one can define a custom alias name so you can do `Element.expose :fullCalendar, :full_calendar` in order to avoid having camel case ruby method for example ? ---------------------------------------------------------------------------------------------------- [02:26:34] Kurtis Rainbolt-Greene(@krainboltgreene):Looks like `Opal::Processor.source_map_register` has gone? ---------------------------------------------------------------------------------------------------- [02:26:40] Kurtis Rainbolt-Greene(@krainboltgreene):I don't see it in the changelog. ---------------------------------------------------------------------------------------------------- [02:35:44] Can Edremitoglu(@cantonic):@krainboltgreene it has been removed in #773 ---------------------------------------------------------------------------------------------------- [02:39:18] Kurtis Rainbolt-Greene(@krainboltgreene):Christ. Slap me if I ever have to write something that depends on Sprockets. ---------------------------------------------------------------------------------------------------- [03:42:50] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Seem to be having a odd compile situation: https://gist.github.com/krainboltgreene/f36eb99799336e00a43f ---------------------------------------------------------------------------------------------------- [03:45:32] Kurtis Rainbolt-Greene(@krainboltgreene):Didn't realize it would spam the channel, sorry. ---------------------------------------------------------------------------------------------------- [03:47:41] Kurtis Rainbolt-Greene(@krainboltgreene):Also realized it was a thing that I did wrong, not something with the compiler. It's really hard to adjust to this transpiler situation. Trying to figure out where the problem is really located, not because Opal is dumb about it but because I don't know the context it's reporting in. ---------------------------------------------------------------------------------------------------- [09:38:13] Can Edremitoglu(@cantonic):hmm… I cannot get rails to render a create.js.opal file. create.js works fine. Using the .js.opal extension leads to a 500 error without any further explanationation in development.log as well as no javascript console errors. ---------------------------------------------------------------------------------------------------- [09:38:43] David Chang(@zetachang):@krainboltgreene open up an issue here (https://github.com/zetachang/react.rb/issues/14) for supporting React Native in react.rb ---------------------------------------------------------------------------------------------------- [09:39:13] Kurtis Rainbolt-Greene(@krainboltgreene):@cantonic I believe the standard is create.js.rb? ---------------------------------------------------------------------------------------------------- [09:40:11] Kurtis Rainbolt-Greene(@krainboltgreene):@zetachang I just got started using react.rb, which is wonderfully done btw. ---------------------------------------------------------------------------------------------------- [09:40:41] David Chang(@zetachang):@krainboltgreene Glad to hear, thanks! :wink: ---------------------------------------------------------------------------------------------------- [09:44:10] Can Edremitoglu(@cantonic):@krainboltgreene I think it isn’t when using opal for server javascript responses. I get a “missing template” error when using js.rb and [this section of the opal-rails README](https://github.com/opal/opal-rails#as-a-template) also indicates to use js.opal ---------------------------------------------------------------------------------------------------- [09:45:26] Kurtis Rainbolt-Greene(@krainboltgreene):Hmm, thought I saw a comment recently about using `.js.rb`. ---------------------------------------------------------------------------------------------------- [09:45:28] Kurtis Rainbolt-Greene(@krainboltgreene):Interesting. ---------------------------------------------------------------------------------------------------- [09:46:04] Kurtis Rainbolt-Greene(@krainboltgreene):Either way, I bet there's a better way to debug the sprocket part of the request. ---------------------------------------------------------------------------------------------------- [09:46:34] Kurtis Rainbolt-Greene(@krainboltgreene):@cantonic: Try with ` <%= javascript_include_tag "application", :debug => true %>` ---------------------------------------------------------------------------------------------------- [09:46:50] Can Edremitoglu(@cantonic):@krainboltgreene yes, usually you use `.js.rb` for opal files in `app/assets/javascripts`, but it doesn’t work for js template files in `app/views` ---------------------------------------------------------------------------------------------------- [09:47:08] Can Edremitoglu(@cantonic):thx. will try that ---------------------------------------------------------------------------------------------------- [09:47:28] Kurtis Rainbolt-Greene(@krainboltgreene):Oh crap, sorry, somehow missed template views. ---------------------------------------------------------------------------------------------------- [09:47:54] Kurtis Rainbolt-Greene(@krainboltgreene):I've never been a fan of app/view/*.js files, so I'm no help. ---------------------------------------------------------------------------------------------------- [09:49:12] Can Edremitoglu(@cantonic):@krainboltgreene i just start becoming a fan of them. previously I used client side ajax calls and made json responses handled by the client, but using server js responses has a lot of advantages over the other approach for me. ---------------------------------------------------------------------------------------------------- [10:15:51] Can Edremitoglu(@cantonic):oh nice, somehow it is working now. Don’t know what caused the error unfortunately ---------------------------------------------------------------------------------------------------- [10:29:27] Can Edremitoglu(@cantonic):and back to error again… weird. is it possible that the latest Sprockets changes prevent files like `create.js.opal` from working? ---------------------------------------------------------------------------------------------------- [10:50:52] Can Edremitoglu(@cantonic):ok, after disabling forgery protection I at least get an error message: `stack level too deep` in `create.js.opal`. The method causing it is `alert 'foobar'` ---------------------------------------------------------------------------------------------------- [10:54:36] Can Edremitoglu(@cantonic):narrowed it down to the instance variables set in the controller’s #create action. They are causing a `stack level too deep` error. When I remove them in the #create action it is working fine. ---------------------------------------------------------------------------------------------------- [10:58:56] Adam Beynon(@adambeynon):@cantonic Im not sure of exactly how it works, as @elia did the templating stuff for rails ---------------------------------------------------------------------------------------------------- [10:58:59] Adam Beynon(@adambeynon):but, https://github.com/opal/opal-rails/blob/master/lib/opal/rails/template_handler.rb#L1-L35 ---------------------------------------------------------------------------------------------------- [10:59:30] Adam Beynon(@adambeynon):it looks like locals are handled via #to_json - so maybe there is something bad in one of the models getting converted to json - recursive objects maybe ---------------------------------------------------------------------------------------------------- [11:01:05] Can Edremitoglu(@cantonic):@adambeynon thank you. I assume the same. ---------------------------------------------------------------------------------------------------- [13:03:02] Elia Schito(@elia):@krainboltgreene `@router = Ghostryder::Router.new` does it work with `@router = ::Ghostryder::Router.new`? ---------------------------------------------------------------------------------------------------- [13:03:29] Elia Schito(@elia):if it works on MRI without the double colon please open an issue ---------------------------------------------------------------------------------------------------- [13:04:59] Elia Schito(@elia):@cantonic didn't use app/views templates in a while, can you try applying `to_json` to all ivars in the controller manually, if it breaks there that's the issue ---------------------------------------------------------------------------------------------------- [13:16:52] Can Edremitoglu(@cantonic):@elia: the controller handles it without any problems ---------------------------------------------------------------------------------------------------- [13:17:44] Elia Schito(@elia):@cantonic can you post some code? (a gist in private chat is ok) ---------------------------------------------------------------------------------------------------- [13:22:17] Can Edremitoglu(@cantonic):sure ---------------------------------------------------------------------------------------------------- [13:33:08] Elia Schito(@elia):can you try replacing create.js.rb with this create.js.erb? ``` <%= JSON.parse(local_assigns.to_json).map { |key, val| "#{key} = #{val.inspect};" }.join %> <%= JSON.parse(@_assigns.to_json).map { |key, val| "@#{key} = #{val.inspect};" }.join %> ``` ---------------------------------------------------------------------------------------------------- [13:34:51] Elia Schito(@elia):trying to manually debug lines from https://github.com/opal/opal-rails/blob/master/lib/opal/rails/template_handler.rb#L1-L35 ---------------------------------------------------------------------------------------------------- [13:45:35] Can Edremitoglu(@cantonic):@elia that raises the same error like create.js.opal. Hope that helps for further investigation :) ---------------------------------------------------------------------------------------------------- [13:45:46] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [15:42:48] Can Edremitoglu(@cantonic):@elia is the `stack level too deep` error happening because the template handler tries to transform the instance variables and all their methods etc into json? If so, could we change the template handler to perform to_json only on the instances attributes? or maybe even totally remove the instances from automatically being available and instead pass local variables to the js.opal file if necessary? ---------------------------------------------------------------------------------------------------- [15:48:27] Elia Schito(@elia):@cantonic simplest solution would be to set those vars only when needed by the view, but that's probably my hate for passing data via ivars that's talking here ---------------------------------------------------------------------------------------------------- ############################## [2015-03-28] ############################## [01:27:56] Kurtis Rainbolt-Greene(@krainboltgreene):I'm super interested in getting react.rb into a framework, maybe like Clearwater. ---------------------------------------------------------------------------------------------------- [01:28:53] Kurtis Rainbolt-Greene(@krainboltgreene):But I want something well defined and composed like ember and ember-cli. ---------------------------------------------------------------------------------------------------- [04:10:14] Kurtis Rainbolt-Greene(@krainboltgreene):@elia If I wanted to use rom-rb in an opal app, a gem that shouldn't have any non-standard API usage or c-extensions, how would I go about doing that? ---------------------------------------------------------------------------------------------------- [08:26:49] Elia Schito(@elia):In MRI you would Opal.use_gem "rom" and then require "Tom" in Opal ---------------------------------------------------------------------------------------------------- [18:36:16] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: As cool as that is it looks like ROM has a dynamic require. Foiled. ---------------------------------------------------------------------------------------------------- [23:46:12] Elia Schito(@elia):@krainboltgreene if you explicitly require the files that would be required by the dynamic require it should work fine (remember to set the dynamic require error level to warning or ignore) ---------------------------------------------------------------------------------------------------- [23:48:46] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Quite frankly I don't think dynamic requires are really that good an idea anyways. I'm hoping to patch it out. ---------------------------------------------------------------------------------------------------- [23:48:49] Kurtis Rainbolt-Greene(@krainboltgreene):But thanks for the detail. ---------------------------------------------------------------------------------------------------- [23:52:31] Elia Schito(@elia):Most of them are not really dynamic anyway ---------------------------------------------------------------------------------------------------- ############################## [2015-03-30] ############################## [17:34:04] Vitor Capela(@dodecaphonic):When writing a bridge to a library, is it customary/recommended for it to be prefixed by "opal-"? ---------------------------------------------------------------------------------------------------- [18:01:57] Kurtis Rainbolt-Greene(@krainboltgreene):Good question. ---------------------------------------------------------------------------------------------------- [18:02:17] Kurtis Rainbolt-Greene(@krainboltgreene):Some of the opal org libraries follow this structure ---------------------------------------------------------------------------------------------------- [18:02:26] Kurtis Rainbolt-Greene(@krainboltgreene):But things like vienna, clearwater, react.rb don't. ---------------------------------------------------------------------------------------------------- [18:03:08] Kurtis Rainbolt-Greene(@krainboltgreene):@dodecaphonic: I think it's a good idea for the gem to have opal-* (for better indexing), but the vendor library to not have it. ---------------------------------------------------------------------------------------------------- [18:03:19] Kurtis Rainbolt-Greene(@krainboltgreene):AKA gem "opal-foo", require "foo" ---------------------------------------------------------------------------------------------------- [18:16:00] Vitor Capela(@dodecaphonic):Great. Thanks, @krainboltgreene. ---------------------------------------------------------------------------------------------------- ############################## [2015-03-31] ############################## [19:12:41] Vitor Capela(@dodecaphonic):I'm writing a wrapper for PouchDB and there's something to which I don't have the answer. I'm briding their responses wrapped in Natives, but I was wondering if it would be better to convert them to Hashes. Is there a consensus on what to do? Is there a standard way to perform that conversion? ---------------------------------------------------------------------------------------------------- [19:20:16] Vitor Capela(@dodecaphonic):A user can store documents with different shapes, so I'm not quite sure how to proceed. ---------------------------------------------------------------------------------------------------- [20:30:10] Mitch VanDuyn(@catmando):@elia (or anybody else, that knows) we are using opal-rspec, and /opal_spec is visible in our production app... is there a simple way to turn this off, that we just missed in the docs? (I had been sending this by mistake over in the volt room, sorry about that!) ---------------------------------------------------------------------------------------------------- [21:07:13] Forrest Chang(@fkchang):@dodecaphonic if you don't return hashes, document. I think the principle of least surprise would dictate that when coding in opal, objects are opal objects (i.e. we just code in Ruby), as being more comfortable and requiring less divergent thought, .i.e. "oh yeah, what this returns isn't really a Hash, so I can only use these 2 operators". ---------------------------------------------------------------------------------------------------- [21:08:04] Vitor Capela(@dodecaphonic):@fkchang That's what I think as well, for sure. That said, is there a helper to go from nested js.Object to a Hash already in place? ---------------------------------------------------------------------------------------------------- [21:08:31] Forrest Chang(@fkchang):@catmando /opal_spec is implemented as a rails engine, at the moment, I don't believe you can turn it off. That being said, I'm going to be doing some work on opal-rails and running specs, I could probably make it so it doesn't respond on production if you set some config value while I'm in there ---------------------------------------------------------------------------------------------------- [21:11:16] Adam Beynon(@adambeynon):@catmando @fkchang It used to be the case where the specs did not run in production. There must have been a regression some where (so at least the fix should be a simple one) ---------------------------------------------------------------------------------------------------- [21:13:59] Forrest Chang(@fkchang):@dodecaphonic Hash.new(native_js_object) works http://fkchang.github.io/opal-irb/index-embeddable.html#code:o%20%3D%20%60obj%20%3D%20%7B%20one%3A%201%2C%20two%3A%202%7D%60%0Ahash%20%3D%20Hash.new(o)%0Aputs%20hash%5B%22one%22%5D ---------------------------------------------------------------------------------------------------- [21:14:57] Vitor Capela(@dodecaphonic):@fkchang Great, thank you! ---------------------------------------------------------------------------------------------------- [21:15:04] Forrest Chang(@fkchang):wow, github assets are running slow for me .. ---------------------------------------------------------------------------------------------------- [21:15:39] Forrest Chang(@fkchang):@dodecaphonic did that link come through for you? ---------------------------------------------------------------------------------------------------- [21:15:48] Vitor Capela(@dodecaphonic):@fkchang Yes, perfect. ---------------------------------------------------------------------------------------------------- [21:16:30] Forrest Chang(@fkchang):hit ctrl-p to go back 1 line, and ctrl-m to do multi line edit on that code snippet, play around ---------------------------------------------------------------------------------------------------- [21:16:53] Forrest Chang(@fkchang):assets won't load for me ---------------------------------------------------------------------------------------------------- [23:10:45] Elia Schito(@elia):@catmando I'll get it fixed tomorrow, …unless someone comes up with a PR in the meanwhile (9hrs left 😁) ---------------------------------------------------------------------------------------------------- ############################## [2015-04-01] ############################## [01:45:32] David Chang(@zetachang):Is there any document about the bahavior of inheriting from a JS constructor function ? ---------------------------------------------------------------------------------------------------- [01:47:38] David Chang(@zetachang):I am working on some rewrite of react.rb to be real toll-free bridge with native ReactComponent. ---------------------------------------------------------------------------------------------------- [03:13:49] Mitch VanDuyn(@catmando):@elia, I think I've got it covered, but can't get the PR done tonight. Should be all set by tomorrow. ---------------------------------------------------------------------------------------------------- [12:06:14] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [12:07:01] Elia Schito(@elia):@catmando btw a rough/WIP PR would be good too ---------------------------------------------------------------------------------------------------- [14:23:13] Mitch VanDuyn(@catmando):@elia, should have something shortly. ---------------------------------------------------------------------------------------------------- [14:23:52] Elia Schito(@elia):+1 ---------------------------------------------------------------------------------------------------- [15:10:00] Mitch VanDuyn(@catmando):@elia right now i have it hard coded (in rails-opal) to not route to /opal_spec if in production. Do you think I should bother to put this on a config switch? ---------------------------------------------------------------------------------------------------- [15:10:57] Elia Schito(@elia):@catmando I'll do that, I already have some code in that direction ---------------------------------------------------------------------------------------------------- [15:11:26] Mitch VanDuyn(@catmando):okay then I'll do my 1 line pull request now :-) ---------------------------------------------------------------------------------------------------- [15:15:45] Mitch VanDuyn(@catmando):@elia pull request done... ---------------------------------------------------------------------------------------------------- ############################## [2015-04-02] ############################## [08:27:57] Elia Schito(@elia):@krainboltgreene you should reflect on that… :P ---------------------------------------------------------------------------------------------------- [08:28:49] Elia Schito(@elia):@krainboltgreene have any feature list for it? just curious ---------------------------------------------------------------------------------------------------- [08:29:44] Kurtis Rainbolt-Greene(@krainboltgreene):ROM for models, react.rb for views. ---------------------------------------------------------------------------------------------------- [08:29:51] Kurtis Rainbolt-Greene(@krainboltgreene):Haven't decided router/controller level details. ---------------------------------------------------------------------------------------------------- [08:30:10] Kurtis Rainbolt-Greene(@krainboltgreene):I think I decided on "reaction". ---------------------------------------------------------------------------------------------------- [08:30:40] Kurtis Rainbolt-Greene(@krainboltgreene):Donno yet though. ---------------------------------------------------------------------------------------------------- [08:30:58] Kurtis Rainbolt-Greene(@krainboltgreene):It'll be my first full frontend framework. I know I'll be focusing on HATEOS JSON API support first class. ---------------------------------------------------------------------------------------------------- [08:31:05] Elia Schito(@elia):prefer reflex over reaction ---------------------------------------------------------------------------------------------------- [08:31:07] Kurtis Rainbolt-Greene(@krainboltgreene):With JWT for authentication protocol (maybe). ---------------------------------------------------------------------------------------------------- [08:41:53] Kris Leech(@krisleech):@krainboltgreene we just started using ClojureScript + Reagent (ReactJS), haven't done much for a good experience so far. ---------------------------------------------------------------------------------------------------- [08:49:38] Kurtis Rainbolt-Greene(@krainboltgreene):So basically the clojure of what I'm doing. That's neat! ---------------------------------------------------------------------------------------------------- [08:49:49] Kurtis Rainbolt-Greene(@krainboltgreene):My friend is writing exjs so he can do the same with elixir. ---------------------------------------------------------------------------------------------------- [08:50:35] Kris Leech(@krisleech):seems blasphemous to talk about this in the Opal channel :) ---------------------------------------------------------------------------------------------------- [08:51:27] Elia Schito(@elia):you two, get out of here :rage1: how you dare! ---------------------------------------------------------------------------------------------------- [08:51:28] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [08:51:39] Elia Schito(@elia):@krainboltgreene you have a link for exjs? ---------------------------------------------------------------------------------------------------- [08:52:02] Kris Leech(@krisleech):;) we love Opal too ---------------------------------------------------------------------------------------------------- [08:52:26] Elia Schito(@elia):I know I know :D ---------------------------------------------------------------------------------------------------- [08:52:31] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: https://github.com/bryanjos/ex_to_js ---------------------------------------------------------------------------------------------------- [08:52:58] Kurtis Rainbolt-Greene(@krainboltgreene):@krisleech: What'd you end up doing for a router? I'm looking at either R3 in pure ruby or maybe ragel, like mongrel did. ---------------------------------------------------------------------------------------------------- [08:53:22] Kurtis Rainbolt-Greene(@krainboltgreene):I wrote a custom one for shogun.gem, but this is probably going to need to be more robust. ---------------------------------------------------------------------------------------------------- [15:03:57] CJ Lazell(@cj):Is anyone here good at recursive async functions? https://gist.github.com/cj/b01840897c23db634127 what I'm trying to have happen is load all the requires for say `list` but make sure it loads all the deepest requires first and then all the way back up to the root `list` and if something else requires the same thing for it to also wait on that promise ---------------------------------------------------------------------------------------------------- [15:06:24] CJ Lazell(@cj):I'm offering $150 bounty if anyone can help ---------------------------------------------------------------------------------------------------- [15:10:31] Elia Schito(@elia):@cj a usage example would help i think ---------------------------------------------------------------------------------------------------- [15:17:36] CJ Lazell(@cj):@elia the gists contains the requires content `requires.rb` and the method called javascript. I can give you remote access to a working example if you like ---------------------------------------------------------------------------------------------------- [17:12:00] Ryan Stout(@ryanstout):@adambeynon @elia how are you? I've been thinking about trying to add an extension to opal to support async/await similar to how es7 does. (Basically, await is a keyword that gets passed a promise, then all code below it in the AST is put inside of the promise. And async just wraps the results of a method in a promise) async/await basically lets you write code that looks synchronous. And I was thinking, it would be easy enough to create a similar library on the server that uses fibers to accomplish the same interface. Any thoughts on the best way for me to get started? I think I could implement async as a method that takes in the symbol returned from ```def``` and then wraps that method. But for await, it would have to become a language keyword. I can figure out how to do the AST transforms, I'm just not sure the best way to extend opal so it won't need many changes when opal changes. Any thoughts? ---------------------------------------------------------------------------------------------------- [20:31:29] Forrest Chang(@fkchang):@adambeynon @elia anything for updating to 0.8.0.dev stuff in head? I did it and my app seems to have a problem requiring classes I've defined ---------------------------------------------------------------------------------------------------- [20:31:40] Forrest Chang(@fkchang):i.e. ---------------------------------------------------------------------------------------------------- [20:32:04] Forrest Chang(@fkchang):``` NameError: uninitialized constant Object::Document (anonymous function)kernel.rb:502 $const_missingmodule.rb:264 getruntime.js:75 (anonymous function)products:1019 global codeproducts:1026 products:1052 ``` ---------------------------------------------------------------------------------------------------- [02:48:30] Kurtis Rainbolt-Greene(@krainboltgreene):I need a name for my frontend framework. ---------------------------------------------------------------------------------------------------- [02:48:48] Kurtis Rainbolt-Greene(@krainboltgreene):Thinking "reflex" ---------------------------------------------------------------------------------------------------- ############################## [2015-04-03] ############################## [02:34:16] Jared White(@jaredcwhite):Hey all, I'm putting together ideas for a regular email newsletter covering Opal and related Ruby/front-end topics - mixture of links and some original content. I feel like between GitHub issues and Gitter, lots of good stuff is happening all the time but hardly anyone knows about it. There's a newsletter I get that covers Rails Dev progress ---------------------------------------------------------------------------------------------------- [02:36:28] Jared White(@jaredcwhite):for example and it's really useful. Anyway, would love your ideas and feedback! cc @adambeynon @elia @ryanstout @fkchang ---------------------------------------------------------------------------------------------------- [03:01:52] Ryan Stout(@ryanstout):@jaredcwhite sounds great. Sign me up :-) ---------------------------------------------------------------------------------------------------- [06:31:50] Forrest Chang(@fkchang):@jaredcwhite I'm up for that, I'd be happy to contribute as I am able to find time. There's been tons of good stuff on irc, though that seems to have died down now that gitter is getting done adoption. One thing for the newsletter could just be good nuggets from irc or gitter since the last newsletter ---------------------------------------------------------------------------------------------------- [06:42:55] Kurtis Rainbolt-Greene(@krainboltgreene):Same. ---------------------------------------------------------------------------------------------------- [08:06:38] Elia Schito(@elia):me too ---------------------------------------------------------------------------------------------------- [12:29:17] David Chang(@zetachang):Hey all, days ago mentioning that I am doing some rewrite to make react.rb support toll-free bridge ReactComponent. I got some code up and running (with some help from inline doc in `runtime.js`). https://gist.github.com/zetachang/abf76b110ac5c80bd4e9 ---------------------------------------------------------------------------------------------------- [12:32:29] Kurtis Rainbolt-Greene(@krainboltgreene):Swweeeet. ---------------------------------------------------------------------------------------------------- [12:32:38] David Chang(@zetachang):I have to override the constructor property since React.js rely on this to check if the component instance are the one instantiated from the element. So the questions is that is this the right way to do this? Since this depends on the usage of `klass._proto` which is actually an implementation details ---------------------------------------------------------------------------------------------------- [13:11:13] David Chang(@zetachang):@jaredcwhite count me in :+1: ---------------------------------------------------------------------------------------------------- [14:07:28] Jared White(@jaredcwhite):All right! Appreciate everyone's enthusiasm. :) I'll work on the first issue next week. ---------------------------------------------------------------------------------------------------- [14:47:26] Elia Schito(@elia):@zetachang have you tried bridging the class? class React::Component < `React.Component` ---------------------------------------------------------------------------------------------------- [14:49:16] David Chang(@zetachang):Yes, i've tried. But since React need a constructor function. So I need to manually set up the prototype chain. ---------------------------------------------------------------------------------------------------- [14:55:16] Elia Schito(@elia):I probably need to study React constructor a bit more to understand the code above, but as a heads up I can say that _proto becomes $$proto from 0.7 on ---------------------------------------------------------------------------------------------------- [14:57:58] David Chang(@zetachang):Actually the reason why I choose copy React.Component.prototype is to remain the previous behavior that any plain Ruby class could be a renderable component class. ---------------------------------------------------------------------------------------------------- [14:58:43] David Chang(@zetachang):Noted on the $$proto part, I will migrate to it after 0.8 released. ---------------------------------------------------------------------------------------------------- ############################## [2015-04-05] ############################## [12:53:46] David Chang(@zetachang):Hey all, just got Opal Ruby up & running in React Native (https://github.com/zetachang/opal-native) ---------------------------------------------------------------------------------------------------- [12:54:54] David Chang(@zetachang):Toolchain implemented in pure Ruby, currently it's kind of a proof of concept. So feel free to drop me a line if you got any suggestion. :wink: ---------------------------------------------------------------------------------------------------- [13:00:05] Kurtis Rainbolt-Greene(@krainboltgreene):Nice. ---------------------------------------------------------------------------------------------------- [13:32:24] Elia Schito(@elia):@zetachang watched ;) ---------------------------------------------------------------------------------------------------- [13:36:54] Elia Schito(@elia):btw im planning to reimplement turbolinks in Opal and with react as a rendering engine (based on the Dom parsing experiment) maybe the rendering engine will be pluggable ---------------------------------------------------------------------------------------------------- [13:42:12] Kurtis Rainbolt-Greene(@krainboltgreene):I'm so sorry. ---------------------------------------------------------------------------------------------------- [13:57:34] Elia Schito(@elia):?? ---------------------------------------------------------------------------------------------------- [13:57:54] Elia Schito(@elia):usual turbolinks hate ? :D ---------------------------------------------------------------------------------------------------- [14:02:02] Kurtis Rainbolt-Greene(@krainboltgreene):Haha, yeah, not a fan. ---------------------------------------------------------------------------------------------------- [14:03:48] David Chang(@zetachang):LoL, turbolinks is fine to me. @elia looking forward to your work. ---------------------------------------------------------------------------------------------------- [14:06:04] Elia Schito(@elia):To me it's cool concept, most problems come from expecting it to work like magic without even looking at the docs (my opinion of course 🐸) ---------------------------------------------------------------------------------------------------- [14:27:38] Kurtis Rainbolt-Greene(@krainboltgreene):It always felt like the same kind of hack that Common Gateway Interface was. ---------------------------------------------------------------------------------------------------- ############################## [2015-04-06] ############################## [18:27:32] Vitor Capela(@dodecaphonic):I'm finishing a wrapper for PouchDB and I'm stuck here on how to Rubify an API. When querying, you can pass a function in or specify a "design document" -- a permanent way to go through data. On the latter, you pass in a stringified function (the guides tell you to call toString() on a function), which means it passes the raw code in and forgoes closures and such things. ---------------------------------------------------------------------------------------------------- [18:27:55] Vitor Capela(@dodecaphonic):Is there a way to get a transformed lambda as a string without the closures? Do you have any ideas how to make that look a little better? ---------------------------------------------------------------------------------------------------- ############################## [2015-04-07] ############################## [02:21:57] Can Edremitoglu(@cantonic):is it possible that since the latest changes to opal-rails it is necessary to name haml templates `js.haml` instead of just `haml`? with just `haml` as filename I get a `Sprockets::FileNotFound` from the file that is requiring the haml template. It’s no problem for me to rename template files to `js.haml`, but that would break the concept of shared remplates in `app/views` like described in the opal-rails readme ---------------------------------------------------------------------------------------------------- [07:14:24] Elia Schito(@elia):@cantonic I'll add a spe for that and fix it, do you mind opening an issue as a reminder? ---------------------------------------------------------------------------------------------------- [07:20:08] Can Edremitoglu(@cantonic):@elia sure. In opal-rails repo? ---------------------------------------------------------------------------------------------------- [07:40:31] Elia Schito(@elia):i'd say opal-haml, but it's the same really ---------------------------------------------------------------------------------------------------- [09:56:40] Can Edremitoglu(@cantonic):alright, done: https://github.com/opal/opal-haml/issues/5 ---------------------------------------------------------------------------------------------------- [10:00:13] Elia Schito(@elia):let me know if the fix works, otherwise we'll reopen the issue ---------------------------------------------------------------------------------------------------- [10:09:20] Can Edremitoglu(@cantonic):yep, fixed it. thank you :) ---------------------------------------------------------------------------------------------------- [10:10:03] Elia Schito(@elia):@zetachang @krainboltgreene https://github.com/ssorallen/turbo-react/ no more original ideas… ---------------------------------------------------------------------------------------------------- [17:25:04] Jared White(@jaredcwhite):@zetachang @fkchang @ryanstout @krainboltgreene @elia @adambeynon OK, for the Opal newsletter, I'm still working on a website but I have the email sign-up ready to go. It's called Opalist. :) https://opalist.curated.co Hoping to get an issue out in a week or so. ---------------------------------------------------------------------------------------------------- [17:29:17] Ryan Stout(@ryanstout):@jaredcwhite awesome, looking forward to it :-) ---------------------------------------------------------------------------------------------------- [18:39:23] Forrest Chang(@fkchang):@jaredcwhite cool. Hope to have some material for you, just posted a blog post of ruby-fying javascript - would like to make a series out of it ---------------------------------------------------------------------------------------------------- ############################## [2015-04-08] ############################## [00:09:26] Cassio Godinho(@cpgo):Any thing new about rubyfire? ---------------------------------------------------------------------------------------------------- [11:35:51] Fred Mitchell(@flajann2):Should I even bother with Angular with Opal? I am thinking I should be able to accomplish the same functionality totally within Opal. Same question for D3. Thoughts? ---------------------------------------------------------------------------------------------------- [20:37:06] Jared White(@jaredcwhite):@flajann2 Well Opal in and of itself won't provide most of the framework-y things that Angular will provide for you. You'll need extra libraries. You could check out Vienna, or React.rb, or Clearwater, or some other things along those lines. We're all waiting for Rubyfire as well. :) Myself, I ended up creating a Backbone-ish framework for controller/view modularization on a big client project, and at some point I might extract it out into a gem but it's not quite ready for prime-time just yet. ---------------------------------------------------------------------------------------------------- [20:46:30] Forrest Chang(@fkchang):@flajann2 Depends on what it is you need/want to do. More often than not I find myself not needed libraries. The only one I've used in depth w/Opal is Lissio, which most ppl seem to not grok, but with React getting popular, more people might. D3 on the other hand, I'd just wrap ( I think someone took a stab at it already, maybe it was a blog post I read) coz it's too much effort to redo in Opal, and performance is an issue. ---------------------------------------------------------------------------------------------------- [20:48:31] Forrest Chang(@fkchang):Just having real classes, sane scoping, and high level language makes a lot of JS libs/frameworks unecessary ---------------------------------------------------------------------------------------------------- ############################## [2015-04-09] ############################## [14:21:47] Elia Schito(@elia):'t was lol :D ---------------------------------------------------------------------------------------------------- [14:40:11] Juan Francisco Giménez Silva(@juanfgs):got it working! :) ---------------------------------------------------------------------------------------------------- [14:42:42] Juan Francisco Giménez Silva(@juanfgs):I created this Rakefile http://pastebin.com/epbarJqD just in case some one is struggling with that issue ---------------------------------------------------------------------------------------------------- [14:42:43] Juan Francisco Giménez Silva(@juanfgs): still don't know why it doesn't work with just gem install and ruby -r opal-browser, but this seems to work ---------------------------------------------------------------------------------------------------- [14:51:38] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [16:01:21] Forrest Chang(@fkchang):@adambeynon @elia seems like the react.rb dsl is very close to @meh 's paggio, maybe that could be the common template format for rails and react.rb ---------------------------------------------------------------------------------------------------- [04:41:51] Fred Mitchell(@flajann2):Thanks @fkchang and @jaredcwhite for your inputs. I am creating a control panel for my neural network engine RubyNEAT, and eventually want it to be a full-blown dev environment where you can monitor the evolution and make changes to some of the parameters, tweaking them in real time. So it will be heavy on the visualization. I find D3 annoying to work with directly, but like its performance. Angular 2 is coming out soon as well, but would just rather (re)do everything in Opal. Using Sinatra as a light-weight interface to RubyNEAT as a plugin, but I don't like some of the issues I am having with it, as Sinatra wants to "steal" the entire show... ---------------------------------------------------------------------------------------------------- [04:47:03] Fred Mitchell(@flajann2):Lisso is looking pretty good. I think I will try that. ---------------------------------------------------------------------------------------------------- [13:31:40] Juan Francisco Giménez Silva(@juanfgs):hi there ---------------------------------------------------------------------------------------------------- [13:32:11] Elia Schito(@elia):hi ---------------------------------------------------------------------------------------------------- [13:32:44] Juan Francisco Giménez Silva(@juanfgs):I have a PHP site with a custom JS app using Websockets, I'm considering using opal to tidy up the code ---------------------------------------------------------------------------------------------------- [13:33:41] Juan Francisco Giménez Silva(@juanfgs):but I'm kinda clueless on how should I go for it, I'm trying to compile using opal -F output.js myfile.rb but it fails when requiring the 'browser' library (I already have the gem installed) ---------------------------------------------------------------------------------------------------- [13:35:24] Elia Schito(@elia):try `ruby -r opal-browser -S opal –c myfile.rb > myfile.js` ---------------------------------------------------------------------------------------------------- [13:37:25] Elia Schito(@elia):@meh can you release an updated opal-browser to rubygems? ---------------------------------------------------------------------------------------------------- [13:39:03] Juan Francisco Giménez Silva(@juanfgs):it returns /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- opal-browser :( despite I just installed opal-browser with gem install opal-browser --pre ---------------------------------------------------------------------------------------------------- [13:39:52] Elia Schito(@elia):yeah, just noticed the realsed version is still for opal-0.6 ---------------------------------------------------------------------------------------------------- [13:40:39] Elia Schito(@elia):@juanfgs if you're using bundler you can add it as a git dependency tho… ---------------------------------------------------------------------------------------------------- [13:41:19] Juan Francisco Giménez Silva(@juanfgs):let me try that ---------------------------------------------------------------------------------------------------- [13:51:20] Juan Francisco Giménez Silva(@juanfgs):still fails :( ---------------------------------------------------------------------------------------------------- [14:07:52] Adam Beynon(@adambeynon):@elia: Have you tried opal-react yet? Im considering moving an app from opal-haml to use it instead ---------------------------------------------------------------------------------------------------- [14:08:08] Adam Beynon(@adambeynon):(currently about 100 views/templates) ---------------------------------------------------------------------------------------------------- [14:08:19] Elia Schito(@elia):@adambeynon not seriously ---------------------------------------------------------------------------------------------------- [14:09:03] Adam Beynon(@adambeynon):@elia As with anything I’ve done backbone based, it just ends up in files full of DOM selectors for updating and event registering ---------------------------------------------------------------------------------------------------- [14:09:52] Adam Beynon(@adambeynon):but, the shared templates with rails is the one reason I havent tried something else (yet) ---------------------------------------------------------------------------------------------------- [14:10:33] Elia Schito(@elia):I'm don't use client views heavily, current app has just 1 ---------------------------------------------------------------------------------------------------- [14:10:59] Elia Schito(@elia):And I re-render each time the model changes ---------------------------------------------------------------------------------------------------- [14:11:27] Elia Schito(@elia):Best thing would be to produce react components from haml… ---------------------------------------------------------------------------------------------------- [14:13:43] Adam Beynon(@adambeynon):@elia yeap, trying to work that out atm. To allow “normal” haml templates and “react” style templates would probably need a new file extension to keep sprockets working ok ---------------------------------------------------------------------------------------------------- [14:19:39] Elia Schito(@elia):@adambeynon also I guess it would require a new Haml::Compiler to produce react js code instead of strings… ---------------------------------------------------------------------------------------------------- [14:21:10] Adam Beynon(@adambeynon):@elia writing compilers is fun though! (maybe) ---------------------------------------------------------------------------------------------------- [14:21:37] Elia Schito(@elia):I wrote a haml2erb gem once… ---------------------------------------------------------------------------------------------------- ############################## [2015-04-10] ############################## [18:45:24] Juan Francisco Giménez Silva(@juanfgs):Hi everyone ---------------------------------------------------------------------------------------------------- [22:30:25] Kurtis Rainbolt-Greene(@krainboltgreene):@fkchang @elia: I noticed that as well, I'm wroking on a pure ruby gem that JUST does the HTML portion. ---------------------------------------------------------------------------------------------------- [22:31:15] Kurtis Rainbolt-Greene(@krainboltgreene):With some validation and static analysis built in. ---------------------------------------------------------------------------------------------------- [22:46:32] Ryan Stout(@ryanstout):@adambeynon or @elia either of you around by chance? ---------------------------------------------------------------------------------------------------- [22:59:44] Ryan Stout(@ryanstout):anyway, when you guys get some time. I'm trying to make it so I can run more of Volt in with opal-rspec. The big problem I'm running into is with jquery. Basically I would like to just not load jquery in the specs since I can stub the dom stuff that gets used. The problem is in one part of Volt, I do: ```ruby if RUBY_PLATFORM == 'opal' require 'opal-jquery' end ``` Is there any way to make it not require opal-jquery when running in the specs? Thanks! ---------------------------------------------------------------------------------------------------- ############################## [2015-04-12] ############################## [16:00:26] Elia Schito(@elia):@ryanstout not in 0.6 ---------------------------------------------------------------------------------------------------- [16:01:16] Ryan Stout(@ryanstout):Volt is on 0.7 now. ---------------------------------------------------------------------------------------------------- [16:01:34] Elia Schito(@elia):0.7+ you can just use normal conditionals ---------------------------------------------------------------------------------------------------- [16:01:59] Ryan Stout(@ryanstout):And they will be run at compile time? ---------------------------------------------------------------------------------------------------- [16:02:00] Elia Schito(@elia):eg. unless defined? RSpec ---------------------------------------------------------------------------------------------------- [16:02:25] Ryan Stout(@ryanstout):will that work once you go back to sprockets? ---------------------------------------------------------------------------------------------------- [16:03:42] Elia Schito(@elia):yep the sprockets revival will require at runtime ---------------------------------------------------------------------------------------------------- [16:04:25] Ryan Stout(@ryanstout):Ok, so any ideas on a long term solution? (Thanks for the help) ---------------------------------------------------------------------------------------------------- [16:05:36] Elia Schito(@elia):Can't look at the code now, but the basic idea is that you treat it like normal ruby ---------------------------------------------------------------------------------------------------- [16:06:48] Ryan Stout(@ryanstout):Ok, thanks. ---------------------------------------------------------------------------------------------------- [16:11:02] Elia Schito(@elia):@krainboltgreene cool, is it based on paggio? ---------------------------------------------------------------------------------------------------- ############################## [2015-04-13] ############################## [01:19:35] Colin Gunn(@balmoral):An issue with Date class: #{Date.today} fails on call to #today (in tryopal and volt using opal-0.7.1). Similarly {Date.new.year} fails. But not {Date.new}. Seems wraps of Date methods which are implemented in Ruby are not compiled/visible in JS. Any help appreciated. ---------------------------------------------------------------------------------------------------- [08:26:06] Elia Schito(@elia):@balmoral /try has limited require support, maybe locally would work after requiring 'date' ---------------------------------------------------------------------------------------------------- [16:19:57] Forrest Chang(@fkchang):@adambeynon @elia @meh we should make something like this for opal http://shaunlebron.github.io/solar-system-of-js - the beauty it would be so much less complex ---------------------------------------------------------------------------------------------------- [21:07:28] Colin Gunn(@balmoral):thanks @elia, works in local opal, but not in volt so problem must be there ---------------------------------------------------------------------------------------------------- ############################## [2015-04-14] ############################## [17:05:14] Jared White(@jaredcwhite):Hi folks - I'm excited to say the first issue of the Opalist newsletter just went out today, and also the new website at http://opalist.co. Many thanks to Vais Salikhov for posting a link on Reddit a few days ago...I had no idea until I was getting ready to send out the newsletter today and saw there had been an influx of subscribers! If anyone has any cool links or tips for the next issue, let me know: hello@whitefusion.io ---------------------------------------------------------------------------------------------------- [17:07:19] Elia Schito(@elia):🚀 super! ---------------------------------------------------------------------------------------------------- [17:08:50] Adam Beynon(@adambeynon):@jaredcwhite awesome stuff! just received it. I was hoping to write a few blogs about the structure of a large opal app I have (about 1.8mb of minimized javascript - very large!). its a very mature app, so I think a lot of the structure could be useful for other people thinking about large opal apps - handling routes, controllers, caching json etc ---------------------------------------------------------------------------------------------------- [18:36:11] Bráulio Bhavamitra(@brauliobo):hello all, sorry for asking such a question, but anyone ever thought of a ruby vm based on opal? ---------------------------------------------------------------------------------------------------- [18:39:15] Adam Beynon(@adambeynon):@brauliobo opal (more specifically javascript) makes it difficult to support everything in ruby ---------------------------------------------------------------------------------------------------- [18:39:21] Adam Beynon(@adambeynon):a big problem would be Threads ---------------------------------------------------------------------------------------------------- [18:39:32] Adam Beynon(@adambeynon):so there are some things which we could never support ---------------------------------------------------------------------------------------------------- [18:40:34] Bráulio Bhavamitra(@brauliobo):@adambeynon threads is not supported by webworkers or something on node.js? ---------------------------------------------------------------------------------------------------- [18:40:48] Bráulio Bhavamitra(@brauliobo):what more would be difficult? ---------------------------------------------------------------------------------------------------- [18:41:56] Bráulio Bhavamitra(@brauliobo):https://github.com/audreyt/node-webworker-threads ---------------------------------------------------------------------------------------------------- [18:42:04] Bráulio Bhavamitra(@brauliobo):webworkers on node.js ---------------------------------------------------------------------------------------------------- [18:51:06] Forrest Chang(@fkchang):@jaredcwhite nice work -- ur giving me incentive to provide content for it ---------------------------------------------------------------------------------------------------- [18:52:27] Ryan Stout(@ryanstout):@adambeynon if you have a second, any ideas on the cause of this? https://github.com/opal/opal/issues/500 (I keep running into this one, and I might take a shot at fixing it for 0.8 if you can point me in the right direction) ---------------------------------------------------------------------------------------------------- [18:55:58] Jared White(@jaredcwhite):@fkchang Awesome! That's the idea :) @adambeynon That sounds great, I'd love to read about that. ---------------------------------------------------------------------------------------------------- [19:04:56] Ryan Stout(@ryanstout):@jaredcwhite great job on the first opalist :-) ---------------------------------------------------------------------------------------------------- [19:05:41] Ryan Stout(@ryanstout):@adambeynon one other question, maybe there's an issue for it. But the default inspect in irb shows instance variables, would you take a PR for that? ---------------------------------------------------------------------------------------------------- ############################## [2015-04-15] ############################## [13:50:26] Vais Salikhov(@vais):@jaredcwhite The pleasure's all mine, thank you, Jared! ---------------------------------------------------------------------------------------------------- [13:54:54] Vais Salikhov(@vais):@jaredcwhite BTW your "But your kids are gonna love it..." post has been in the number one spot on http://www.reddit.com/r/ruby all day today. Keep up the good work, this is exactly what Opal needs! ---------------------------------------------------------------------------------------------------- [18:36:04] meh.(@meh):@adambeynon I updated to master and lissio started breaking down, I've been trying to fix the Lissio::Server part but I'm failing, could you take a look please? I assume the problem comes from the upgrade to Sprockets 3. ---------------------------------------------------------------------------------------------------- [20:06:38] Forrest Chang(@fkchang):@ryanstout @adambeynon ironically I tackled the inspect thing for the same reason. I had to use a method I have in opal-irb that gives me just the "ruby instance variables" i.e. there are asserted instance variables that are not normal to ruby, i.e. for 0.7.1 there is @constructor and @toString, so I filter those out. I gave a coworker a monkey patch to run in his opal-irb ---------------------------------------------------------------------------------------------------- ############################## [2015-04-16] ############################## [05:31:08] Ryan Stout(@ryanstout):@adambeynon or @elia have either of you ran into this issue? (https://github.com/opal/opal/issues/801) I'm hoping this is something I can patch support in. Its a blocker for me :-) ---------------------------------------------------------------------------------------------------- [05:41:39] Ryan Stout(@ryanstout):ok, tracked down the issue. Basically ```true.hash``` doesn't return a consistent value. ---------------------------------------------------------------------------------------------------- [05:42:15] Ryan Stout(@ryanstout):@elia I think you worked on the hashing stuff, hit me up when you get time. I've got a question, but I can do a PR fix. ---------------------------------------------------------------------------------------------------- [18:36:05] Vitor Capela(@dodecaphonic):I'm mapping a library with the classic case of taking a callback as a block. When it comes to executing the thing in an async test, however, I get `undefined is not a function`. Analyzing it further, It boils down to a NoMethodError calling `continue_async` on nil. Any tips? ---------------------------------------------------------------------------------------------------- [18:58:17] Vitor Capela(@dodecaphonic):I have a lot of other async tests running fine, using Promises as the async mechanism. When I go to raw procs or even passing lambdas, I get that sort of error. ---------------------------------------------------------------------------------------------------- [19:28:59] Elia Schito(@elia):Maybe the block is instance evaled so that self is no more the example ---------------------------------------------------------------------------------------------------- ############################## [2015-04-17] ############################## [17:25:33] Forrest Chang(@fkchang):@elia @adambeynon @meh what is the general guidelines on using Native vs not. I've been doing some stuff w/google maps and some other js wrappers to that, and I've been mixing it up, partly because I can only get some things to work w/o calling Native and using x strings. From the Ruby perspective, I'd like to use Native all the time, and minimize my use of x strings ---------------------------------------------------------------------------------------------------- [17:26:45] meh.(@meh):@fkchang personally I use it as a helper to build wrappers around libraries, but what's not working that forces you to go with x-strings? ---------------------------------------------------------------------------------------------------- [21:11:04] Forrest Chang(@fkchang):@meh I suspect it was a non correct conversion of types a few layers down, i.e. map.bounds.extendWith(arrayOfJsObjs), where I originally called Native on map. I started w/JS and converted, I couldn't get it all working, and ended up doing the x strings wrapping that worked ---------------------------------------------------------------------------------------------------- ############################## [2015-04-19] ############################## [14:24:55] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Any plans to implement URI? ---------------------------------------------------------------------------------------------------- [17:32:16] Elia Schito(@elia):@krainboltgreene I started about a year ago I think but there were too many issues with regexps… ---------------------------------------------------------------------------------------------------- ############################## [2015-04-20] ############################## [00:48:49] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Alright, I'm going to work on it I think. Not specifically the corelib, but rather a lib for doing that sort of thing. ---------------------------------------------------------------------------------------------------- [00:49:37] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [11:55:14] Vitor Capela(@dodecaphonic):@elia Forgot to thank you the other day. Thank you :) ---------------------------------------------------------------------------------------------------- [15:19:27] Elia Schito(@elia):@dodecaphonic hi5 ---------------------------------------------------------------------------------------------------- [17:18:43] Jared White(@jaredcwhite):@krainboltgreene Sounds great. For some reason, every time I try working with URIs in Javascript it gives me a headache. A nice clean Ruby-esque lib would be lovely. ---------------------------------------------------------------------------------------------------- [20:34:24] Ryan Stout(@ryanstout):@elia you still around? ---------------------------------------------------------------------------------------------------- [23:06:47] Elia Schito(@elia):Sup? ---------------------------------------------------------------------------------------------------- ############################## [2015-04-21] ############################## [13:24:37] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Any details on kwarg process? I have quite a few pure ruby gems using kwargs that would be great to have in opal-land. ---------------------------------------------------------------------------------------------------- [13:25:39] Elia Schito(@elia):@krainboltgreene basic support is there for kwargs, you have any particular issue? ---------------------------------------------------------------------------------------------------- [13:30:00] Kurtis Rainbolt-Greene(@krainboltgreene):Wait really? I could have sworn I read that it wasn't. I'll try now. ---------------------------------------------------------------------------------------------------- [13:30:23] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [13:34:43] Kurtis Rainbolt-Greene(@krainboltgreene):Wow ---------------------------------------------------------------------------------------------------- [13:35:07] Kurtis Rainbolt-Greene(@krainboltgreene):I changed a library completely over to non-kwargs because I thought kwargs weren't supported. Oh god I need a drink :P ---------------------------------------------------------------------------------------------------- [13:35:46] Elia Schito(@elia):go get it or watch railsconf live: https://twitter.com/elia/status/590499249655324674 ---------------------------------------------------------------------------------------------------- [13:41:35] Kurtis Rainbolt-Greene(@krainboltgreene):I'm not there. ---------------------------------------------------------------------------------------------------- [16:29:38] AstonJ(@AstonJ):Anyone catch the DHH keynote? So Rails 5 introducing ActionCable https://rubygems.org/gems/actioncable (Native support for Websockets in Rails 5) ---------------------------------------------------------------------------------------------------- [16:30:24] Elia Schito(@elia):oh, cool, didn't check rubygems for it ---------------------------------------------------------------------------------------------------- [16:38:55] Adam Beynon(@adambeynon):Looking forward to that, and seeing how they implement it. always found faye <=> rails a bit tricky and awkward to work nicely ---------------------------------------------------------------------------------------------------- [16:39:11] Adam Beynon(@adambeynon):might help volt + rails work a bit nicer as well ---------------------------------------------------------------------------------------------------- [16:40:30] AstonJ(@AstonJ):I was thinking it might be good for Fire :D Think they used http://www.phoenixframework.org as inspiration. ---------------------------------------------------------------------------------------------------- [16:41:31] AstonJ(@AstonJ):I haven't seen the talk yet - look forward to confreaks putting it online haha ---------------------------------------------------------------------------------------------------- [16:43:12] Adam Beynon(@adambeynon):Ahh, I didn’t know about phoenix - I heard him mention it ---------------------------------------------------------------------------------------------------- [16:43:18] Adam Beynon(@adambeynon):going to have a good read of that ---------------------------------------------------------------------------------------------------- [18:50:55] Kurtis Rainbolt-Greene(@krainboltgreene):Great, even more coupled pieces between the rails frontend and backend. ---------------------------------------------------------------------------------------------------- ############################## [2015-04-22] ############################## [05:48:09] George Plymale II(@ylluminarious):hey, i just wrote a post in the phaser forum about using opal to rewrite phaser for phaser 3: http://www.html5gamedevs.com/topic/13599-reconsidering-building-phaser-3-in-typescript/?p=79737 if anyone wants to offer community support with that, that'd be great :) ---------------------------------------------------------------------------------------------------- [16:06:45] Bernhard Weichel(@bwl21):How can I clone a Javascript object? ```ruby curnote = `Abc.get_abcModel()` # somehow get the javascript object myclone = Native(curnote).clone # always returns Nil ``` ---------------------------------------------------------------------------------------------------- [16:10:50] Elia Schito(@elia):I think one of the techniques is `JSON.parse(JSON.stringify(obj))` ---------------------------------------------------------------------------------------------------- [16:27:32] Bernhard Weichel(@bwl21):the problem is that curnote contains circular references so JSON.stringify does not work. If I could get the keys of the object (e.g. `curnote.keys`) i could implement a generic clone or dup. but curnote.keys also delivers Nil, and I could not find out how to get the keys of an object. ---------------------------------------------------------------------------------------------------- [17:53:35] Ryan Stout(@ryanstout):question, is phantom 2.0 still an issue on opal-rspec? ---------------------------------------------------------------------------------------------------- [18:03:29] Adam Beynon(@adambeynon):@ryanstout not sure . I keep getting the warnings, but not sure what version of phantom im using (on mobile, can’t check) ---------------------------------------------------------------------------------------------------- [18:03:40] Adam Beynon(@adambeynon):I have nt made any fixes for the issue though] ---------------------------------------------------------------------------------------------------- [18:11:51] Ryan Stout(@ryanstout):@adambeynon ok, no worries, just was curious. Someone was running into phantom 2.0 issues and I figured it was still a problem. ---------------------------------------------------------------------------------------------------- [18:12:31] Ryan Stout(@ryanstout):@adambeynon also, sorry to ask, but are you thinking 0.8 will go out soon? (debating what to do about sourcemaps) ---------------------------------------------------------------------------------------------------- [19:34:34] Adam Beynon(@adambeynon):@ryanstout yes, really as soon as we can get things together ---------------------------------------------------------------------------------------------------- [19:34:45] Adam Beynon(@adambeynon):I believe @elia has fixed all the source map stuff ---------------------------------------------------------------------------------------------------- [19:34:57] Adam Beynon(@adambeynon):there isn’t anything “major” to do before release ---------------------------------------------------------------------------------------------------- [19:35:11] Adam Beynon(@adambeynon):I guess we could release a beta asap to check for issues and see where we get ---------------------------------------------------------------------------------------------------- [19:35:24] Ryan Stout(@ryanstout):@adambeynon ok, cool. Sorry to bug you on it. Was just debating if I should try and worry about 0.7, or just wait. ---------------------------------------------------------------------------------------------------- [21:40:34] Elia Schito(@elia):@adambeynon @ryanstout the only thing that still bugs me is that we can't enable optim ops by default yet as some specs fail /cc @meh @vais ---------------------------------------------------------------------------------------------------- [21:40:55] Ryan Stout(@ryanstout):@elia what's optim ops? Is that inline ops? ---------------------------------------------------------------------------------------------------- [23:41:11] Elia Schito(@elia):yes, sorry, was writing onehanded ---------------------------------------------------------------------------------------------------- ############################## [2015-04-23] ############################## [07:50:59] Elia Schito(@elia):@ylluminarious alias_native is for methods, not for properties, including native should already set a method_missing handler that will respond with the property value iirc ---------------------------------------------------------------------------------------------------- [07:52:43] Elia Schito(@elia):…but apparently *I don't recall correctly* >.< ---------------------------------------------------------------------------------------------------- [07:52:58] Elia Schito(@elia):The solution seems to be this: ---------------------------------------------------------------------------------------------------- [07:52:59] Elia Schito(@elia):http://opalrb.org/try/?code:%25x%7B%0Afunction%20Class%20()%20%7B%0Athis.food%20%3D%20%7Bname%3A%20%22pizza%22%2C%20flavor%3A%20%22cheesy%22%7D%3B%0Athis.drink%20%3D%20%7Bname%3A%20%22root%20beer%22%2C%20flavor%3A%20%22carbonated%20sugar%20water%22%7D%3B%0Athis.array_of_objects%20%3D%20%5Bthis.food%2C%20this.drink%5D%3B%0A%7D%0A%7D%0A%0Aclass%20WrappedClass%0A%20%20include%20Native%0A%20%20%0A%20%20def%20initialize%0A%20%20%20%20%40native%20%3D%20%60new%20Class()%60%0A%20%20end%0A%20%20%0A%20%20alias_native%20%3Aarray_of_objects%0Aend%0A%0Awrapped_class%20%3D%20WrappedClass.new%0Awrapped_class.array_of_objects.each%20do%20%7Celement%7C%0A%20%20if%20Native(element).name%20%3D%3D%20%22pizza%22%0A%20%20%20%20puts%20%22this%20is%20the%20pizza%20element%22%0A%20%20end%0Aend ---------------------------------------------------------------------------------------------------- [07:54:38] Elia Schito(@elia):problem is that native doesn't cross the border of bridged classes I think, but when an Array, which is bridged contains native elements it fails because the Array already is marked as "opal-ready" and thus Native won't check/wrap its contents cc: @meh @adambeynon ---------------------------------------------------------------------------------------------------- [08:37:45] Elia Schito(@elia):> does that give a significant performance improvement? @ryanstout only on math ops, on that it's dramatic, it's the difference between method call with proto chain lookup and func call (which is substantially inlined by all browsers) ---------------------------------------------------------------------------------------------------- [09:41:52] Adam Beynon(@adambeynon):@elia @ryanstout also, on non-math object (i.e. anything not a number), the extra overhead is tiny (< 0.05% according to jsperf) ---------------------------------------------------------------------------------------------------- [09:42:00] Adam Beynon(@adambeynon):the only downside is ugly generated code ---------------------------------------------------------------------------------------------------- [09:42:05] Adam Beynon(@adambeynon):but then, source maps.. ---------------------------------------------------------------------------------------------------- [09:43:03] Elia Schito(@elia):@adambeynon you had a look at the failures that come up when enabling the optimization? ---------------------------------------------------------------------------------------------------- [12:13:31] Vais Salikhov(@vais):@elia how do you run the specs with optimization enabled to see the failures? ---------------------------------------------------------------------------------------------------- [12:15:15] Elia Schito(@elia):@vais https://github.com/opal/opal/blob/6af46d725e44660309401582219ea0c3145cbb10/lib/opal/compiler.rb#L105 and https://github.com/opal/opal/blob/6af46d725e44660309401582219ea0c3145cbb10/lib/opal/sprockets/processor.rb#L66 ---------------------------------------------------------------------------------------------------- [12:18:35] Vais Salikhov(@vais):@elia right, I got that, but how do you actually execute the specs with that option enabled? I was looking for some env var or something... I mean `bundle exec rake ???` ---------------------------------------------------------------------------------------------------- [12:19:22] Elia Schito(@elia):@vais no, you just change the default value, that's our aim anyway, to enable them by default ---------------------------------------------------------------------------------------------------- [12:20:04] Elia Schito(@elia):but I must confess that having a way to run specs with different option combinations is a very good idea ---------------------------------------------------------------------------------------------------- [12:20:26] Elia Schito(@elia):and probably worth adding some of them as travis builds ---------------------------------------------------------------------------------------------------- [12:20:36] Vais Salikhov(@vais):Ahh, I see, it's easier than I thought :) I'll give it a try... ---------------------------------------------------------------------------------------------------- [12:21:10] Elia Schito(@elia):awesome ✨ ---------------------------------------------------------------------------------------------------- [12:22:39] Adam Beynon(@adambeynon):@elia just hit an interesting milestone with an Opal app. The “main” one I work on has just hit 2.0mb minimised javascript. the code base is now epic. ---------------------------------------------------------------------------------------------------- [12:22:59] Elia Schito(@elia):hey! ---------------------------------------------------------------------------------------------------- [12:23:31] Elia Schito(@elia):any chance I can put my :eyes: on it? ---------------------------------------------------------------------------------------------------- [12:23:36] Adam Beynon(@adambeynon):ls -al app/assets/javascripts/views/**/*.* | wc -l ---------------------------------------------------------------------------------------------------- [12:23:37] Adam Beynon(@adambeynon):193 ---------------------------------------------------------------------------------------------------- [12:23:44] Adam Beynon(@adambeynon):that is a lot of view classes! ---------------------------------------------------------------------------------------------------- [12:23:51] Elia Schito(@elia):indeed ---------------------------------------------------------------------------------------------------- [12:24:14] Adam Beynon(@adambeynon):I gave up on the idea of going from haml views -> react.rb ---------------------------------------------------------------------------------------------------- [12:24:19] Adam Beynon(@adambeynon):rewriting all those will be painfull ---------------------------------------------------------------------------------------------------- [12:25:41] Elia Schito(@elia):yes, the best would be to have haml compile directly to a react tree that can be compared to the currently rendered one and then perform its minimal updates ---------------------------------------------------------------------------------------------------- [12:29:07] Vais Salikhov(@vais):@elia setting `compiler_option :inline_operators, true, :as => :inline_operators?`, I am seeing 4 errors for the entire spec suite, in `Array#-`, `Array#+`, `String#*`, and `String#+`. Are those the failures you are referring to? Is there anything else? ---------------------------------------------------------------------------------------------------- [12:30:00] Elia Schito(@elia):Don't remember honestly, I quickly tried enabling it a month ago I think and lacked the time to look in detail ---------------------------------------------------------------------------------------------------- [12:30:49] Elia Schito(@elia):@vais give a try to `rake mspec_phantom` which uses phantomjs and sprockets to run the specs, just to add a different code path ---------------------------------------------------------------------------------------------------- [13:05:01] Vais Salikhov(@vais):@elia `brew install phantomjs`-ing now. I'll try to wrap my mind around it over the weekend. ---------------------------------------------------------------------------------------------------- [13:32:28] Vais Salikhov(@vais):Hmm... @elia with or without optimizations, here is what I get: ---------------------------------------------------------------------------------------------------- [13:32:38] Vais Salikhov(@vais):``` $ bundle exec rake mspec_phantom Starting MSpec Runner... [filters] Adding 43 spec files... [shared] Adding 160 spec files... [lexer] Adding 1 spec files... [parser] Adding 30 spec files... [rubyspecs] Adding 298 spec files... Thin web server (v1.6.3 codename Protein Powder) Maximum connections set to 1024 Listening on localhost:9999, CTRL+C to stop TypeError: undefined is not an object (evaluating 'args[0]') /Users/vais/GitHub/opal/lib/mspec/opal/sprockets.js:34 in global code ``` ---------------------------------------------------------------------------------------------------- [13:33:29] Vais Salikhov(@vais):Am I doing something wrong? I.e. does `rake mspec_phantom` work for you? ---------------------------------------------------------------------------------------------------- [14:34:41] George Plymale II(@ylluminarious):@elia thanks for the advice earlier! sorry, i didn't reply sooner; i was sleeping. ---------------------------------------------------------------------------------------------------- [14:35:30] Elia Schito(@elia):@vais eh, ok, I think it's this: https://github.com/opal/opal-rspec/blob/617560c4048708712a416697fd598d4f08ee1c20/lib/opal/rspec/rake_task.rb#L36-L45 ---------------------------------------------------------------------------------------------------- [16:17:50] Forrest Chang(@fkchang):@elia @adambeynon wrt haml-> react, how about paggio on both sides? opal-react's html dsl resembles paggio quite closely. ---------------------------------------------------------------------------------------------------- [16:23:58] Elia Schito(@elia):Paggio makes total sense unless you want to avoid migration from haml:) ---------------------------------------------------------------------------------------------------- [16:48:50] Forrest Chang(@fkchang):@elia a haml -> paggio converter shouldn't be too hard, no? ---------------------------------------------------------------------------------------------------- [16:49:39] Forrest Chang(@fkchang):though I had a problem trying to add paggio to my opal-rails app by itself the other day, not certain what the issue was but even the simplest example sent Chrome into some kind of infinite loop, @meh thought it might be an inspect bug ---------------------------------------------------------------------------------------------------- [16:51:07] Forrest Chang(@fkchang):Also, I'm seeing a bunch people seemingly reinvent paggio, I think in part cuz ppl don't know it exists, or all the functionality that's in opal-browser. I will not, if you're using rails and opal-rails that jquery and opal-jquery are already bundled in. This time around I decided not to fight what was already there, but I strive towards jQuery free apps where possible ---------------------------------------------------------------------------------------------------- [16:51:31] meh.(@meh):@fkchang yeah, I tried to look but I couldn't see any issues with the inspect code, I'll have to dig deeper, did you try with other browsers? ---------------------------------------------------------------------------------------------------- [16:53:20] Forrest Chang(@fkchang):@meh I should try, but I backed away to get the task at hand finished. If I have time, I'll setup the simplest opal-rails w/paggio project that duplicates the erro ---------------------------------------------------------------------------------------------------- [16:53:43] meh.(@meh):@fkchang cool ---------------------------------------------------------------------------------------------------- [17:17:18] Forrest Chang(@fkchang):@meh creating the project from scratch was not too hard https://github.com/fkchang/test_paggio_and_rails -- I'll not that it does the same thing to safari. app/assets/javascripts/test_paggio.js.rb is the file ---------------------------------------------------------------------------------------------------- [17:51:52] Jared White(@jaredcwhite):@adambeynon Got a quick question on Promises, not sure if I'm doing something wrong or ran into a limitation. I'm trying to run some code whether the promise is resolved or rejected, for instance in an HTTP request via opal-query: ``` HTTP.get('/fooling/jsonstest').then do alert 'good!' end.fail do alert 'oops!' end.always do alert 'finished' end ``` But the "always" block doesn't actually happen always. My expectation would be to get "good!" + "finished" alerts if the request was successful, and "oops!" + "finished" alerts if not. Any ideas? ---------------------------------------------------------------------------------------------------- [18:42:09] Adam Beynon(@adambeynon):@jaredcwhite that would be my assumption as well. I’ll check with @meh as he implemented it. ---------------------------------------------------------------------------------------------------- [18:42:14] Adam Beynon(@adambeynon):but yes, that should be the case ---------------------------------------------------------------------------------------------------- [18:51:46] meh.(@meh):@adambeynon @jaredcwhite it's like that by design, I don't know if it would be possible to implement it like that since a rejection is short circuiting. ---------------------------------------------------------------------------------------------------- [18:52:41] Adam Beynon(@adambeynon):@meh does Promises A have anything similar to #always? ---------------------------------------------------------------------------------------------------- [18:53:14] meh.(@meh):adambeynon, I don't remember, I think not, #always was more like an lias to .then(&block).fail(&block) ---------------------------------------------------------------------------------------------------- [00:29:54] Ryan Stout(@ryanstout):does that give a significant performance improvement? ---------------------------------------------------------------------------------------------------- [04:44:37] George Plymale II(@ylluminarious):sorry, don't mean to interrupt the conversation here, but just a quick question about accessing js properties in native opal. i have an example here: http://cl.ly/0K0x1k3H1t0Y that models a problem i am currently having. if you run the code, you get an error saying that `element.$name()` is undefined (which is the code on line 21). the only way i can see to bypass this error is to do something like this: http://cl.ly/1I2O1t3X0W0O. however, i'd prefer to find a solution for this in native opal. does anyone have any ideas? ---------------------------------------------------------------------------------------------------- ############################## [2015-04-24] ############################## [22:24:12] Elia Schito(@elia):jk ---------------------------------------------------------------------------------------------------- [22:24:24] meh.(@meh):I didn't consider always would have to act that way ---------------------------------------------------------------------------------------------------- [22:26:21] Elia Schito(@elia):btw optparse implementation (by nobu + another guy) is really a mess ---------------------------------------------------------------------------------------------------- [22:26:35] Elia Schito(@elia):or at least not easily readable ---------------------------------------------------------------------------------------------------- [22:28:00] Ryan Stout(@ryanstout):@elia I've tried to read through optparse, its rough :-) ---------------------------------------------------------------------------------------------------- [22:28:07] Ryan Stout(@ryanstout):I think it's really really old though ---------------------------------------------------------------------------------------------------- [22:29:01] Elia Schito(@elia):yea, there are blobs of code that look a lot like C ---------------------------------------------------------------------------------------------------- [22:30:29] Ryan Stout(@ryanstout):@elia or @adambeynon any idea why require '...' wouldn't actually include code when using Opal.compile ---------------------------------------------------------------------------------------------------- [22:30:34] Ryan Stout(@ryanstout):or am I missing something obvious ---------------------------------------------------------------------------------------------------- [22:32:27] Elia Schito(@elia):Opal.compile == Opal::Compiler.new(…).compile irrc ---------------------------------------------------------------------------------------------------- [22:33:07] Elia Schito(@elia):I suggest using: `compiler = Opal::Compiler.new(…); compiler.compile; compiler.requires` which gives you the list of requires from a compiled file ---------------------------------------------------------------------------------------------------- [22:33:35] Elia Schito(@elia):Opal::Compiler is low level, Opal::Builder takes care of fetching requires ---------------------------------------------------------------------------------------------------- [22:34:15] Elia Schito(@elia):@ryanstout when `requirable: true` is passed to Opal::Compiler it will compile inside `Opal.module` (js) ---------------------------------------------------------------------------------------------------- [22:34:42] Elia Schito(@elia):then you'll be able to require the file in opal-land with Kernel#require (opal) ---------------------------------------------------------------------------------------------------- [22:35:07] Elia Schito(@elia):_inception, as always_ ---------------------------------------------------------------------------------------------------- [22:35:24] Ryan Stout(@ryanstout):so maybe I should be using Opal::Builder. The problem is right now I have to start with a string of code. Would that still work? ---------------------------------------------------------------------------------------------------- [22:35:31] Ryan Stout(@ryanstout):or is Opal::Builder for working with files? ---------------------------------------------------------------------------------------------------- [22:35:51] Elia Schito(@elia):Use Opal::Builder#build_str ---------------------------------------------------------------------------------------------------- [22:36:20] Elia Schito(@elia):alas you have no other option than checking the source to see docs, params, etc. ---------------------------------------------------------------------------------------------------- [22:36:55] Ryan Stout(@ryanstout):no worries, I can read through the source :-) ---------------------------------------------------------------------------------------------------- [22:37:05] Ryan Stout(@ryanstout):cool, that might have answered another question I had ---------------------------------------------------------------------------------------------------- [22:37:48] Elia Schito(@elia):feel free to add documentation! :P ---------------------------------------------------------------------------------------------------- [22:43:41] Ryan Stout(@ryanstout):is Opal::Builder going away in 0.8? ---------------------------------------------------------------------------------------------------- [22:47:24] Elia Schito(@elia):no, but I think it will stick with current 0.7 implementation, that kinda reinvents the sprockets wheel ---------------------------------------------------------------------------------------------------- [00:34:12] Forrest Chang(@fkchang):@elia @adambeynon so what's in 0.7.2? ---------------------------------------------------------------------------------------------------- [00:37:04] Elia Schito(@elia):Basically just fixed ENGINE_VERSION inside Opal ---------------------------------------------------------------------------------------------------- [00:37:55] Elia Schito(@elia):https://github.com/opal/opal/pull/806 ---------------------------------------------------------------------------------------------------- [05:48:44] Penn Su(@pencilcheck):so opal is rubyfire? ---------------------------------------------------------------------------------------------------- [06:08:21] Adam Beynon(@adambeynon):@pencilcheck rubyfire is a MVC style library that uses Opal. It is being extracted from a production app, but isn’t yet ready (taking longer than expected/not enough time to finish getting it ready) ---------------------------------------------------------------------------------------------------- [06:08:31] Adam Beynon(@adambeynon):it is similar to vienna, which is on github already ---------------------------------------------------------------------------------------------------- [06:10:20] Penn Su(@pencilcheck):Ah I see ---------------------------------------------------------------------------------------------------- [15:29:33] Jared White(@jaredcwhite):@adambeynon @meh Hmm, this feels like a bug to me. For example, using jQuery directly this works as I would expect: ``` $.get('/fooling/jsontest').done(function() { alert('$.get done!'); }).fail(function() { alert('$.get failed!'); }).always(function() { alert( "$.get finished" ); }); ``` ---------------------------------------------------------------------------------------------------- [15:33:45] Jared White(@jaredcwhite):There, the code in the always callback is run whether or not the promise was resolved or rejected ---------------------------------------------------------------------------------------------------- [15:34:30] meh.(@meh):@jaredcwhite makes sense, I'll give it a shot. ---------------------------------------------------------------------------------------------------- [17:33:40] Forrest Chang(@fkchang):@meh get a chance to check the paggio project? ---------------------------------------------------------------------------------------------------- [17:33:52] meh.(@meh):@fkchang not yet, I'll do it after the Promise stuff ---------------------------------------------------------------------------------------------------- [17:34:00] Forrest Chang(@fkchang):ok, cool ---------------------------------------------------------------------------------------------------- [20:21:41] Jared White(@jaredcwhite):@meh Cool, thanks ---------------------------------------------------------------------------------------------------- [21:03:31] ylluminate(@ylluminate):@ylluminate applauds @AstonJ & @elia for Twitter crusade. ---------------------------------------------------------------------------------------------------- [21:27:16] Ryan Stout(@ryanstout):did 0.7.2 go back to sprockets, or is that waiting for 0.8? ---------------------------------------------------------------------------------------------------- [21:27:55] ylluminate(@ylluminate):I thought I saw .8 ---------------------------------------------------------------------------------------------------- [21:36:40] AstonJ(@AstonJ):Thanks @ylluminate - I’m glad that conversation happened, because I will feel less guilty about supporting, promoting and helping Volt now; nobody can say we didn’t try our hardest to try and get DHH to adopt Opal/full stack Ruby. ---------------------------------------------------------------------------------------------------- [21:38:29] Elia Schito(@elia):@ryanstout 0.7.2 just fixes RUBY_ENGINE_VERSION ---------------------------------------------------------------------------------------------------- [21:39:09] Elia Schito(@elia):unless I messed up very badly :fearful: ---------------------------------------------------------------------------------------------------- [21:39:23] Ryan Stout(@ryanstout):@AstonJ DHH has a vested interest to keep things the same. (imho) ---------------------------------------------------------------------------------------------------- [21:39:33] Ryan Stout(@ryanstout):@elia no, I was just curious ---------------------------------------------------------------------------------------------------- [21:42:05] Elia Schito(@elia):I think opal should be a good rails citizen, and rails & volt can be friends too :) I don't like confrontational style very much as it yields very few results ---------------------------------------------------------------------------------------------------- [21:42:48] Ryan Stout(@ryanstout):true :-) ---------------------------------------------------------------------------------------------------- [21:42:56] Ryan Stout(@ryanstout):yea, I like DHH actually :-) ---------------------------------------------------------------------------------------------------- [21:43:10] Ryan Stout(@ryanstout):just saying he has more incentive to move slowly, because too many changes and he'll lose people ---------------------------------------------------------------------------------------------------- [21:43:22] Ryan Stout(@ryanstout):which is very understandable ---------------------------------------------------------------------------------------------------- [22:06:50] AstonJ(@AstonJ):I like DHH as well, I have a huge amount of respect for him both in relation to Ruby related stuff and personal stuff. I like that he stands up for what he believes in (often for the underdogs or those who are persecuted - something that I think takes guts) and of course I love Rails. But I love Ruby more. I think, like @ryanstout, that Rails has stagnated. It is 10 years old, and although they have done an amazing job to remain relevant, apps (note I don't say 'the web') is a very different place now. I think MVVm is more relevant, I think isomorphic Ruby is nicer (which should equate to better productivity), I think scalability is no longer an option and I think bags of old code and functionality that nobody uses anymore is a hinderance. This is why I am so excited about Volt - it is fresh, and has that certain something, that pizazz, that I think can capture the imagination of the next generation of developers/development. ---------------------------------------------------------------------------------------------------- [22:08:19] AstonJ(@AstonJ):I also think there is only so much you can achieve by being nice @elia, we've tried to get DHH to consider Opal for a while now, you and Adam even went to the trouble of giving him Active Support when that was his main criticism! I think we just have to accept that we have to make our own path. And I think it's totally fine that there will be inroads back to us (developers leaving Rails, Ember, etc) ...and that is only down to them, for not recognising that people wanted a pure (ish) Ruby option and all the other things that Volt and Opal is offering us. ---------------------------------------------------------------------------------------------------- [22:11:40] Elia Schito(@elia):I have no need to convince dhh to adopt opal, nicely or otherwise, having people that care and build awesome stuff is enough and in the long run all other players will notice. Rails had plenty of criticism, but I guess by now is quite established tech ---------------------------------------------------------------------------------------------------- [22:13:17] Elia Schito(@elia):I'd rather see energy spent making opal docs and improving the experience for newcomers ---------------------------------------------------------------------------------------------------- [22:13:51] Elia Schito(@elia):another example: RSpec prospers even if dhh kinda hates it ---------------------------------------------------------------------------------------------------- [22:14:56] Elia Schito(@elia):also the small part of activesupport I implemented was for me :P ---------------------------------------------------------------------------------------------------- [22:16:01] AstonJ(@AstonJ):It is the logical choice imo. Rails is Ruby, and most Rubyists love Ruby and want to write Ruby not JS. But yeah I agree with you, docs are severely lacking for Opal - we need some newbie guides. I keep toying with the idea of doing screen casts at Metaruby.com - just can’t fidn the time. ---------------------------------------------------------------------------------------------------- [22:18:57] meh.(@meh):I don't care either way, I just wanted Ruby in the browser :D ---------------------------------------------------------------------------------------------------- [22:19:40] Elia Schito(@elia):that's how we roll ---------------------------------------------------------------------------------------------------- [22:19:42] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [22:20:31] AstonJ(@AstonJ):Me too @meh! I don’t like JS (nor most other lamguages tbh - think I have a mental block!) give me Ruby any day of the week :grinning: ---------------------------------------------------------------------------------------------------- [22:21:13] Elia Schito(@elia):@meh switching gears, I'm trying to port optparse, and had to "implement" throw/catch, wdyt? ``` def catch(name) $__throwables__ ||= {} throwable_class = ($__throwables__[name] ||= Class.new(ArgumentError) { attr :object }) begin yield rescue throwable_class => throwable throwable.object end end def throw(name, object = nil) $__throwables__ ||= {} throwable_class = ($__throwables__[name] ||= Class.new(ArgumentError) { attr :object }) throwable = throwable_class.new throwable.object = object raise throwable end ``` ---------------------------------------------------------------------------------------------------- [22:21:17] Elia Schito(@elia):in Kernel ---------------------------------------------------------------------------------------------------- [22:23:18] meh.(@meh):wait, we don't have throw/catch? ---------------------------------------------------------------------------------------------------- [22:23:33] Elia Schito(@elia):doesn't seem so ---------------------------------------------------------------------------------------------------- [22:23:51] meh.(@meh):I think you should make Throwable class ---------------------------------------------------------------------------------------------------- [22:23:52] meh.(@meh):or something ---------------------------------------------------------------------------------------------------- [22:23:55] Elia Schito(@elia):you were using it to implement Promise#always? ;) ---------------------------------------------------------------------------------------------------- [22:23:58] meh.(@meh):instead of feeding off ArgumentError ---------------------------------------------------------------------------------------------------- [22:24:06] meh.(@meh):nope ---------------------------------------------------------------------------------------------------- [22:24:11] meh.(@meh):I just designed that part in a retarded way ---------------------------------------------------------------------------------------------------- ############################## [2015-04-25] ############################## [01:07:08] Ryan Stout(@ryanstout):@elia so if I'm using Opal::Builder.new.build_str, can I get source maps to work also? ---------------------------------------------------------------------------------------------------- [01:07:29] Ryan Stout(@ryanstout):its not spitting out the special comment ---------------------------------------------------------------------------------------------------- [01:07:52] Elia Schito(@elia):yes, bc that depends on the url you'll serve the file ---------------------------------------------------------------------------------------------------- [01:08:16] Elia Schito(@elia):save the builder: `builder = Opal::Builder.new(…)` ---------------------------------------------------------------------------------------------------- [01:08:29] Elia Schito(@elia):then `build_str` ---------------------------------------------------------------------------------------------------- [01:08:49] Elia Schito(@elia):then you should be able to access sourcemaps and single assets on the builder ---------------------------------------------------------------------------------------------------- [01:08:56] Elia Schito(@elia):don't remember the methods tho ---------------------------------------------------------------------------------------------------- [01:09:00] Elia Schito(@elia):also bedtime ---------------------------------------------------------------------------------------------------- [01:09:08] Elia Schito(@elia):good luck ;) ---------------------------------------------------------------------------------------------------- [01:13:21] Ryan Stout(@ryanstout):quick question though ---------------------------------------------------------------------------------------------------- [01:13:32] Ryan Stout(@ryanstout):so I'm not seeing the comment in the original file, is there an option I need to enable? ---------------------------------------------------------------------------------------------------- [01:13:37] Ryan Stout(@ryanstout):I have Opal.source_maps_enabled = true ---------------------------------------------------------------------------------------------------- [01:13:53] Ryan Stout(@ryanstout):I can dig through the source to find it if your gone :-) ---------------------------------------------------------------------------------------------------- [03:45:26] Jared White(@jaredcwhite):@yilluminate @astonj @elia Read through the tweetstorm with DHH and co. about Opal...this line really boggles my mind; https://twitter.com/dhh/status/591605198499479554 ---------------------------------------------------------------------------------------------------- [03:47:43] Jared White(@jaredcwhite):so...it's great to invent a whole new framework from scratch in an obscure language (first version of Rails), but now it's not worth it to support Ruby in the browser? That makes no sense to me whatsoever. And for the record, I really don't like Coffeescript...anyway, mad props for making a valiant effort! :clap: ---------------------------------------------------------------------------------------------------- [05:46:01] ylluminate(@ylluminate):i know, right?! precisely the same sentiment here. ---------------------------------------------------------------------------------------------------- [05:46:14] ylluminate(@ylluminate):pot, meet kettle ---------------------------------------------------------------------------------------------------- [12:00:03] AstonJ(@AstonJ):You shoul’ve joined in @jaredcwhite hehe - I’m still getting replies and notifications for that thread lol ---------------------------------------------------------------------------------------------------- [12:00:45] AstonJ(@AstonJ):And I totally agree with you - it just doesn’t make sense. ---------------------------------------------------------------------------------------------------- ############################## [2015-04-26] ############################## [15:43:15] Bernhard Weichel(@bwl21):I saw that opal 0.7.2 is available. Thanks for all effort in Opal. May I ask if there are some release notes. ---------------------------------------------------------------------------------------------------- [16:55:24] meh.(@meh):@jaredcwhite try Promise#always on master, it should work as expected now. ---------------------------------------------------------------------------------------------------- [17:54:30] meh.(@meh):@fkchang found the issue, the loop is actually an Opal bug, `string.gsub(/^[ \t]{#{string.scan(/^[ \t]*(?=\S)/).min.size rescue 0}}/, '')` causes an infinite loop ---------------------------------------------------------------------------------------------------- [17:59:55] meh.(@meh):@fkchang and I just realized it's actually a bug that I opened on Dec 15, 2013, https://github.com/opal/opal/issues/457 ---------------------------------------------------------------------------------------------------- [18:00:38] meh.(@meh):@fkchang it works on lissio because it doesn't use `Paggio::Formatter` ---------------------------------------------------------------------------------------------------- ############################## [2015-04-27] ############################## [00:10:53] Elia Schito(@elia):@bwl21 https://github.com/opal/opal/blob/master/CHANGELOG.md it's a super micro release ---------------------------------------------------------------------------------------------------- [10:09:51] Vais Salikhov(@vais):@meh @fkchang the fix for #457 is on the opal master branch :) ---------------------------------------------------------------------------------------------------- [14:59:15] Jared White(@jaredcwhite):@meh I'd love to try out your fix for Promise#always -- however I can't seem to run anything on the latest Opal master. I had updated another project to master a few days ago, and run into a huge issue and figured maybe I was doing something wrong and reverted, but now I just updated a simple test project and ran into the same issue. ---------------------------------------------------------------------------------------------------- [14:59:21] Jared White(@jaredcwhite):[Error] NameError: uninitialized constant Object::Document (anonymous function) (kernel.js, line 1137) $const_missing (module.js, line 329) get (runtime.js, line 75) (anonymous function) (index, line 214) global code (index, line 246) ---------------------------------------------------------------------------------------------------- [14:59:58] Jared White(@jaredcwhite):The issue seems to be that a bunch of extra library files (the opal-jquery stuff for example), as well as my own asset files, simply aren't being loaded. Maybe a Sprockets issue? ---------------------------------------------------------------------------------------------------- [15:01:33] Jared White(@jaredcwhite):Sorry -- I misspoke -- the compiled JS is loaded into the browser, but it's not accessible in the runtime context. For example, document.js is loaded from opal-jquery, but if I go to the console and type "Opal.Document" it is undefined. ---------------------------------------------------------------------------------------------------- [15:03:18] Jared White(@jaredcwhite):@adambeynon @fkchang BTW, I'm going to be sending out the next issue of the Opalist newsletter on Wednesday, so if you have any content/links you'd like me to include let me know in the next day or so. Thanks! ---------------------------------------------------------------------------------------------------- [22:09:52] Nathan Hopkins(@hopsoft):can someone demonstrate how to access a method on a global object. i'm using vue.js & would like to do this from opal. note `Vue` is a global. ``` Vue.directive("html-with-newlines", function (value) { this.el.innerHTML = String(value).replace(/\n/g, '
'); }); ``` ---------------------------------------------------------------------------------------------------- [22:10:43] Elia Schito(@elia):@hopsoft Easiest way is probably through `Native()` ---------------------------------------------------------------------------------------------------- [22:12:17] Nathan Hopkins(@hopsoft):I'm trying Native, but am getting: Uncaught NoMethodError: undefined method `directive' for # ---------------------------------------------------------------------------------------------------- [22:12:49] Elia Schito(@elia):``` Vue = Native(`Vue`) Vue.directive('html-with-newlines', -> value { Native(`this`)[:el].innerHTML = String(value).gsub("\n", '
')} ``` ---------------------------------------------------------------------------------------------------- [22:13:11] Elia Schito(@elia):I see, it's a known problem ---------------------------------------------------------------------------------------------------- [22:13:22] Elia Schito(@elia):Proc == js Function ---------------------------------------------------------------------------------------------------- [22:14:04] Elia Schito(@elia):so whenever Native tries to guess if an object is a Native or an opal object gets confused if the object lives in both worlds ---------------------------------------------------------------------------------------------------- [22:14:50] Nathan Hopkins(@hopsoft):any workarounds? ---------------------------------------------------------------------------------------------------- [22:15:13] Nathan Hopkins(@hopsoft):other than backticks with js? ---------------------------------------------------------------------------------------------------- [22:16:33] Elia Schito(@elia):you can still wrap it manually: ``` class Vue < Struct.new(:native) def self.directive(selector, &block) `window.Vue.directive(selector, fuction(value) { #{block.call(value)} }` end end ``` ---------------------------------------------------------------------------------------------------- [22:16:49] Elia Schito(@elia):a great example of this technique is opal-jquery ---------------------------------------------------------------------------------------------------- [22:17:57] Elia Schito(@elia):@hopsoft if Native was viable you could have used `$$` which is the equivalent of ```Native(`window`)``` ---------------------------------------------------------------------------------------------------- [22:18:19] Elia Schito(@elia):@elia is looking up vue.js ---------------------------------------------------------------------------------------------------- [22:19:50] Elia Schito(@elia):@meh wdyt of adding a second option on `Kernel#Native` to force wrapping instead of guessing if it's native? ---------------------------------------------------------------------------------------------------- [22:20:17] meh.(@meh):@elia how do you mean? ---------------------------------------------------------------------------------------------------- [22:20:53] Elia Schito(@elia):a function isn't recognized as Native bc it's bridged to Proc ---------------------------------------------------------------------------------------------------- [22:21:10] Elia Schito(@elia):same goes with Array and all bridged objects ---------------------------------------------------------------------------------------------------- [22:21:21] Elia Schito(@elia):…be glad to be proven wrong tho ---------------------------------------------------------------------------------------------------- [22:22:52] Nathan Hopkins(@hopsoft):@elia thanks for the help ---------------------------------------------------------------------------------------------------- [22:23:10] Elia Schito(@elia):@meh e.g.: ``` > opal -rnative -e 'p Native(`[{},{a:1}]`).class' Array ``` ---------------------------------------------------------------------------------------------------- [22:23:39] Elia Schito(@elia):@hopsoft anytime ---------------------------------------------------------------------------------------------------- [22:24:10] meh.(@meh):@elia I don't like the idea, the point of Native is to only make an Opal object what is not ---------------------------------------------------------------------------------------------------- [22:25:03] Elia Schito(@elia):yeah, not attached to the solution, but I hear about the issue all the time ---------------------------------------------------------------------------------------------------- [22:25:05] meh.(@meh):I think Native::Array does something for that, but I might be remembering wrong, wouldn't be hard to check in Native if it's an Array and make everything inside a Native ---------------------------------------------------------------------------------------------------- [22:25:40] Elia Schito(@elia):it needs some special treatment for bridged objects as you don't really know if their contents are opal or native ---------------------------------------------------------------------------------------------------- [22:27:00] Elia Schito(@elia):that also prevents any constructor from being wrapped directly as it's recognized as a Proc ---------------------------------------------------------------------------------------------------- ############################## [2015-04-28] ############################## [15:57:49] AstonJ(@AstonJ):Speaking of uptake, I think resources play a significant part. I had gone off the idea, but I am thinking about doing screen casts at www.metaruby.com again to be a bit like egghead.io but with a forum as well. We were thinking of Voltcasts over at Volt, but I think a broader scope would help the whole Opal (/Ruby) community. What do you guys think? ---------------------------------------------------------------------------------------------------- [16:00:04] Adam Beynon(@adambeynon):@AstonJ of course. Railscasts was/is huge for rails uptake ---------------------------------------------------------------------------------------------------- [16:00:07] Elia Schito(@elia):> @AstonJ I’m not too woried about opal being “officially” supported in rails, in the same way that Haml isn’t, nor Slim, nor RSpec, etc completely agree ---------------------------------------------------------------------------------------------------- [16:01:39] Rick Carlino(@RickCarlino):@AstonJ : I've been doing more content creation out of my blog these days (www.datamelon.io/blog). If you want an guest/affiliate writer for content creation, let me know. I've got some Volt stuff in the works. ---------------------------------------------------------------------------------------------------- [16:01:42] Elia Schito(@elia):"Voltcasts" would be awesome, ppl need "how do I …" style tutorials ---------------------------------------------------------------------------------------------------- [16:01:56] Rick Carlino(@RickCarlino):Hell, is there a curated email list for the Opal / Volt community yet? ---------------------------------------------------------------------------------------------------- [16:02:34] Adam Beynon(@adambeynon):We do, yeap: http://www.opalist.co ---------------------------------------------------------------------------------------------------- [16:02:52] Adam Beynon(@adambeynon):new (only 1 mailing so far), but will be a nice central place for updates ---------------------------------------------------------------------------------------------------- [16:03:21] Rick Carlino(@RickCarlino):Awesome. I'll let you guys know when new content is up. ---------------------------------------------------------------------------------------------------- [16:07:10] AstonJ(@AstonJ):There’s Opalist.co - Adam beat me to it :p Rick, blog posts sound cool! I think we could probably keep a list of all publised posts on the Volt site somewhere, that will help for people clicking through and for SEO. I’ll run this past Ryan later. ---------------------------------------------------------------------------------------------------- [16:12:33] Elia Schito(@elia):@adambeynon I think we should promote the ML on opalrb.org and in the README, @jaredcwhite mind doing a PR? ---------------------------------------------------------------------------------------------------- [16:14:34] AstonJ(@AstonJ):Agree @elia - also add everything else that’s using Opal too? Such as Volt and Clearspring and Fire and I think even Active Support isn’t even mentioned on the site? ---------------------------------------------------------------------------------------------------- [16:15:29] AstonJ(@AstonJ):Btw @adambeynon, I think the link to my post is still broke on the RubyFire site ---------------------------------------------------------------------------------------------------- [16:15:58] Elia Schito(@elia):Yes I'll be glad to accept PRs and I think @adambeynon would agree to even give commit access to opalrb.org if a maintainer arises, docs really need some love ---------------------------------------------------------------------------------------------------- [16:21:44] AstonJ(@AstonJ):Nice. I am currently going through the Volt docs, I’ll try to move on to Opal after that. If any of you can write up some rough docs, I don’t mind trying to edit or re-write them? (I am crap at JS so probably shouldn’t be trusted with writing them myself lol) ---------------------------------------------------------------------------------------------------- [17:21:28] Michał Kalbarczyk(@fazibear):Hi Guys, I have a problem, trying to set up opal env with sprockets with opal-query, and when I require ‘opal-jquery’ have a following error: ---------------------------------------------------------------------------------------------------- [17:21:42] Michał Kalbarczyk(@fazibear):``` Opal::Builder::MissingRequire at /index.html A file required by "test" wasn't found. A file required by "opal-jquery" wasn't found. A file required by "opal/jquery" wasn't found. A file required by "opal/jquery/window" wasn't found. A file required by "opal/jquery/element" wasn't found. can't find file: "native" in ["/Users/fazibear/dev/opal/styles", "/Users/fazibear/dev/opal/views", "/Users/fazibear/dev/opal/opal", "/Users/fazibear/dev/opal/vendor", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/sourcemap-0.1.1/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/hike-1.2.3/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/multi_json-1.11.0/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/tilt-1.4.1/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-2.12.3/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/hike-1.2.3/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/tilt-1.4.1/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/opal-0.7.2/lib", "/Users/fazibear/.rubies/2.2.2/lib/ruby/gems/2.2.0/gems/opal-jquery-0.3.0/lib"] (in /Users/fazibear/dev/opal/views/index.html.slim) ``` ---------------------------------------------------------------------------------------------------- [17:22:00] Michał Kalbarczyk(@fazibear):Tried to require it with opal require, with sprockets directive, nothing works ---------------------------------------------------------------------------------------------------- [17:22:25] Michał Kalbarczyk(@fazibear):opal 0.7.2, opal-jquery 0.3.0 ---------------------------------------------------------------------------------------------------- [17:33:36] Michał Kalbarczyk(@fazibear):`can't find file: "native" in […]` ---------------------------------------------------------------------------------------------------- [17:55:07] ylluminate(@ylluminate):anyone successfully used `opal-browser` with `volt` yet? @gabrielrios was hitting a wall yesterday in the volt room regarding a problem: "Anyone have user opal-browser with volt? I’m trying some Canvas code here but getting uninitialized Error" ---------------------------------------------------------------------------------------------------- [17:55:51] ylluminate(@ylluminate):he's since moved on to another approach w/o opal-browser, but i thought it might be worth exploring a little to see if there may be some mutual community benefit on resolving the issue ---------------------------------------------------------------------------------------------------- [18:44:30] Forrest Chang(@fkchang):@ylluminate ---------------------------------------------------------------------------------------------------- [18:45:21] Forrest Chang(@fkchang):Opal browser can conflict with opal jQuery. That might be the source of you problems ---------------------------------------------------------------------------------------------------- [19:50:27] ylluminate(@ylluminate):@gabrielrios @fkchang noted something that i think we saw some time ago on another project (or was that @ylluminarious ?), i'm suspecting you already tested that? ---------------------------------------------------------------------------------------------------- [19:54:49] Gabriel Rios(@gabrielrios):I don’t think this is the case as I’m getting a Uninitialized constant error ---------------------------------------------------------------------------------------------------- [21:28:48] Elia Schito(@elia):@adambeynon still around? ---------------------------------------------------------------------------------------------------- [21:29:17] Elia Schito(@elia):looking at milestones I think it's a good time to release 1.1 https://github.com/opal/opal/milestones ? ---------------------------------------------------------------------------------------------------- [21:29:21] Elia Schito(@elia):lol jk ---------------------------------------------------------------------------------------------------- [21:53:08] AstonJ(@AstonJ):lol @elia ---------------------------------------------------------------------------------------------------- [21:55:44] Forrest Chang(@fkchang):@jaredcwhite when is the newsletter going out? Trying to finish it in time ---------------------------------------------------------------------------------------------------- [22:29:19] Ryan Stout(@ryanstout):just wanted to see if anyone here had any thoughts on a good way to serialize opal back to the server. Right now I'm using to_json, but that doesn't do things like dates. Any thoughts? ---------------------------------------------------------------------------------------------------- [22:33:24] Ryan Stout(@ryanstout):maybe I can use msgpack with extensions ---------------------------------------------------------------------------------------------------- [22:34:41] Elia Schito(@elia):implementing Marshal could be interesting… ---------------------------------------------------------------------------------------------------- [22:41:16] Jared White(@jaredcwhite):@fkchang It'll be going out 6am Pacific (USA) tomorrow (Wed.), so up to about 10pm Pacific tonight I'll be checking if there are any last minute additions :) :shipit: ---------------------------------------------------------------------------------------------------- [22:43:15] Jared White(@jaredcwhite):@elia You mean link to Opalist from the site/readme? That would be way cool. Yeah I will work on a PR. :bow: ---------------------------------------------------------------------------------------------------- [22:45:26] Elia Schito(@elia):@jaredcwhite great! ---------------------------------------------------------------------------------------------------- [23:29:01] Jared White(@jaredcwhite):@fkchang Was this the same problem you ran into? https://github.com/opal/opal/issues/817 cc @vais ---------------------------------------------------------------------------------------------------- [00:16:52] AstonJ(@AstonJ): ---------------------------------------------------------------------------------------------------- [12:56:02] Forrest Chang(@fkchang):@vais @meh thanks for the fix, like ---------------------------------------------------------------------------------------------------- [12:56:20] Forrest Chang(@fkchang):like @jaredcwhite I can't use master, things aren't working for me ---------------------------------------------------------------------------------------------------- [12:57:00] Forrest Chang(@fkchang):@jaredcwhite I have a 2nd post in the Rubyfying JS series that's 2/3 written, guess I need to finish it stat to get it in ---------------------------------------------------------------------------------------------------- [15:14:59] Vais Salikhov(@vais):@fkchang what's the problem you are having with master? Could you file an issue, something I can repro on my end? ---------------------------------------------------------------------------------------------------- [15:20:34] Forrest Chang(@fkchang):@vais Offhand I don't remember, I backed out the upgrade because I needed to get some stuff done. WHen I resume, I'll try to file something ---------------------------------------------------------------------------------------------------- [15:25:51] Forrest Chang(@fkchang):@AstonJ Related to your twitter crusade, I honestly don't understand why more Ruby web devs are diving into opal. GIven all the conference rejections I've gotten, I obviously must not be phrasing the message right. Lately, I've been thinking of "why wouldn't someone use opal for web if they're already a rubyist". As far as I can tell it's existing investment(say lots of Backbone/Angular whatever), and that might in the team members mentality, raw performance, or just thinking that opal is a toy ---------------------------------------------------------------------------------------------------- [15:26:00] Forrest Chang(@fkchang):otherewise, I can't think of any good reasons ---------------------------------------------------------------------------------------------------- [15:42:03] Adam Beynon(@adambeynon):@fkchang the lack of large open-source examples could hinder it as well ---------------------------------------------------------------------------------------------------- [15:42:12] Adam Beynon(@adambeynon):nothing like a large code base to show development stylw ---------------------------------------------------------------------------------------------------- [15:42:16] Adam Beynon(@adambeynon):style* ---------------------------------------------------------------------------------------------------- [15:47:56] AstonJ(@AstonJ):@fkchang Funnily enough, I have just been having a short exchange with DHH over email. He says he can only fit so many causes on his plate - and that right now Ruby in the browser isn’t one of them. I’ve asked him if there’s anything we can do to change his mind. **EDIT**: he’s just got back to me saying that we are unlikely to sway him :-(. Like you, I think there must be other reasons that is part of his reasoning (probably not wanting to re-write all that Coffescript for one, followed by other smaller factors). ---------------------------------------------------------------------------------------------------- [15:48:00] AstonJ(@AstonJ):But that’s ok, at least we tried, and tbh, it makes me feel a lot less guilty about supporting and promoting Volt - because at least nobody can say we didn’t try our hardest to get Opal in Rails. Not that Volt’s only appeal is Opal, the whole package in Volt is pretty awesome, and on many levels, a step-up from Rails in many regards. It’s fresh, with ideas to match. Lean (does not have baggage of legacy frameworks). Scalable, thanks to tech like JRuby compatible and web sockets. Cutting edge (adopted the current best methodologies) and of course gives us the power of Ruby in the browser (and minimises our exposure to JS!! haha) ---------------------------------------------------------------------------------------------------- [15:48:27] AstonJ(@AstonJ):@adambeynon - I think Volt is going to be Opal’s first killer app ;-) ---------------------------------------------------------------------------------------------------- [15:49:18] Rick Carlino(@RickCarlino):Sad to hear @AstonJ . That's the route I'm taking- I'm trying my hardest to promote Volt. It's the best road forward for the community at this point. We just need to sell it. And sell it hard. ---------------------------------------------------------------------------------------------------- [15:49:55] Adam Beynon(@adambeynon):@AstonJ I’m not too woried about opal being “officially” supported in rails, in the same way that Haml isn’t, nor Slim, nor RSpec, etc ---------------------------------------------------------------------------------------------------- [15:52:04] AstonJ(@AstonJ):Completely agree @RickCarlino - we have started a strategies team at Volt if you (or anyone else here) is interested in joining :) ---------------------------------------------------------------------------------------------------- [15:52:28] AstonJ(@AstonJ):All Volt needs is _one_ killer app. And I really don’t think it will be long before we see one :D ---------------------------------------------------------------------------------------------------- [15:53:06] AstonJ(@AstonJ):@adambeynon It just would have been nice (and fitting) that’s all. Look what Rails did for CS, completely unworthy imo. ---------------------------------------------------------------------------------------------------- ############################## [2015-04-29] ############################## [10:42:19] Elia Schito(@elia):where's the batman emoji ---------------------------------------------------------------------------------------------------- [10:42:21] Elia Schito(@elia):! ---------------------------------------------------------------------------------------------------- [10:48:37] Elia Schito(@elia):@adambeynon ``` _ ~/~/~/~/~/~/\~~/~/ _ _ \/__/_|/_/_/_|_/_/ _____*~~~ ** ~~~*_____ \____/ __* ___ |\__/| ___ *__ _* / 888~~\__(8OO8)__/~~888 \ *_ _* /88888888888888888888888888\ *_ * |8888888888888888888888888888| * /~* \8888/~\88/~\8888/~\88/~\8888/ *~ / ~* \88/ \/ (88) \/ \88/ *~ / ~* \/ \/ \/ *~ / ~~*_ _*~~/ / ~~~~~*___ ** ___*~~~~~ / / ~ ~ / / / / / / / / t__n__r__ / / | ####### | / ___ | ####### | ____i__ / / _____p_____l_l____ | ####### | | ooooo | qp i__p__ / | ############## | | ####### |__l___xp____| ooooo | |~~~~| oooo |_I_| ############## | | ####### |oo%Xoox%ooxo| ooooo |p__h__|##%#| oooo |ooo| ############## | | ####### |o%xo%%xoooo%| ooooo | |#xx%| oooo |ooo| ############## | | ####### |o%ooxx%ooo%%| ooooo |######|x##%| oooo |ooo| ############## | | ####### |oo%%x%oo%xoo| ooooo |######|##%x| oooo |ooo| ############## | | ####### |%x%%oo%/oo%o| ooooo |######|/#%x| oooo |ooo| ############## | | ####### |%%x/oo/xx%xo| ooooo |######|#%x/| oooo |ooo| ############## | | ####### |xxooo%%/xo%o| ooooo |######|#^x#| oooo |ooo| ############## | | ####### |oox%%o/x%%ox| ooooo |~~~$~~|x##/| oooo |ooo| ############## | | ####### |x%oo%x/o%//x| ooooo |_KKKK_|#x/%| ooo~\|ooo|~\############## | ~\####### |oox%xo%%oox%~\ooooo |_|~|~\|xx%/| ooo ||oHo| |####AAAA###### |h||##XX### |x%x%WWx%%/ox||ooDoo |_| |Y||xGGx| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~ ``` ---------------------------------------------------------------------------------------------------- [10:51:18] Vais Salikhov(@vais):HOLY BATMAN! Startled me on Alt-Tab! ---------------------------------------------------------------------------------------------------- [10:52:09] Vais Salikhov(@vais):Anyway, @elia, we have 99 open issues now :) https://github.com/opal/opal/issues/678 is closed ---------------------------------------------------------------------------------------------------- [10:53:35] Vais Salikhov(@vais):[99 issues](https://vimeo.com/50802768) ---------------------------------------------------------------------------------------------------- [11:03:44] Elia Schito(@elia):saw that, we're at 99 bottles now ---------------------------------------------------------------------------------------------------- [11:22:33] Michał Kalbarczyk(@fazibear):Hi, why this thing not work ? ---------------------------------------------------------------------------------------------------- [11:23:27] Michał Kalbarczyk(@fazibear):``` ` var Test; Test = (function() { function Test(a, b) { console.log(a); console.log(b); this.a = a; this.b = b; } Test.prototype.get_a = function() { return this.a; }; Test.prototype.get_b = function() { return this.b; }; return Test; })(); ` class RTest < `Test` end puts RTest.new(1,2) puts `new Test(1,2)` ``` ---------------------------------------------------------------------------------------------------- [11:24:46] Michał Kalbarczyk(@fazibear):Arguments passed to constructor is undefined ---------------------------------------------------------------------------------------------------- [11:29:35] Michał Kalbarczyk(@fazibear):Tried with RTest = Native(`Test`), but it also failed ---------------------------------------------------------------------------------------------------- [11:43:29] Michał Kalbarczyk(@fazibear):What I’m doing wrong ? ---------------------------------------------------------------------------------------------------- [12:02:50] AstonJ(@AstonJ):@vais I know Ryan has commented, but just wanted to say thanks for the feedback! (And yeah I agree, PG support is going to be a big plus :)) ---------------------------------------------------------------------------------------------------- [12:11:01] Elia Schito(@elia):@fazibear the original constructor is mapped to ruby's #allocate you probably want to override RTest.new ---------------------------------------------------------------------------------------------------- [12:12:03] Elia Schito(@elia):@fazibear I must say tho that your expectation make sense, maybe it's worth opening an issue or a PR to discuss the thing ---------------------------------------------------------------------------------------------------- [12:59:53] Forrest Chang(@fkchang):We need something like http://elixir-lang.org/learning.html - of course, we need to make that content 1st ---------------------------------------------------------------------------------------------------- [13:10:13] Michał Kalbarczyk(@fazibear):@elia This one works, but its little bit hakish :) ``` class RTest def self.new(a, b) Native(`new Test(#{a},#{b})`) end end ``` ---------------------------------------------------------------------------------------------------- [13:12:20] Elia Schito(@elia):this should also work: ``` class RTest < `Test` def self.new(a,b) `new Test(a,b)` end end ``` as the prototype is already augmented by inheriting from ``` `Test` ``` ---------------------------------------------------------------------------------------------------- [13:16:15] Michał Kalbarczyk(@fazibear):@elia, With your solution `puts RTest.new(1,2).get_a` not work ---------------------------------------------------------------------------------------------------- [13:18:07] Elia Schito(@elia):was missing a return ---------------------------------------------------------------------------------------------------- [13:18:15] Elia Schito(@elia):``` class RTest < `Test` def self.new(a,b) %x{return new Test(a,b);} end end puts RTest.new(1,2) ``` ---------------------------------------------------------------------------------------------------- [13:18:24] AstonJ(@AstonJ):I was looking at that earlier @fkchang totally agree. What happened to those screencasts you promised me last year :p hehe ---------------------------------------------------------------------------------------------------- [13:20:04] Vais Salikhov(@vais):@elia Yeah, that kinda sucks, I wish there was a way to make @fazibear's original code "just work" ---------------------------------------------------------------------------------------------------- [13:21:38] Michał Kalbarczyk(@fazibear):@elia, no, still not work. `[Error] TypeError: undefined is not a function (evaluating '$scope.get('RTest').$new(1, 2).$get_a()’)` ---------------------------------------------------------------------------------------------------- [13:23:38] AstonJ(@AstonJ):I know screencasts are time consuming tho @fkchang, and one of the ideas behind metaruby.com was to get devs like @adambeynon @elia @meh @ryanstout etc to do a screen recording of some aspect of their project just explaining something in particular - they don’t have to worry about scripts, or it being nice like a screencast or keeping an eye on time, just an overview or as much detail as they like, and then I/the metaruby team re-record the info into a new digestible screencast. This seems like a really good, fast-track way to get info and quality screencasts out there without too much hassle for devs. What does everyone else think about this idea? ---------------------------------------------------------------------------------------------------- [13:25:14] Elia Schito(@elia):@fazibear http://opalrb.org/try/?code:%60%0Avar%20Test%3B%0A%0ATest%20%3D%20(function()%20%7B%0A%20%20function%20Test(a%2C%20b)%20%7B%0A%20%20%20%20console.log(a)%3B%0A%20%20%20%20console.log(b)%3B%0A%20%20%20%20this.a%20%3D%20a%3B%0A%20%20%20%20this.b%20%3D%20b%3B%0A%20%20%7D%0A%0A%20%20Test.prototype.get_a%20%3D%20function()%20%7B%0A%20%20%20%20return%20this.a%3B%0A%20%20%7D%3B%0A%0A%20%20Test.prototype.get_b%20%3D%20function()%20%7B%0A%20%20%20%20return%20this.b%3B%0A%20%20%7D%3B%0A%0A%20%20return%20Test%3B%0A%0A%7D)()%3B%0A%60%0A%0Aclass%20RTest%20%3C%20%60Test%60%0A%20%20def%20self.new(a%2Cb)%0A%20%20%20%20%25x%7Breturn%20new%20Test(a%2Cb)%3B%7D%0A%20%20end%0A%20%20%0A%20%20alias_native%20%3Aget_a%0Aend%0A%0Aputs%20RTest.new(1%2C2)%0Aputs%20RTest.new(3%2C4).get_a%0Aputs%20%60new%20Test(1%2C2)%60 ---------------------------------------------------------------------------------------------------- [13:48:45] Michał Kalbarczyk(@fazibear):@elia, thanks, now I get it :) ---------------------------------------------------------------------------------------------------- [14:37:32] Forrest Chang(@fkchang):@AstonJ screencasts is still on list of things to do. the opalist mailing list is giving some sort of deadline incentive to churn out all the material that's been piling up that I've meant to publish in some form or another. I was really hoping to come up with that smalltalk/lisp machine cool tooling I hinted at w/opal-inspector, but stalled waiting for the method/comment lookup stuff in opal. @adambeynon said it's still on his list though. Maybe @vais knows enough to put that in. I also thought I might be able to fake some of that functionality (small talk object browser type functionality) if I could programmatically call source maps. At least enough to make a really compelling video to inspire ppl ---------------------------------------------------------------------------------------------------- [14:47:52] Forrest Chang(@fkchang):@elia @adambeynon any of you guys use opal-jquery against IE8? Having a problem, suspect that self.new breaks on IE8 coz new is a reserved word and won't work on IE8 ---------------------------------------------------------------------------------------------------- [14:48:19] Elia Schito(@elia):@fkchang I think it's fixed on master ---------------------------------------------------------------------------------------------------- [14:53:50] Forrest Chang(@fkchang):@elia is opal-jquery master against 0.8 ? ---------------------------------------------------------------------------------------------------- [15:00:06] Elia Schito(@elia):@fkchang opal master should be enough, opal-jquery master is probably a good idea too ---------------------------------------------------------------------------------------------------- [15:26:44] AstonJ(@AstonJ):Sounds good @fkchang. Quite a few people have expressed an interest in doing screen casts now which is great :) I think we definitely need some beginner tuts that introduce the concepts - just so people can get their heads around the idea. ---------------------------------------------------------------------------------------------------- [15:40:14] Forrest Chang(@fkchang):@elia we may submit a PR with the same self.new fix in the 0.7 since 0.8 doesn't work for us yet ---------------------------------------------------------------------------------------------------- [15:40:37] Elia Schito(@elia):sure, branch is 0-7-stable ---------------------------------------------------------------------------------------------------- [15:40:57] Forrest Chang(@fkchang):@AstonJ it's cool that there is interest in screen casts. I think beginner material of all kinds are needed. ---------------------------------------------------------------------------------------------------- [15:41:24] Forrest Chang(@fkchang):I'd consider writing a book, but then I'd have to understand all that stuff ;) , and then find the time to do it ---------------------------------------------------------------------------------------------------- [15:41:45] Forrest Chang(@fkchang):I think something that comprehensive will help, and more open source examples ---------------------------------------------------------------------------------------------------- [15:43:54] Forrest Chang(@fkchang):I suspect one reservation people have is that they don't think opal is ready for production. Comprehensive instructions/examples can help. Or it's a case of "I'd love to do Ruby in the browser, but I don't know how to XXX" and at the moment, googling doesn't yield the answer. ---------------------------------------------------------------------------------------------------- [15:44:55] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [16:09:10] AstonJ(@AstonJ):@fkchang yeah, book writing is haaard (at least if you are to do it properly). I started work on a Rails book once, but decided against it because Rails changes every year and you would need to make a long term commitment, keeping the book updated etc I agree with you about the reservations people might have - Opal really could do with a few screencasts on how to use it (say in Rails). It's actually one of the reasons why I think Volt is appealing, cos Ryan has done all the nitty gritty and if you learn Volt, you also end up learning all those things that you might otherwise have thought about using Opal for. I also think, that maybe as time goes on, Opal becomes the 'heart' of frameworks and tools like Volt, Fire and Clearspring, rather than something used independently. This I think makes sense on a number of fronts - the Opal team then only need to spend time helping a smaller number of devs - rather than thousands for example. ---------------------------------------------------------------------------------------------------- [21:09:24] Rick Carlino(@RickCarlino):What is this `magic-breakpoint` I keep hearing about? ---------------------------------------------------------------------------------------------------- [21:09:34] Rick Carlino(@RickCarlino):Is that a debug tool? ---------------------------------------------------------------------------------------------------- [23:43:21] Elia Schito(@elia):@RickCarlino never heard of that… ---------------------------------------------------------------------------------------------------- [00:11:46] Penn Su(@pencilcheck):@ryanstout what do you mean? the compiled code? or the data? ---------------------------------------------------------------------------------------------------- [00:11:50] Penn Su(@pencilcheck):or marshaling? ---------------------------------------------------------------------------------------------------- [00:32:59] Ryan Stout(@ryanstout):@elia the data. ---------------------------------------------------------------------------------------------------- [00:33:20] Ryan Stout(@ryanstout):Mostly I'm wishing json had a date type. ---------------------------------------------------------------------------------------------------- [02:34:45] Forrest Chang(@fkchang):@jaredcwhite ok, so I have about 2.5 hours. On it ---------------------------------------------------------------------------------------------------- [02:35:27] Forrest Chang(@fkchang):@jaredcwhite the symptoms in that opal issue look very similar to what i remember seeing. I'm wondering if we need to do additional requiring in 0.8 vs 0.7 ---------------------------------------------------------------------------------------------------- [03:08:59] Vais Salikhov(@vais):@AstonJ, this is my "two cents" only, please take with a grain of salt: Mongo is the elephant in the room. Nevermind its recent fall from grace, the meteoric rise and fall among the hipsters. The real issue is the disconnect between the general appeal and applicability of Volt on the one hand, and the narrow scope of Mongo on the other. Volt's association with Mongo will serve to hinder PR efforts attempted prior to the release of the data provider api. That is, if you want to talk about Volt and Rails in the same sentence, the Mongo-only issue has to be addressed. ---------------------------------------------------------------------------------------------------- [03:10:16] Ryan Stout(@ryanstout):@vais We're adding support for other databases, postgres support should be out shortly. ---------------------------------------------------------------------------------------------------- [03:16:59] Jared White(@jaredcwhite):@vais @ryanstout That's the only significant reason why I've been hesitant to dive deep into Volt. Knowing that postgres support is coming soon, I'm very excited to check that out! ---------------------------------------------------------------------------------------------------- [03:17:37] Ryan Stout(@ryanstout):I wish I had gotten the memo that everyone hated mongo before I started :-) Though that was two years ago, so everyone didn't then :-) ---------------------------------------------------------------------------------------------------- [03:17:52] Ryan Stout(@ryanstout):also, mongo was easier for me to implement due to a few reasons. ---------------------------------------------------------------------------------------------------- [03:56:35] Jared White(@jaredcwhite):Heh...3 years ago I built a Rails app using CouchDB. Found out that was even dumber than going with Mongo...ended up porting to postgres. Live and learn! ---------------------------------------------------------------------------------------------------- [04:02:45] ylluminate(@ylluminate):get excited @gabrielrios - note the very soon support of pgsql! ---------------------------------------------------------------------------------------------------- [04:04:40] ylluminate(@ylluminate):we used couch back about 5 years ago on a project @jaredcwhite. went surprisingly well. i still miss it sometimes, but pgsql just offers too much utility ---------------------------------------------------------------------------------------------------- [04:21:30] Forrest Chang(@fkchang):@jaredcwhite http://funkworks.blogspot.com/2015/04/ruby-fying-javascript-avoiding-jquery.html ---------------------------------------------------------------------------------------------------- [05:02:41] Vais Salikhov(@vais):@ryanstout two years ago everyone was loving mongo :) But seriously, this is not about loving or hating Mongo - I summarized my thoughts on this [here](http://www.reddit.com/r/ruby/comments/33eu6t/volt_090_is_here_and_its_amazing_xpost/cqkcmf2) in response to the 0.9.0 announcement. I really am excited about the promise of data provider API, and I know I'm not alone in this. I like to think that you tied Volt to Mongo on purpose, so that you get to build it out in relative calm, then drop Mongo and really take Volt public :) Cause there's no freaking chance in hell that a mongo-specific ruby framework is going to take the world by storm in 2015. But a storage-agnostic real-time isomorphic ruby framework that puts Rails to shame in terms of developer productivity just might ;) ---------------------------------------------------------------------------------------------------- [05:03:35] Ryan Stout(@ryanstout):@vais yea, I did mongo because it was fast to get up and running with. ---------------------------------------------------------------------------------------------------- [05:03:49] Ryan Stout(@ryanstout):(since Volt needs to parse queries and its easy to parse mongo queries) ---------------------------------------------------------------------------------------------------- [05:04:22] Ryan Stout(@ryanstout):@vais anyway, come chat in the volt gitter sometime if you want to chat more ---------------------------------------------------------------------------------------------------- [05:36:30] Jared White(@jaredcwhite):@fkchang got it, thanks!!! ---------------------------------------------------------------------------------------------------- [05:42:15] Ryan Stout(@ryanstout):does require_tree only work as a sprockets directive, or does it work directly in opal? ---------------------------------------------------------------------------------------------------- [06:23:31] Elia Schito(@elia):@ryanstout which version of Opal ? ---------------------------------------------------------------------------------------------------- [06:24:34] Elia Schito(@elia):on master I can tell it's parsed by the compiler and available as #required_trees iirc ---------------------------------------------------------------------------------------------------- [07:48:51] Elia Schito(@elia):@adambeynon ping ---------------------------------------------------------------------------------------------------- [07:50:23] Adam Beynon(@adambeynon):@elia yo yo ---------------------------------------------------------------------------------------------------- [07:52:10] Elia Schito(@elia):@adambeynon sup, anything you wanna take into 0.8 from this list https://github.com/opal/opal/milestones/0.8? ---------------------------------------------------------------------------------------------------- [07:53:15] Adam Beynon(@adambeynon):@elia hmmmmmmm, I had one thought which might help debugging. At the moment, when looking at stack traces, any blocks show up as $TMP_1, $TMP_2 etc, which isn’t very helpful. I thought about changing the temp variables names into something more useful ---------------------------------------------------------------------------------------------------- [07:53:25] Adam Beynon(@adambeynon):e.g. $block_in_array_each ---------------------------------------------------------------------------------------------------- [07:53:38] Elia Schito(@elia):that would be great ---------------------------------------------------------------------------------------------------- [07:53:54] Elia Schito(@elia):or even $Array_each ---------------------------------------------------------------------------------------------------- [07:55:06] Adam Beynon(@adambeynon):elia, yeap. its an easy fix, and would make debugging WAY easier. From what I can see, it would work in both chrome and safari in terms of stack traces ---------------------------------------------------------------------------------------------------- [07:55:19] Adam Beynon(@adambeynon):haven’t tried firefox, but I imagine it is a similar thingy ---------------------------------------------------------------------------------------------------- [07:59:38] Elia Schito(@elia):@adambeynon you already have it working locally? ---------------------------------------------------------------------------------------------------- [08:36:19] Elia Schito(@elia):I thought this was just local: https://travis-ci.org/opal/opal/jobs/60498552 ---------------------------------------------------------------------------------------------------- [08:37:19] Elia Schito(@elia):@adambeynon @vais you ever saw that ^^^? ---------------------------------------------------------------------------------------------------- [08:56:37] Vais Salikhov(@vais):@elia ow snap! Yes, I saw it while running specs on Chrome and on Chrome only. I suspect this has something to do with how the JS runtime is compiled, since on the same machine nodejs did not have a problem with it, and Chrome did, and both are V8. Well, actually, Chrome has a more recent V8 than node, so maybe its a newer version of node being used to run the specs on travis? ---------------------------------------------------------------------------------------------------- [09:01:50] Vais Salikhov(@vais):Anyhow, the fix would be to fiddle with the TOLERANCE constant here: https://github.com/opal/rubyspec/blob/master/spec_helper.rb#L44 ---------------------------------------------------------------------------------------------------- [09:02:21] Vais Salikhov(@vais):Currently `TOLERANCE = 0.00003 unless Object.const_defined?(:TOLERANCE)` ---------------------------------------------------------------------------------------------------- [09:04:08] Vais Salikhov(@vais):So, edit the spec_helper or define `TOLERANCE` before the specs are run. ---------------------------------------------------------------------------------------------------- [09:30:21] Elia Schito(@elia):@vais node v0.12 here, you have an earlier one? ---------------------------------------------------------------------------------------------------- [09:34:58] Vais Salikhov(@vais):$ node -v v0.10.35 ---------------------------------------------------------------------------------------------------- [09:35:14] Elia Schito(@elia):I guess we nailed it down ---------------------------------------------------------------------------------------------------- [09:35:44] Elia Schito(@elia):>> '%.8f' % (11226018484.0012 - 11226018484.001236) => "-0.00003624" ---------------------------------------------------------------------------------------------------- [09:37:34] Vais Salikhov(@vais):right, @elia, but I'm confused - I just did 2 PRs, one failed the other one didn't ---------------------------------------------------------------------------------------------------- [09:37:56] Elia Schito(@elia):My guess is that they're running on different machines ---------------------------------------------------------------------------------------------------- [09:38:08] Vais Salikhov(@vais):Hehe, that would explain it ---------------------------------------------------------------------------------------------------- [09:38:16] Elia Schito(@elia):and they're in the process of upgrading the default version of node ---------------------------------------------------------------------------------------------------- [09:38:22] Elia Schito(@elia):pushing a fix ---------------------------------------------------------------------------------------------------- [09:38:39] Vais Salikhov(@vais):Mystery solved :) ---------------------------------------------------------------------------------------------------- [09:39:25] Elia Schito(@elia):btw, 4.8k specs is awesome ---------------------------------------------------------------------------------------------------- [09:40:50] Vais Salikhov(@vais)::+1: ---------------------------------------------------------------------------------------------------- [10:04:42] Elia Schito(@elia):@vais so, you're still on the #format quest or you need another one? :P ---------------------------------------------------------------------------------------------------- [10:26:22] Vais Salikhov(@vais):@elia nope, that's 100% done. What do you have in mind? ---------------------------------------------------------------------------------------------------- [10:27:23] Elia Schito(@elia):nothing particular, just had a vague idea about trying to get the number of open issues / PR down ---------------------------------------------------------------------------------------------------- [10:27:50] Vais Salikhov(@vais):Do go on... ---------------------------------------------------------------------------------------------------- [10:28:55] Elia Schito(@elia):@vais got a bit envious when I saw the rubyhero sequel maintainer and they said he constantly keeps the number of issues at **zero** 😮 ---------------------------------------------------------------------------------------------------- [10:29:42] Elia Schito(@elia):so maybe there are some quests ready in there ---------------------------------------------------------------------------------------------------- [10:37:34] Vais Salikhov(@vais):A few weeks back I reviewed every issue and closed what I could. I will comb through it again to see if there's anything I can pick off now that I've gained some experience with Opal ;) ---------------------------------------------------------------------------------------------------- [10:37:39] Vais Salikhov(@vais):That said, a lot of the issues are discussions, WIPs etc. I don't see anything wrong with having those around, as long as they don't go stale. And many of them are, but I would need your help with those... ---------------------------------------------------------------------------------------------------- [10:39:23] Elia Schito(@elia):I'll be happy to help of course! ---------------------------------------------------------------------------------------------------- [10:39:37] Vais Salikhov(@vais):@elia LOL, we have exactly 100 open issues ---------------------------------------------------------------------------------------------------- [10:40:36] Vais Salikhov(@vais):And a lot of those are compiler issues that I just can't bring myself to figure out. We need @adambeynon back!!! ---------------------------------------------------------------------------------------------------- ############################## [2015-04-30] ############################## [02:44:29] Forrest Chang(@fkchang):4805058877 ---------------------------------------------------------------------------------------------------- [02:51:55] Rick Carlino(@RickCarlino):@fkchang Are you from Arizona? ---------------------------------------------------------------------------------------------------- [04:35:40] Forrest Chang(@fkchang):@RickCarlino no, accidentally posted that ---------------------------------------------------------------------------------------------------- [16:01:17] AstonJ(@AstonJ):Hey guys, I have just created a room for those interersted in doing Ruby/Opal/Volt/Clearwater screencasts - if any of you are interested let me know and I’ll add you // @fkchang @RickCarlino ---------------------------------------------------------------------------------------------------- [16:02:10] Forrest Chang(@fkchang):@AstonJ add me ---------------------------------------------------------------------------------------------------- [16:02:46] AstonJ(@AstonJ):Added :-) ---------------------------------------------------------------------------------------------------- [16:04:16] Forrest Chang(@fkchang):I suppose I should start trying to write a book just to document opal. I think I was hoping that I'd have written enough blogposts to have done that by now, but I came up short, though w/the opalist, it'll bring me up to a blogpost every 2 weeks. If I write the book @adambeynon @elia @meh will have to do a lot of proofreading... ---------------------------------------------------------------------------------------------------- [16:05:11] Forrest Chang(@fkchang):@AstonJ where's the room btw? ---------------------------------------------------------------------------------------------------- [16:05:38] AstonJ(@AstonJ):That’s great @fkchang - I’m happy to proof read once they have done the technical side if you like (I’m currently going thro the volt docs) ---------------------------------------------------------------------------------------------------- [16:05:49] AstonJ(@AstonJ):Room is AstonJ/rubyscreencasts ---------------------------------------------------------------------------------------------------- [16:06:04] AstonJ(@AstonJ):(Should show up on the left hand side?) ---------------------------------------------------------------------------------------------------- [16:06:35] Forrest Chang(@fkchang):@AstonJ it did not show up until I hit it direct via url ---------------------------------------------------------------------------------------------------- [16:07:13] AstonJ(@AstonJ):Might be cos there were no new posts after I added you :/ ---------------------------------------------------------------------------------------------------- [18:35:12] Rick Carlino(@RickCarlino): ---------------------------------------------------------------------------------------------------- [18:37:30] Rick Carlino(@RickCarlino):@AstonJ I'd love to join in. Having issues getting in though. Does Gitter have an invite feature? ---------------------------------------------------------------------------------------------------- [18:39:17] AstonJ(@AstonJ):@RickCarlino added you (it’s a private room) ---------------------------------------------------------------------------------------------------- [18:39:27] AstonJ(@AstonJ):Details in the first post :) ---------------------------------------------------------------------------------------------------- [22:26:56] AstonJ(@AstonJ):@jgaskins just pinging you in case you’re also interested in the screencasting idea... ---------------------------------------------------------------------------------------------------- [22:38:39] AstonJ(@AstonJ):Hi All, we are currently weighing up screencasting - either Volt/Opal specific or broader all-Ruby related. If you can, please retweet - we’re hoping to gauge interest: https://twitter.com/AstonJ/status/593901578186285056 ---------------------------------------------------------------------------------------------------- ############################## [2015-05-01] ############################## [02:22:04] Rick Carlino(@RickCarlino):http://crystal-lang.org/2015/04/30/crystal-0.7.0-released.html ---------------------------------------------------------------------------------------------------- [02:22:31] Rick Carlino(@RickCarlino):Looks like the nice folks at the Crystal project are celebrating a 0.7.0 release ---------------------------------------------------------------------------------------------------- [03:09:20] Kurtis Rainbolt-Greene(@krainboltgreene):I wish projects would realize how SEMVER actually works and stop being afraid of 1.0.0. I'm happy for their release, but man I don't need another project both pretending to be "in development" but talking as if you can use it in production. ---------------------------------------------------------------------------------------------------- [10:54:09] Elia Schito(@elia):@krainboltgreene to me opal is 1.0 from 0.3 which I had in production for several years ---------------------------------------------------------------------------------------------------- [11:17:11] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [16:58:33] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: So then why is it not 1.0.0 officially? ---------------------------------------------------------------------------------------------------- [16:59:50] Elia Schito(@elia):@krainboltgreene I'm not in charge :) opal is adam's project ---------------------------------------------------------------------------------------------------- [17:00:26] Kurtis Rainbolt-Greene(@krainboltgreene):Oh, that's...strange. ---------------------------------------------------------------------------------------------------- [17:01:17] Adam Beynon(@adambeynon):@elia we’re an open source democracy :heart: ---------------------------------------------------------------------------------------------------- [17:01:50] Adam Beynon(@adambeynon):@krainboltgreene I think 0.8 is going to be a last release before 1.0.0 ---------------------------------------------------------------------------------------------------- [17:02:17] Adam Beynon(@adambeynon):I think it will be a quick release between them as well. a lot of the bugs are being hammered out at the moment ---------------------------------------------------------------------------------------------------- [17:02:52] Kurtis Rainbolt-Greene(@krainboltgreene):It's fine if you're not using SEMVER. ---------------------------------------------------------------------------------------------------- [17:05:41] Adam Beynon(@adambeynon):SEMVER with opal is tricky, as “ruby compatibility” is a moving target ---------------------------------------------------------------------------------------------------- [17:06:03] Kurtis Rainbolt-Greene(@krainboltgreene):It's not really. There's a place in SEMVER for that, it's called the metadata section. ---------------------------------------------------------------------------------------------------- [17:30:06] Elia Schito(@elia):@adambeynon :heart: ---------------------------------------------------------------------------------------------------- [18:00:33] Forrest Chang(@fkchang):So there's a project I started but never finished, called opal-starter-kit, The idea was to have a cmd line tool generate all the various configurations, so getting started w/opal would be 2 steps 1) install the gem 2) call the cmd line w/the desired config, and go. I'd take it another step further w/the visual tools I will build, but I'd start w/that. https://github.com/fkchang/opal-starter-kit ---------------------------------------------------------------------------------------------------- [18:01:05] Forrest Chang(@fkchang):with the increased community activity, I thought it would be a good thing to bring up. Now we can tell people to run those 2 steps (after it works, I stopped working on it last year so it's certainly out of date) ---------------------------------------------------------------------------------------------------- [18:02:17] Kurtis Rainbolt-Greene(@krainboltgreene):@fkchang: Promoting my gem, architecture.gem a extraction of the tho file generation API ---------------------------------------------------------------------------------------------------- ############################## [2015-05-02] ############################## [09:28:53] Vais Salikhov(@vais):Yes, that's right! The solution is right there in the test suite! ---------------------------------------------------------------------------------------------------- [09:29:15] Vais Salikhov(@vais):mspec even has an option to run each `it` block multiple times ---------------------------------------------------------------------------------------------------- [09:29:42] Vais Salikhov(@vais):So, I think the solution is to leverage the spec suite and mspec itself ---------------------------------------------------------------------------------------------------- [09:30:09] Vais Salikhov(@vais):The issue that I'm struggling with is the general workflow for running this performance check ---------------------------------------------------------------------------------------------------- [09:30:35] Vais Salikhov(@vais):Logically, there's no escaping the fact that the suite would have to be run twice: ---------------------------------------------------------------------------------------------------- [09:30:40] Elia Schito(@elia):oh that's cool, we can add an allow failure entry that runs those block multiple times and set up some kind of boy that reports performance ---------------------------------------------------------------------------------------------------- [09:31:18] Vais Salikhov(@vais):once for the before, and once for the after, then the two can be compared ---------------------------------------------------------------------------------------------------- [09:31:31] Elia Schito(@elia):that would work locally of course but can give immediate feedback on IRC or on github ---------------------------------------------------------------------------------------------------- [09:31:47] Vais Salikhov(@vais):Right ---------------------------------------------------------------------------------------------------- [09:32:05] Vais Salikhov(@vais):But here's the problem: what about this before and after thing? ---------------------------------------------------------------------------------------------------- [09:32:29] Vais Salikhov(@vais):I mean, integrating it with git - there be dragons ---------------------------------------------------------------------------------------------------- [09:32:39] Elia Schito(@elia):for Travis I'm not sure is very easy ---------------------------------------------------------------------------------------------------- [09:32:55] Elia Schito(@elia):but we can keep it for local checks ---------------------------------------------------------------------------------------------------- [09:33:18] Vais Salikhov(@vais):Ok, so, lets go through a hypothetical workflow ---------------------------------------------------------------------------------------------------- [09:33:50] Elia Schito(@elia):say we have a env car for enabling bms on mspec with the number of times it should run ---------------------------------------------------------------------------------------------------- [09:33:50] Vais Salikhov(@vais):I checkout an older version of the code and run the performance rake task ---------------------------------------------------------------------------------------------------- [09:34:17] Elia Schito(@elia):we can use it on both local and travis ---------------------------------------------------------------------------------------------------- [09:35:02] Vais Salikhov(@vais):Right, so, back to the first step, I checkout an older version and run the task ---------------------------------------------------------------------------------------------------- [09:35:18] Vais Salikhov(@vais):Then I checkout the newer version and run the task ---------------------------------------------------------------------------------------------------- [09:35:26] Elia Schito(@elia):right ---------------------------------------------------------------------------------------------------- [09:35:29] Vais Salikhov(@vais):Now I want to compare them ---------------------------------------------------------------------------------------------------- [09:35:52] Vais Salikhov(@vais):The problem is that we'd need to store the intermediate results somewhere between runs, you see? ---------------------------------------------------------------------------------------------------- [09:36:07] Vais Salikhov(@vais):I mean there is a git break in the middle of the workflow ---------------------------------------------------------------------------------------------------- [09:36:15] Elia Schito(@elia):dump the results to json ---------------------------------------------------------------------------------------------------- [09:36:18] Vais Salikhov(@vais):So the thing cannot be in-process ---------------------------------------------------------------------------------------------------- [09:36:30] Vais Salikhov(@vais):Right, that's what I was thinking too ---------------------------------------------------------------------------------------------------- [09:36:32] Elia Schito(@elia):kry would be example name ---------------------------------------------------------------------------------------------------- [09:36:40] Elia Schito(@elia):key ---------------------------------------------------------------------------------------------------- [09:36:48] Vais Salikhov(@vais):Right ---------------------------------------------------------------------------------------------------- [09:36:53] Elia Schito(@elia):value the time ---------------------------------------------------------------------------------------------------- [09:36:59] Vais Salikhov(@vais):Right ---------------------------------------------------------------------------------------------------- [09:37:27] Vais Salikhov(@vais):Now I guess I need to dig into mspec ---------------------------------------------------------------------------------------------------- [09:37:47] Vais Salikhov(@vais):I hacked some things directly into it to have a proof of concept ---------------------------------------------------------------------------------------------------- [09:37:58] Elia Schito(@elia):heroku app can compare stuff for travis ---------------------------------------------------------------------------------------------------- [09:38:19] Vais Salikhov(@vais):Oh, nice ---------------------------------------------------------------------------------------------------- [09:38:35] Vais Salikhov(@vais):You mean the rake task would upload to a heroku app ---------------------------------------------------------------------------------------------------- [09:38:36] Vais Salikhov(@vais):? ---------------------------------------------------------------------------------------------------- [09:38:41] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [09:38:57] Elia Schito(@elia):brb ---------------------------------------------------------------------------------------------------- [09:38:59] Vais Salikhov(@vais):Cool, then that's it! ---------------------------------------------------------------------------------------------------- [09:39:45] Vais Salikhov(@vais):I just worry my mspec-fu is zero right now ---------------------------------------------------------------------------------------------------- [09:39:52] Vais Salikhov(@vais):there's a ton of hooks ---------------------------------------------------------------------------------------------------- [09:40:21] Vais Salikhov(@vais):the ones I need must be there already, but I just don't know ---------------------------------------------------------------------------------------------------- [09:41:10] Vais Salikhov(@vais):But now I got the general sense of the direction where we want this to go, so I can start working on it ---------------------------------------------------------------------------------------------------- [09:41:58] Vais Salikhov(@vais):Thanks, @elia! ---------------------------------------------------------------------------------------------------- [09:45:34] Elia Schito(@elia):Last thing, you might want to ask brixen for tips as well ---------------------------------------------------------------------------------------------------- [09:46:37] Vais Salikhov(@vais):Do you know what's the best way to reach out to him? ---------------------------------------------------------------------------------------------------- [09:47:23] Vais Salikhov(@vais):I have a PR sitting on mspec for a couple weeks with no response, so not sure if opening an issue to ask for tips is gonna work... ---------------------------------------------------------------------------------------------------- [09:47:53] Elia Schito(@elia):Oh, I'd try IRC first and then with an issue on gh ---------------------------------------------------------------------------------------------------- [09:48:31] Elia Schito(@elia):i think that the problem is that now he has a day job ---------------------------------------------------------------------------------------------------- [17:07:06] Kurtis Rainbolt-Greene(@krainboltgreene):@fkchang: That's exactly why I created architecture. ---------------------------------------------------------------------------------------------------- [06:35:54] Forrest Chang(@fkchang): @krainboltgreene this one - https://github.com/krainboltgreene/architecture.gem ---------------------------------------------------------------------------------------------------- [06:36:38] Forrest Chang(@fkchang):I was using thor, had a hard time figuring out how to use it, surprisingly not documented given how mature it is, IMO. If urs is easier to grok, I'll switch ---------------------------------------------------------------------------------------------------- [09:16:54] Vais Salikhov(@vais):@elia, you there? ---------------------------------------------------------------------------------------------------- [09:19:20] Elia Schito(@elia):Hey ---------------------------------------------------------------------------------------------------- [09:19:56] Elia Schito(@elia):@vais sup? ---------------------------------------------------------------------------------------------------- [09:21:11] Vais Salikhov(@vais):So, I've been thinking about benchmarking again ---------------------------------------------------------------------------------------------------- [09:21:31] Vais Salikhov(@vais):There are many meanings to the word ---------------------------------------------------------------------------------------------------- [09:22:08] Vais Salikhov(@vais):1. Opal vs MRI vs other rubies - interesting but useless ---------------------------------------------------------------------------------------------------- [09:22:46] Vais Salikhov(@vais):2. Vanity benchmarks ---------------------------------------------------------------------------------------------------- [09:23:16] Vais Salikhov(@vais):I.e. how fast is my ruby vs other rubies ---------------------------------------------------------------------------------------------------- [09:23:38] Vais Salikhov(@vais):We are not interested in that (at least I'm not) ---------------------------------------------------------------------------------------------------- [09:23:58] Vais Salikhov(@vais):Then there is the whole Opal vs JavaScript performance thing ---------------------------------------------------------------------------------------------------- [09:24:31] Vais Salikhov(@vais):Again, I'm not interested in that. ---------------------------------------------------------------------------------------------------- [09:25:25] Vais Salikhov(@vais):So, this rules out (for me) running any of the Ruby benchmark suites out there ---------------------------------------------------------------------------------------------------- [09:26:21] Vais Salikhov(@vais):What I think makes the most sense for Opal development is to benchmark the specs ---------------------------------------------------------------------------------------------------- [09:27:19] Elia Schito(@elia):Makes sense to me ---------------------------------------------------------------------------------------------------- [09:27:37] Vais Salikhov(@vais):Again, the problem I want to solve is not knowing how a change to a method implementation of one class may affect the performance of that method AND performance of other seemingly unrelated methods. Then, with pinpoint precision, be able to go in and fix the performance problem. ---------------------------------------------------------------------------------------------------- [09:27:58] Elia Schito(@elia):i sometimes looked at the time taken on Travis in that sense ---------------------------------------------------------------------------------------------------- [09:28:24] Vais Salikhov(@vais):That's what a generic benchmark suite does not provide - the pinpoint precision to fix the problem ---------------------------------------------------------------------------------------------------- ############################## [2015-05-03] ############################## [05:36:26] Ryan Stout(@ryanstout):are there any docs on using Native? ---------------------------------------------------------------------------------------------------- [09:14:45] Elia Schito(@elia):@ryanstout no, just some sparse blog post, unless you want to consider Opal-browser a giant example ---------------------------------------------------------------------------------------------------- [09:43:57] Vais Salikhov(@vais):@elia check out my benchmarking PR https://github.com/opal/opal/pull/828 ---------------------------------------------------------------------------------------------------- [09:44:47] Elia Schito(@elia):Reading it in this precise moment:P ---------------------------------------------------------------------------------------------------- [09:45:30] Vais Salikhov(@vais):It's a little underwhelming in the end :) ---------------------------------------------------------------------------------------------------- [09:47:18] Vais Salikhov(@vais):Hope you can play around with it and recommend some next steps in terms of reporting. HTML? ---------------------------------------------------------------------------------------------------- [09:53:46] Vais Salikhov(@vais):I won't have much time for Opal in the next week or more, so if anyone wants to pick it up where I left off, that'd be awesome :stuck_out_tongue_winking_eye: ---------------------------------------------------------------------------------------------------- [13:31:26] Elia Schito(@elia):@vais I'll try my best ---------------------------------------------------------------------------------------------------- [13:32:02] Elia Schito(@elia):😎 ---------------------------------------------------------------------------------------------------- [13:44:42] Vais Salikhov(@vais):Nice, thanks, @elia! :beers: With this is in place, working on improving performance will be just as fun as closing out bugs is right now thanks to rubyspecs - instant gratification! Also, it will make accepting contributions easier: rubyspec makes sure nothing gets broken, and this thing ensures performance does not take a hit :pray: Warm and fuzzy all around :rainbow: ---------------------------------------------------------------------------------------------------- [18:53:16] Kurtis Rainbolt-Greene(@krainboltgreene):I think opal is super important. ---------------------------------------------------------------------------------------------------- ############################## [2015-05-04] ############################## [13:47:31] Adam Beynon(@adambeynon):parser errors, aye? always the most fun to fix ---------------------------------------------------------------------------------------------------- [13:48:19] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [22:56:26] Forrest Chang(@fkchang):@elia @adambeynon you guys ever get problems w/templates in opal-rspec? ``` NoMethodError: undefined method `attributes' for # ---------------------------------------------------------------------------------------------------- [22:57:28] Forrest Chang(@fkchang):I can monkey patch that to get around it temporarily but then I get immutable string errors. If caller() worked I could know where those are getting hit ---------------------------------------------------------------------------------------------------- [23:23:55] Forrest Chang(@fkchang):@elia @adambeynon nearest I can tell, it's some sort of rspec diff'ing -- don't know why it's happening with templates introduced to the specs ---------------------------------------------------------------------------------------------------- [00:38:13] Vais Salikhov(@vais):@krainboltgreene why? ---------------------------------------------------------------------------------------------------- [00:42:30] Vais Salikhov(@vais):@elia I feel like christmas came early this year: `jeremyevans forked opal/opal to jeremyevans/opal 3 hours ago` :joy: ---------------------------------------------------------------------------------------------------- [00:45:06] Elia Schito(@elia):Hehe 🎅🏻 ---------------------------------------------------------------------------------------------------- [00:46:18] Elia Schito(@elia):(btw I don't get the multiethnic Santa #randomrant) ---------------------------------------------------------------------------------------------------- [11:55:14] Elia Schito(@elia):@vais btw what's your time zone ? (Just curious on how much of the clock we cover…, no need to answer) ---------------------------------------------------------------------------------------------------- [11:59:03] Vais Salikhov(@vais):@elia Indochina Time, GMT+7 ---------------------------------------------------------------------------------------------------- [11:59:09] Vais Salikhov(@vais):What about you? ---------------------------------------------------------------------------------------------------- [12:00:03] Elia Schito(@elia):Italy, GMT+2 :) ---------------------------------------------------------------------------------------------------- [12:02:44] Vais Salikhov(@vais):I suppose @adambeynon is GMT, and @meh is in the nebulous "Internet" time zone :) ---------------------------------------------------------------------------------------------------- [12:03:19] meh.(@meh):indeed ---------------------------------------------------------------------------------------------------- [12:03:51] Elia Schito(@elia):@vais but it's PT (Programmer's Time) anytime so terrestrial TZs are not always respected… ---------------------------------------------------------------------------------------------------- [12:04:01] Elia Schito(@elia):@meh goodmorning :P ---------------------------------------------------------------------------------------------------- [12:04:14] meh.(@meh):morning ---------------------------------------------------------------------------------------------------- [12:05:17] Vais Salikhov(@vais):Gents, what's the ETA for 8.0? ---------------------------------------------------------------------------------------------------- [12:06:28] Elia Schito(@elia):I don't think any of these are worth holding the release https://github.com/opal/opal/milestones/0.8 ---------------------------------------------------------------------------------------------------- [12:07:28] Elia Schito(@elia):@meh @adambeynon wdyt? ---------------------------------------------------------------------------------------------------- [12:08:04] meh.(@meh):I'd fix the parser errors at least ---------------------------------------------------------------------------------------------------- [12:09:35] Elia Schito(@elia):I guess we'll have to wait and see if @adambeynon (ping) can have a look ---------------------------------------------------------------------------------------------------- [12:10:45] Vais Salikhov(@vais):And I would like to do a "Finish `String`" PR - the last remaining (fixable) issues are these two https://github.com/opal/opal/blob/master/spec/filters/bugs/string.rb#L17-L18 ---------------------------------------------------------------------------------------------------- [12:11:46] Vais Salikhov(@vais):Performance stuff can wait until 0.9 I think ---------------------------------------------------------------------------------------------------- [12:12:40] Vais Salikhov(@vais):@elia whip out that batman poster again :) ---------------------------------------------------------------------------------------------------- [12:12:52] Elia Schito(@elia):oh lol, wait googlin ---------------------------------------------------------------------------------------------------- [12:13:42] Elia Schito(@elia):``` _ ~/~/~/~/~/~/\~~/~/ _ _ \/__/_|/_/_/_|_/_/ _____*~~~ ** ~~~*_____ \____/ __* ___ |\__/| ___ *__ _* / 888~~\__(8OO8)__/~~888 \ *_ _* /88888888888888888888888888\ *_ * |8888888888888888888888888888| * /~* \8888/~\88/~\8888/~\88/~\8888/ *~ / ~* \88/ \/ (88) \/ \88/ *~ / ~* \/ \/ \/ *~ / ~~*_ _*~~/ / ~~~~~*___ ** ___*~~~~~ / / ~ ~ / / / / / / / / t__n__r__ / / | ####### | / ___ | ####### | ____i__ / / _____p_____l_l____ | ####### | | ooooo | qp i__p__ / | ############## | | ####### |__l___xp____| ooooo | |~~~~| oooo |_I_| ############## | | ####### |oo%Xoox%ooxo| ooooo |p__h__|##%#| oooo |ooo| ############## | | ####### |o%xo%%xoooo%| ooooo | |#xx%| oooo |ooo| ############## | | ####### |o%ooxx%ooo%%| ooooo |######|x##%| oooo |ooo| ############## | | ####### |oo%%x%oo%xoo| ooooo |######|##%x| oooo |ooo| ############## | | ####### |%x%%oo%/oo%o| ooooo |######|/#%x| oooo |ooo| ############## | | ####### |%%x/oo/xx%xo| ooooo |######|#%x/| oooo |ooo| ############## | | ####### |xxooo%%/xo%o| ooooo |######|#^x#| oooo |ooo| ############## | | ####### |oox%%o/x%%ox| ooooo |~~~$~~|x##/| oooo |ooo| ############## | | ####### |x%oo%x/o%//x| ooooo |_KKKK_|#x/%| ooo~\|ooo|~\############## | ~\####### |oox%xo%%oox%~\ooooo |_|~|~\|xx%/| ooo ||oHo| |####AAAA###### |h||##XX### |x%x%WWx%%/ox||ooDoo |_| |Y||xGGx| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~ ``` ---------------------------------------------------------------------------------------------------- [12:13:50] Elia Schito(@elia):theeeere we go ---------------------------------------------------------------------------------------------------- [12:22:34] Vais Salikhov(@vais):@adambeynon the city of gotham needs you once again! ---------------------------------------------------------------------------------------------------- [12:25:11] Vais Salikhov(@vais):@meh, before I waste any time on them, do you think any of these `String#initialize` failures are theoretically fixable at this time? https://github.com/opal/opal/blob/master/spec/filters/bugs/string.rb#L61-L73 ---------------------------------------------------------------------------------------------------- [12:25:43] meh.(@meh):vais, taint and freeze related failures go into unsupported ---------------------------------------------------------------------------------------------------- [12:26:10] meh.(@meh):the rest seems doable ---------------------------------------------------------------------------------------------------- [12:27:56] Vais Salikhov(@vais):@meh right, but I was worried about potential native bridging issues in particular ---------------------------------------------------------------------------------------------------- [12:28:19] meh.(@meh):vais, how do you mean? ---------------------------------------------------------------------------------------------------- [12:28:49] Vais Salikhov(@vais):same as with all the other String failures with the word `subclass` in them ---------------------------------------------------------------------------------------------------- [12:29:11] Vais Salikhov(@vais):just checking ---------------------------------------------------------------------------------------------------- [12:29:19] meh.(@meh):it shouldn't apply on those, I think ---------------------------------------------------------------------------------------------------- [12:29:40] Vais Salikhov(@vais):ok then, thanks, I'll give it a try ---------------------------------------------------------------------------------------------------- [12:29:52] Vais Salikhov(@vais):What about `String@dump`? ---------------------------------------------------------------------------------------------------- [12:30:05] Vais Salikhov(@vais):That's for marshalling, right? ---------------------------------------------------------------------------------------------------- [12:30:12] meh.(@meh):I think so, yeah ---------------------------------------------------------------------------------------------------- [12:30:51] Vais Salikhov(@vais):Yeah, I remember you saying something re marshalling will never be implemented, so won't bother with those ---------------------------------------------------------------------------------------------------- ############################## [2015-05-05] ############################## [01:19:08] Forrest Chang(@fkchang):@elia @adambeynon so adding Template::OutputBuffer#<<() gets me most of the way, but it seems that fail_with() is still trying to do ```message << etc`` where message is a string. Where's the right place to fix that? ---------------------------------------------------------------------------------------------------- [01:30:59] Forrest Chang(@fkchang):@elia @adambeynon it seems weird that I'm hitting this error at all, IMO, wouldn't I have hit hit fail_with() before? I wonder if something else is wrong. ---------------------------------------------------------------------------------------------------- [01:32:54] Forrest Chang(@fkchang):```uninitialized constant RSpec::Expectations::Differ::PP``` ---------------------------------------------------------------------------------------------------- [01:33:18] Forrest Chang(@fkchang):ought to have hit that before, need more info on how you guys "fixed" rspec to work w/opal ---------------------------------------------------------------------------------------------------- [02:01:17] Forrest Chang(@fkchang):@elia @adambeynon hmm, my fix was pretty ugly ---------------------------------------------------------------------------------------------------- [02:02:47] Forrest Chang(@fkchang):with this as a monkey patch, specs will run w/templates (If this is right I can try a PR or 2) ```ruby class Template class OutputBuffer def attributes {} end def <<(what) # puts "OutputBuffer#<<" append what end end end ::PP = Kernel module RSpec module Expectations class Differ def diff_as_string(input_data_new, input_data_old) # real diff and encoding code hard, get it to pass for now old_input = input_data_old.is_a?(Array) ? input_data_old.join("") : input_data_old.to_s new_input = input_data_new.is_a?(Array) ? input_data_new.join("") : input_data_new.to_s return new_input + ' vs ' + old_input end end end end module RSpec module Expectations class << self def fail_with(message, expected=nil, actual=nil) if !message raise ArgumentError, "Failure message is nil. Does your matcher define the " + "appropriate failure_message_for_* method to return a string?" end if actual && expected if all_strings?(actual, expected) if any_multiline_strings?(actual, expected) # message << "\nDiff:" << differ.diff_as_string(coerce_to_string(actual), coerce_to_string(expected)) message = message + "\nDiff:" + differ.diff_as_string(coerce_to_string(actual), coerce_to_string(expected)) end elsif no_procs?(actual, expected) && no_numbers?(actual, expected) # message << "\nDiff:" << differ.diff_as_object(actual, expected) message = message + "\nDiff:" + differ.diff_as_object(actual, expected) end end raise(RSpec::Expectations::ExpectationNotMetError.new(message)) end end end end ``` ---------------------------------------------------------------------------------------------------- [06:18:29] Elia Schito(@elia):@fkchang please send the PR, with a failing test if you can ---------------------------------------------------------------------------------------------------- [08:04:58] Elia Schito(@elia):@fkchang just to clarify you should open an issue on Opal-rspec as discussing there is much more convenient and easily discoverable ---------------------------------------------------------------------------------------------------- [08:06:46] Elia Schito(@elia):The way opal-rspec works is by a series of monkey patches, many of th are related to mutable strings ---------------------------------------------------------------------------------------------------- [08:19:55] Elia Schito(@elia):@meh speaking of `throw`/`catch` (in Ruby) I wonder if they can be implemented with [labels](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label) instead of exceptions… cc @vais ---------------------------------------------------------------------------------------------------- [10:40:43] Adam Beynon(@adambeynon):@elia ping? ---------------------------------------------------------------------------------------------------- [10:56:52] Elia Schito(@elia):@adambeynon hey there ---------------------------------------------------------------------------------------------------- [11:14:07] Adam Beynon(@adambeynon):@elia I have fixed the pressing issues left in the 0.8 milestone, do you think the others need fixing before release? (or even before a beta/pre) ---------------------------------------------------------------------------------------------------- [11:18:41] Elia Schito(@elia):@adambeynon I don't think it's worth it, they're not something particularly meaningful in relation to a release, just bugs ---------------------------------------------------------------------------------------------------- [11:20:23] Elia Schito(@elia):@adambeynon I'd release as soon as possible, allowing all those projects that were orphaned by broken sourcemaps (e.g. react.rb) ---------------------------------------------------------------------------------------------------- [11:27:47] Vais Salikhov(@vais):@adambeynon is back! ---------------------------------------------------------------------------------------------------- [11:45:01] Vais Salikhov(@vais):@elia something like this (http://stackoverflow.com/a/14822502) ```javascript LABEL1: do { x = x + 2; ... // JUMP TO THE END OF THE DO-WHILE - A FORWARDS GOTO if (x < 100) break LABEL1; // JUMP TO THE START OF THE DO WHILE - A BACKWARDS GOTO... if (x < 100) continue LABEL1; } while(0); ``` ---------------------------------------------------------------------------------------------------- [12:10:04] Elia Schito(@elia):@vais that's what I meant ---------------------------------------------------------------------------------------------------- [13:09:27] Vais Salikhov(@vais):@elia this trick only works within a function and does not work across function boundaries, unless I'm missing something. ---------------------------------------------------------------------------------------------------- [13:16:10] Elia Schito(@elia):@vais super-bright :bulb: idea retired :smile: ---------------------------------------------------------------------------------------------------- [13:19:25] Vais Salikhov(@vais):@elia well, there's this: http://summerofgoto.com/ ---------------------------------------------------------------------------------------------------- [13:19:28] Vais Salikhov(@vais)::) ---------------------------------------------------------------------------------------------------- [16:16:28] Forrest Chang(@fkchang):@elia so in my monkey patches, the 1st one for Template::OutputBuffer could/should go into opal, the others makes sense to go to opal-rspec -- should it go in the fixes.rb file? How do you coordinate across gems where 1 fix goes in 1 gem and the other. I could monkey patch it in opal-rspec, ensuring that older than master versions of opal get it and/or patch it in opal ---------------------------------------------------------------------------------------------------- [16:17:56] Elia Schito(@elia):@fkchang open 2 issues/PRs and just ref from one another ---------------------------------------------------------------------------------------------------- [16:42:11] Forrest Chang(@fkchang):@elia what if I want the fix to go into 0.7.* as well? I do need to see if we can update our app to master 0.8, last time it didn't work out well and I had to revert ---------------------------------------------------------------------------------------------------- [20:27:11] Forrest Chang(@fkchang):@elia @adambeynon @meh I tried to make a chrome console panel plugin, turns out Chrome won't let you do eval unless you sandbox ---------------------------------------------------------------------------------------------------- [20:32:59] Elia Schito(@elia):@fkchang his they do it for coffeeescript? ---------------------------------------------------------------------------------------------------- [20:34:22] Forrest Chang(@fkchang):trying to figure that out ---------------------------------------------------------------------------------------------------- ############################## [2015-05-06] ############################## [23:02:35] Elia Schito(@elia):you can either `require 'json'` ---------------------------------------------------------------------------------------------------- [23:03:00] Elia Schito(@elia):or `require 'native'` and do ``` Hash.new(`{a: 1}`) ``` ---------------------------------------------------------------------------------------------------- [23:03:25] Kurtis Rainbolt-Greene(@krainboltgreene):That doesn't get the data from the files. ---------------------------------------------------------------------------------------------------- [23:04:08] meh.(@meh):krainboltgreene, just put the json in a .js and into a global variable, then require the .js and ``` Hash.new(`global`) ``` ---------------------------------------------------------------------------------------------------- [23:04:20] meh.(@meh):that's the simplest way ---------------------------------------------------------------------------------------------------- [23:05:08] Forrest Chang(@fkchang):@krainboltgreene you want to load it at page load time? How r u serving up stuff? opal-rails for example lets you expand controller variables in your views, so in rails I'll use that a lot ---------------------------------------------------------------------------------------------------- [23:05:19] Kurtis Rainbolt-Greene(@krainboltgreene):Haha what. ---------------------------------------------------------------------------------------------------- [23:05:30] Kurtis Rainbolt-Greene(@krainboltgreene):@fkchang I want to load it at compile time. ---------------------------------------------------------------------------------------------------- [23:06:36] Kurtis Rainbolt-Greene(@krainboltgreene):It seems like the Dir library has SOME methods meant for compile time. ---------------------------------------------------------------------------------------------------- [23:06:44] Kurtis Rainbolt-Greene(@krainboltgreene):It just doesn't have `Dir#glob()` ---------------------------------------------------------------------------------------------------- [23:06:52] Forrest Chang(@fkchang):@krainboltgreene not sure if this is exactly what you want to do, but I'vbe got something like this ---------------------------------------------------------------------------------------------------- [23:07:04] meh.(@meh):krainboltgreene, we don't really have a file system available ---------------------------------------------------------------------------------------------------- [23:07:04] Forrest Chang(@fkchang):```haml :opal Document.ready? do $mi = MapInterface.new(#{@json}, #{ZipCoords.zipcode_hash}) end ``` ---------------------------------------------------------------------------------------------------- [23:07:48] Forrest Chang(@fkchang):where @json is set in the controller, and ZipCoords.zipcode_hash is a bunch of zipcode shape data stored in server side objects ---------------------------------------------------------------------------------------------------- [23:08:15] Kurtis Rainbolt-Greene(@krainboltgreene):Argh, File.read doesn't exist either. ---------------------------------------------------------------------------------------------------- [23:08:27] meh.(@meh):krainboltgreene, we just cannot have it ---------------------------------------------------------------------------------------------------- [23:08:42] Elia Schito(@elia):@krainboltgreene the only place where we have a file system is node.js, in the browser File.read doesn't make sense ---------------------------------------------------------------------------------------------------- [23:08:46] Kurtis Rainbolt-Greene(@krainboltgreene):I know that. ---------------------------------------------------------------------------------------------------- [23:08:55] Elia Schito(@elia):you in a browser? ---------------------------------------------------------------------------------------------------- [23:09:10] meh.(@meh):krainboltgreene, if you want it at compile time, you do as I said, you put the json in a .js file with ``` global = ``` ---------------------------------------------------------------------------------------------------- [23:09:11] Kurtis Rainbolt-Greene(@krainboltgreene):Yes, but like I'd like to do file stuff as it's getting compiled. ---------------------------------------------------------------------------------------------------- [23:09:16] meh.(@meh):then you require it, and you have it available in global ---------------------------------------------------------------------------------------------------- [23:09:42] Forrest Chang(@fkchang):@krainboltgreene I would imagine that you would have something similar in a game, to the scheme that I have for the map example I gave you. ---------------------------------------------------------------------------------------------------- [23:10:28] Elia Schito(@elia):@krainboltgreene listen to @meh :) `require` is the right way ---------------------------------------------------------------------------------------------------- [23:16:36] Kurtis Rainbolt-Greene(@krainboltgreene):It seems weird that I have the ability to require files but not get the contents of files. ---------------------------------------------------------------------------------------------------- [23:16:45] Kurtis Rainbolt-Greene(@krainboltgreene):I know why, I understand why, but :? ---------------------------------------------------------------------------------------------------- [23:17:04] Elia Schito(@elia):how so? ---------------------------------------------------------------------------------------------------- [23:17:11] meh.(@meh):krainboltgreene, even require doesn't do what you think it does ---------------------------------------------------------------------------------------------------- [23:17:19] Kurtis Rainbolt-Greene(@krainboltgreene):Would it be so terrible to assume all Dir, File, and Path domains refered to a "fake" filesystem loaded by Opal.environment? ---------------------------------------------------------------------------------------------------- [23:17:28] Kurtis Rainbolt-Greene(@krainboltgreene):I know what it does meh, I've looked at the source. ---------------------------------------------------------------------------------------------------- [23:17:34] meh.(@meh):krainboltgreene, it wouldn't work out well with how dynamic Ruby is ---------------------------------------------------------------------------------------------------- [23:17:42] meh.(@meh):we can't just assume a constant is the top level one ---------------------------------------------------------------------------------------------------- [23:17:49] meh.(@meh):and we can't assume it's not been overloaded ---------------------------------------------------------------------------------------------------- [23:18:37] meh.(@meh):we'd need compiler macros ---------------------------------------------------------------------------------------------------- [23:18:48] meh.(@meh):but it's a lot of work for not much good ---------------------------------------------------------------------------------------------------- [23:18:49] Kurtis Rainbolt-Greene(@krainboltgreene):I don't see why you would. ---------------------------------------------------------------------------------------------------- [23:19:17] Kurtis Rainbolt-Greene(@krainboltgreene):Just implement filesystem operations as if they were talking to an Opal.environment virtual fs. ---------------------------------------------------------------------------------------------------- [23:21:11] meh.(@meh):that would be doable assuming you tell the compiler which files to embed ---------------------------------------------------------------------------------------------------- [23:21:34] meh.(@meh):but even then you'd have to assume all the files are text, since strings are UTF-16 in js ---------------------------------------------------------------------------------------------------- [23:21:40] meh.(@meh):so it would just be a halfassed implementation ---------------------------------------------------------------------------------------------------- [23:22:28] Kurtis Rainbolt-Greene(@krainboltgreene):@meh: We already tell the compilier which directory to pay attention to. ---------------------------------------------------------------------------------------------------- [23:26:27] Kurtis Rainbolt-Greene(@krainboltgreene):BTW, I love what Opal::Builder has done in my rakefile. ---------------------------------------------------------------------------------------------------- [23:26:29] Kurtis Rainbolt-Greene(@krainboltgreene):Much easier to read. ---------------------------------------------------------------------------------------------------- [23:29:04] meh.(@meh):krainboltgreene, have you considered using __END__? ---------------------------------------------------------------------------------------------------- [23:31:53] Kurtis Rainbolt-Greene(@krainboltgreene):@meh: What's that? ---------------------------------------------------------------------------------------------------- [23:32:12] meh.(@meh):krainboltgreene, https://shifteleven.com/articles/2009/02/09/useless-ruby-tricks-data-and-__end__/ ---------------------------------------------------------------------------------------------------- [23:32:22] Kurtis Rainbolt-Greene(@krainboltgreene):Oh shit right. ---------------------------------------------------------------------------------------------------- [23:32:34] meh.(@meh):that's supported ---------------------------------------------------------------------------------------------------- [23:46:31] Kurtis Rainbolt-Greene(@krainboltgreene):That might be OK for small things, but this dataset could get large. I think what I'll do is be "fancy" and add "data" to my path, use `Kernal#load()` and use Ruby native datastructs instead of JSON. ---------------------------------------------------------------------------------------------------- [00:25:21] Forrest Chang(@fkchang):@elia @adambeynon got closer, seems to work, but global variables cause this ```Extension server error: Inspector protocol error: Object has too long reference chain(must not be longer than 1000)``` ---------------------------------------------------------------------------------------------------- [00:29:14] Forrest Chang(@fkchang):Not exactly sure why, I apparently can call the object ```ruby $dm.class.name # works ``` but trying to call the just the variable, causes that error ```ruby $dm # generates the exception ``` I pray @adambeynon or anyone might have a clue. So close, but so far ---------------------------------------------------------------------------------------------------- [00:34:13] Elia Schito(@elia):Have you googled the error already ? ---------------------------------------------------------------------------------------------------- [00:44:43] Forrest Chang(@fkchang):@elia seems like this might be it in general https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/T1IqBsNr1-U where it looks like I'd have to munge what the opal compiler gives ---------------------------------------------------------------------------------------------------- [00:52:04] Elia Schito(@elia):I think it can serialize with json the name which is a string and not the obj itself for obvious reasons ---------------------------------------------------------------------------------------------------- [01:10:52] Forrest Chang(@fkchang):Yeah, so the question is can we make opal objects json stringifyable? or do I munge the compiled output to force to_s or someting? @adambeynon ? ---------------------------------------------------------------------------------------------------- [01:12:02] Forrest Chang(@fkchang):otherwise fairly close to a chrome panel that you can have opal-irb in any opal app w/o having to build it in ---------------------------------------------------------------------------------------------------- [01:14:50] Forrest Chang(@fkchang):this unfortunately the last evaluated object, because everything has to be stringified? ---------------------------------------------------------------------------------------------------- [01:41:48] Forrest Chang(@fkchang):So it seems when it comes back, it loses the opal prototype ---------------------------------------------------------------------------------------------------- [01:42:07] Forrest Chang(@fkchang):unless @adambeynon or anyone else has any ideas, I think I'm going to give up on the chrome panel ---------------------------------------------------------------------------------------------------- [06:24:13] Adam Beynon(@adambeynon):@fkchang iirc, when I looked at it before, my plan of action was to inject the compiler/parser into the page itself, and the REPL was just a case of passing the string to the page context, doing the compiling there, and then returning the result ---------------------------------------------------------------------------------------------------- [06:24:40] Adam Beynon(@adambeynon):if you want to do object inspection, then all that logic and code etc would need to live in the page itself, and the extension just asks for the json representation ---------------------------------------------------------------------------------------------------- [06:25:01] Adam Beynon(@adambeynon):its all very awkward, but unfortunately thats the way it is ---------------------------------------------------------------------------------------------------- [06:25:11] Adam Beynon(@adambeynon):opal-parser.js could have all that logic baked in ---------------------------------------------------------------------------------------------------- [06:25:29] Adam Beynon(@adambeynon):so the chrome extension is just an interface to that logic ---------------------------------------------------------------------------------------------------- [14:11:55] Forrest Chang(@fkchang):@adambeynon what I believe is happening is that the chrome panel runs as it's own process, thus allowing it to have different js libs and what not. ```javascript chrome.devtools.inspectedWindow.eval``` runs it in the context of the inspected window and the result gets json-stringify-ed to be sent back to the chrome panel. If I understand your example, you want to inject the compiler into the page, and use ```javascript inspectedWIndow.eval``` to communicate w/that one? Hmm, I might be able to make that work, but it is convoluted. After killing a day yesterday, I think I'll let that digest a bit ---------------------------------------------------------------------------------------------------- [14:14:13] Forrest Chang(@fkchang):Though maybe just improving opal-irb and other tools so they have less dependencies and is easier to insert into ones app (mostly it's the dependencies that make that a little harder) might be better ROI ---------------------------------------------------------------------------------------------------- [14:16:46] Forrest Chang(@fkchang):@adambeynon did u have an idea of how u would inject the parser into the page? ---------------------------------------------------------------------------------------------------- [14:32:54] Forrest Chang(@fkchang):I suppose I could precompile the pertinent classes into a single js file and inject that. The problem I see w/that is that may or may not run if there is an opal version conflict, whereas the chrome panel way of doing it simply sends code across to be evaled in the inspected window's context w/o injecting possibly incompatible code. Not sure if it would be worth the time ---------------------------------------------------------------------------------------------------- [14:34:01] Elia Schito(@elia):I kinda like the irb solution more (as a safari user :P) ---------------------------------------------------------------------------------------------------- [14:39:53] Vais Salikhov(@vais):Guys, can someone please tell me how in the world this works: ``` $ bundle exec opal-repl >> puts "hool\u0007" hoola => nil >> puts "hool\u001b" hoole => nil ``` It's been driving me crazy for a couple of days already that I can't figure it out. @adambeynon any pointers where this transformation occurs in the parse/compile process? ---------------------------------------------------------------------------------------------------- [14:44:38] Elia Schito(@elia):@vais check the lexer too ---------------------------------------------------------------------------------------------------- [14:45:29] Elia Schito(@elia):``` > opal --sexp -Oe 'puts "hool\u0007"' (:call, nil, :puts, (:arglist, (:str, "hool\a"))) ``` ---------------------------------------------------------------------------------------------------- [14:48:17] Elia Schito(@elia):@vais probably `def read_escape` ---------------------------------------------------------------------------------------------------- [15:08:48] Vais Salikhov(@vais):@elia thanks, but this is exactly the place that's been driving me crazy - `read_escape` seems to be doing the right thing, but somehow, somewhere down the line this transformation occurs. `read_escape` definitely does not convert `\u0007` into `a` and `\u001b` into `e`... wtf.. ---------------------------------------------------------------------------------------------------- [15:10:27] Elia Schito(@elia):@vais that means it's after lexing and before parsing as the sexp already shows `\a` ---------------------------------------------------------------------------------------------------- [15:11:19] Vais Salikhov(@vais):Something is converting these unicode escapes into `\a` and `\e` which are not recognized by javascript, it just sees them as literal `a` and `e`. How to make them stay as unicode escapes all the way into js-land? ---------------------------------------------------------------------------------------------------- [15:11:59] Elia Schito(@elia):drop a `puts` :bomb: ---------------------------------------------------------------------------------------------------- [15:12:18] Elia Schito(@elia):but beware escaping: inspect vs. to_s ---------------------------------------------------------------------------------------------------- [15:23:09] Vais Salikhov(@vais):@elia I dropped so many `puts` bombs the whole thing looks like the surface of the moon :sweat: ---------------------------------------------------------------------------------------------------- [15:24:37] Vais Salikhov(@vais):Giving up for today. @elia if you or @adambeynon can take a look, plz lmk... It's not super urgent, just hate the feeling. ---------------------------------------------------------------------------------------------------- [15:26:35] Elia Schito(@elia):lol :) ---------------------------------------------------------------------------------------------------- [15:26:55] Elia Schito(@elia):quick attempt shows it's the lexer ---------------------------------------------------------------------------------------------------- [15:26:59] Elia Schito(@elia):``` >> l = Opal::Lexer.new('"\u0007"', 'file') => #, @scanner_stack=[#], @case_stmt=nil, @start_of_lambda=nil> >> l.next_token => [:tSTRING_BEG, ["\"", [1, 0]]] >> l.next_token => [:tSTRING_CONTENT, ["\a", [1, 1]]] >> l.next_token => [:tSTRING_END, ["\"", [1, 7]]] >> ``` ---------------------------------------------------------------------------------------------------- [15:27:43] Elia Schito(@elia):but also in ruby: ---------------------------------------------------------------------------------------------------- [15:27:50] Elia Schito(@elia):``` >> "\u0007" => "\a" ``` ---------------------------------------------------------------------------------------------------- [15:29:48] Elia Schito(@elia):@vais it's this line: https://github.com/opal/opal/blob/master/lib/opal/parser/lexer.rb#L262 ---------------------------------------------------------------------------------------------------- [15:30:06] Elia Schito(@elia):`scanner[1].to_i(16).chr(Encoding::UTF_8)` ---------------------------------------------------------------------------------------------------- [15:30:27] Elia Schito(@elia):converts to a hex num and then picks the corresponding char ---------------------------------------------------------------------------------------------------- [15:31:20] Vais Salikhov(@vais):@elia right, so then "\a" goes into js-land ---------------------------------------------------------------------------------------------------- [15:31:37] Vais Salikhov(@vais):But there it no longer has the same meaning ---------------------------------------------------------------------------------------------------- [15:33:21] Vais Salikhov(@vais):Ok, it's late here, my brain is fried. Thanks for the pointer, @elia, I'll pick it up tomorrow. :zzz: ---------------------------------------------------------------------------------------------------- [15:36:34] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [20:29:54] Mitch VanDuyn(@catmando):anybody: using opal-rspec and playing with react.rb... this needs to include react.js... not sure how to add a include to the opal-rspec header that seems like its generated automatically by opal-rspec. Can anybody explain how I would go about including a js file so its there for all the specs to run? ---------------------------------------------------------------------------------------------------- [20:59:05] Forrest Chang(@fkchang):@catmando if react.js is in the load path you can just do a require 'react' ---------------------------------------------------------------------------------------------------- [21:04:14] Mitch VanDuyn(@catmando):problem is I am using gem react.rb which is also called "react" ---------------------------------------------------------------------------------------------------- [21:05:06] Mitch VanDuyn(@catmando):So I guess I need to pull down react.js save it in assets, rename it to something like react-js.js and then require 'react-js' will that work? ---------------------------------------------------------------------------------------------------- [21:27:25] Forrest Chang(@fkchang):@catmando there will be a problem if 2 files are compiled to react.js, maybe you can have a path that uniquely identifies it say, require 'vendor/assets/javascripts/react/react' or if you include an html file as your html for the test, you could do a script tag there ---------------------------------------------------------------------------------------------------- [21:35:05] Mitch VanDuyn(@catmando):@fkchang.. I guess. In this case its really a matter of new library (react.rb) that needs to under the hood include react.js... For now I took the route I suggested (rename react.js to react_js.js) and that works fine. ---------------------------------------------------------------------------------------------------- [21:37:00] Mitch VanDuyn(@catmando):@fkchang - please explain "or if you include an html file as your html for the test, you could do a script tag there" That was my original approach, but I could not figure out how to get opal-rspec to use a different index file. ---------------------------------------------------------------------------------------------------- [21:45:21] Elia Schito(@elia):@catmando @fkchang react.rb depends on react-source which is the gem from facebook itself ---------------------------------------------------------------------------------------------------- [21:45:28] Elia Schito(@elia):https://rubygems.org/gems/react-source ---------------------------------------------------------------------------------------------------- [21:47:03] Elia Schito(@elia):not sure with which path you can require it tho ---------------------------------------------------------------------------------------------------- [21:48:14] Mitch VanDuyn(@catmando):@elia, yeah I also could not figure that out... There is no doc for react-source. Also react.rb only requires react-source in development (!?) ---------------------------------------------------------------------------------------------------- [21:48:47] Elia Schito(@elia):and it doesn't work out of the box uh… ---------------------------------------------------------------------------------------------------- [21:50:05] Mitch VanDuyn(@catmando):I am guessing react-source would be required using 'react' but the name conflicts. I guess I could try renaming react.rb so that you can require react_rb or some such... ---------------------------------------------------------------------------------------------------- [21:51:53] Elia Schito(@elia):my gut tells me @zetachang has done his work properly and you don't need to ---------------------------------------------------------------------------------------------------- [21:52:58] Mitch VanDuyn(@catmando):could be, I am going to put in an issue, and perhaps he can clarify everything ---------------------------------------------------------------------------------------------------- [21:58:11] Forrest Chang(@fkchang):@catmando when you config the rake task for your opal specs you can configure the index file i.e. ```ruby Opal::RSpec::RakeTask.new("spec:opal") do |s| s.index_path = "opal/spec/index.html" ``` ---------------------------------------------------------------------------------------------------- [21:58:11] Forrest Chang(@fkchang): ---------------------------------------------------------------------------------------------------- [22:04:51] Mitch VanDuyn(@catmando):@fkchang... gotcha... thanks... ---------------------------------------------------------------------------------------------------- [22:47:14] Kurtis Rainbolt-Greene(@krainboltgreene):How should I handle data loading at compile time? ---------------------------------------------------------------------------------------------------- [22:56:32] Elia Schito(@elia):@krainboltgreene what do you mean? ---------------------------------------------------------------------------------------------------- [22:57:04] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: I'm making a game, and I have configuration data stored as json files. ---------------------------------------------------------------------------------------------------- [22:57:17] Kurtis Rainbolt-Greene(@krainboltgreene):I want to load those files as native Ruby objects and have those available in runtime. ---------------------------------------------------------------------------------------------------- [22:58:04] Elia Schito(@elia):Like hashes or something else? ---------------------------------------------------------------------------------------------------- [23:02:06] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: Sure. ---------------------------------------------------------------------------------------------------- ############################## [2015-05-07] ############################## [16:06:37] Vais Salikhov(@vais):@elia figured it out. The parser was doing everything right. To solve the problem of Ruby's `\a` and `\e` escape sequences not being supported in JS, I had to fix it in the compiler. That was the "next step" I was missing. The final result is here: https://github.com/opal/opal/pull/837 ---------------------------------------------------------------------------------------------------- [16:07:29] Vais Salikhov(@vais)::beer::beer::beer: ---------------------------------------------------------------------------------------------------- [16:17:27] Forrest Chang(@fkchang):I'm probably holding off on browser extensions indefinitely for the issues. Aside from not being able to show the value of the last evaluated object correctly if it's not a string or number, I do a have a working opal-irb chrome plugin. Is that of value to anyone? It's sort of like gdb/dbx/ where if you want to see the value you have to print it out out -- i.e. ``` p variable``` so it works. The in app opal-irb will be superior in that you don't have to do that, but the chrome panel is cool in that you can attach it to an opal app w/o having to build it in. ---------------------------------------------------------------------------------------------------- [16:18:16] Forrest Chang(@fkchang):Maybe I'll make a screencast and leave a question of "is this useful enough to release, given it can't do all the things I want?" ---------------------------------------------------------------------------------------------------- [16:30:41] Adam Beynon(@adambeynon):@fkchang I stopped working on an extension because of the same reasons ---------------------------------------------------------------------------------------------------- [16:30:49] Adam Beynon(@adambeynon):something like opal-irb seems the better option ---------------------------------------------------------------------------------------------------- ############################## [2015-05-08] ############################## [21:50:56] Elia Schito(@elia):it should ---------------------------------------------------------------------------------------------------- [21:51:06] Mitch VanDuyn(@catmando):trying now... ---------------------------------------------------------------------------------------------------- [21:51:56] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [21:57:05] Brian Glusman(@bglusman):Just pushed up a tetris that runs in opal and on shoes locally FYI :-) bglusman/tetris ---------------------------------------------------------------------------------------------------- [21:58:33] Mitch VanDuyn(@catmando):@elia, yeah that works fine... bottom line (for me any way - add a config.js.rb.erb file and then include it the top level header. That works for dev and production. For running rspec in the browser I will just add the config to the spec helper. ---------------------------------------------------------------------------------------------------- [21:59:14] Mitch VanDuyn(@catmando):I'm thinking a little gem would be nice, or perhaps just add something to opal-rails ---------------------------------------------------------------------------------------------------- [21:59:20] Elia Schito(@elia):@bglusman awe ---------------------------------------------------------------------------------------------------- [22:00:18] Elia Schito(@elia):@bglusman just add a screenshot to the readme plz! ---------------------------------------------------------------------------------------------------- [22:00:59] Elia Schito(@elia):@catmando 0.8 should fix thise kind of issues ---------------------------------------------------------------------------------------------------- [22:01:58] Mitch VanDuyn(@catmando):@elia, not so much from an issue standpoint, but just would be nice to have a standard solution ---------------------------------------------------------------------------------------------------- [22:03:10] Elia Schito(@elia):sorry, I though the gem would have been to solve the require problem, plz be patient :smile_cat: ---------------------------------------------------------------------------------------------------- [22:05:28] Mitch VanDuyn(@catmando):no drama here at all, thanks for all the great work.. opal has been a life saver for us! ---------------------------------------------------------------------------------------------------- [22:13:10] Brian Glusman(@bglusman):@elia it's easy far from done, literally just pushed up the first version with Abby kind of proof it's at all functional :-) ---------------------------------------------------------------------------------------------------- [22:14:26] Elia Schito(@elia):@bglusman k, will wait, but think of the children! :D ---------------------------------------------------------------------------------------------------- [22:45:49] Vais Salikhov(@vais):@fkchang thanks for all the great work you've been doing to spread awareness of Opal. Just want you to know that it's made a huge difference. It will take time, but we're getting there. > I do need the feature thats somewhere deep down in @adambeynon 's todo list to be able to retrieve the code and comments to duplicate some of the small talk env stuff. Maybe @vais knows enough about the innards of Opal now that he could hit it I wish I did :) Is there an issue for this on GH? This would be the first step. I will be offline for a couple days, but will check back ;) ---------------------------------------------------------------------------------------------------- [14:58:01] AstonJ(@AstonJ):Agree with Rick - I think the Opal FAQ can be reworded at some point :) ---------------------------------------------------------------------------------------------------- [14:59:04] Rick Carlino(@RickCarlino):You might want to give it a second look. They have some great conversations on there, plus Reddit drives thousands of readers per week to my blog. It's a great place to share stuff that's useful to other developers. The key is to subscribe to good subreddits. ---------------------------------------------------------------------------------------------------- [14:59:39] Rick Carlino(@RickCarlino):The upvotes / downvotes stop people from being spammy, too. ---------------------------------------------------------------------------------------------------- [14:59:59] Vais Salikhov(@vais):@AstonJ what @RickCarlino said :+1: ---------------------------------------------------------------------------------------------------- [15:01:27] Rick Carlino(@RickCarlino):Also, "Reddit Enhancement Suite" is a pretty good user script if you're having trouble keeping track of stuff. Adds a ton of features as a browser plugin. ---------------------------------------------------------------------------------------------------- [15:04:40] AstonJ(@AstonJ):I think I posted about my Rails book idea on there a while back (or was it HN lol) - the responses were alright actually. It’s just that some of the threads I’ve seen on there seem indicate it is a ‘free for all’, which I find tedious. I will check out the Ruby bits tho. ---------------------------------------------------------------------------------------------------- [15:04:50] AstonJ(@AstonJ):Oo look… awwwww http://www.reddit.com/r/40DaysofRuby/comments/1tglws/for_those_of_you_preparing_to_start_ruby_i/ ---------------------------------------------------------------------------------------------------- [15:05:28] AstonJ(@AstonJ): ---------------------------------------------------------------------------------------------------- [15:06:04] Rick Carlino(@RickCarlino):**studio audience says "Awwww..."** ---------------------------------------------------------------------------------------------------- [15:06:33] Rick Carlino(@RickCarlino):https://www.reddit.com/domain/astonj.com ---------------------------------------------------------------------------------------------------- [15:07:26] AstonJ(@AstonJ):The one @dfyx posted has had the most comments (Red Hot Ruby article) :) ---------------------------------------------------------------------------------------------------- [15:08:28] AstonJ(@AstonJ):So this is the one to follow right? https://www.reddit.com/r/ruby/ ---------------------------------------------------------------------------------------------------- [15:09:53] AstonJ(@AstonJ):I am sure I had the ‘AstonJ’ user, but on trying to reset password it says no email with that username ---------------------------------------------------------------------------------------------------- [15:11:32] meh.(@meh):vais, yeah, I agree, but I also never read the FAQ :P ---------------------------------------------------------------------------------------------------- [15:24:37] AstonJ(@AstonJ):Something like this? @vais @RickCarlino @elia @meh @adambeynon ### Why does Opal exist? Opal exists because the power of Ruby in the browser is, and always has been, extremely appealing. Thanks to this power, Opal is now paving the way to allow developers to do what they could previously only dream off - isomorphic Ruby. ---------------------------------------------------------------------------------------------------- [15:26:26] AstonJ(@AstonJ):(Just initital thoughts - feel free to edit/modify) ---------------------------------------------------------------------------------------------------- [15:33:01] AstonJ(@AstonJ):Version 2: ### Why does Opal exist? Opal exists because the prospect of the power of Ruby in the browser was too good to ignore. Thanks to this power, Opal is now paving the way to allow developers to do what they could previously only dream off - client side apps in Ruby as well as full stack isomorphic Ruby. ---------------------------------------------------------------------------------------------------- [16:18:44] Michał Kalbarczyk(@fazibear):Hi, I’m messing around with new opal beta and source maps, and it looks like everything point to last line of ruby source ? Any clues why this thing happened ? Using sprockets 3.0 ? ---------------------------------------------------------------------------------------------------- [16:27:27] Michał Kalbarczyk(@fazibear):[![Screen Shot 2015-05-08 at 18.27.04.png](https://files.gitter.im/opal/opal/7CR1/thumb/Screen-Shot-2015-05-08-at-18.27.04.png)](https://files.gitter.im/opal/opal/7CR1/Screen-Shot-2015-05-08-at-18.27.04.png) ---------------------------------------------------------------------------------------------------- [16:41:10] Forrest Chang(@fkchang):@vais @RickCarlino @elia @meh @adambeynon @AstonJ On the note of spreading opal/explaining why rubyists should adopt Opal, I'm stumped. I thought my Rubyconf 13 video that brought @vais into the fold would've done it, I think I covered enough bases that a Rubyist would think it's a no brainer. Perhaps I showed too much info? Maybe I wasn't specific enough. I propose a bunch of Opal talks for conferences every year trying spread the message from various angles, to date only the Star Wars one was accepted. My Jubilee talk for Rubyconf 14 slips in Opal in the side door and I show that code, but that one also surprises me in how little attention Rubyists are paying to the "Ruby everywhere" thing that Jubilee and Opal give you. ---------------------------------------------------------------------------------------------------- [16:43:00] Forrest Chang(@fkchang):Some of it think needs concrete, pertinent examples. This Ruby-fying javascript series I'm blogging about is attempting to do that w/real world code. I've been assembling a pattern language around it that blogging is helping me solidify. I'm hoping give names to concrete things that explain why coding browser code in Opal really is much better can help. ---------------------------------------------------------------------------------------------------- [16:47:05] Forrest Chang(@fkchang):@all any help on having me flesh these out would be appreciated. If ppl can read, comment, discuss those things, that might help. I see how pattern languages yielded Design Patterns and all the descendant *** Patterns exploded by cataloging and naming things - I hope to enumerate the reasons starting w/my Ruby-fying JS. I'm trying to think about how to reword the messages, which I think are pretty darn solid for the Rubyist, in my various talk proposals. These days, they distill to why Ruby is better in the browser, and how Ruby everywhere is both viable and joyful. ---------------------------------------------------------------------------------------------------- [16:47:32] AstonJ(@AstonJ):You’re doing a great job @fkchang :+1: I think what Opal could really do with is some screencasts (or blogs) from the very basics up (bit like I am aiming to do with Volt :point_up: [May 8 2015 6:31 AM](https://gitter.im/AstonJ/rubyscreencasts?at=554c4a37489c98827952e2cb)). I am crap at JS so suggest someone with a better knowledge has a go instead of me. Ideally (at least in my mind) a series on Opal would show youhow to do stuff that you would usually use JS for without even mentioning JS. Almost like JS has been rendered superfluous. ---------------------------------------------------------------------------------------------------- [16:48:27] Forrest Chang(@fkchang):When I get around to building opal-inspector and the ilk, the message will be how opal will have better tooling/environment -- I've had that talk brewing for a while, I have the movie theme, quotes, multimedia all lined up for that. I do need the feature thats somewhere deep down in @adambeynon 's todo list to be able to retrieve the code and comments to duplicate some of the small talk env stuff. Maybe @vais knows enough about the innards of Opal now that he could hit it ---------------------------------------------------------------------------------------------------- [16:51:37] Forrest Chang(@fkchang):@AstonJ if you need my opal blogs http://funkworks.blogspot.com/search/label/opal - I had been meaning to collect all the various blogs at one point myself ---------------------------------------------------------------------------------------------------- [16:52:18] Rick Carlino(@RickCarlino):@fkchang I think it just takes time. My thought is that once Volt hits 1.0 and has proven itself in production it will be Opal's killer app. ---------------------------------------------------------------------------------------------------- [16:52:57] Rick Carlino(@RickCarlino):I heard about Opal for the first time maybe 18 months ago? When I heard about it I thought "Oh, cool. I'm going to star this and hope to god it grows an ecosystem" ---------------------------------------------------------------------------------------------------- [16:53:17] Rick Carlino(@RickCarlino):Im sure others who hear about Opal thinking the same thing- they're optimistic, but they need reassurance. ---------------------------------------------------------------------------------------------------- [16:55:26] Forrest Chang(@fkchang):@RickCarlino I think volt is definitely cool, but I feel Rails integration needs more pumping. When you can use Rails for all the good and many things it does well, and then Opal for the front end, that's huge for pretty much anyone who does rails. I tried to explain that in my Jubilee talk w/my demo app, where I summarized it as "Use rails to get me to the game, Jubilee/opal to play the game". Twitter signup oauth, like 3 lines in Rails, -- BAM, real time sync w/servers and players, a handful of Jubilee/opal code bam! ---------------------------------------------------------------------------------------------------- [16:55:38] AstonJ(@AstonJ):Sounds good Forrest. I do think we need to cover the basics first because that way we make it super easy for anyone to jump in - even benefits in the way of just helping with the mental shift. Agree with Rick too. Volt is going to be Opal’s first killer app, which in turn is going to get Opal a lot more interest. I sometimes think that Opal is actually going to be more of the heart/engine, of frameworks like Volt, Clearspring, Vienna, Fire etc. In some ways that is better for the Opal team as it’s less people asking support questions. ---------------------------------------------------------------------------------------------------- [16:55:43] Forrest Chang(@fkchang):Being able to leverage your old code and the entire Rails ecosystem isn't to be laughed at ---------------------------------------------------------------------------------------------------- [16:56:08] AstonJ(@AstonJ):Also agree with you about Rails integration Forrest. ---------------------------------------------------------------------------------------------------- [16:56:16] Forrest Chang(@fkchang):We deployed our 1st production rails app w/opal last night. Opal was a huge part of the success ---------------------------------------------------------------------------------------------------- [16:56:21] AstonJ(@AstonJ):(I’m off shopping now but will catch up later) ---------------------------------------------------------------------------------------------------- [16:56:32] Rick Carlino(@RickCarlino):That's true- maybe I'll write an article titled "How to get Opal in your existing Rails app today" ---------------------------------------------------------------------------------------------------- [16:56:44] Rick Carlino(@RickCarlino):We can see how people take to it. ---------------------------------------------------------------------------------------------------- [16:56:46] Forrest Chang(@fkchang):I think Rails ppl need to see and hear this. The problem is none of the production rails app are open source ---------------------------------------------------------------------------------------------------- [16:57:55] Rick Carlino(@RickCarlino):I work on two production Rails apps that are opensource. I can try to wedge it in where possible ---------------------------------------------------------------------------------------------------- [16:58:03] Rick Carlino(@RickCarlino):although, both use angular :( ---------------------------------------------------------------------------------------------------- [16:58:05] Forrest Chang(@fkchang):I'll get down to blogging about various techniques I've come up with that I think are pretty nice. It'd be nice if we could get a little blog circle on that. @adambeynon and @elia would have probably the most data on that ---------------------------------------------------------------------------------------------------- [16:59:09] Rick Carlino(@RickCarlino):Doesn't "The Opalist" cover this sort of stuff currently? Who runs that? ---------------------------------------------------------------------------------------------------- [16:59:12] Forrest Chang(@fkchang):I'd be curious what @jaredcwhite is working on. Kudos again on the opalist. I think that will help w/the cause. It has me committing to providing content for each issue which I think is a good thing. Sometimes we just need deadlines to get stuff to the top fo the q ---------------------------------------------------------------------------------------------------- [17:01:26] Forrest Chang(@fkchang):On another thing, a message I know most ppl don't grok is that I think "Ruby web components" has the potential to be significant -- matching w/all the other web components (official and implemented by various frameworks) buzz that I also realize most ppl don't grok. It's why I really like @meh 's lissio ---------------------------------------------------------------------------------------------------- [17:02:18] Forrest Chang(@fkchang):React has been strong in pushing the reasons why lissio is really significant, but lissio's implementation is better, IMO, it's all objects, all Ruby, cohesively together ---------------------------------------------------------------------------------------------------- [17:02:26] Forrest Chang(@fkchang):at the point, coding is just Ruby ---------------------------------------------------------------------------------------------------- [17:02:31] Forrest Chang(@fkchang):and that is significant ---------------------------------------------------------------------------------------------------- [17:07:26] Jared White(@jaredcwhite):@RickCarlino @fkchang Opalist is a bi-weekly email newsletter. I also have a matching blog, which I'm obviously happy to open up to anyone who would like to publish on that, although I suspect most people writing a blog post will want to post on their own blog. (Which is fine, I can link to that from the newsletter!) So...I'm checking Reddit, Ruby news sites, etc. like anybody, but if you specifically want to make sure your content ends up in Opalist just send it my way. hello@whitefusion.io ---------------------------------------------------------------------------------------------------- [17:20:49] Rick Carlino(@RickCarlino):Good stuff. Would probably be good if it had a "Submit an article" form or something. I'll have some content here shortly. ---------------------------------------------------------------------------------------------------- [18:53:42] Elia Schito(@elia):> I think it just takes time. I agree, if anyone remember how Ruby & Rails were considered in the early years… ---------------------------------------------------------------------------------------------------- [18:55:05] Elia Schito(@elia):> We deployed our 1st production rails app w/opal last night. @fkchang that would be cool to list on the site, that too in the early years helped rails ---------------------------------------------------------------------------------------------------- [18:55:59] Elia Schito(@elia):@fkchang also I think that would be cool if you were blogging from the opalrb.org blog, at least for general stuff ---------------------------------------------------------------------------------------------------- [19:13:31] Elia Schito(@elia):@jaredcwhite how many days left before the next opalist issue? ---------------------------------------------------------------------------------------------------- [19:13:47] Rick Carlino(@RickCarlino):Great question. ---------------------------------------------------------------------------------------------------- [19:13:55] Rick Carlino(@RickCarlino):@RickCarlino wants to know how long he can procrastinate ---------------------------------------------------------------------------------------------------- [19:14:09] Elia Schito(@elia):haha, meee too ---------------------------------------------------------------------------------------------------- [19:14:20] Elia Schito(@elia):was thinking it would be nice to have the 0.8 post out for that date ---------------------------------------------------------------------------------------------------- [19:28:14] Rick Carlino(@RickCarlino):Oh lol @edubkendo is in here. Long time no see, sir. ---------------------------------------------------------------------------------------------------- [19:28:28] Rick Carlino(@RickCarlino):We met many moons ago in the TowerJS days ---------------------------------------------------------------------------------------------------- [19:34:22] Jared White(@jaredcwhite):@RickCarlino Great point, I will work on that. @elia Next issue's going out Wednesday next week (May 13). I will try to get you a PR for a link as well. :shipit: ---------------------------------------------------------------------------------------------------- [19:38:44] Elia Schito(@elia):ok, then I don't think I'll be able to write something :( ---------------------------------------------------------------------------------------------------- [19:38:52] Elia Schito(@elia):great to hear about that PR ---------------------------------------------------------------------------------------------------- [19:40:01] Elia Schito(@elia):If you guys have any production app with opal installer would be also great to have a "trysted by" section in the homepage ---------------------------------------------------------------------------------------------------- [20:10:02] AstonJ(@AstonJ):@jaredcwhite Do you think you could update the Opal site with a list of all Opal related articles to date too? :point_up: [May 8 2015 12:38 PM](https://gitter.im/opal/opal?at=554ca024629c609946251102) Seems more sense for you to do it if you are already scouring the web for Opal-related stuff :) If you can’t no worries, but could you email us a list of Opal-related articles you know of to date please? One of us can add them to the site then. ---------------------------------------------------------------------------------------------------- [20:12:39] Elia Schito(@elia):@AstonJ @jaredcwhite opening now an issue on opalrb.org to gather the list so you too can accumulate stuff there and get an agreement on where it's better to put them in the site :smiley: ---------------------------------------------------------------------------------------------------- [20:13:05] AstonJ(@AstonJ):Awesome, thanks @elia :) ---------------------------------------------------------------------------------------------------- [20:14:13] Elia Schito(@elia):https://github.com/opal/opalrb.org/issues/19 ---------------------------------------------------------------------------------------------------- [21:10:45] Mitch VanDuyn(@catmando):anybody have strategies for configuring opal between development/test/production. ---------------------------------------------------------------------------------------------------- [21:11:31] Mitch VanDuyn(@catmando):For example i have a string value that I need to have a different value depending on whether we are in test/development or production. ---------------------------------------------------------------------------------------------------- [21:12:06] Rick Carlino(@RickCarlino):Is ERB an option? ---------------------------------------------------------------------------------------------------- [21:12:55] Rick Carlino(@RickCarlino):Oh wait, I'm not sure that would work. It might in the asset pipeline, though. Have you tried adding a .erb to the end and putting in some ERB with an ENV[] var? ---------------------------------------------------------------------------------------------------- [21:13:26] Adam Beynon(@adambeynon):yep, I use the erb solution (with asset pipeline) ---------------------------------------------------------------------------------------------------- [21:14:03] Rick Carlino(@RickCarlino):Ah, but you don't like it I take it? ---------------------------------------------------------------------------------------------------- [21:14:29] Rick Carlino(@RickCarlino):Probably makes it hard for your syntax highlight to do its job ---------------------------------------------------------------------------------------------------- [21:14:30] Elia Schito(@elia):I tend to prefer data attributes, in some cases I used meta tags and loaded into ENV (inside opal) ---------------------------------------------------------------------------------------------------- [21:15:01] Adam Beynon(@adambeynon):umm, its not ideal. I keep meaning to move to something similar to elia ^^ ---------------------------------------------------------------------------------------------------- [21:30:58] Mitch VanDuyn(@catmando):soo not be a dummy but... I stuck a little file (config.js.rb.erb) into the assets folder. ---------------------------------------------------------------------------------------------------- [21:31:29] Mitch VanDuyn(@catmando):I can require it fine in the opal code, but the erb is not getting expanded ---------------------------------------------------------------------------------------------------- [21:31:49] Mitch VanDuyn(@catmando):do I have to do something to enable this in the asset pipeline? ---------------------------------------------------------------------------------------------------- [21:31:49] Elia Schito(@elia):v0.7? ---------------------------------------------------------------------------------------------------- [21:32:20] Mitch VanDuyn(@catmando):yeah more or less (its my patched version mostly 0.7) ---------------------------------------------------------------------------------------------------- [21:32:55] Elia Schito(@elia):then you either use master or you use the .erb as main file ---------------------------------------------------------------------------------------------------- [21:33:10] Elia Schito(@elia):in 0.7 only the main file gets full sprockets treatment ---------------------------------------------------------------------------------------------------- [21:34:14] Elia Schito(@elia):0.8 restores full sprockets processing while keeping support for require order ---------------------------------------------------------------------------------------------------- [21:37:27] Mitch VanDuyn(@catmando):the main file being like application.js.rb ? ---------------------------------------------------------------------------------------------------- [21:37:45] Elia Schito(@elia):yep, would be application.js.rb.erb ---------------------------------------------------------------------------------------------------- [21:37:49] Elia Schito(@elia):that should work ---------------------------------------------------------------------------------------------------- [21:43:55] Mitch VanDuyn(@catmando):nope :-( ---------------------------------------------------------------------------------------------------- [21:44:20] Mitch VanDuyn(@catmando):but ... ---------------------------------------------------------------------------------------------------- [21:44:37] Elia Schito(@elia):that is the file you use for javascript_include_tag? ---------------------------------------------------------------------------------------------------- [21:44:45] Elia Schito(@elia):_assuming rails_ ---------------------------------------------------------------------------------------------------- [21:44:55] Mitch VanDuyn(@catmando):what exactly do we mean by top level file... ---------------------------------------------------------------------------------------------------- [21:45:03] Mitch VanDuyn(@catmando):what if you have multiple? ---------------------------------------------------------------------------------------------------- [21:45:15] Elia Schito(@elia):example? ---------------------------------------------------------------------------------------------------- [21:45:34] Mitch VanDuyn(@catmando):we have a ton of javascript_include_tags ---------------------------------------------------------------------------------------------------- [21:45:43] Elia Schito(@elia):shouldn't be a problem ---------------------------------------------------------------------------------------------------- [21:45:43] Mitch VanDuyn(@catmando):our asset pipeline structure is a mess ---------------------------------------------------------------------------------------------------- [21:46:09] Mitch VanDuyn(@catmando):so as long as its being pulled in via the top level javascript_include_tag it should work ---------------------------------------------------------------------------------------------------- [21:46:11] Elia Schito(@elia):does it work you use erb on a plain js file? ---------------------------------------------------------------------------------------------------- [21:46:19] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [21:50:40] Mitch VanDuyn(@catmando):so as long as I directly include config.js.rb.erb all should be well correct? ---------------------------------------------------------------------------------------------------- [02:40:01] Kurtis Rainbolt-Greene(@krainboltgreene):@elia Hey, re: our previous discussion about other filesystem operations it seems like Opal's File and Dir classes already assume some level of "during build process"? ---------------------------------------------------------------------------------------------------- [02:40:58] Kurtis Rainbolt-Greene(@krainboltgreene):Or they talk to a virtual fs, I can't really tell. ---------------------------------------------------------------------------------------------------- [02:49:05] Kurtis Rainbolt-Greene(@krainboltgreene):Ugh, this is really just becoming an annoying blocker for me. Hmm. ---------------------------------------------------------------------------------------------------- [04:12:36] Kurtis Rainbolt-Greene(@krainboltgreene):@elia: http://opalrb.org/try/?code:hash%20%3D%20%7B%20foo%3A%201%20%7D%0Astring%20%3D%20%22Value%3A%20%25%3Cfoo%3E%22%0A%0Aputs(string%20%25%20hash) :( ---------------------------------------------------------------------------------------------------- [07:52:09] Elia Schito(@elia):@krainboltgreene fixed on master, but with {} instead of <> ---------------------------------------------------------------------------------------------------- [07:52:19] Elia Schito(@elia):thanks to @vais of course ---------------------------------------------------------------------------------------------------- [08:07:23] Elia Schito(@elia):@adambeynon ping, got my message? ---------------------------------------------------------------------------------------------------- [09:51:33] Vais Salikhov(@vais):@elia @krainboltgreene actually both `%{}` and `%<>` format strings are fully supported now. `Kernel#format` (and the many names it's known by and the many forms in which it manifests itself) is 100% rubyspec-compliant since https://github.com/opal/opal/commit/511565ab80b1ae2250ef29d99ba6f6ec18a3558e :beers: ---------------------------------------------------------------------------------------------------- [09:52:12] Elia Schito(@elia):uh, maybe I did something wrong when I tried it ---------------------------------------------------------------------------------------------------- [09:53:42] Elia Schito(@elia):@vais I get `ArgumentError: malformed format string - %` when executing the code from @krainboltgreene's link ---------------------------------------------------------------------------------------------------- [09:53:55] Elia Schito(@elia):``` hash = { foo: 1 } string = "Value: %" puts(string % hash) ``` ---------------------------------------------------------------------------------------------------- [10:00:16] Vais Salikhov(@vais):@elia I see - this must be a case not covered by rubyspec then. This is actually a pretty little-known feature of ruby for some reason. The difference between `%{}` and `%<>` is that the first one is not followed by a field specifier, but the second one must be, otherwise it does not work. So, in MRI it fails silently, but in Opal it blows up, as it should :) Check this out: ``` $ ruby -v -e "p('Value: %' % { foo: 1 })" ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] "Value: %" $ ruby -v -e "p('Value: %s' % { foo: 1 })" ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] "Value: 1" $ bundle exec opal -v -e "p('Value: %s' % { foo: 1 })" Opal v0.8.0.dev "Value: 1" ``` ---------------------------------------------------------------------------------------------------- [10:02:28] Vais Salikhov(@vais):MRI's behavior above should be considered a bug, since it silently drops the value on the floor instead of complaining about an invalid format string. This is how *we* roll: ``` $ bundle exec opal -v -e "p('Value: %' % { foo: 1 })" Opal v0.8.0.dev /private/var/folders/pt/kr0lwm4d20jgc_jvpc5fyk1r0000gn/T/opal-nodejs-runner-20150508-18639-1wd0fyb:3603 throw exception; ^ ArgumentError: malformed format string - % ``` ---------------------------------------------------------------------------------------------------- [10:18:28] Elia Schito(@elia):go @vais! in which Opal uncovered an MRI bug :P ---------------------------------------------------------------------------------------------------- [10:29:59] Vais Salikhov(@vais):@elia LOL. I just checked on 2.0.0 cause I though this may be a regression in 2.2.0, but no, it's the same. Go figure. Well, @brixen did complain about MRI devs not using rubyspec :trollface: Except that there is no test covering this particular case in rubyspec either double-:trollface: ri Kernel#sprintf just has this to say at the very bottom: ``` For more complex formatting, Ruby supports a reference by name. %s style uses format style, but %{name} style doesn't. Examples: sprintf("%d : %f", { :foo => 1, :bar => 2 }) #=> 1 : 2.000000 sprintf("%{foo}f", { :foo => 1 }) # => "1f" ``` ---------------------------------------------------------------------------------------------------- [10:31:33] Elia Schito(@elia):@vais should be noted that now they're actually using it https://github.com/ruby/rubyspec ---------------------------------------------------------------------------------------------------- [10:31:50] Vais Salikhov(@vais):It's officially my favorite feature of Ruby :stuck_out_tongue_closed_eyes: ---------------------------------------------------------------------------------------------------- [10:32:12] Vais Salikhov(@vais)::stuck_out_tongue_winking_eye: ---------------------------------------------------------------------------------------------------- [10:32:23] Elia Schito(@elia)::smile_cat: ---------------------------------------------------------------------------------------------------- [10:36:55] Vais Salikhov(@vais):@elia my git-fu is still not strong enough to sync our outdated rubyspec fork with theirs :sweat_smile: ---------------------------------------------------------------------------------------------------- [10:37:35] Elia Schito(@elia):I still dream up on doing it myself, but I lack time-fu :clock230: ---------------------------------------------------------------------------------------------------- [10:38:16] Elia Schito(@elia):last time I think mike did the hard work ---------------------------------------------------------------------------------------------------- [10:38:55] Elia Schito(@elia):https://github.com/opal/opal/pull/528 ---------------------------------------------------------------------------------------------------- [10:54:15] Vais Salikhov(@vais):@elia the way I think about it is we still have plenty of failing cases to work on as it is, so no rush :) ---------------------------------------------------------------------------------------------------- [11:17:56] Elia Schito(@elia):@/all beta1 is out! https://rubygems.org/gems/opal/versions/0.8.0.beta1 ---------------------------------------------------------------------------------------------------- [11:22:20] Elia Schito(@elia):(ugh https://travis-ci.org/opal/opal/jobs/61749537, fixed on master) ---------------------------------------------------------------------------------------------------- [11:25:42] AstonJ(@AstonJ):Nice one @elia :+1: ---------------------------------------------------------------------------------------------------- [11:26:02] Elia Schito(@elia)::smile: ---------------------------------------------------------------------------------------------------- [11:28:00] Vais Salikhov(@vais):Where in the world is @mieko? I was just reading his ["Opal" blog post](http://mike.filespanker.com/post/80464613230/opal) from a year ago. Posting it to reddit/r/ruby now, it really resonated with me. Hope he's doing well. ---------------------------------------------------------------------------------------------------- [11:36:48] AstonJ(@AstonJ):That’s a nice post @vais @mieko (looks like he hastn’t blogged for over a year?). Btw I think it would be a good idea to put every blog post about Opal on the Opal site somewhere (I proposed the same thing about Volt). ---------------------------------------------------------------------------------------------------- [11:38:12] Elia Schito(@elia):@AstonJ you think you can do a PR on https://github.com/opal/opalrb.org adding a resources page with those links? ---------------------------------------------------------------------------------------------------- [11:41:00] AstonJ(@AstonJ):Sure - can you think of any other links you feel should be added? (I’ll Google later too) @elia ---------------------------------------------------------------------------------------------------- [11:41:43] Elia Schito(@elia):the opalrb twitter account should have a good collection of them ---------------------------------------------------------------------------------------------------- [11:55:22] AstonJ(@AstonJ):Awesome thanks :) ---------------------------------------------------------------------------------------------------- [12:31:31] Vais Salikhov(@vais):@AstonJ make sure you include this one - it got me interested in Opal ;) http://confreaks.tv/videos/rubyconf2013-opal-a-new-hope-for-ruby-programmers ---------------------------------------------------------------------------------------------------- [12:38:59] Elia Schito(@elia):once again kudos to @fkchang :clap: ---------------------------------------------------------------------------------------------------- [12:44:33] AstonJ(@AstonJ):@vais Is that the one where I’m on stage with DHH? ;-) Hehe :sparkles: ---------------------------------------------------------------------------------------------------- [12:54:42] Vais Salikhov(@vais)::) ---------------------------------------------------------------------------------------------------- [14:30:46] Rick Carlino(@RickCarlino):Holy crap! /r/ruby has so many Opal related posts right now! ---------------------------------------------------------------------------------------------------- [14:54:14] Vais Salikhov(@vais):@RickCarlino from http://opalrb.org/docs/faq > Why does Opal exist? > To try and keep ruby relevant in a world where client-side apps are making javascript the primary development platform. I think Opal deserves more attention on /r/ruby. Right now the burden is on us to give the community something worth talking about. BTW @elia @adambeynon the *"try and keep ruby relevant"* always rubbed me the wrong way. Does anyone else feel that way? ---------------------------------------------------------------------------------------------------- [14:55:06] Rick Carlino(@RickCarlino):@vais Just so I make myself apparent- I think the high volume of Opal posts on /r/ruby is **a good thing**. ---------------------------------------------------------------------------------------------------- [14:55:57] Vais Salikhov(@vais):@RickCarlino no, I understood you correctly :) Just offering an explanation as to why. ---------------------------------------------------------------------------------------------------- [14:56:13] Rick Carlino(@RickCarlino):But yeah "try and keep Ruby relevant" might indicate that its losing relevance to some people ---------------------------------------------------------------------------------------------------- [14:56:32] Rick Carlino(@RickCarlino):Maybe "spread the power of Ruby to new platforms" ---------------------------------------------------------------------------------------------------- [14:57:25] AstonJ(@AstonJ):Is r/ruby, reddit? I have never seen the appeal tbh - it just looks like a stripped down forum but where it’s really difficult to keep track of the conversation. ---------------------------------------------------------------------------------------------------- ############################## [2015-05-09] ############################## [03:10:38] Rick Carlino(@RickCarlino):@bglusman That's awesome. Way to target the benefits of isomorphism. Blog about it! The world needs to know! ---------------------------------------------------------------------------------------------------- [13:14:40] Kurtis Rainbolt-Greene(@krainboltgreene):@elia @vais: Wow, thanks for that fix. I'll pull from master later today. ---------------------------------------------------------------------------------------------------- [17:43:55] AstonJ(@AstonJ):Nice! Looking forward to seeing rubytetris.com and all of our scores @bglusman ;-) ---------------------------------------------------------------------------------------------------- [23:08:05] Jamie Gaskins(@jgaskins):@AstonJ Sorry, I only just saw your message about screencasts. For some reason, I didn't get the email from Gitter about the mention. I'd love to get in on that. I was thinking of making some Clearwater screencasts anyway. :+1: ---------------------------------------------------------------------------------------------------- ############################## [2015-05-10] ############################## [00:07:45] AstonJ(@AstonJ):@jgaskins No probs Jamie I’ll add you to the room :-) We’re currently debating on the direction - whether we go for a screencasting outfit (which I think may be fraught with problems or take too much time to set up properly) or a syndicate style app that feeds everyone’s videos through Rubycasters.com, giving everyone independence and freedom to follow their own vision. Have a read of my post starting ‘Attention please’. ---------------------------------------------------------------------------------------------------- [03:23:01] Mario Rogic(@supermario):Hey guys - I've been messing with Opal for a while now, including presenting it at a Ruby Meetup in Melbourne recently where it was pretty well received (demoed a WIP game and a FirefoxOS weather app). I'm really struggling from time to time however, mostly with `opal-browser` not having docs, using specs as docs but them not working somehow (i.e. can't for the life of me get `Interval` to work, or `Browser::Console`, but then others like `Browser::HTTP` are fine). I'm not sure if perhaps I'm missing something - but I'd love to figure it all out and even contribute back with docs. Can someone help, or point me in the right direction? ---------------------------------------------------------------------------------------------------- [03:49:31] Jamie Gaskins(@jgaskins):@supermario Did you `require 'browser/interval'`? That one's necessary to require manually, same with `require 'browser/delay'`. Also, I've been using the GitHub version of `opal-browser` in my apps because I think the current gem release is pretty far behind it. ---------------------------------------------------------------------------------------------------- [03:50:29] Jamie Gaskins(@jgaskins):@supermario Also, the code itself is _very_ well written and documented, so you should be able to find your way through it reasonably well. Some stuff in the gem, I'd really like docs for, so maybe I'll put in a PR for it when I get some free time. ---------------------------------------------------------------------------------------------------- [11:19:26] Mario Rogic(@supermario):@jgaskins I was positive I had – but just tried again and now fine, so I must have made some mistake. Yep, I'm pulling straight from github in my gemfile. ---------------------------------------------------------------------------------------------------- [11:21:25] Mario Rogic(@supermario):Not trying to imply the code is poorly written or documented, just sharing I'm having a tough time as a professional developer (not ruling out it could just be that I'm daft), and wonder if beginners would fare much worse. If I can help that cause, I'd be happy to. ---------------------------------------------------------------------------------------------------- [11:23:05] Mario Rogic(@supermario):I guess i'll crack on some more, and keep watching issues to see if there's some area I can help out :smile: ---------------------------------------------------------------------------------------------------- [17:29:12] Forrest Chang(@fkchang):@supermario I've been wanting to write docs/a series of blog posts on opal-browser primarily because I feel nearly no one knows about it, and they end up reimplementing it when they don't need to. Also, someone needs to pimp @meh 's work ---------------------------------------------------------------------------------------------------- [17:30:40] Forrest Chang(@fkchang):Though lately I haven't been using it much because it conflicts w/opal-jquery in places and the bulk of the opal I've been doing uses rails - I put both opal-browser and opal-jquery on an internal project, but for our app that just went to production on thurs, I decided not to fight the fact that rails comes w/jquery and our app already uses it. Some team members tried to pull it in, hit some issues and backed out ---------------------------------------------------------------------------------------------------- [17:33:32] meh.(@meh):fkchang, I could try to work around those if you know what was up ---------------------------------------------------------------------------------------------------- [17:33:42] meh.(@meh):they should not conflict ---------------------------------------------------------------------------------------------------- [18:01:58] Forrest Chang(@fkchang):@meh I need to catalog what the problems were, I think 1 was that both set $document. I can ask the team if they remember what the problems they hit were. For the internal tool, I think the order I evaluated mattered depending on what it was that I wanted to do ---------------------------------------------------------------------------------------------------- [23:50:07] Mario Rogic(@supermario):I'm finding less and less of a need for jQuery lately, especially with different approaches like React. Also http://youmightnotneedjquery.com/ – so yeah I'd agree, I didn't find opal-browser for a while and even then had issues until I went straight from GH repo. Would definitely be a stumbling block for beginners I think! ---------------------------------------------------------------------------------------------------- ############################## [2015-05-11] ############################## [16:27:30] Rick Carlino(@RickCarlino):Is `opal-rails` set to have source maps by default? ---------------------------------------------------------------------------------------------------- [16:28:13] Rick Carlino(@RickCarlino):It says it does, but I'm not seeing them. It appears that I have source maps enabled in Chrome and have assets in debug mode ---------------------------------------------------------------------------------------------------- [16:30:22] Rick Carlino(@RickCarlino):It maps to `the_correct_file.rb` in console, but when I open that file, it's compiled output, not Ruby ---------------------------------------------------------------------------------------------------- [16:36:17] Elia Schito(@elia):@RickCarlino I need to check how other projects set defaults for different environments ---------------------------------------------------------------------------------------------------- [16:37:00] Rick Carlino(@RickCarlino):Ah ok. So its a known issue with `opal-rails`? ---------------------------------------------------------------------------------------------------- [16:37:47] Elia Schito(@elia):no, it should work afaik, was just pointing out that current status is a bit fragile ---------------------------------------------------------------------------------------------------- [16:50:19] Forrest Chang(@fkchang):@RickCarlino which version of opal r u using? source maps are (were?) broken for the 0.7.* I've been using lately ---------------------------------------------------------------------------------------------------- [16:50:34] Forrest Chang(@fkchang):on 0.6.* they worked out of the box for me ---------------------------------------------------------------------------------------------------- [16:50:40] Elia Schito(@elia):@fkchang thanks, that's the right question ---------------------------------------------------------------------------------------------------- [16:51:36] Rick Carlino(@RickCarlino):``` opal (0.7.1) hike (~> 1.2) sourcemap (~> 0.1.0) sprockets (>= 2.2.3, < 4.0.0) tilt (~> 1.4) opal-activesupport (0.1.0) opal (>= 0.5.0, < 1.0.0) opal-jquery (0.3.0) opal (~> 0.7.0) opal-rails (0.7.0) jquery-rails opal (~> 0.7.0) opal-activesupport (>= 0.0.5) opal-jquery (~> 0.3.0.beta1) opal-rspec (~> 0.4.0) rails (>= 3.2, < 5.0) opal-rspec (0.4.2) opal (~> 0.7.0) ``` ---------------------------------------------------------------------------------------------------- [16:51:47] Rick Carlino(@RickCarlino):Yep. That's it. 0.7.* ---------------------------------------------------------------------------------------------------- [16:52:22] Elia Schito(@elia):@RickCarlino yeah, you can try with opal and opal-rails from master ---------------------------------------------------------------------------------------------------- [16:53:36] Rick Carlino(@RickCarlino):Ah ok ---------------------------------------------------------------------------------------------------- [18:07:02] Forrest Chang(@fkchang):@vais submitted an issue per your suggestion https://github.com/opal/opal/issues/840 ---------------------------------------------------------------------------------------------------- [20:01:27] Brian Glusman(@bglusman):Anyone around to talk through how to do some things with Opal React? specifically struggling with attaching key handler to top level dom element ---------------------------------------------------------------------------------------------------- [20:02:29] Brian Glusman(@bglusman):there’s an example [here](https://github.com/zetachang/react.rb/blob/master/examples/todos/app/components/app.react.rb) for an input where the input doesn’t need to take a block, but I get warnings etc modifying afterwards and can’t make this work on parent div that’s meant to catch keypress anywhere in window ---------------------------------------------------------------------------------------------------- [20:03:58] Brian Glusman(@bglusman):I’m also failing to get a background color property to be a dynamic inline style the way I’m trying, but that’s less pressing :-) ---------------------------------------------------------------------------------------------------- [20:05:29] Jared White(@jaredcwhite):@RickCarlino @elia @AstonJ @fkchang @adambeynon Got a new page up on Opalist where you can submit links directly for inclusion in the newsletter: http://www.opalist.co/submit-link (thanks Rick for the suggestion) -- reminder next issue's going out this Wednesday AM Pacific Time ---------------------------------------------------------------------------------------------------- [20:09:16] Rick Carlino(@RickCarlino):@jaredcwhite I will have an article published in the next 12 hours ---------------------------------------------------------------------------------------------------- [20:09:22] Rick Carlino(@RickCarlino):Thanks for the heads up! ---------------------------------------------------------------------------------------------------- [20:11:46] AstonJ(@AstonJ):That’s brilliant, thanks @jaredcwhite :+1: Would be great if you could keep a running list that we could add to the Opal site too. Tho I imagine at some point that might have to be restricted to just featured items as I expect the list will get very big haha ---------------------------------------------------------------------------------------------------- [20:22:25] Forrest Chang(@fkchang):@jaredcwhite awesome, I'll submit as soon as I have something ready. What's the exact cut off hour? ---------------------------------------------------------------------------------------------------- [20:50:39] Jared White(@jaredcwhite):@AstonJ Yep, will add some stuff here https://github.com/opal/opalrb.org/issues/19 @fkchang When I go to bed on Tuesday. :) Generally around 10:30pm ---------------------------------------------------------------------------------------------------- [22:05:32] Rick Carlino(@RickCarlino):Is try opal broke right now? ---------------------------------------------------------------------------------------------------- [22:05:49] Elia Schito(@elia):just pushed a new version of opalrb ---------------------------------------------------------------------------------------------------- [22:06:02] Rick Carlino(@RickCarlino):Ah- just temporary? ---------------------------------------------------------------------------------------------------- [22:06:21] Elia Schito(@elia):no, was supposedly ok, let me check, what's the error? ---------------------------------------------------------------------------------------------------- [22:06:44] Rick Carlino(@RickCarlino):http://opalrb.org/try/ <-- broke in chrome on linux ---------------------------------------------------------------------------------------------------- [22:19:55] Elia Schito(@elia):@RickCarlino should be fixed ---------------------------------------------------------------------------------------------------- [22:20:19] Elia Schito(@elia):let me know if you see any other broken stuff ---------------------------------------------------------------------------------------------------- ############################## [2015-05-12] ############################## [04:19:43] Forrest Chang(@fkchang):Pre- react, I think most people just wouldn't grok lissio, after lissio, I think it makes sense. That everything including CSS is in Opal is a distinguishing aspect of lissio ---------------------------------------------------------------------------------------------------- [08:12:49] Vais Salikhov(@vais):@fkchang re #840, I must admit you are over-estimating my current ability with Opal by an order of magnitude or two :sweat_smile: Nevertheless, having it posted as an issue gives it visibility and a chance of getting worked on. Who knows, maybe even by yours truly... ---------------------------------------------------------------------------------------------------- [08:28:20] Elia Schito(@elia):@catmando i'd love to help but I'm a bit tight with time, there's already an issue open on opal or opal-rails or opal-rspec? ---------------------------------------------------------------------------------------------------- [14:28:44] Mitch VanDuyn(@catmando):@elia - no drama. If there is not an obvious answer, then I will indeed open an issue on opal-rspec. I think the root problem is that opal-rpsec should build one tree of requires for the entire test, not a separate tree for each individual test spec. I might fork a branch and see if I can get that work. In the mean time I put a work around in place: I made a version of react.js that checks if its loaded. I am just loading that version in test (not in production or development.) That got me through the night. I will add that to the notes on the problem in case anybody else bumps into this. ---------------------------------------------------------------------------------------------------- [15:16:33] Jared White(@jaredcwhite):Anyone try getting the latest Opal 0.8.0.beta1 and opal-rails working? I'm just not having luck at all. https://github.com/opal/opal-rails/issues/49#issuecomment-101317128 ---------------------------------------------------------------------------------------------------- [15:32:47] Forrest Chang(@fkchang):@vais re: #840 -- maybe, I figure it's just a matter of time. When @meh is directing issues directly to you, I figure u picked up very quickly ---------------------------------------------------------------------------------------------------- [15:57:00] Vais Salikhov(@vais):Thanks @fkchang I'm seriously flattered :blush: ---------------------------------------------------------------------------------------------------- [15:57:32] meh.(@meh):vais, did anyone give you the contributor bit yet? you should get it if not ---------------------------------------------------------------------------------------------------- [16:08:19] Vais Salikhov(@vais):@meh yes! I'm a "collaborator" :smile: I still prefer to send PRs though :sweat_smile: ---------------------------------------------------------------------------------------------------- [16:16:23] Forrest Chang(@fkchang):@vais ur welcome. I'm just going to keep flattering u until the feature is in ;) ---------------------------------------------------------------------------------------------------- [16:17:02] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [16:19:22] Forrest Chang(@fkchang):Related to opal promotion and killer apps, I'd like to think that if I build out opal inspector w/it's smalltalk and lisp machine inspired features, that could be a killer app for Opal. avdi has been posting about smalltalk, and I completely could build in a lot of those things he's excited about. ---------------------------------------------------------------------------------------------------- [16:19:45] Forrest Chang(@fkchang):like this https://twitter.com/avdi/status/597423163509764096 I could completely build that (somewhat simulated because we don't exactly have the full smalltalk features) ---------------------------------------------------------------------------------------------------- [16:20:10] Forrest Chang(@fkchang):I'm tempted to build it and then basically post the same thing but with #opal ---------------------------------------------------------------------------------------------------- [16:27:27] Vais Salikhov(@vais):@fkchang how about that "find by example" feature? (Finds what method could be used to accomplish the output based on input). I can't wrap my mind around how that's even implemented in Smalltalk. Mind-blowing. ---------------------------------------------------------------------------------------------------- [16:27:56] Vais Salikhov(@vais):BTW, here's the video http://devblog.avdi.org/2015/05/11/in-which-i-make-you-hate-ruby-in-7-minutes/ ---------------------------------------------------------------------------------------------------- [16:35:21] Forrest Chang(@fkchang):@vais actually find by example is already implemented as a gem https://github.com/BMorearty/what_methods --- the way it's done is a little more complicated than I would've done it (probably covers more edge cases and it blacklists certain dangerous methods). Unfortunately that code didn't work when I pasted it into opal-irb, so I'll end up rewriting it anyways ---------------------------------------------------------------------------------------------------- [16:36:52] Forrest Chang(@fkchang):the 7 min demo, I could come reasonably close to duplicating. Being able to lookup code/comments would be a key part of approximating/duplicating the smalltalk experience ---------------------------------------------------------------------------------------------------- [16:37:37] Forrest Chang(@fkchang):On a side note, I thought I would name opal-inspector - clouseau, but unfortunately that name is taken. I have all sorts of Pink Panther imagery for my eventual talk on it ---------------------------------------------------------------------------------------------------- [16:38:19] Forrest Chang(@fkchang):though a video called "in which I make you love Opal in 7 minutes" would be cool ---------------------------------------------------------------------------------------------------- [16:44:02] Forrest Chang(@fkchang):@AstonJ @elia @meh @adambeynon @vais I think this excerpt from this Rust critique applies to opal http://www.viva64.com/en/b/0324/ i.e. ```I think it's high time we started learning lessons of history. No one sane will ever start using a new language in their projects until you show them a few cool development tools supporting it, tell them a couple of success stories, and show a dozen of programmers working with that language and living close by. As for programmers, they will never - except probably for the youngest ones - spend their time and health on learning another "very best" language until you show them a few cool development tools (not a frob like Racer) and a couple of tens of thousands of ready-made libraries (not "experimental" or "unstable" or stuff like that), tell them a couple of success stories, and show them a dozen of open vacancies in their city or town. You know, it's like the "Chicken or the Egg" dilemma. On very rare occasions, this problem does get resolved (relatively representative examples are Go and Scala) - mostly thanks to investments of time and money from some large company (Google, Typesafe) who for some reason finds it worthy to popularize a new language.``` ---------------------------------------------------------------------------------------------------- [17:20:33] AstonJ(@AstonJ):Completely agree with that Forrest :+1: I think Volt will be Opal's first killer app and when Volt gets its own killer app, Opal will benefit hugely as well. I also agree about showing people stuff, how they can use it (and why it's so much better than the alternatives!!) ...exactly why I think good quality screencasts are important. I'm currently reformatting my Mac but will post a summary of what's going on with the screencasts and where everyone's at later this week :) ---------------------------------------------------------------------------------------------------- [19:01:29] Dan Ross(@btnpushnmunky):Hi there. I have the following code to get a file input tag `file_input = Element.find("#fileInput")`. I'm using opal-jquery as well as just opal. I can't figure out a way to get the file being uploaded. I'm trying to read a file via the FileReader. Any help would be appreciated. ---------------------------------------------------------------------------------------------------- [21:45:33] Forrest Chang(@fkchang):@jaredcwhite submitted post via submit-link --- 7.5 hours before the deadline! ---------------------------------------------------------------------------------------------------- [21:45:58] Rick Carlino(@RickCarlino):. #livingOnTheEdge #YOLO ---------------------------------------------------------------------------------------------------- [23:16:15] Rick Carlino(@RickCarlino):Has anyone dealt with class level instance var issues in Opal before? ---------------------------------------------------------------------------------------------------- [23:16:22] Rick Carlino(@RickCarlino):https://github.com/opal/opal/issues/849 ---------------------------------------------------------------------------------------------------- [23:39:51] Jared White(@jaredcwhite):@RickCarlino Replied -- it may be a weird blank char or something, I'm not sure. I got it working just by retyping in the Try code box. ---------------------------------------------------------------------------------------------------- [23:40:39] Jared White(@jaredcwhite):@fkchang :clap: ---------------------------------------------------------------------------------------------------- [23:41:06] Rick Carlino(@RickCarlino):whoah... ---------------------------------------------------------------------------------------------------- [23:41:57] Rick Carlino(@RickCarlino):Yep. Cool. Thanks @jaredcwhite ---------------------------------------------------------------------------------------------------- [23:55:10] Vais Salikhov(@vais):@fkchang wow re what_methods, didn't know that even existed, cool! Re being able to lookup code/comments, at the risk of this starting to sound like the beginning of the [stone soup story](http://en.wikipedia.org/wiki/Stone_Soup), I think the next step is for you to express your vision for this capability as a set of executable failing specs :wink2: Then someone could just make those specs pass, and... the end. This would really take a lot of guesswork (and design work) out of it. I know I would never have gotten involved with Opal if not for rubyspec. It made it a no-brainer to contribute. ---------------------------------------------------------------------------------------------------- [01:37:11] Rick Carlino(@RickCarlino):@jaredcwhite Thanks for the confirmation email. Pretty sure I forgot that I sent it to you and may have inadvertently double posted. Sorry if that was the case. ---------------------------------------------------------------------------------------------------- [02:11:47] Rick Carlino(@RickCarlino):So what are the most actively maintained front end frameworks in Opal? All im seeing is Vienna and ReactRB. Is that about right? ---------------------------------------------------------------------------------------------------- [02:13:32] meh.(@meh):RickCarlino, lissio! ---------------------------------------------------------------------------------------------------- [02:14:33] Rick Carlino(@RickCarlino):Ah nice. It's mostly working then? ---------------------------------------------------------------------------------------------------- [02:16:21] meh.(@meh):RickCarlino, it all works, I use it ---------------------------------------------------------------------------------------------------- [02:16:29] meh.(@meh):RickCarlino, actually, I think it's kinda broken on 0.8 ---------------------------------------------------------------------------------------------------- [02:16:36] Rick Carlino(@RickCarlino):Awesome. Close enough! ---------------------------------------------------------------------------------------------------- [02:16:46] meh.(@meh):but @adambeynon and @elia haven't had the time to help me fix the issues with the new sprockets changes ---------------------------------------------------------------------------------------------------- [02:17:04] Rick Carlino(@RickCarlino):As long as its not a "Oh crap! People are using this and its not even Alpha yet guys!" level haha ---------------------------------------------------------------------------------------------------- [02:17:25] meh.(@meh):RickCarlino, I used it to write an Overwolf app that won a contest ---------------------------------------------------------------------------------------------------- [02:17:28] meh.(@meh):so it does do its job ---------------------------------------------------------------------------------------------------- [02:17:40] meh.(@meh):RickCarlino, https://github.com/meh/wuvwuvwuv that's the app ---------------------------------------------------------------------------------------------------- [02:17:47] Rick Carlino(@RickCarlino):Nice! ---------------------------------------------------------------------------------------------------- [02:18:03] Rick Carlino(@RickCarlino):I take it its a static app then? And if so, what's your build tool? ---------------------------------------------------------------------------------------------------- [02:18:22] meh.(@meh):RickCarlino, check the Rakefile ---------------------------------------------------------------------------------------------------- [02:18:49] meh.(@meh):lissio build gives you an index.html ---------------------------------------------------------------------------------------------------- [02:18:51] meh.(@meh):with everything compiled in ---------------------------------------------------------------------------------------------------- [02:19:03] Rick Carlino(@RickCarlino):omg that's great for phonegap ---------------------------------------------------------------------------------------------------- [02:19:13] Rick Carlino(@RickCarlino):Makes it easier to dump into phonegap build ---------------------------------------------------------------------------------------------------- [02:19:22] meh.(@meh):it's broken on 0.8 tho ---------------------------------------------------------------------------------------------------- [02:19:29] Rick Carlino(@RickCarlino):Is that the latest? ---------------------------------------------------------------------------------------------------- [02:19:32] meh.(@meh):the builder/server stuff changed ---------------------------------------------------------------------------------------------------- [02:19:34] meh.(@meh):yeah, the beta ---------------------------------------------------------------------------------------------------- [02:19:51] meh.(@meh):the latest stable should be 0.7.2 IIRC ---------------------------------------------------------------------------------------------------- [02:19:53] meh.(@meh):it works there ---------------------------------------------------------------------------------------------------- [02:21:00] meh.(@meh):RickCarlino, it's kinda weird to get used to how it works tho ---------------------------------------------------------------------------------------------------- [02:21:11] meh.(@meh):the whole Lissio::Component thing can be hard to get around ---------------------------------------------------------------------------------------------------- [02:21:25] meh.(@meh):but once you get it you wonder why you would ever do things differently :P ---------------------------------------------------------------------------------------------------- [02:22:31] Rick Carlino(@RickCarlino):Looks pretty straightforward to me. ---------------------------------------------------------------------------------------------------- [02:22:47] meh.(@meh):RickCarlino, it's just most people are used to the MVC pattern ---------------------------------------------------------------------------------------------------- [02:22:51] Rick Carlino(@RickCarlino):I guess Ill get there for sure when I try it out. ---------------------------------------------------------------------------------------------------- [02:23:12] Rick Carlino(@RickCarlino):Ah, I've goofed around with Vue / Knockout / Mithril so it doesn't look toooo far off ---------------------------------------------------------------------------------------------------- [02:23:14] meh.(@meh):RickCarlino, there are some other apps I wrote that use lissio that should be simpler to grok than wuv³ ---------------------------------------------------------------------------------------------------- [02:25:04] meh.(@meh):RickCarlino, https://github.com/meh/shekels this one ---------------------------------------------------------------------------------------------------- [02:25:12] meh.(@meh):should still work even tho it's pretty old ---------------------------------------------------------------------------------------------------- [03:16:48] Mitch VanDuyn(@catmando):still can't find anyway to get react_js.js loaded just once in opal-rspec running in the browser under opal-rails. I see no configuration that can be used for this, checked with David Chang and he agrees its a problem. Can anybody help. You can't put `require react_js` in the spec_helper as that gets reloaded on every spec, and I see no way to get it added in the default load done by the outer index.html file... ---------------------------------------------------------------------------------------------------- [04:17:58] Forrest Chang(@fkchang):@RickCarlino https://github.com/meh/gwentoo is the other lissio app that @meh wrote -- it gives you more examples than shekels ---------------------------------------------------------------------------------------------------- [04:18:38] Forrest Chang(@fkchang):@RickCarlino I also used lissio on an internal app to good effect. I used Jubilee for RT interaction also ---------------------------------------------------------------------------------------------------- ############################## [2015-05-13] ############################## [21:13:38] Forrest Chang(@fkchang):@hcatlin re: reload, I plan to enable dev in the browser, so there would be no reload, and better yet, you get to keep your current state, ala lisp machines and smalltalk. To some extent you can do that now w/opal-irb, but my ultimate goal is much more ambitious, ala this prototype https://www.youtube.com/watch?v=TRkhihHVLzQ -- though most people haven't worked w/lisp machines or smalltalk, so they don't really get what I'm pitching, from what I can tell ---------------------------------------------------------------------------------------------------- [21:16:51] Hampton Catlin(@hcatlin):hahahaa... that's intense. ---------------------------------------------------------------------------------------------------- [21:17:42] Hampton Catlin(@hcatlin):i'm currently trying to get something to just display on a the page with the sinatra app... ---------------------------------------------------------------------------------------------------- [21:17:54] Hampton Catlin(@hcatlin):I feel like I'm missing something obvious here. ---------------------------------------------------------------------------------------------------- [21:18:16] Hampton Catlin(@hcatlin):Like, I know this is general purpose Ruby->JS, and not a framework, but I'm trying to figure out how to work with the browser itself. ---------------------------------------------------------------------------------------------------- [21:18:49] Elia Schito(@elia):it's either opal-jquery or opal-browser ---------------------------------------------------------------------------------------------------- [21:19:02] Elia Schito(@elia):the alternative is using native.rb ---------------------------------------------------------------------------------------------------- [21:19:18] Forrest Chang(@fkchang):@hcatlin re, getting started, I feel your pain. I started (but never completed) https://github.com/fkchang/opal-starter-kit w/the intention of making getting started 2 steps --- also to officially document the correct ways to setup ---------------------------------------------------------------------------------------------------- [21:19:25] Hampton Catlin(@hcatlin):vienna doesn't cover it ---------------------------------------------------------------------------------------------------- [21:19:29] Hampton Catlin(@hcatlin):oh!... let me check that out. ---------------------------------------------------------------------------------------------------- [21:19:43] Elia Schito(@elia):vienna it's based on opal-jquery ---------------------------------------------------------------------------------------------------- [21:20:24] Forrest Chang(@fkchang):@hcatlin opal-browser covers a lot more functionality than jquery, -- canvas, websql, websockets, etc. but you might be more comfortable w/opal-jquery if your a jquery person ---------------------------------------------------------------------------------------------------- [21:21:30] Forrest Chang(@fkchang):@hcatlin re frameworks, there's vienna, lissio that are more mature, and new ones like volt, clearwater, opal-react that I know of ---------------------------------------------------------------------------------------------------- [21:21:52] Hampton Catlin(@hcatlin):I guess I'm looking for a template folder I can setup... ---------------------------------------------------------------------------------------------------- [21:22:02] Hampton Catlin(@hcatlin):And where I can just write some CSS and get to building something. ---------------------------------------------------------------------------------------------------- [21:22:20] Hampton Catlin(@hcatlin):Models are less important... ---------------------------------------------------------------------------------------------------- [21:23:29] Hampton Catlin(@hcatlin):I guess I mean server-side support, more than an intense browser framework. ---------------------------------------------------------------------------------------------------- [21:23:39] Hampton Catlin(@hcatlin):The starter-kit seems pretty close. ---------------------------------------------------------------------------------------------------- [21:26:08] Forrest Chang(@fkchang):@hcatlin yeah, so if opal-starter-kit was coded against like opal 0.5 ish, I've been meaning to revisit. I think the most bells and whistles out of the box is to setup opal-rails ---------------------------------------------------------------------------------------------------- [21:26:35] Forrest Chang(@fkchang):then you can just edit the haml and the opal code w/o having to set stuff up ---------------------------------------------------------------------------------------------------- [21:27:37] Forrest Chang(@fkchang):It's nice to just use the rails conventions, write opal in both *.js.rb files and via the :opal filter in haml ---------------------------------------------------------------------------------------------------- [21:28:33] Hampton Catlin(@hcatlin):my goal is to have this thing be fully static... so I might give opal-jquery a try. ---------------------------------------------------------------------------------------------------- [21:30:24] Forrest Chang(@fkchang):@hcatlin I think starting w/opal-rails makes it easy to get started and monkey w/stuff and then you can switch to generating a static app. When I get around to updating the starter kit, I'm going to make the static recipe, include opal server, so you can dev against it, and have a rake task to generate the static app. ---------------------------------------------------------------------------------------------------- [21:30:40] meh.(@meh):hcatlin, if you want something fully static, check out lissio ---------------------------------------------------------------------------------------------------- [21:31:01] meh.(@meh):hcatlin, I built an Overwolf app with it, just generates the index.html with everything in and it werks ---------------------------------------------------------------------------------------------------- [21:31:24] meh.(@meh):hcatlin, but it's probably going to feel weird if you're used to MVC ---------------------------------------------------------------------------------------------------- [21:36:30] Elia Schito(@elia):this might be of interest http://dev.mikamai.com/post/96967839924/dead-simple-view-layer-with-opal-and-jquery ---------------------------------------------------------------------------------------------------- [21:40:02] Hampton Catlin(@hcatlin):that sounds good! ---------------------------------------------------------------------------------------------------- [21:40:23] Hampton Catlin(@hcatlin):@meh I'm pretty used to new things. ;) ---------------------------------------------------------------------------------------------------- [21:43:15] Hampton Catlin(@hcatlin):feeling a bit overwhelmed by choice here... looking around the Todo app ---------------------------------------------------------------------------------------------------- [21:54:42] Forrest Chang(@fkchang):@hcatlin lissio's all ruby - component based approach really appealed to me ---------------------------------------------------------------------------------------------------- [21:55:55] Forrest Chang(@fkchang):Re: choice, I find w/Opal a lot of time I find I "don't need no stinking frameworks", that opal-inspect prototype is mostly just raw opal w/some opal-jquery ---------------------------------------------------------------------------------------------------- [21:59:28] Hampton Catlin(@hcatlin):```GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/helpers.self.map 404 (Not Found) localhost/:15 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/module.self.map 404 (Not Found) localhost/:17 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/class.self.map 404 (Not Found) localhost/:17 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/basic_object.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/kernel.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/nil_class.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/boolean.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/error.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/regexp.self.map 404 (Not Found) localhost/:18 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/comparable.self.map 404 (Not Found) localhost/:20 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/enumerable.self.map 404 (Not Found) localhost/:29 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/enumerator.self.map 404 (Not Found) localhost/:29 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/array.self.map 404 (Not Found) localhost/:29 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/array/inheritance.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/hash.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/string.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/string/inheritance.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/match_data.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/numeric.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/complex.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/rational.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/proc.self.map 404 (Not Found) localhost/:31 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/method.self.map 404 (Not Found) localhost/:32 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/range.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/time.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/struct.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/io.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/main.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/variables.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/dir.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/corelib/file.self.map 404 (Not Found) localhost/:40 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/opal.self.map 404 (Not Found) localhost/:43 GET http://localhost:9292/__OPAL_SOURCE_MAPS__/native.self.map 404 (Not Found) ``` ---------------------------------------------------------------------------------------------------- [21:59:44] Hampton Catlin(@hcatlin):this is all I get in my app logs... and the page is blank. ---------------------------------------------------------------------------------------------------- [22:00:02] Hampton Catlin(@hcatlin):This is my attempt at updating opal-todo ---------------------------------------------------------------------------------------------------- [22:00:09] Hampton Catlin(@hcatlin):any hints? ---------------------------------------------------------------------------------------------------- [22:00:27] Elia Schito(@elia):self.map comes from sprockets 3 ---------------------------------------------------------------------------------------------------- [22:00:58] Elia Schito(@elia):so it might be a good idea to downgrade to 2 until i fix it properly ---------------------------------------------------------------------------------------------------- [22:01:28] Forrest Chang(@fkchang):@hcatlin Opal-inspector prototype was surprisingly small amount of code too, I talk about how how little code it was and not the need for a framework at about 23:40 in https://www.youtube.com/watch?v=GH9FAfKG-qY -- that video is good coz it's a very broad overview of everything in Opal at that time: has a better opal inspector demo than the dedicated youtube, I show off some lissio too ---------------------------------------------------------------------------------------------------- [22:01:31] Elia Schito(@elia):sourcemaps will be a hack on top of sprockets until v4 (of sprockets) ---------------------------------------------------------------------------------------------------- [22:02:52] Hampton Catlin(@hcatlin):np ---------------------------------------------------------------------------------------------------- [22:03:40] Elia Schito(@elia):about the blank page I need to know which opal version you're using, is it master? ---------------------------------------------------------------------------------------------------- [22:04:08] Hampton Catlin(@hcatlin):That fixed it! Thanks @elia ---------------------------------------------------------------------------------------------------- [22:04:15] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:04:18] Hampton Catlin(@hcatlin):and, I got stuff displaying. had the wrong #element ---------------------------------------------------------------------------------------------------- [22:06:46] Forrest Chang(@fkchang):@elia u did the source maps support, IIRC? ---------------------------------------------------------------------------------------------------- [22:09:02] Elia Schito(@elia):@fkchang I hacked in something initially, based on comments (similarly to those you see in sass), but then @adambeynon added support at compiler level ---------------------------------------------------------------------------------------------------- [22:09:48] Forrest Chang(@fkchang):so then @adambeynon is the one to ask to see if we could reuse stuff in source maps to provide the code/comment lookup stuff I want ---------------------------------------------------------------------------------------------------- [22:11:45] Elia Schito(@elia):yes, sorry ---------------------------------------------------------------------------------------------------- [22:13:24] Forrest Chang(@fkchang):rats... ---------------------------------------------------------------------------------------------------- [22:13:37] Forrest Chang(@fkchang):expecting @vais to have a stroke of genius now ---------------------------------------------------------------------------------------------------- [22:14:40] Elia Schito(@elia):well, the compiler stuff is really readable and OO, you have to look into lib/opal/nodes ---------------------------------------------------------------------------------------------------- [22:17:33] meh.(@meh):as long as it's not parser related it's fairly simple ---------------------------------------------------------------------------------------------------- [22:51:12] Jeremy Evans(@jeremyevans):I've been playing around with the new Opal::TiltTemplate stuff, and I've found that it doesn't work well when you need to require something in the stdlib or let's says opal/jquery, or maybe I'm doing it wrong ---------------------------------------------------------------------------------------------------- [22:51:19] Jeremy Evans(@jeremyevans):I think if TiltTemplate could optionally call Opal::Builder instead of Opal::Compiler, this may fix the issue ---------------------------------------------------------------------------------------------------- [22:51:25] Jeremy Evans(@jeremyevans):e.g. if you do Tilt.new('foo.rb', :build=>true).render # use Opal::Builder, not Opal::Compiler ---------------------------------------------------------------------------------------------------- [22:51:32] Jeremy Evans(@jeremyevans):Before I head further down that path, I'd like to get a sanity check from an opal developer to make sure that makes sense ---------------------------------------------------------------------------------------------------- [22:52:11] Elia Schito(@elia):@jeremyevans just to be sure I understand your goal, you still want to avoid sprockets? ---------------------------------------------------------------------------------------------------- [22:53:12] Jeremy Evans(@jeremyevans):Yes ---------------------------------------------------------------------------------------------------- [22:53:30] Elia Schito(@elia):ok, then Opal::Builder is the way to go ---------------------------------------------------------------------------------------------------- [22:54:04] Jeremy Evans(@jeremyevans):OK. So does a :build option to Opal::TiltTemplate to support Opal::Builder make sense? ---------------------------------------------------------------------------------------------------- [22:55:15] Elia Schito(@elia):like `build: true`? to which method you want to pass the option? ---------------------------------------------------------------------------------------------------- [22:55:22] Jeremy Evans(@jeremyevans):Tilt.new ---------------------------------------------------------------------------------------------------- [22:57:48] Elia Schito(@elia):ok, so, I don't know that well Tilt, but looking at the TiltTemplate source I think it could make sense to just use the builder and let the user control the build with `require` ---------------------------------------------------------------------------------------------------- [22:58:17] Elia Schito(@elia):basically what you want is to replicate the tilt based Processor from opal 0.7 ---------------------------------------------------------------------------------------------------- [22:58:48] Elia Schito(@elia):https://github.com/opal/opal/blob/0-7-stable/lib/opal/sprockets/processor.rb#L68-L83 ---------------------------------------------------------------------------------------------------- [22:59:53] Jeremy Evans(@jeremyevans):Yes, similar, but instead of having sprockets doing things, just leave everything to Opal::Builder, since it seems like Opal::Builder can handle things without sprockets ---------------------------------------------------------------------------------------------------- [23:00:45] Jeremy Evans(@jeremyevans):I mean, if you are using sprockets directives in your code, then using sprockets makes sense, but if you aren't using sprockets directives, it seems unnecessary to try to use sprockets ---------------------------------------------------------------------------------------------------- [23:00:50] Elia Schito(@elia):yes, I struggled to make them work together but gave up :) ---------------------------------------------------------------------------------------------------- [23:01:44] Elia Schito(@elia):I still like sprockets for the compilation minification etc. ---------------------------------------------------------------------------------------------------- [23:03:01] Elia Schito(@elia):@jeremyevans to skip sprockets you just don't pass a special path_reader ---------------------------------------------------------------------------------------------------- [23:03:01] Elia Schito(@elia):https://github.com/opal/opal/blob/0-7-stable/lib/opal/sprockets/processor.rb#L111-L116 ---------------------------------------------------------------------------------------------------- [23:04:12] Elia Schito(@elia):and you can also skip passing an array of already required stuff (`prerequired`) ---------------------------------------------------------------------------------------------------- [23:04:13] Elia Schito(@elia):https://github.com/opal/opal/blob/0-7-stable/lib/opal/sprockets/processor.rb#L75 ---------------------------------------------------------------------------------------------------- [23:04:34] Jeremy Evans(@jeremyevans):I'm developing with 0.8.0 beta1, do you think I should use the sprockets-specific stuff, or is it safe to just rely on Opal::Builder? ---------------------------------------------------------------------------------------------------- [23:05:51] Elia Schito(@elia):I'm kinda evaluating if having a "sprockets-free" codepath still valuable as the more I was trying to make it work the more I found I was reimplementing sprockets ---------------------------------------------------------------------------------------------------- [23:06:10] Elia Schito(@elia):your use case makes a point I think ---------------------------------------------------------------------------------------------------- [23:08:05] Elia Schito(@elia):also I think that when I'll switch to the new style of sprockets processor api (#call based) they could share most code, just a supposition though ---------------------------------------------------------------------------------------------------- [23:09:42] Jeremy Evans(@jeremyevans):It really depends if the long term goal is to depend on sprockets or move away from sprockets. Personally, I like the fact that you can use Opal like any other template library, independent of sprockets. But I may be in the minority :) ---------------------------------------------------------------------------------------------------- [23:10:53] Elia Schito(@elia):maybe it forces it to stay a bit more general and not too tied to sprockets ---------------------------------------------------------------------------------------------------- [23:12:20] Elia Schito(@elia):anyway for now the builder won't go anywhere, it might lose some sprockets-like features in the future bu that's not a problem I guess ---------------------------------------------------------------------------------------------------- [23:13:26] Elia Schito(@elia):thinking out loud, the other thing that sprockets facilitates on the other hand is plugins and alternative processors like opal-haml or react.rb jsx support ---------------------------------------------------------------------------------------------------- [23:14:22] Jeremy Evans(@jeremyevans):Good to know. I've got to go now, I'll try to check back in tomorrow. ---------------------------------------------------------------------------------------------------- [23:14:29] Elia Schito(@elia):@jeremyevans keep me posted on your experience, real world always beats mumbling :P ---------------------------------------------------------------------------------------------------- [23:14:56] Jeremy Evans(@jeremyevans):Definitely. I'm liking things so far. ---------------------------------------------------------------------------------------------------- [23:15:38] Elia Schito(@elia):always good to hear! ---------------------------------------------------------------------------------------------------- [00:05:46] Forrest Chang(@fkchang):@vais, I could certainly write some specs, or at least some pseudo spec. If the caller is in the same place as the where Opal code is compiled, it'd be relatively easy. A potential issue is then you'd have to package the indexing of such which could be quite large. I would probably want to have it on demand the info, similar to source maps, but I guess 1 step at a time. ---------------------------------------------------------------------------------------------------- [00:09:25] Forrest Chang(@fkchang):perhaps @adambeynon has some ideas, but I'm foreseeing something like this * static app - prepackage indexing w/app via a compile option * app w/ruby based server, possible to prepack via same compile option or, with some sort of rack middle ware that servers up info on demand much like source maps, which accesses on demand some output the compiler emited when it was compiled Ultimately in something like opal-inspector, I would override the mapping w/code that is evaluated in browser, so I would also want the ability to send it back to the server, but that's out of scope for the feature I'm asking and more in the middle ware. So I guess I'd start with the compile option ---------------------------------------------------------------------------------------------------- [00:10:56] Vais Salikhov(@vais):@fkchang any idea how this is done on MRI (in pry for example)? Would that approach not work for what your are trying to accomplish? ---------------------------------------------------------------------------------------------------- [00:14:03] Forrest Chang(@fkchang):@vais I don't know how it's done in pry, but I'd guess it has some index and servers up the files off the file system, which described like that is close to what the source maps do ---------------------------------------------------------------------------------------------------- [00:15:53] Forrest Chang(@fkchang):Pry's example might provide insight, wouldn't be surprised if it dropped in to C to do it though. Maybe @elia can provide some source map insights ---------------------------------------------------------------------------------------------------- [00:17:25] Forrest Chang(@fkchang):You ultimate need to index a method entity with code that was compiled, @adambeynon suggested some AST traversing for part of that. Then you'd store it somewhere. Packaging could be as easy as global hash or similar. ---------------------------------------------------------------------------------------------------- [00:19:50] Vais Salikhov(@vais):@fkchang this does sound very close to what sourcemaps do. I have no idea how sourcemaps work, so that would be the place I'd start to figure this out. And yes, the difference with MRI is that it has direct access to the source files on disk. So, it looks like sourcemaps would play into this one way or another. ---------------------------------------------------------------------------------------------------- [00:21:12] Forrest Chang(@fkchang):Step one I'd go with fully qualified method names ```ruby $method_lookup = { 'Mod::Class1#foo' => "def foo (param)\n blah(param)\nend" } ``` ---------------------------------------------------------------------------------------------------- [00:32:32] Forrest Chang(@fkchang):@vais I added a pseudo spec to https://github.com/opal/opal/issues/840 -- tell me if it makes sense ---------------------------------------------------------------------------------------------------- [10:26:01] Vais Salikhov(@vais):@fkchang makes sense ;) ---------------------------------------------------------------------------------------------------- [11:08:19] Vais Salikhov(@vais):@elia, you there? ---------------------------------------------------------------------------------------------------- [11:09:33] Vais Salikhov(@vais):I'm trying to run `bundle exec rake dist` on the latest master, and it chokes: ``` * building math... done. (development: 10.93KB, minified: 7.63KB, gzipped: 1.26KB). * building minitest... rake aborted! Sprockets::FileNotFound: couldn't find file 'optparse' (in /Users/vais/GitHub/opal/stdlib/minitest.rb) ``` ---------------------------------------------------------------------------------------------------- [11:10:38] Vais Salikhov(@vais):This is in regards to jshint, I want to run it locally, so I need `rake dist` which I've never used before. ---------------------------------------------------------------------------------------------------- [11:10:53] Vais Salikhov(@vais):Any ideas? ---------------------------------------------------------------------------------------------------- [12:04:00] Vais Salikhov(@vais):@elia weird, I checked out your upstream/jshint branch, and I'm still getting an error, but it's a different one: ``` * building math... done. (development: 10.93KB, minified: 7.63KB, gzipped: 1.26KB). * building minitest... rake aborted! Sprockets::CircularDependencyError: /Users/vais/GitHub/opal/stdlib/minitest.rb has already been required ``` ---------------------------------------------------------------------------------------------------- [14:38:50] Forrest Chang(@fkchang):@vais @elia when I was describing the process outload, maybe we could just slightly piggy back on the source maps mechanism. We already map lines of code to source maps, maybe the indexing by method comment simply generates the same sort of mapping of method/comment to source code? ---------------------------------------------------------------------------------------------------- [14:39:01] Forrest Chang(@fkchang):this w/o knowing how the source maps are implemented at all ---------------------------------------------------------------------------------------------------- [14:39:34] Forrest Chang(@fkchang):@jaredcwhite good editorial summary/copy on the opalist! kudos ---------------------------------------------------------------------------------------------------- [15:57:52] Jared White(@jaredcwhite):@fkchang Thanks man. Yeah, I enjoyed reading about your dev experience on the project. ---------------------------------------------------------------------------------------------------- [18:47:25] Jose Bencosme(@jlbenc):Hello, all. Avdi mentioned Volt on the Ruby Rogues latest episode (#207, around ~40:00). Go Opal! :) ---------------------------------------------------------------------------------------------------- [18:47:41] Rick Carlino(@RickCarlino):Awesome! ---------------------------------------------------------------------------------------------------- [18:48:30] Jose Bencosme(@jlbenc):Simple mention, but nice anyway! ---------------------------------------------------------------------------------------------------- [19:54:59] Elia Schito(@elia):https://twitter.com/hcatlin/status/598575698148622336 ---------------------------------------------------------------------------------------------------- [20:12:02] Hampton Catlin(@hcatlin):hahahaha ---------------------------------------------------------------------------------------------------- [20:12:06] Hampton Catlin(@hcatlin):YOU ARE TALKING ABOUT ME ---------------------------------------------------------------------------------------------------- [20:12:22] Forrest Chang(@fkchang):@hcatlin just about to respond to that tweet ---------------------------------------------------------------------------------------------------- [20:13:48] Hampton Catlin(@hcatlin):My current startup is an open sourced Ember app with a Rails API backend. I'm not disappointed with Ember, but I'm also not 100% happy with it. ---------------------------------------------------------------------------------------------------- [20:14:27] Hampton Catlin(@hcatlin):I'm needing to build a simple side-site, that's pretty interaction heavy... and so I've been evaluating different options. ---------------------------------------------------------------------------------------------------- [20:14:49] Forrest Chang(@fkchang):@hcatlin what are you not happy about wrt to ember? There are certain perks that I think opal brings out of the box, they may or may not address your grievances w/ember ---------------------------------------------------------------------------------------------------- [20:15:48] Hampton Catlin(@hcatlin):There are a lot of best-practices that aren't written down, and vague references to how you are doing it wrong (by following the public guides)... which is kind of an odd feeling. ---------------------------------------------------------------------------------------------------- [20:16:02] Hampton Catlin(@hcatlin):And, there are definitely funny edge cases all over the place that aren't covered at all. ---------------------------------------------------------------------------------------------------- [20:16:43] Hampton Catlin(@hcatlin):Odd behaviours that are hard to tell if it's a bug or something I did or a best practice I never read or, more typically, just an "edge case" that they haven't gotten to yet. ---------------------------------------------------------------------------------------------------- [20:17:14] Hampton Catlin(@hcatlin):The thing I *love* is the fast auto-reloader of Ember-CLI. ---------------------------------------------------------------------------------------------------- [20:17:32] Hampton Catlin(@hcatlin):But, I freaking hate that to upgrade, I have to *delete the node_modules and bower_components* folder to get it tow rok. ---------------------------------------------------------------------------------------------------- [20:17:34] Hampton Catlin(@hcatlin):work* ---------------------------------------------------------------------------------------------------- [20:20:54] Hampton Catlin(@hcatlin):I don't think Opal directly solves any of those, tbh, but I'd rather deal with trying to translate Ruby concepts into interactive apps, then wrangling with weird prototype-object behaviours and weird NPM side-effects. ---------------------------------------------------------------------------------------------------- [20:22:32] Hampton Catlin(@hcatlin):I kind of think Opal + React could be interesting. ---------------------------------------------------------------------------------------------------- [20:23:51] Hampton Catlin(@hcatlin):Writing pure Javascript makes me use patterns again, just like when I used to write Java. It makes me miss the feeling I had with Ruby, where I don't feel like I need to implement patterns, since the language makes coding more straightforward. ---------------------------------------------------------------------------------------------------- [20:23:56] Hampton Catlin(@hcatlin):@hcatlin attacks the room with messages ---------------------------------------------------------------------------------------------------- [20:24:00] Elia Schito(@elia):@hcatlin great to hear that! ---------------------------------------------------------------------------------------------------- [20:25:22] Hampton Catlin(@hcatlin):Now, I just need to give this a good test run. What's the simplest way to get an opal server running so I can start building an app? Templating + Opal Scripts, etc. ---------------------------------------------------------------------------------------------------- [20:25:43] Elia Schito(@elia):and welcome! also u'r internet famous ;) and linking your tweet was necessary ---------------------------------------------------------------------------------------------------- [20:26:29] Elia Schito(@elia):@hcatlin check out the rack example in the repo ---------------------------------------------------------------------------------------------------- [20:27:49] Elia Schito(@elia):there's also an adapter for a templating language you may have heard of… if your interested ---------------------------------------------------------------------------------------------------- [20:27:55] Hampton Catlin(@hcatlin):hahahaha... I just saw it! ---------------------------------------------------------------------------------------------------- [20:28:33] Hampton Catlin(@hcatlin):Wait... so how does that work? ---------------------------------------------------------------------------------------------------- [20:28:37] Hampton Catlin(@hcatlin):Does it use the regular Haml gem? ---------------------------------------------------------------------------------------------------- [20:28:42] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [20:28:50] Elia Schito(@elia):cool uh ---------------------------------------------------------------------------------------------------- [20:28:51] Elia Schito(@elia):? ---------------------------------------------------------------------------------------------------- [20:29:17] Hampton Catlin(@hcatlin):oh... so it does Haml->Semi-HTML? ---------------------------------------------------------------------------------------------------- [20:29:27] Elia Schito(@elia):compiles to ruby first and then to js ---------------------------------------------------------------------------------------------------- [20:30:17] Elia Schito(@elia):https://github.com/opal/opal-haml/blob/master/lib/opal/haml.rb#L13 ---------------------------------------------------------------------------------------------------- [20:30:26] Hampton Catlin(@hcatlin):is that... efficient? ---------------------------------------------------------------------------------------------------- [20:31:33] Elia Schito(@elia):it's done on the server, and the client just does string concatenation, so I guess yes ---------------------------------------------------------------------------------------------------- [20:32:45] Hampton Catlin(@hcatlin):When deploying to production, the compilation is done as part of the asset pipeline in Rails, right? ---------------------------------------------------------------------------------------------------- [20:33:08] Elia Schito(@elia):yep, it's based on sprockets ---------------------------------------------------------------------------------------------------- [20:33:11] Hampton Catlin(@hcatlin):I'm assuming Opal in production is a static compiler. ---------------------------------------------------------------------------------------------------- [20:33:13] Hampton Catlin(@hcatlin):Yeah. ---------------------------------------------------------------------------------------------------- [20:33:41] Hampton Catlin(@hcatlin):Hmmm..... looking at this just makes me desperately want to make a live reload server. ---------------------------------------------------------------------------------------------------- [20:34:05] Elia Schito(@elia):@ryanstout has done it for volt ---------------------------------------------------------------------------------------------------- [20:34:38] Elia Schito(@elia):if there's anything for sprockets it should work out of the box ---------------------------------------------------------------------------------------------------- [20:35:31] Hampton Catlin(@hcatlin):I'm trying to keep a clean API for our customers to use... so that's why Volt probably is too much for me. But, I should learn more about it. ---------------------------------------------------------------------------------------------------- [20:36:10] Elia Schito(@elia):what I meant is just that it's doable :) ---------------------------------------------------------------------------------------------------- [20:36:15] Hampton Catlin(@hcatlin):right. ---------------------------------------------------------------------------------------------------- [20:36:27] Elia Schito(@elia):be back in 15min ---------------------------------------------------------------------------------------------------- [20:47:57] Elia Schito(@elia):@hcatlin master is advised or 0.8 beta ---------------------------------------------------------------------------------------------------- [20:48:12] Elia Schito(@elia):at least to get working source maps ---------------------------------------------------------------------------------------------------- ############################## [2015-05-14] ############################## [18:08:53] Brian Glusman(@bglusman):Any hints on how to build static opal app with react.rb? It complains it can’t find react when doing rake build ---------------------------------------------------------------------------------------------------- [18:10:06] Brian Glusman(@bglusman):I’d also like to figure out why I couldn’t do keypresses better with opal-jquery or react.rb natively, but worked around that with raw js for now and adding @elia’s requested screenshot, and maybe a playable demo on github pages if I can get this to build :-) ---------------------------------------------------------------------------------------------------- [18:24:14] Brian Glusman(@bglusman):Well, I added screenshots in any case @elia hopefully playable in browser coming soon :-) ---------------------------------------------------------------------------------------------------- [18:59:02] BrandonMathis(@BrandonMathis):@RickCarlino just turned me on to opal! ---------------------------------------------------------------------------------------------------- [18:59:11] Rick Carlino(@RickCarlino):lmao ---------------------------------------------------------------------------------------------------- [18:59:18] Rick Carlino(@RickCarlino)::clap: ---------------------------------------------------------------------------------------------------- [18:59:52] Forrest Chang(@fkchang):@BrandonMathis good for @RickCarlino --- smashing the heck out of my track record ---------------------------------------------------------------------------------------------------- [19:00:21] Rick Carlino(@RickCarlino):He's actually trolling me right now. We were co-workers previously and I just noticed that he was in here. ---------------------------------------------------------------------------------------------------- [19:04:43] BrandonMathis(@BrandonMathis):That is right! I'm still cleaning up after the guy too! ---------------------------------------------------------------------------------------------------- [19:04:57] Rick Carlino(@RickCarlino):This guy ^ ---------------------------------------------------------------------------------------------------- [00:12:36] Forrest Chang(@fkchang):anyone remember what the conversation on irc was that made me write http://bit.ly/1A19LU6 ---------------------------------------------------------------------------------------------------- [01:31:26] AstonJ(@AstonJ):Dunno, but that’s awesome :+1: @fkchang ---------------------------------------------------------------------------------------------------- [07:32:00] Adam Beynon(@adambeynon):@fkchang the more I think about it, the more I prefer opal-irb being “in-browser” rather than built into chrome dev tools ---------------------------------------------------------------------------------------------------- [07:32:29] Adam Beynon(@adambeynon):the only slight thought it about how to debug web apps running on iOS ---------------------------------------------------------------------------------------------------- [07:32:36] Adam Beynon(@adambeynon):which is 99% of my time these days ---------------------------------------------------------------------------------------------------- [15:33:55] Jared White(@jaredcwhite):@fkchang :+1: on opal-irb -- _finally_ got around to trying it out. Sent in a PR for a couple of Rails instruction tweaks. Otherwise, great stuff. I also vote to keep it in browser, at least as an option, as I do all my dev work in Safari on OS X not Chrome. ---------------------------------------------------------------------------------------------------- [15:50:19] Elia Schito(@elia):yay for safari! ---------------------------------------------------------------------------------------------------- [16:07:37] Forrest Chang(@fkchang):@adambeynon @jaredcwhite unless I can get around the json_stringify issue I had w/Chrome, I'm pretty much dropping it. I have an idea for a cheat that might work, but that's my last ditch effort. Otherwise, I'm inspired to add some cool stuff and refactor opal-irb. I'll probably start w/autocompletion, the hardest part is actually how to display/pick the choices (due partly to my meager CSS skills), I already know how I'll populate entries for the 1st go ---------------------------------------------------------------------------------------------------- [16:08:03] Forrest Chang(@fkchang):then I'll probably do the create if missing on methods ---------------------------------------------------------------------------------------------------- [16:09:02] Forrest Chang(@fkchang):@jaredcwhite merged, thx ---------------------------------------------------------------------------------------------------- [16:09:03] Adam Beynon(@adambeynon):@fkchang I will try and offer some commits etc soon, as I need a way for remote debugging, i.e. an opal-irb session talking to a remote iOS device ---------------------------------------------------------------------------------------------------- [16:09:16] Adam Beynon(@adambeynon):so some sort of rails/server side part to proxy the session ---------------------------------------------------------------------------------------------------- [16:10:04] Forrest Chang(@fkchang):@adambeynon cool. I look forward to it. I ultimately thought as when I build opal-inspector for real that I could use it for backend code as well, so your proxy ideas will be pertinent ---------------------------------------------------------------------------------------------------- [16:26:08] Adam Beynon(@adambeynon)::+1: much better than my current approach of trying to write compiled opal into the web inspector ;) ---------------------------------------------------------------------------------------------------- ############################## [2015-05-15] ############################## [00:05:25] Forrest Chang(@fkchang):@adambeynon how would I get constants in Opal? I tried this, but I get something with a lot of code in it. ```ruby def opal_constants constants = [] $opal_js_object = Native(`Opal`) # have to make this global right now coz not seen in the each closure w/current opal $opal_js_object.each {|k| attr = $opal_js_object[k] constants << attr } constants.uniq end ``` the object with all the code in it looks like this ```javascript ,[object Object],function slice() { [native code] },function () { unique_id += 2; ``` ---------------------------------------------------------------------------------------------------- [00:05:56] Forrest Chang(@fkchang):I'm doing tab completion and thought I'd tackle constants next (I've got method completion off of an irb var) ---------------------------------------------------------------------------------------------------- [00:06:38] Forrest Chang(@fkchang):I use something similar to grab classes, but I only add it to the array if attr.is_a?(Class) which does work ---------------------------------------------------------------------------------------------------- [00:10:24] Elia Schito(@elia):@fkchang have you tried `Object.constants`? ---------------------------------------------------------------------------------------------------- [00:16:37] Forrest Chang(@fkchang): ---------------------------------------------------------------------------------------------------- [00:17:46] Forrest Chang(@fkchang):wait, I take it back ---------------------------------------------------------------------------------------------------- [00:18:25] Forrest Chang(@fkchang):@elia - that works, thanks ---------------------------------------------------------------------------------------------------- [00:18:42] Elia Schito(@elia)::wink: ---------------------------------------------------------------------------------------------------- [00:21:46] Elia Schito(@elia):btw, fun times ---------------------------------------------------------------------------------------------------- [00:21:54] Elia Schito(@elia):apparently I lied for years: https://github.com/opal/opal-rails/commit/f6da4a9f01d802964e76bda0b6e157219f59277e ---------------------------------------------------------------------------------------------------- [00:30:36] Jared White(@jaredcwhite):Hey nice work in the comments @RickCarlino here: http://www.rubyflow.com/p/kb71un-where-have-all-the-libraries-gone ---------------------------------------------------------------------------------------------------- [03:52:15] Rick Carlino(@RickCarlino):@jaredcwhite I try to sell Opal and Volt wherever I can ;-) . It really is the future for the community, the more it gets talked about, the more likely people are to try it. ---------------------------------------------------------------------------------------------------- [04:08:21] Forrest Chang(@fkchang):random thanks to @adambeynon for creating opal. ALso to rest of the opal core team, @meh @elia and I guess now @vais ---------------------------------------------------------------------------------------------------- [04:08:58] Forrest Chang(@fkchang):BTW, opal-irb w/auto complete is pretty sweet so far, maybe can release it tomorrow ---------------------------------------------------------------------------------------------------- [04:09:06] Rick Carlino(@RickCarlino):Yeah! You guys are doing a great job. :clap: ---------------------------------------------------------------------------------------------------- [12:43:35] AstonJ(@AstonJ):Excellent post on RF @RickCarlino and yeah, the Opal team is doing a stellar job :+1: ---------------------------------------------------------------------------------------------------- [12:45:22] AstonJ(@AstonJ):Btw I think we need a Strategies team like we have on Volt (maybe combine them actually as there’s a lot of crossover) - to discuss marketing/promotion etc What do you say @adambeynon @elia and co? I think @fkchang and @RickCarlino @vais and anyone else who’s interested in helping should be added :-) ---------------------------------------------------------------------------------------------------- [14:28:53] AstonJ(@AstonJ):Not seen this before http://ilikekillnerds.com/2015/02/is-ruby-on-rails-dying #rails ---------------------------------------------------------------------------------------------------- [17:02:21] Forrest Chang(@fkchang):@AstonJ I think he's got some points. Rails hasn't the shiny new thing for a while. I would think Opal would help a lot to match the "js on the backend allows the js people to leverage their skills there" argument for Rubyists the other way, but again we have the whole adoption issues I quoted from the Rust critique to address. Ultimately, my opinion, is "if they want Javascript, they can have it." I'm about spreading the joy of Ruby, extended outside of it's traditional place in to the web front end w/Opal, scaling the backend w/Jubliee/vert.x, etc... ---------------------------------------------------------------------------------------------------- [17:02:46] Forrest Chang(@fkchang):Ruby everywhere is an advantage, IMO, so we don't need to conquer the world, just thrive. ---------------------------------------------------------------------------------------------------- [19:30:13] Jeremy Evans(@jeremyevans):I've just added pull request #864 which makes tilt/opal able to build opal projects that use require (and probably require_tree) without using sprockets. If anyone could take a look and provide feedback, that would be great. ---------------------------------------------------------------------------------------------------- [20:04:11] Jeremy Evans(@jeremyevans):Here's an example of using opal with Roda via tilt: https://github.com/jeremyevans/roda-opal-example/blob/master/config.ru#L4-L7, assuming you are using #864. ---------------------------------------------------------------------------------------------------- [20:40:01] Elia Schito(@elia):@jeremyevans great PR, I'll merge just after the build is fixed ---------------------------------------------------------------------------------------------------- [20:40:10] Elia Schito(@elia):just a quick note on the roda example ---------------------------------------------------------------------------------------------------- [20:40:11] Elia Schito(@elia):https://github.com/jeremyevans/roda-opal-example/blob/master/config.ru#L19 ---------------------------------------------------------------------------------------------------- [20:40:28] Elia Schito(@elia):this line is probably unnecessary ---------------------------------------------------------------------------------------------------- [20:40:36] Elia Schito(@elia):nevermind, :( ---------------------------------------------------------------------------------------------------- [20:40:54] Elia Schito(@elia):I missed the stub :) ---------------------------------------------------------------------------------------------------- [20:40:56] Elia Schito(@elia):https://github.com/jeremyevans/roda-opal-example/blob/master/config.ru#L4 ---------------------------------------------------------------------------------------------------- [20:46:58] Jeremy Evans(@jeremyevans):@elia Any ideas on why the build is broken on mspec_phantom? It apparently works for mspec_node. I think the relevant error message is "Error: Sprockets::FileNotFound: couldn't find file 'spec_helper' with type 'application/javascript'", but I'm not sure what is causing that or how it is related ---------------------------------------------------------------------------------------------------- [21:25:05] Elia Schito(@elia):@jeremyevans my gut says it has to do with a missing entry in "Opal.paths", or some api change or usage on path readers ---------------------------------------------------------------------------------------------------- ############################## [2015-05-16] ############################## [01:28:05] Forrest Chang(@fkchang):@all I pushed up my initial take at tab completion for opal-irb demo video https://youtu.be/mQTulgBm5Nk ---------------------------------------------------------------------------------------------------- [12:36:55] Jose Bencosme(@jlbenc):Just got "The Changelog Weekly" mailing, and there's an entry regarding Opal: "Jeremy Evans has people excited about Roda. What’s he excited about right now? A Ruby to JavaScript compiler called Opal." ---------------------------------------------------------------------------------------------------- [12:37:44] Jose Bencosme(@jlbenc): ---------------------------------------------------------------------------------------------------- [14:08:13] Jamie Gaskins(@jgaskins):@jeremyevans Awesome! I was trying to get Roda and Opal to play nicely a few months ago to get a Clearwater app going without having to use Rails, but since I was still learning Roda I didn't quite understand what to do. ---------------------------------------------------------------------------------------------------- [14:10:52] Jamie Gaskins(@jgaskins):@fkchang That is fantastic! :+1: I wonder if we could put that on opalrb.org/try. :-) ---------------------------------------------------------------------------------------------------- [16:33:12] Jeremy Evans(@jeremyevans):@elia Figured out the issue causing #864 to fail. Local variable vs. method call issue. :) ---------------------------------------------------------------------------------------------------- ############################## [2015-05-17] ############################## [01:12:29] Mitch VanDuyn(@catmando):Does anybody know if Method.nesting works in Opal??? (I don't think so :-) ) ---------------------------------------------------------------------------------------------------- [01:55:56] Mitch VanDuyn(@catmando):it is just returning nil ---------------------------------------------------------------------------------------------------- [04:04:22] Forrest Chang(@fkchang):@jgaskins w/o a "live objects", we can't reflect as much in try opal, that being said, I should look in to what I can do for editor completion. I could at least do constant, global expansion and dot completion off of the same. W/in something like opal inspector I can constrain things so I that I can determine things better ---------------------------------------------------------------------------------------------------- [23:37:49] Elia Schito(@elia):@jeremyevans eagle-eye! I looked at it a bunch of times without noticing… ---------------------------------------------------------------------------------------------------- [23:40:11] Jeremy Evans(@jeremyevans):So now that I've opal working well with tilt, I've been trying to convert some simple javascript I have in a project over to opal ---------------------------------------------------------------------------------------------------- [23:40:49] Jeremy Evans(@jeremyevans):Unfortunately, I guess my expectations for the integration with ruby and javascript were a little off ---------------------------------------------------------------------------------------------------- [23:41:41] Jeremy Evans(@jeremyevans):Hence my recent issue and pull request ---------------------------------------------------------------------------------------------------- [23:48:35] Jeremy Evans(@jeremyevans):It looks like if you writing a function that can be called with a javascript object, you have to manually wrap it (Native) and unwrap it (to_n), which is not going to be great for productivity, and at least strings can't be wrapped. ---------------------------------------------------------------------------------------------------- [23:50:54] Jeremy Evans(@jeremyevans):With things as they currently are, I can definitely see using opal when I want to share some ruby logic between the client and server, but using opal as a general javascript replacement is looking like it may not be worth it from a cost/benefit perspective. ---------------------------------------------------------------------------------------------------- [23:51:18] Jeremy Evans(@jeremyevans):I'd definitely like to change that :) ---------------------------------------------------------------------------------------------------- ############################## [2015-05-18] ############################## [17:56:18] meh.(@meh):catmando, I don't think that's possible ---------------------------------------------------------------------------------------------------- [17:57:36] Forrest Chang(@fkchang):@meh ur opinions would be appreciated on https://gist.github.com/jgaskins/9de193f4babcb56da4ee ---------------------------------------------------------------------------------------------------- [17:59:48] meh.(@meh):fkchang, paggio is technically already a virtual dom, as in it uses an internal DOM representation ---------------------------------------------------------------------------------------------------- [18:00:33] meh.(@meh):fkchang, https://github.com/opal/opal-browser/blob/master/opal/browser/dom/builder.rb ---------------------------------------------------------------------------------------------------- [18:00:45] meh.(@meh):that's where the virtual DOM of paggio gets converted to the actual DOM ---------------------------------------------------------------------------------------------------- [18:01:53] meh.(@meh):so it shouldn't be too hard to make it rerender only when required ---------------------------------------------------------------------------------------------------- [18:14:21] Forrest Chang(@fkchang):@meh would it be easy to do DOM diffs? I think @jgaskins and everyone else who seems to be basically reimplementing paggio should try to standardize, unless there's some tech reason not to ---------------------------------------------------------------------------------------------------- [18:14:41] meh.(@meh):fkchang, I think so, everything is already stored in the object ---------------------------------------------------------------------------------------------------- [18:14:57] meh.(@meh):it should just be a simple recursive function ---------------------------------------------------------------------------------------------------- [18:25:47] Forrest Chang(@fkchang):@meh then w/virtual dom diffs and server side rendering of components, lissio could be invinceable ---------------------------------------------------------------------------------------------------- [18:35:47] Jamie Gaskins(@jgaskins):@fkchang @meh Interesting, I figured it was just doing string concatenation. :+1: ---------------------------------------------------------------------------------------------------- [18:37:54] Jamie Gaskins(@jgaskins):@fkchang I was actually in the middle of writing up a GH issue for Clearwater based on our discussion on the gist when you tweeted at me to get in here. :-) ---------------------------------------------------------------------------------------------------- [18:39:23] Forrest Chang(@fkchang):@jgaskins I figured that while @meh was actually online, I'd hit him up ---------------------------------------------------------------------------------------------------- [18:40:55] Jamie Gaskins(@jgaskins):The virtual DOM library Clearwater's using is pretty impressive. I didn't write it, but I kinda like it. I need to clean up its Opal bindings, though. ---------------------------------------------------------------------------------------------------- [18:43:18] Jamie Gaskins(@jgaskins):@fkchang I'm not actually reimplementing Paggio, though. Just added some convenience methods to a mixin to sanitize and generate nodes for that virtual DOM implementation. ---------------------------------------------------------------------------------------------------- [18:44:41] Jamie Gaskins(@jgaskins):The idea is that, as long as an object's `render` method returns a scalar, a virtual DOM node, or an array of any combination of those, that's all that's needed. ---------------------------------------------------------------------------------------------------- [18:56:19] Forrest Chang(@fkchang):@jgaskins yours doesn't look as close to paggio as some others I've seen ---------------------------------------------------------------------------------------------------- [20:27:24] Elia Schito(@elia):@fkchang dang it! you exposed my little scheme! ---------------------------------------------------------------------------------------------------- [21:02:12] Forrest Chang(@fkchang):@elia if it makes @adambeynon blog, it'll be worth it ---------------------------------------------------------------------------------------------------- [21:02:35] Forrest Chang(@fkchang):BTW, I added the global and class dot completion to opal-irb ---------------------------------------------------------------------------------------------------- [21:19:38] Elia Schito(@elia):@fkchang great stuff! can't wait to try it ---------------------------------------------------------------------------------------------------- [21:24:48] Forrest Chang(@fkchang):@adambeynon I'm using regexps for the tab completion, I suppose I should probably use some kind of AST assist instead, as I want to support fully qualified classnames which means changing the regexps ---------------------------------------------------------------------------------------------------- [00:02:12] Jeremy Evans(@jeremyevans):@elia A couple other questions. 1) How would you feel about moving sprockets from a runtime dependency to a development dependency, and having the tilt runtime dependency support >=1.4? 2) Would you consider supporting syntax allowing you to call javascript methods (e.g. obj.$method() in ruby calls obj.method() in javascript)? ---------------------------------------------------------------------------------------------------- [09:03:45] Adam Beynon(@adambeynon):@jeremyevans I have looked at a syntax based way to call into javascript land, and in honesty it is something I would love to add. It’s just a matter of deciding on something that won’t break anything on the ruby side ---------------------------------------------------------------------------------------------------- [09:04:30] Adam Beynon(@adambeynon):Originally Opal did use obj::foo() style calls to compile down into regular javascript calls, but as we started using ruby libraries, such as rspec, mspec etc it was no longer viable ---------------------------------------------------------------------------------------------------- [09:05:09] Adam Beynon(@adambeynon):I also wondered about something like a compiler trigger ---------------------------------------------------------------------------------------------------- [09:05:38] Adam Beynon(@adambeynon):object.js.foo() would compile to `object.foo()`, or someything like that (and perhaps something better than `.js`) ---------------------------------------------------------------------------------------------------- [09:05:53] Adam Beynon(@adambeynon):but, any suggestions would be great :+1: ---------------------------------------------------------------------------------------------------- [09:08:25] Adam Beynon(@adambeynon):@fkchang autocomplete stuff is looking great! :smile: ---------------------------------------------------------------------------------------------------- [11:52:37] Elia Schito(@elia):@adambeynon ping, you have a minute? ---------------------------------------------------------------------------------------------------- [11:53:49] Elia Schito(@elia):``` def has_attribute?(name) `!!self.attr(name)` end ``` ---------------------------------------------------------------------------------------------------- [11:53:57] Elia Schito(@elia):I think should be: ---------------------------------------------------------------------------------------------------- [11:54:25] Elia Schito(@elia):``` def has_attribute?(name) `self.attr(name) !== undefined` end ``` but it can potentially break apps ---------------------------------------------------------------------------------------------------- [11:55:17] Elia Schito(@elia):(backstory is that jquery returns an empty string if the attribute is there but has no value set) ---------------------------------------------------------------------------------------------------- [11:56:15] Adam Beynon(@adambeynon):@elia yes, agree with that. Better fit for behaviour. (not sure if undefined vs. null makes any difference) ---------------------------------------------------------------------------------------------------- [11:56:47] Elia Schito(@elia):@adambeynon good, will check again docs and push the change ---------------------------------------------------------------------------------------------------- [11:58:17] Elia Schito(@elia):> As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. ---------------------------------------------------------------------------------------------------- [11:58:22] Elia Schito(@elia):http://api.jquery.com/attr/ ---------------------------------------------------------------------------------------------------- [12:01:15] Elia Schito(@elia):@adambeynon also updating Element#[] ---------------------------------------------------------------------------------------------------- [12:01:19] Elia Schito(@elia):``` def [](name) %x{ var value = self.attr(name); if(value === undefined) return nil; return value; } end ``` ---------------------------------------------------------------------------------------------------- [12:04:17] Elia Schito(@elia):uh, this is funny: ---------------------------------------------------------------------------------------------------- [12:04:19] Elia Schito(@elia):> * `Element#[]` and `Element#attr` now return `nil` for empty attributes, instead of returning an empty string. ---------------------------------------------------------------------------------------------------- [12:04:23] Elia Schito(@elia):from the changelog ---------------------------------------------------------------------------------------------------- [12:25:41] Adam Beynon(@adambeynon):hmmm. I do remember changing that. maybe we were returning the same result for empty strings AND missing attributes ---------------------------------------------------------------------------------------------------- [12:25:57] Adam Beynon(@adambeynon):your proposed behaviour is the one we should be using ---------------------------------------------------------------------------------------------------- [12:26:23] Elia Schito(@elia):@adambeynon yes, I checked, what about making Element#[]= remove attribute when assigned nil? ---------------------------------------------------------------------------------------------------- [12:28:00] Adam Beynon(@adambeynon):@elia yeap, sounds good. ---------------------------------------------------------------------------------------------------- [12:28:10] Adam Beynon(@adambeynon):I will look at anything I have fixed in apps for opal-jquery ---------------------------------------------------------------------------------------------------- [12:28:18] Adam Beynon(@adambeynon):might as well do a big release for 0.8.0 ---------------------------------------------------------------------------------------------------- [12:28:28] Adam Beynon(@adambeynon):Im sure I have a few monkey patches somewhere ---------------------------------------------------------------------------------------------------- [12:29:20] Elia Schito(@elia):eheh, that's what I'm doing too ---------------------------------------------------------------------------------------------------- [12:30:37] Adam Beynon(@adambeynon):@elia I really need to blog about some of my app stuff. I now have model validations and processors that run on rails, opal (webapp) AND rubymotion. The only difference is the view layer for each ---------------------------------------------------------------------------------------------------- [12:30:40] Adam Beynon(@adambeynon):its beautiful. ---------------------------------------------------------------------------------------------------- [12:31:12] Elia Schito(@elia):Can't wait for it, please do :clap: ---------------------------------------------------------------------------------------------------- [12:32:09] Elia Schito(@elia):@adambeynon have started any draft for the post? ---------------------------------------------------------------------------------------------------- [16:11:28] Elia Schito(@elia):@adambeynon this is for you :wink2: https://twitter.com/rubymotion/status/600332643620790273 ---------------------------------------------------------------------------------------------------- [16:49:04] Adam Beynon(@adambeynon):eeek, will do! It should also cover my transition from Cordova/PhoneGap => WKWebView ---------------------------------------------------------------------------------------------------- [16:49:10] Adam Beynon(@adambeynon):much more pleasant experience ---------------------------------------------------------------------------------------------------- [16:49:17] Adam Beynon(@adambeynon):(and metal speedzzz) ---------------------------------------------------------------------------------------------------- [17:23:07] Forrest Chang(@fkchang): @elia is crowd sourcing peer pressure for @adambeynon to blog, that's what the internet is for ---------------------------------------------------------------------------------------------------- [17:23:54] AstonJ(@AstonJ):Haha nice one @elia - I shall look forward to the post @adambeynon :) ---------------------------------------------------------------------------------------------------- [17:32:59] Forrest Chang(@fkchang):@adambeynon what can we do to improve handling compile errors in opal-rspec? I have 2 examples of things that can really throw you off * if a spec file doesn't compile, the spec runner just ignores it, so you can get green, so if u don't pay attention to the spec count, you think the build is passing. * no stack trace when there is an error. I'm having this issue right now where specs that should pass cause a bunch of stuff totally unrelated to break, comment them out, and everything is normal. The only info is this ``` TypeError: wrong argument type Method (expected Proc/Method) ``` ---------------------------------------------------------------------------------------------------- [17:46:00] Mitch VanDuyn(@catmando):Is there any hacky way to get the callers binding ---------------------------------------------------------------------------------------------------- [17:46:10] Mitch VanDuyn(@catmando):In opal? ---------------------------------------------------------------------------------------------------- [17:48:30] Mitch VanDuyn(@catmando):In other words how to implement binding soft caller gem in opal. Just a hint is all I need ---------------------------------------------------------------------------------------------------- ############################## [2015-05-19] ############################## [13:20:42] Elia Schito(@elia):@vais the docs: https://help.github.com/articles/closing-issues-via-commit-messages/ ;) ---------------------------------------------------------------------------------------------------- [13:54:03] Vais Salikhov(@vais):@elia got it ---------------------------------------------------------------------------------------------------- [17:35:28] ylluminate(@ylluminate):https://www.facebook.com/groups/2221017023/permalink/10152720126532024/ ---------------------------------------------------------------------------------------------------- [17:38:29] ylluminate(@ylluminate):didn't know @jeremyevans 's face would be such a good marketing draw ;) ---------------------------------------------------------------------------------------------------- [18:01:11] Forrest Chang(@fkchang):@ylluminate I'd love to hear more details on your successes, you've made references to them in irc, here and some other places (or so I believe seeing them). A blog post or 3 would make good material for the opalist (hope @jaredcwhite doesn't mind me pimping that) for the greater opal publicity ---------------------------------------------------------------------------------------------------- [18:03:12] Forrest Chang(@fkchang):related @AstonJ suggested something about a publicity committee or similar? We should definitely do that since I think we have enough "highly enthused" ppl here. Maybe merging w/volt's committee is the thing to do? ---------------------------------------------------------------------------------------------------- [18:04:17] Elia Schito(@elia):@ylluminate any way to see it without logging into fb? ---------------------------------------------------------------------------------------------------- [18:28:39] Jared White(@jaredcwhite):@jeremyevans What about hash syntax with the proposed .JS syntax? Aka `some object.JS.somemethod({foo: "bar"})` -- I'm wondering if that passes on a regular JS hash-style object to the method or an Opal hash which wouldn't be compatible. ---------------------------------------------------------------------------------------------------- [18:32:29] Jeremy Evans(@jeremyevans):@jaredcwhite I assume that would pass the ruby/opal hash, you'd have to use `some object.JS.somemethod({foo: "bar"}.to_n)` to pass the javascript object ---------------------------------------------------------------------------------------------------- [18:32:57] meh.(@meh):jeremyevans, you should probably insert a Native.try_convert ---------------------------------------------------------------------------------------------------- [18:33:02] meh.(@meh):implicitly ---------------------------------------------------------------------------------------------------- [18:33:06] meh.(@meh):when calling a method with JS ---------------------------------------------------------------------------------------------------- [18:33:44] Jeremy Evans(@jeremyevans):@meh doesn't that require loading native from the stdlib, which the runtime can't depend on? ---------------------------------------------------------------------------------------------------- [18:34:13] meh.(@meh):jeremyevans, becomes simple when it's an option ---------------------------------------------------------------------------------------------------- [18:35:27] meh.(@meh):jeremyevans, that's also why I'd go with the disable by default ---------------------------------------------------------------------------------------------------- [18:35:47] meh.(@meh):I'd rather keep the standard semantics with the default options, and not everyone needs that kind of stuff in their code ---------------------------------------------------------------------------------------------------- [18:35:57] meh.(@meh):but we do need at least per-gem options ---------------------------------------------------------------------------------------------------- [18:36:03] meh.(@meh):per-file would be good too ---------------------------------------------------------------------------------------------------- [18:36:44] meh.(@meh):basically I'm all for this thing if it seamlessly uses Native as well, and it's disabled by default ---------------------------------------------------------------------------------------------------- [18:37:10] meh.(@meh):it's a nice ergonomic thing when you're dealing with native stuff, i.e. porting something or writing a wrapper ---------------------------------------------------------------------------------------------------- [18:37:18] meh.(@meh):but when writing Opal code you should never, ever, access JS ---------------------------------------------------------------------------------------------------- [18:37:37] meh.(@meh):it should all be hidden behind wrappers ---------------------------------------------------------------------------------------------------- [18:38:02] meh.(@meh):if you're writing js in your application you're doing something wrong unless it's for optimization ---------------------------------------------------------------------------------------------------- [18:40:21] Jeremy Evans(@jeremyevans):The main reason for adding this is so I can easily write ruby instead of javascript, with minimal invasion. I would like to be able to incrementally replace javascript with ruby, which is really ugly if you have to manually wrap and unwrap javascript objects everywhere. ---------------------------------------------------------------------------------------------------- [18:41:20] Jeremy Evans(@jeremyevans):I think per-file options would be possible using magic comments, but I can't think of another good way to do so ---------------------------------------------------------------------------------------------------- [18:42:46] Jeremy Evans(@jeremyevans):Really, if you should never, ever, access JS, opal should be implicitly converting all function arguments to ruby objects, and converting all function return values to javascript objects if they weren't called by ruby code. That would probably slow things down quite a bit, though. ---------------------------------------------------------------------------------------------------- [18:46:36] Jeremy Evans(@jeremyevans):I have a more pragmatic viewpoint. If you are running on a javascript runtime, you'll eventually need to deal with javascript objects, so you might as well make that as easy as possible. ---------------------------------------------------------------------------------------------------- [18:53:20] Elia Schito(@elia):I had a hard time too trying to deal with native libs http://dev.mikamai.com/post/87806500959/learning-d3-js-basics-with-ruby-and-opal ---------------------------------------------------------------------------------------------------- [19:02:38] meh.(@meh):jeremyevans, the point is JS is treated like FFI ---------------------------------------------------------------------------------------------------- [19:02:56] meh.(@meh):we're running on it, but that doesn't mean it should be seamless, and it doesn't work ---------------------------------------------------------------------------------------------------- [19:03:08] meh.(@meh):when you need to go down to raw JS is to use APIs written in it ---------------------------------------------------------------------------------------------------- [19:03:16] meh.(@meh):and that's where writing a Ruby-esque wrapper comes in ---------------------------------------------------------------------------------------------------- [19:03:27] meh.(@meh):you do it, release it, and everyone's happier ---------------------------------------------------------------------------------------------------- [20:11:39] Christian Käser(@dfyx):Just some experiment to get opal running with electron: ---------------------------------------------------------------------------------------------------- [20:11:41] Christian Käser(@dfyx): require 'opal' require 'opal-electron/app' require 'opal-electron/browser_window' require 'opal-electron/crash_reporter' require 'opal-electron/process' CrashReporter::start App::on 'window-all-closed' do App::quit if Process::platform != 'darwin' end App::on 'ready' do main_window = BrowserWindow.new(width: 800, height: 600) main_window.load_url_relative 'index.html' end ---------------------------------------------------------------------------------------------------- [20:11:44] Christian Käser(@dfyx):Works ---------------------------------------------------------------------------------------------------- [20:11:53] Christian Käser(@dfyx):All those requires are pretty simple ---------------------------------------------------------------------------------------------------- [20:12:50] Christian Käser(@dfyx):(I just wrapped everything I needed in ruby classes) ---------------------------------------------------------------------------------------------------- [23:06:52] AstonJ(@AstonJ):@AstonJ Want to join the strategies team? ---------------------------------------------------------------------------------------------------- [23:07:45] AstonJ(@AstonJ): Hey @/all We have just started a new team for anyone interested in helping out with the some of the behind-the-scenes stuff, marketing and promotion of the Opal and Volt projects (in fact any Opal related project). Some of the things we'll cover are screencasts, blog posts, docs and demo apps! If you fancy being on the team, please let me know and I'll add you to the room! :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-05-20] ############################## [17:51:54] Ryan Stout(@ryanstout):ok, thats what I figured ---------------------------------------------------------------------------------------------------- [17:52:06] Ryan Stout(@ryanstout):ok, let me test one thing real quick ---------------------------------------------------------------------------------------------------- [17:52:53] Elia Schito(@elia):was on mobile before, but now I can try to reproduce locally to better explain ---------------------------------------------------------------------------------------------------- [17:53:28] Ryan Stout(@ryanstout):ok, can you explain the Opal::Processor.load_asset_code again? ---------------------------------------------------------------------------------------------------- [17:53:33] Ryan Stout(@ryanstout):I didn't follow what that was about ---------------------------------------------------------------------------------------------------- [17:54:48] Ryan Stout(@ryanstout):ok, so if all I do is compile a file with ```require 'opal'``` in it, I get the error: ```Uncaught NameError: uninitialized constant Object::Volt``` ---------------------------------------------------------------------------------------------------- [17:54:59] Ryan Stout(@ryanstout):which I'm guessing has to do with the file path ---------------------------------------------------------------------------------------------------- [17:55:14] Ryan Stout(@ryanstout):let me make an isolated example ---------------------------------------------------------------------------------------------------- [17:56:02] Elia Schito(@elia):it shouldn't have anything to do with modules paths ---------------------------------------------------------------------------------------------------- [17:57:12] Elia Schito(@elia):`load_asset_code` just outputs `Opal.load('my_app')` plus some helpers for non-opal js files and stubbed files ---------------------------------------------------------------------------------------------------- [17:57:53] Elia Schito(@elia):@ryanstout I'm on skype if you want to have a look together ---------------------------------------------------------------------------------------------------- [17:58:25] Ryan Stout(@ryanstout):thanks, give me a few minutes to see if I can come up with an isolated example ---------------------------------------------------------------------------------------------------- [18:00:42] Ryan Stout(@ryanstout):so I'm using sprockets, but not javascript_include_tag, could that be related? ---------------------------------------------------------------------------------------------------- [18:00:47] Ryan Stout(@ryanstout):also, what's with the .self.js urls? ---------------------------------------------------------------------------------------------------- [18:01:10] Ryan Stout(@ryanstout):nevermind, figured it out ---------------------------------------------------------------------------------------------------- [18:03:42] Ryan Stout(@ryanstout):ok, it must be something I'm doing in volt, since on a simple sprockets example it works. ---------------------------------------------------------------------------------------------------- [18:04:51] Ryan Stout(@ryanstout):let me hack on this for a while and see if I can figure out what the issue is, thanks ---------------------------------------------------------------------------------------------------- [18:06:07] Elia Schito(@elia):yes, javascript_include_tag in opal-rails internally calls load_asset_code ---------------------------------------------------------------------------------------------------- [18:06:09] Elia Schito(@elia):gotta go ---------------------------------------------------------------------------------------------------- [18:34:24] Christian Käser(@dfyx):@elia For some reason `require 'nodejs'` causes electron to give me 'The app provided is not a valid electron app, please read the docs on how to write one: https://github.com/atom/electron/tree/master/docs' ---------------------------------------------------------------------------------------------------- [18:34:49] Christian Käser(@dfyx):But the `Native` class does most of what I need anyways ---------------------------------------------------------------------------------------------------- [18:36:22] Christian Käser(@dfyx):(Unfortunately I didn't find a way to ask electron WHAT went wrong. It doesn't have a `--verbose` flag) ---------------------------------------------------------------------------------------------------- [20:25:32] Forrest Chang(@fkchang):@elia @ryanstout 's undefined sounds similar to the issues I had when I tried to upgrade our opal-rails app to 0.8 beta a while back. I didn't have time to deal w/it so I reverted w/o testing much, but the 1 thing I remember was it felt like things weren't being found and/or required. ---------------------------------------------------------------------------------------------------- [20:30:45] Elia Schito(@elia):It's possible that the more precise require system could uncover some require-sequence related race condition ---------------------------------------------------------------------------------------------------- [20:31:10] Elia Schito(@elia):@adambeynon ping https://github.com/opal/opal/pull/879 ---------------------------------------------------------------------------------------------------- [20:31:31] Elia Schito(@elia):need a review there ---------------------------------------------------------------------------------------------------- [20:36:40] Ryan Stout(@ryanstout):@elia so just so I'm clear, in 0.8 I need to call Opal::Processor.load_asset_code(sprockets, logical_path) for each file I load in a script tag? ---------------------------------------------------------------------------------------------------- [20:45:59] Elia Schito(@elia):No, just for the main one, supposing it requires the others ---------------------------------------------------------------------------------------------------- [20:49:36] Ryan Stout(@ryanstout):@elia humm, still getting the error ---------------------------------------------------------------------------------------------------- [20:49:50] Ryan Stout(@ryanstout):what does load_asset_code do? ---------------------------------------------------------------------------------------------------- [20:51:22] Ryan Stout(@ryanstout):it errors before the app.rb file is done loading actually ---------------------------------------------------------------------------------------------------- [20:51:43] Ryan Stout(@ryanstout):am I supposed to take the output of load_asset_code and have that one the client page? ---------------------------------------------------------------------------------------------------- [21:34:05] Ryan Stout(@ryanstout):@elia you still around? is it possible now to run code in a .rb opal file thats not in a class? ---------------------------------------------------------------------------------------------------- [21:34:25] Ryan Stout(@ryanstout):I've got it now where I'm not getting an error, but if I do a ```puts 'hey'``` that doesn't show up ---------------------------------------------------------------------------------------------------- [21:34:28] Ryan Stout(@ryanstout):outside of a class ---------------------------------------------------------------------------------------------------- [21:34:53] Ryan Stout(@ryanstout):in the main file, not one that gets required in ---------------------------------------------------------------------------------------------------- [21:59:57] Elia Schito(@elia):@ryanstout can you put the code somewhere? ---------------------------------------------------------------------------------------------------- [22:02:04] Ryan Stout(@ryanstout):@elia its all of volt, so it would probably be a bit confusing. I'm still messing with it. Unrelated, is there not a way to include the Opal.mark_as_loaded stuff in the generated file? ---------------------------------------------------------------------------------------------------- [22:03:04] Elia Schito(@elia):What it does at its core is just `Opal.load('mymainfile')` ---------------------------------------------------------------------------------------------------- [22:03:15] Elia Schito(@elia):so you can try doing just that ---------------------------------------------------------------------------------------------------- [22:07:52] CJ Lazell(@cj):does opal-rspec not support stubbing? https://github.com/opal/opal-rspec/issues/20 ---------------------------------------------------------------------------------------------------- [22:19:45] Elia Schito(@elia):@ryanstout ^ ---------------------------------------------------------------------------------------------------- [22:20:02] Ryan Stout(@ryanstout):@elia are you saying add that into my rb file? ---------------------------------------------------------------------------------------------------- [22:20:34] Elia Schito(@elia):no must be external ---------------------------------------------------------------------------------------------------- [23:36:23] Elia Schito(@elia):(@ryanstout ^) ---------------------------------------------------------------------------------------------------- [23:39:13] Forrest Chang(@fkchang):@cj that error is indicative of 2 things 1) it's likely trying to do #<< on a string, which are immutable in Opal, opal-rspec is basically monkey patching rspec to not modify strings so it'll work on opal 2) older syntax, I noticed some of the older syntaxes were not monkey patched, forcing me to go to the newer syntax, ---------------------------------------------------------------------------------------------------- [23:39:34] Forrest Chang(@fkchang):the new syntax for any instance subbing is ```ruby allow_any_instance_of(Widget).to receive(:name).and_return("Wibble") expect_any_instance_of(Widget).to receive(:name).and_return("Wobble") ``` ---------------------------------------------------------------------------------------------------- [23:40:13] Elia Schito(@elia):@fkchang fixed that on master ---------------------------------------------------------------------------------------------------- [23:48:39] Elia Schito(@elia):@ryanstout bedtime for me, pushed here an attempt I made updating to opal-master ---------------------------------------------------------------------------------------------------- [23:48:39] Elia Schito(@elia):https://github.com/elia/volt/tree/opal-0-8 ---------------------------------------------------------------------------------------------------- [23:49:24] Elia Schito(@elia):got 32 failing specs out of 250 ---------------------------------------------------------------------------------------------------- [16:23:26] CJ Lazell(@cj):morning. has any got minitest working with opal? ---------------------------------------------------------------------------------------------------- [16:30:18] Elia Schito(@elia):https://rubygems.org/gems/opal-minitest ---------------------------------------------------------------------------------------------------- [16:30:22] Elia Schito(@elia):@cj ^ ---------------------------------------------------------------------------------------------------- [16:31:14] Elia Schito(@elia):@dfyx opal-node is out of date, but we have some nice wrappers for node stuff in the stdlib, just require 'nodejs' from inside opal ---------------------------------------------------------------------------------------------------- [16:31:30] Elia Schito(@elia):of course any help in updating opal-node would be appreciated ---------------------------------------------------------------------------------------------------- [16:31:33] CJ Lazell(@cj):@elia I tried that ... https://github.com/opal/opal/issues/880 ---------------------------------------------------------------------------------------------------- [16:31:56] Christian Käser(@dfyx):@elia thanks, I'll look at it when I'm at home ---------------------------------------------------------------------------------------------------- [16:32:37] Elia Schito(@elia):@cj missed the issue, etc.so looks like fun :P ---------------------------------------------------------------------------------------------------- [16:32:49] CJ Lazell(@cj):lol ---------------------------------------------------------------------------------------------------- [16:39:12] Elia Schito(@elia):@cj at first look the culprit is sprockets 3 ---------------------------------------------------------------------------------------------------- [16:46:05] CJ Lazell(@cj):@elia I tried sprockets 2, but still got issues with etc.so ---------------------------------------------------------------------------------------------------- [17:28:08] Ryan Stout(@ryanstout):if anyone's around, I'm testing out opal 0.8 and seeing a strange issue. I have a file at volt/volt/app.rb. For some reason its outputting the following for that file: ``` /* Generated by Opal 0.8.0.beta1 */ Opal.modules["volt/volt/app"] = function(Opal) { Opal.dynamic_require_severity = "error"; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; return nil }; ``` ^assuming I empty the file then I get: Uncaught NameError: uninitialized constant Object::Volt ---------------------------------------------------------------------------------------------------- [17:28:48] Ryan Stout(@ryanstout):I think part of the issue was that my naming maybe wasn't following conventions? ---------------------------------------------------------------------------------------------------- [17:29:03] Ryan Stout(@ryanstout):any ideas on this? ---------------------------------------------------------------------------------------------------- [17:30:58] Elia Schito(@elia):What's the source of app.rb? ---------------------------------------------------------------------------------------------------- [17:31:45] Ryan Stout(@ryanstout):so originally it had the following: ``` module Volt class App ... end end ``` ---------------------------------------------------------------------------------------------------- [17:31:52] Ryan Stout(@ryanstout):but even if I remove that, it still gives me the error ---------------------------------------------------------------------------------------------------- [17:32:05] Ryan Stout(@ryanstout):and outputs the Opal.modules['volt/volt/app'] ---------------------------------------------------------------------------------------------------- [17:32:54] Ryan Stout(@ryanstout):sorry, I'm probably not being very helpful. ---------------------------------------------------------------------------------------------------- [17:35:30] Elia Schito(@elia):How do you compile files? ---------------------------------------------------------------------------------------------------- [17:36:58] Ryan Stout(@ryanstout):sprockets ---------------------------------------------------------------------------------------------------- [17:37:01] Ryan Stout(@ryanstout):for this code ---------------------------------------------------------------------------------------------------- [17:37:14] Ryan Stout(@ryanstout):looks like its a problem in const_get ---------------------------------------------------------------------------------------------------- [17:38:16] Elia Schito(@elia):With 0.8 sprockets always compiles into modules ---------------------------------------------------------------------------------------------------- [17:39:09] Elia Schito(@elia):you have to manually add the boot sea code to run the main file ---------------------------------------------------------------------------------------------------- [17:39:54] Elia Schito(@elia):which in turn is responsible of requiring its dependencies ---------------------------------------------------------------------------------------------------- [17:40:45] Ryan Stout(@ryanstout):"boot sea code?" ---------------------------------------------------------------------------------------------------- [17:41:39] Elia Schito(@elia):Lol ---------------------------------------------------------------------------------------------------- [17:41:59] Elia Schito(@elia):bootstrapping ---------------------------------------------------------------------------------------------------- [17:42:15] Ryan Stout(@ryanstout):sorry, I still don't understand ---------------------------------------------------------------------------------------------------- [17:43:00] Elia Schito(@elia):Opal::Processor.load_asset_code(sprockets, logical_path) ---------------------------------------------------------------------------------------------------- [17:43:54] Ryan Stout(@ryanstout):ok, sorry I haven't kept up with opal master as much as I should have. When you say 0.9 compiles to modules, what do you mean by that? ---------------------------------------------------------------------------------------------------- [17:44:35] Elia Schito(@elia):Sorry: Opal 0.8 ---------------------------------------------------------------------------------------------------- [17:44:40] Ryan Stout(@ryanstout):sorry, 0.8 ---------------------------------------------------------------------------------------------------- [17:45:20] Ryan Stout(@ryanstout):is the load_asset_code something I need to call before I setup Opal::Server ---------------------------------------------------------------------------------------------------- [17:46:15] Elia Schito(@elia):compiling via sprockets in 08 will always put compiled code into Opal.modules ---------------------------------------------------------------------------------------------------- [17:51:08] Ryan Stout(@ryanstout):ok, but if I have a module name that doesn't match what Opal.modules generates, that still works right? ---------------------------------------------------------------------------------------------------- [17:51:46] Elia Schito(@elia):what goes into Opal.modules is like the filename ---------------------------------------------------------------------------------------------------- ############################## [2015-05-22] ############################## [22:02:37] Rick Carlino(@RickCarlino):How do I convert a native JS DOM object to opal-browser DOM object? ---------------------------------------------------------------------------------------------------- [23:14:59] meh.(@meh):RickCarlino, DOM(object) ---------------------------------------------------------------------------------------------------- [23:15:24] Rick Carlino(@RickCarlino):Ah, thankyou. That's part of `opal-browser`? ---------------------------------------------------------------------------------------------------- [23:16:05] meh.(@meh):RickCarlino, ye ---------------------------------------------------------------------------------------------------- [23:16:28] meh.(@meh):RickCarlino, with Kernel#DOM you can either wrap a native node, or create one with a block ---------------------------------------------------------------------------------------------------- [23:16:38] meh.(@meh):``` DOM { h1 'I like trains' } ``` ---------------------------------------------------------------------------------------------------- [23:16:49] Rick Carlino(@RickCarlino):Ah, very cool. ---------------------------------------------------------------------------------------------------- [23:50:38] Jose Bencosme(@jlbenc): ---------------------------------------------------------------------------------------------------- [23:52:17] Rick Carlino(@RickCarlino):That's what I'm saying! ---------------------------------------------------------------------------------------------------- ############################## [2015-05-25] ############################## [13:58:38] Mitch VanDuyn(@catmando):Could anybody help with a little problem I am having? I am working with the react.rb gem. Currently when you do a require, you say: `require 'react'` but this keeps causing all sorts of problems because of the name space collision with the react.js library. I want to change things so that you say `require 'opal-react'` (like `opal-jquery`) but still use the `React` name space within opal to refer to the opal wrapper. (I assume this is okay with the opal team, if not then something like ruby-react would be fine) This is a dumb question I think, but I am not seeing how this is done with opal-jquery. THANKS IN ADVANCE! ---------------------------------------------------------------------------------------------------- [14:05:55] Elia Schito(@elia):@catmando you should consider them as normal ruby requires and actively forgot the special bound between module/class naming and file names that rails adds ---------------------------------------------------------------------------------------------------- [14:07:00] Elia Schito(@elia):also think of js files as native libs, the same way as you require a `.so` file in MRI ---------------------------------------------------------------------------------------------------- [14:07:19] Elia Schito(@elia):(not that that happens often, but the idea it's the same) ---------------------------------------------------------------------------------------------------- [14:09:16] Mitch VanDuyn(@catmando):@elia well, the problems I keep having is with using react.rb in rails... I am pretty sure its because of the specific name "react.rb". I worked around the first set of problems, but now am getting things working with rails-react, and I am back into the middle of these issues. I have no problems using other opal gems, so I am assuming I just need to change the name of react.rb to something else. ---------------------------------------------------------------------------------------------------- [14:09:38] Mitch VanDuyn(@catmando):But I would like to keep it so that within the opal code you can still just use the Module "React". ---------------------------------------------------------------------------------------------------- [14:10:18] Elia Schito(@elia):@catmando just renaming the files and updating the requires should do the job ---------------------------------------------------------------------------------------------------- [14:10:34] Mitch VanDuyn(@catmando):I am pretty if I just change the whole gem to say "reactrb" and call the outer scope ReactRB things will work fine ---------------------------------------------------------------------------------------------------- [14:11:17] Mitch VanDuyn(@catmando):But I would prefer if possible to be able to use React inside Opal while requiring 'opal-react'. ---------------------------------------------------------------------------------------------------- [14:11:33] Mitch VanDuyn(@catmando):I think this is essentially what was done with opal-jquery as well. ---------------------------------------------------------------------------------------------------- [14:12:10] Elia Schito(@elia):@catmando have you tried it? it should work fine… ---------------------------------------------------------------------------------------------------- [14:12:25] Elia Schito(@elia):let me know if you get any specific error ---------------------------------------------------------------------------------------------------- [14:12:52] Elia Schito(@elia):and remember that module namespace doesn't need to match filenames ---------------------------------------------------------------------------------------------------- [14:12:57] Mitch VanDuyn(@catmando):So you think if I just change the gem name to "opal-react" from "react.rb" things should work? ---------------------------------------------------------------------------------------------------- [14:13:54] Elia Schito(@elia):I don't think the problem is with the gem name at all ---------------------------------------------------------------------------------------------------- [14:13:55] Mitch VanDuyn(@catmando):OHHH I see... I also need to change the top level file from react.rb to opal-react.rb... got it. ---------------------------------------------------------------------------------------------------- [14:14:00] Elia Schito(@elia):https://github.com/zetachang/react.rb/blob/master/lib/react.rb#L2-L8 ---------------------------------------------------------------------------------------------------- [14:14:03] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [14:16:50] Mitch VanDuyn(@catmando):so just change this to ```ruby if RUBY_ENGINE == 'opal' require "opal-react/top_level" require "opal-react/component" require "opal-react/element" require "opal-react/event" require "opal-react/version" require "opal-react/api" require "opal-react/validator" else require "tilt" require "opal" require "react/version" require "opal-activesupport" require "react/ext/jsx_support" Opal.append_path File.expand_path('../', __FILE__).untaint Opal.append_path File.expand_path('../../vendor', __FILE__).untaint end ``` and change lib/react.rb to lib/opal-react.rb Is that right? ---------------------------------------------------------------------------------------------------- [14:17:31] Elia Schito(@elia):yes, and also rename lib/react to lib/opal-react ---------------------------------------------------------------------------------------------------- [14:29:23] Mitch VanDuyn(@catmando):OKAY! That worked... and hopefully that means I can now drop 'opal-react' into react-rails, and really have some fun! ---------------------------------------------------------------------------------------------------- [14:29:38] Mitch VanDuyn(@catmando):@elia Thank You So Much! ---------------------------------------------------------------------------------------------------- [14:29:48] Elia Schito(@elia):anytime! ---------------------------------------------------------------------------------------------------- [17:52:38] Mitch VanDuyn(@catmando):@elia once the name was changed to opal-react, there was zero problems integrated with react-rails. Instant isomorphic rendering in ruby. I am proposing to react.rb's developer that we rename to opal-react. Is that okay? ---------------------------------------------------------------------------------------------------- [20:28:31] Elia Schito(@elia):@catmando sure it is ---------------------------------------------------------------------------------------------------- [20:31:54] Elia Schito(@elia):no need to ask anyway ;) ---------------------------------------------------------------------------------------------------- [20:41:01] Elia Schito(@elia):@catmando btw an example app with opal-react+react-rails+clearwater would be really cool ---------------------------------------------------------------------------------------------------- [20:41:20] Elia Schito(@elia):blog post/tut would be super :sparkles: ---------------------------------------------------------------------------------------------------- [20:41:40] Elia Schito(@elia):@catmando does this setup do server side rendering too? ---------------------------------------------------------------------------------------------------- [20:44:38] Mitch VanDuyn(@catmando):Ye'* ---------------------------------------------------------------------------------------------------- [20:48:55] Mitch VanDuyn(@catmando):@elia yep just tried a small test, but seems to work fine, server and client. The react API in ruby reads beautifully, and react integrates so easily ---------------------------------------------------------------------------------------------------- [20:49:39] Mitch VanDuyn(@catmando):I expect to have some pages on our website converted by end of week. ---------------------------------------------------------------------------------------------------- [20:50:01] Mitch VanDuyn(@catmando):Will also work on a to do demo ---------------------------------------------------------------------------------------------------- ############################## [2015-05-26] ############################## [00:31:57] Jamie Gaskins(@jgaskins):@catmando FWIW, when I was playing around with react.rb, I was able to do this, which I found to be intention-revealing: ```ruby require 'react.js' require 'react.rb' ``` ---------------------------------------------------------------------------------------------------- [00:36:23] Jamie Gaskins(@jgaskins):@elia I'm not sure how well Clearwater would work with React, at least not in the same parts of the DOM. The idea behind both virtual DOMs is that they're the only things modifying their part of the DOM tree. Once they start colliding, results are likely unpredictable. ---------------------------------------------------------------------------------------------------- [00:42:49] Jamie Gaskins(@jgaskins):@elia With that said, I think it would be a lot of fun to see if we could make react.rb components work with Clearwater. I'm not sure what that entails yet, though, because React's components are presented with just the class name. ---------------------------------------------------------------------------------------------------- [15:57:20] David Chang(@zetachang):Hey, guys. Just setup a gitter room for react.rb https://gitter.im/zetachang/react.rb ---------------------------------------------------------------------------------------------------- [15:59:35] David Chang(@zetachang):Feel free to drop a line if you got something to be discussed or stuff to share :smile: ---------------------------------------------------------------------------------------------------- [19:44:32] Rick Carlino(@RickCarlino):. #shamelessPromotion f you live in Chicago (or have dev friends in Chicago) I will be giving a talk on Volt / Opal next month. Hope to see you there. http://www.meetup.com/BurbDev/events/222795205/ ---------------------------------------------------------------------------------------------------- [22:20:47] CJ Lazell(@cj):I have this bit of code that I need to run and attach to the compiled opal https://github.com/wedgeio/wedge/blob/master/lib/wedge.rb#L147-L169 right now I'm not using sprockets to compile for that reason, would it be possible to override sprokets to add it in ---------------------------------------------------------------------------------------------------- ############################## [2015-05-27] ############################## [11:12:48] Francesco 'makevoid' Canessa(@makevoid):@RickCarlino do you plan to record a video of the session? that would be cool ---------------------------------------------------------------------------------------------------- [12:26:01] Rick Carlino(@RickCarlino):@makevoid In the past, we've done video streams. I can make that happen. ---------------------------------------------------------------------------------------------------- [13:39:31] Francesco 'makevoid' Canessa(@makevoid):I think it will be useful for rubysts that want to start playing with opal, there are not many videos out there ---------------------------------------------------------------------------------------------------- [17:37:27] CJ Lazell(@cj):so I'm trying to find out where it appends the required js to the compiled result as I need to append code https://github.com/opal/opal/blob/master/lib/opal/sprockets/processor.rb#L43-L46 ---------------------------------------------------------------------------------------------------- [17:39:52] CJ Lazell(@cj):the result.to_s is still just the single file and doesn't include all the files js it requires ---------------------------------------------------------------------------------------------------- [17:51:47] Mitch VanDuyn(@catmando):arghh! I need to define a javascript var at the global level from within opal. I want to do something like this: ---------------------------------------------------------------------------------------------------- [17:52:08] Mitch VanDuyn(@catmando):var Foo = some_func_call() ---------------------------------------------------------------------------------------------------- [17:52:40] Mitch VanDuyn(@catmando):where Foo is the result of a function call. ---------------------------------------------------------------------------------------------------- [17:52:42] Mitch VanDuyn(@catmando):i.e. ---------------------------------------------------------------------------------------------------- [17:53:38] Jared White(@jaredcwhite):@catmando All global JS vars are essentially properties on `window`. So you can simply do `window.Foo = some_func_call()` ---------------------------------------------------------------------------------------------------- [17:53:48] Mitch VanDuyn(@catmando):yeah ---------------------------------------------------------------------------------------------------- [17:53:58] Mitch VanDuyn(@catmando):but I Foo itself is a variable ---------------------------------------------------------------------------------------------------- [17:54:11] Mitch VanDuyn(@catmando):i.e. "Foo" is the result of a function call ---------------------------------------------------------------------------------------------------- [17:54:21] Mitch VanDuyn(@catmando):do I have to use javascript eval? ---------------------------------------------------------------------------------------------------- [17:55:02] Jared White(@jaredcwhite):Not following ---------------------------------------------------------------------------------------------------- [17:57:06] Jared White(@jaredcwhite):at which ever point you have a variable that you want to assign to the global level (lets' call it local_var, in backticks you would write JS code: ---------------------------------------------------------------------------------------------------- [17:57:21] Jared White(@jaredcwhite):`window.globalVar = local_var` ---------------------------------------------------------------------------------------------------- [17:57:36] Mitch VanDuyn(@catmando):no like this ---------------------------------------------------------------------------------------------------- [17:58:08] Mitch VanDuyn(@catmando):window[name_to_be_defined] = something_else ---------------------------------------------------------------------------------------------------- [17:58:53] Jared White(@jaredcwhite):what you just wrote will work actually ---------------------------------------------------------------------------------------------------- [17:59:02] Mitch VanDuyn(@catmando):nope tried that ---------------------------------------------------------------------------------------------------- [17:59:20] Jared White(@jaredcwhite):I just tried it in my JS console: ---------------------------------------------------------------------------------------------------- [17:59:22] Jared White(@jaredcwhite):> foo = "myVar" < "myVar" > window[foo] = "something" < "something" > window.myVar < "something" ---------------------------------------------------------------------------------------------------- [18:01:39] Mitch VanDuyn(@catmando):yes lovely... I know how to do it JS ---------------------------------------------------------------------------------------------------- [18:01:43] Mitch VanDuyn(@catmando):I am trying to do it ruby ---------------------------------------------------------------------------------------------------- [18:03:03] Jared White(@jaredcwhite):You mean an Opal-context global var? Hmm, not sure about that. I always encapsulate "global" variables instead of a Ruby class or a module. ---------------------------------------------------------------------------------------------------- [18:05:13] CJ Lazell(@cj):hopefully this might help understand what I'm trying to do (sorry about the non dry code, just trying to get it working) https://gist.github.com/cj/11a226a6df25c3a49e41#file-opal-rb-L22 I'm trying to override the compile method to append some javascript. The issue is it needs all the required files included with the compiled js, but when it hits compile it's just the single file.... this hack works but there must be a better way to tell/trigger once all files are joined ---------------------------------------------------------------------------------------------------- [18:05:29] Mitch VanDuyn(@catmando):@jaredcwhite Yes, but this is for a special case (communicating to React JS via Rails-React) ---------------------------------------------------------------------------------------------------- [18:07:47] CJ Lazell(@cj):I tried wrapping it in a simple typeof check but then the code block never gets executed ---------------------------------------------------------------------------------------------------- [18:08:04] Elia Schito(@elia):@catmando with native loaded this should work ``` Native(`window`)[some_key] = whatever ``` ---------------------------------------------------------------------------------------------------- [18:09:00] CJ Lazell(@cj):I can't seem to find which opal is adding the compiled js for all the require 'foo' in a certain file ---------------------------------------------------------------------------------------------------- [18:09:04] CJ Lazell(@cj):where* ---------------------------------------------------------------------------------------------------- [18:13:47] Mitch VanDuyn(@catmando):@elia - thank you kind sir. Almost there with a very nice opal-react-rails demo! ---------------------------------------------------------------------------------------------------- [18:29:55] Mitch VanDuyn(@catmando):@elia - we are just looking at this... (works) but can you explain exactly what Native() does? ---------------------------------------------------------------------------------------------------- [19:03:46] Elia Schito(@elia):@catmando really briefly native creates a ruby object with a @native ivar that contains the native object, then uses method missing to call native methods + #[] and #[]= for properties reading/setting ---------------------------------------------------------------------------------------------------- [19:08:59] CJ Lazell(@cj):is there anyway to execute code after Opal.modules["wedge"] has been triggered ? ---------------------------------------------------------------------------------------------------- [19:09:37] CJ Lazell(@cj):I'm trying add code on compile that only gets executed once the file has been loaded including all it's requires ---------------------------------------------------------------------------------------------------- ############################## [2015-05-28] ############################## [16:14:41] Forrest Chang(@fkchang):@jaredcwhite So I dunno about others, but I'd be interested in a reminder to submit stuff for the opalist. The 2 weeks went by too fast. Thanks for including opal-irb in the issue. Though even with a warning, this was pretty swamped, Amazon told us Monday that they were going to retire our main server due to h/w degradation, so I spent the last 2 days rebuilding, testing and then deploying the replacement ---------------------------------------------------------------------------------------------------- [16:15:45] Forrest Chang(@fkchang):So I wouldn't have been able to write something up. That being said, I'll target next issue ---------------------------------------------------------------------------------------------------- [16:34:15] CJ Lazell(@cj):morning. ran into a strange issue passing blocks https://github.com/opal/opal/issues/895 ---------------------------------------------------------------------------------------------------- [19:10:10] ylluminate(@ylluminate):@all just a reminder that we're looking to get more community involvement, input and demos going for opal-phaser (https://gitter.im/orbitalimpact/opal-phaser). our goal with opal-phaser is to take advantage of this very robust and well accepted framework and make it absolutely as ruby-like as possible. we're using it for a private, rather large, application development project at the moment that we can't share, but we are more than open to getting some suggestions for demo games and such as well as input to make the api more ruby friendly. ---------------------------------------------------------------------------------------------------- [20:15:49] Forrest Chang(@fkchang):@ylluminate I'd love to read more about what you guys are doing w/opal. Surely there are some aspects you can write about even if you can't share about the large project? ---------------------------------------------------------------------------------------------------- [20:33:26] Mitch VanDuyn(@catmando):@adambeyon - we were curious over on the react.rb (opal-react) gitter about where the name opal came from... ---------------------------------------------------------------------------------------------------- [21:27:46] Jared White(@jaredcwhite):@fkchang Yikes, sorry to hear about that hassle! Yes I will try to send a reminder out the week before so people have time to get content ready. ---------------------------------------------------------------------------------------------------- ############################## [2015-05-29] ############################## [18:05:50] Mitch VanDuyn(@catmando):```ruby before(:all) do @test_chains = Hash.new(Promise.new.tap { |p| p.resolve}) end async "test 1" do @test_chains[:default].then do @test_chains[:default] = Promise.new # I will start right away async {@test_chains[:default].resolve; expect ... } end end async "test 2", test_chain: :chain_2 do etc # I will also start right away end async "test 3" do # and I will also start right away end async "test 4" do # but I wont' start until test3 finishes end async "test 5", test_chain: :chain_1 do # and I won't start until test 1 finishes end ``` ---------------------------------------------------------------------------------------------------- [18:25:35] Adam Beynon(@adambeynon):@ryanstout no, havne’t had a chance Im sorry. In honesty, im not sure if its something Im going to look to fix anytime soon. not really having time to work on web/opal stuff atm ---------------------------------------------------------------------------------------------------- [19:31:26] Ryan Stout(@ryanstout):@adambeynon no worries. I know how that goes. Would you take a PR for it? ---------------------------------------------------------------------------------------------------- [19:40:33] Mitch VanDuyn(@catmando):@ryanstout - fyi I also started on a change for this... let me know if you want to wait for me to finish it up, else I can use what you have in mind....I too want to get this fixed :-) ---------------------------------------------------------------------------------------------------- [19:42:03] Ryan Stout(@ryanstout):@catmando so the thing I'm trying to get working is making it so specs run the same in MRI and opal, so we may not have the same use cases. On the server, I can have the promises block when created. ---------------------------------------------------------------------------------------------------- [19:43:09] Mitch VanDuyn(@catmando):@ryanstout but you use async? ---------------------------------------------------------------------------------------------------- [19:45:08] Ryan Stout(@ryanstout):yea, but they are still in promises. ---------------------------------------------------------------------------------------------------- [19:45:10] Ryan Stout(@ryanstout):long story ---------------------------------------------------------------------------------------------------- [19:45:17] Ryan Stout(@ryanstout):anyway, let me know if you start on it, maybe I can help ---------------------------------------------------------------------------------------------------- [19:54:08] Mitch VanDuyn(@catmando):@catmando so roughly right should the outline I gave above work for you? I.e. async case is blocked by a promise until the previous case finishes? ---------------------------------------------------------------------------------------------------- [07:13:32] ylluminate(@ylluminate):@elia @catmando @fkchang i was thinking of something along these lines: http://f.cl.ly/items/0n1p3c1k0a1S2G322s3i/Opal%20Logo%20-%20R3.1.png ---------------------------------------------------------------------------------------------------- [07:15:12] ylluminate(@ylluminate):obviously not the 3d rendered version i'd mentioned, but this gives an idea of what i was talking about. ---------------------------------------------------------------------------------------------------- [07:28:46] Elia Schito(@elia):I like the fill color, yet I prefer a more unique shape ---------------------------------------------------------------------------------------------------- [10:14:17] Mitch VanDuyn(@catmando):I like it ---------------------------------------------------------------------------------------------------- [10:14:53] Mitch VanDuyn(@catmando):Clear message ---------------------------------------------------------------------------------------------------- [14:10:45] ylluminate(@ylluminate):I was going to change shape too @elia, but then I kept getting stuck on the importance about how we want folks to recognize that this IS "ruby" (I think a la @catmando's "clear message" conclusion). So that's why I thought I'd send this for some chatter before going any further. I do perhaps think, at the very least, I need to somehow raise the contrast of this or perhaps "opalize" the facets separately. Hmmm. ---------------------------------------------------------------------------------------------------- [14:18:16] Elia Schito(@elia):gradients and textures are not very scalable (svg-wise) ---------------------------------------------------------------------------------------------------- [14:38:18] Vais Salikhov(@vais):@ylluminate in my past life I did a short stint as a web dev at a jewelry business. Opal's never cut to have facets, it's normally more of a smooth, oblong affair. So, yes, making it look like ruby is problematic :smile: ---------------------------------------------------------------------------------------------------- [14:42:54] ylluminate(@ylluminate):LOL, that crossed my mind @vais, but that was thrown into the wind when the name "opal" was chosen for a ruby implementation. ;) ---------------------------------------------------------------------------------------------------- [14:44:54] ylluminate(@ylluminate):of course these shapes did cross my mind: http://cl.ly/image/2S1r0q1u2l44 ---------------------------------------------------------------------------------------------------- [14:45:38] Vais Salikhov(@vais):Here's a stream of consciousness.... From wikipedia "The internal structure of precious opal makes it diffract light; depending on the conditions in which it formed, it can take on many colors. " ---------------------------------------------------------------------------------------------------- [14:45:55] ylluminate(@ylluminate):http://cl.ly/image/1Q1z3T3K253A ---------------------------------------------------------------------------------------------------- [14:46:59] Vais Salikhov(@vais):http://www.puresoliloquy.com/wp-content/uploads/2013/10/pink-floyd-dark-side-of-the-moon-wallpaper-2.png ---------------------------------------------------------------------------------------------------- [14:47:25] Vais Salikhov(@vais)::wink2: ---------------------------------------------------------------------------------------------------- [14:47:41] ylluminate(@ylluminate):lol, cute ---------------------------------------------------------------------------------------------------- [14:47:49] Vais Salikhov(@vais):(with a ruby shape instead of a triangle of course) ---------------------------------------------------------------------------------------------------- [14:49:25] Vais Salikhov(@vais):Oops, that's actually not an example of diffraction :sweat_smile: ---------------------------------------------------------------------------------------------------- [14:50:23] ylluminate(@ylluminate):one problem with logos is that when we get too many mental concepts going on it wrecks havoc on the user's ability to obtain meaning. i once did a logo design for an organization about 8 years ago that caused me to not do any designs since for anyone buy my own projects because a committee had to decide on it. i went through about 200 iterations until i finally gave up, used a logo design app and used a nike-like swoosh default and they freaking loved it. -.- i was not a happy camper, but c'est la vie ---------------------------------------------------------------------------------------------------- [14:51:56] Vais Salikhov(@vais):Hehe... ---------------------------------------------------------------------------------------------------- [14:52:53] Vais Salikhov(@vais):Nike-like swoosh... that's not a bad idea! ---------------------------------------------------------------------------------------------------- [14:53:13] ylluminate(@ylluminate)::P ---------------------------------------------------------------------------------------------------- [14:53:22] Vais Salikhov(@vais):LOL ---------------------------------------------------------------------------------------------------- [14:53:24] ylluminate(@ylluminate):let's just use a white dot ---------------------------------------------------------------------------------------------------- [14:53:50] ylluminate(@ylluminate):(no outline, just a white dot... :shipit: ) ---------------------------------------------------------------------------------------------------- [14:58:42] Vais Salikhov(@vais):That's already taken - I'm using it for Diamond, my Opal implementation on top of Windows Scripting Host. ---------------------------------------------------------------------------------------------------- [14:59:23] Vais Salikhov(@vais):Anyway, long day, it's time for me to shutdown :zzz: Have fun with it! ---------------------------------------------------------------------------------------------------- [14:59:38] Elia Schito(@elia):good night! ---------------------------------------------------------------------------------------------------- [14:59:51] ylluminate(@ylluminate):lol, i thought that was "Glass" ---------------------------------------------------------------------------------------------------- [15:00:11] ylluminate(@ylluminate):sounds like it's pretty fragile... ;) night ---------------------------------------------------------------------------------------------------- [15:34:21] Forrest Chang(@fkchang):@ylluminate I like logo, w/the intentional ruby shape ---------------------------------------------------------------------------------------------------- [15:53:33] Christian Käser(@dfyx):@elia Did you see that the specs for opal-rails fail on travis? ---------------------------------------------------------------------------------------------------- [15:56:19] Elia Schito(@elia):@dfyx yes, I think it's a weird issue with travis' file system ---------------------------------------------------------------------------------------------------- [15:56:28] Christian Käser(@dfyx):Alright ---------------------------------------------------------------------------------------------------- [15:57:16] Christian Käser(@dfyx):Just saw it because my boss *finally* lets me migrate some of our web stuff to rails and what better way is there to start a new rails app than with opal on the front end? ---------------------------------------------------------------------------------------------------- [15:57:35] Elia Schito(@elia)::tada: ---------------------------------------------------------------------------------------------------- [15:58:31] Christian Käser(@dfyx):(Would have loved to use volt but I don't think it fits that specific application) ---------------------------------------------------------------------------------------------------- [16:54:18] Ryan Stout(@ryanstout):@adambeynon hey, how are you? Have you had any more thoughts about making opal-rspec wait on returned promises? ---------------------------------------------------------------------------------------------------- [16:57:16] Ryan Stout(@ryanstout):is there a way to do async/run_async in opal rspec for before/after right now? ---------------------------------------------------------------------------------------------------- [17:33:56] Mitch VanDuyn(@catmando):@ryanstout can you explain your opal-rspec question again? I am having what I think is a similar problem, so its something I have been thinking about as well. ---------------------------------------------------------------------------------------------------- [17:35:49] Ryan Stout(@ryanstout):@catmando basically, I have some stuff that returns a promise, and I want the it spec to wait until it resolves before continuing. (Since I setup .then blocks that run more expect's) ---------------------------------------------------------------------------------------------------- [17:35:51] Mitch VanDuyn(@catmando):@ylluminate how about putting a small standard red ruby symbol inside the current logo (instead of the triangle at the back) ---------------------------------------------------------------------------------------------------- [17:38:12] Mitch VanDuyn(@catmando):@ryanstout - **exactly** the same problem I having. For now I just have one giant spec with a bunch of `expects` inside that concluding in the final `async { expect ..`. ---------------------------------------------------------------------------------------------------- [17:41:20] Mitch VanDuyn(@catmando):@ryanstout this might be a quick easy fix: have each async block do a busy wait until the previous async block completes. Busy-wait normally bad, but acceptable in a test environment. ---------------------------------------------------------------------------------------------------- [17:41:42] Ryan Stout(@ryanstout):@catmando you can't busy wait in JS ---------------------------------------------------------------------------------------------------- [17:41:45] Mitch VanDuyn(@catmando):I am suggesting this function be added to aync ---------------------------------------------------------------------------------------------------- [17:41:48] Ryan Stout(@ryanstout):well, you can, but the other thing won't get done :-) ---------------------------------------------------------------------------------------------------- [17:41:52] Ryan Stout(@ryanstout):for (;;) {} ---------------------------------------------------------------------------------------------------- [17:42:12] Mitch VanDuyn(@catmando):perhaps I should have said "poll" ---------------------------------------------------------------------------------------------------- [17:42:40] Ryan Stout(@ryanstout):you can't do that either in this situation, because a setTimeout would move on to the next spec ---------------------------------------------------------------------------------------------------- [17:42:52] Ryan Stout(@ryanstout):afaik ---------------------------------------------------------------------------------------------------- [17:43:59] Mitch VanDuyn(@catmando):you would add the polling to the async block so yes it would "move on" but what you would actually create is a chain of async blocks that will run in order ---------------------------------------------------------------------------------------------------- [17:50:36] Mitch VanDuyn(@catmando):currently ```ruby async "test returns_a_promise" do returns_a_promise.then do async { expect ... } end end async "test returns_another_promise" do returns_another_promise.then do async { expect ... } end end ``` Today it may call returns_another_promise before returns_a_romise completes (just confirming the problem statement is correct) If each async test block just waits (heck probably doesn't need to poll) for the previous block finish its async test, then I think we are all set ---------------------------------------------------------------------------------------------------- [17:52:03] Mitch VanDuyn(@catmando):in fact we can add a optional parameter called `:test_chain` so that you can set up independent chains of tests ---------------------------------------------------------------------------------------------------- [17:55:11] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [17:56:31] Mitch VanDuyn(@catmando):```ruby async "test 1", test_chain: :chain_1 do # I will start right away end async "test 2", test_chain: :chain_2 do # I will also start right away end async "test 3" do # and I will also start right away end async "test 4" do # but I wont' start until test3 finishes end async "test 5", test_chain: :chain_1 do # and I won't start until test 1 finishes end ``` How about that? ---------------------------------------------------------------------------------------------------- [17:57:26] Mitch VanDuyn(@catmando):I think it can all be done today without updating opal-rspec just as a test: ---------------------------------------------------------------------------------------------------- ############################## [2015-05-30] ############################## [14:20:25] Vais Salikhov(@vais):Fun fact: Opal is now passing 5005 rubyspec examples :tada: ---------------------------------------------------------------------------------------------------- [16:03:37] Mitch VanDuyn(@catmando):Coolest! ---------------------------------------------------------------------------------------------------- [16:03:58] Mitch VanDuyn(@catmando):@vais 5005 out of? ---------------------------------------------------------------------------------------------------- [16:04:10] Mitch VanDuyn(@catmando):anybody: I am having trouble using Element.expose ---------------------------------------------------------------------------------------------------- [16:10:46] Mitch VanDuyn(@catmando):I am trying to do this ```ruby Element.expose "dialog" class Foo def close Element.find(@e).dialog('close') # this fails with Uncaught TypeError: $scope.get(...).$find(...).$dialog is not a function end end ``` now if I move `Element.expose` to the line right above where I am using it, all is well. ---------------------------------------------------------------------------------------------------- [17:10:22] Elia Schito(@elia):@vais awesome! great job! ---------------------------------------------------------------------------------------------------- [17:14:15] Elia Schito(@elia):@catmando does it work if you `expose` in another file? ---------------------------------------------------------------------------------------------------- [17:20:54] Elia Schito(@elia):https://twitter.com/opalrb/status/604698858959040512 ---------------------------------------------------------------------------------------------------- [20:19:15] Mitch VanDuyn(@catmando):@elia, no I tried it in a separate file... well if this is surprising behavior, I will extract this to a smaller test app, and see what is going on. ---------------------------------------------------------------------------------------------------- [20:19:51] Mitch VanDuyn(@catmando):@elia so weird though... works fine as long as its executed in the method before its used ---------------------------------------------------------------------------------------------------- [21:13:33] Elia Schito(@elia):@catmando had a dejavu, anyway can you open an issue for that (or search for an existing one)? ---------------------------------------------------------------------------------------------------- [21:26:43] Mitch VanDuyn(@catmando):@elia of course, but first I want to make sure its not something totally goofy I am doing ---------------------------------------------------------------------------------------------------- [21:35:09] Elia Schito(@elia):alas, I have a bad feeling about this ;) ---------------------------------------------------------------------------------------------------- [21:42:01] meh.(@meh):elia, what is going on? getting a bunch of notifications ---------------------------------------------------------------------------------------------------- [21:42:07] meh.(@meh):are we gonna die? ---------------------------------------------------------------------------------------------------- [21:42:25] Elia Schito(@elia):let me check… ---------------------------------------------------------------------------------------------------- [21:42:38] Elia Schito(@elia):uh… ---------------------------------------------------------------------------------------------------- [21:42:39] Elia Schito(@elia):err… ---------------------------------------------------------------------------------------------------- [21:42:46] Elia Schito(@elia):no :D ---------------------------------------------------------------------------------------------------- [21:43:26] Elia Schito(@elia):played a bit with GH teams to get team mentions that would include @vais ---------------------------------------------------------------------------------------------------- [21:43:40] Elia Schito(@elia):now @opal/core should work ---------------------------------------------------------------------------------------------------- [21:44:31] Elia Schito(@elia):@meh I think you should also join the #opal room on gitter ---------------------------------------------------------------------------------------------------- ############################## [2015-05-31] ############################## [02:43:02] Vais Salikhov(@vais):@catmando please try it with the latest master, then if it's still a problem, please submit an issue with a smallest possible example for me to repro. ---------------------------------------------------------------------------------------------------- [02:45:12] Mitch VanDuyn(@catmando):@vais - I will do so soon, but please don't worry, I have lot going on in the code, so it may be my fault. ---------------------------------------------------------------------------------------------------- [02:48:47] Vais Salikhov(@vais):@catmando no problem, I'll wait :smile: ---------------------------------------------------------------------------------------------------- [17:02:22] Jamie Gaskins(@jgaskins):@meh I'm looking into trimming my `opal-browser` payload a bit to try to reduce the size of Clearwater apps (Clearwater uses it as its DOM abstraction). For example, I don't need all of the CSSOM stuff and I want to make some of the more specialized things like `Browser::Event::DeviceProximity` opt-in vs loaded by default. It looks like it might take some restructuring of the base classes since it seems they know about their subclasses. I was wondering if you had any ideas about that. ---------------------------------------------------------------------------------------------------- [17:03:17] meh.(@meh):jgaskins, it's already cherry-pickable, check opal/browser.rb ---------------------------------------------------------------------------------------------------- [17:05:14] Jamie Gaskins(@jgaskins):@meh Some of it is. If I want events, though, I have to load all of the event types. ---------------------------------------------------------------------------------------------------- [17:08:41] meh.(@meh):jgaskins, splitting up the event handling code would be a pain in the ass, if I recall I tried last time and it came out really ugly ---------------------------------------------------------------------------------------------------- [17:09:24] meh.(@meh):jgaskins, but pull requests welcome if you figure out a way to make it not ugly as sin and cherry-pickable ---------------------------------------------------------------------------------------------------- [17:10:28] Jamie Gaskins(@jgaskins):@meh Totally, I have a few ideas I'll try out. Just wanted to check and see if you had been down that road, too. ---------------------------------------------------------------------------------------------------- [17:11:05] meh.(@meh):jgaskins, sure, if you need any pointers just ask :) ---------------------------------------------------------------------------------------------------- [17:11:23] Jamie Gaskins(@jgaskins):@meh :+1: Will do! ---------------------------------------------------------------------------------------------------- [21:54:19] Mitch VanDuyn(@catmando):What doc generator does opal use? ---------------------------------------------------------------------------------------------------- [22:11:02] meh.(@meh):docs? what are docs? ---------------------------------------------------------------------------------------------------- ############################## [2015-06-01] ############################## [02:51:43] Jared White(@jaredcwhite):Bravo @meh! :clap: ---------------------------------------------------------------------------------------------------- [06:31:03] Adam Beynon(@adambeynon):haha, true true. ---------------------------------------------------------------------------------------------------- [08:39:10] Christian Käser(@dfyx):@meh According to Wikipedia: > Docs may mean: > > * a common name for Dr. Martens footwear, usually boots > * a plural of some of the meanings of Doc, usually documents or doctors > * Google Docs online document editing suite from Google > * Docs.com online document editing suite from Microsoft And some more I have omitted... ---------------------------------------------------------------------------------------------------- [08:39:40] Christian Käser(@dfyx): ---------------------------------------------------------------------------------------------------- [22:34:04] Elia Schito(@elia):@meh @adambeynon @vais I'm going to branch out a 0-8-stable branch and release 0.8.0.rc1 ---------------------------------------------------------------------------------------------------- [22:34:20] Elia Schito(@elia):any objections? ---------------------------------------------------------------------------------------------------- [22:34:23] meh.(@meh):go for it ---------------------------------------------------------------------------------------------------- [22:34:51] Elia Schito(@elia):I'm sick of @vais fixing tons of stuff ;) ---------------------------------------------------------------------------------------------------- [22:45:13] Elia Schito(@elia):@meh how many days before releasing the final version? a week? until friday? ---------------------------------------------------------------------------------------------------- [22:45:31] meh.(@meh):let's wait a week ---------------------------------------------------------------------------------------------------- [23:18:32] Mitch VanDuyn(@catmando):has anybody tried using the state-machine gem with Opal? I am getting a wrong-constant name error just trying a simple statemachine... ---------------------------------------------------------------------------------------------------- [23:33:14] Mitch VanDuyn(@catmando):I guess I need to require it, but I can't... is there anyway just to be able to use a standard ruby gem in Opal without doing anything explicit inside the gem? ---------------------------------------------------------------------------------------------------- [23:36:54] Elia Schito(@elia):@catmando Opal.use_gem ---------------------------------------------------------------------------------------------------- [23:37:34] Mitch VanDuyn(@catmando):okay... sorry to be dense ... where? ---------------------------------------------------------------------------------------------------- [23:37:45] Elia Schito(@elia):sorry, from MRI ---------------------------------------------------------------------------------------------------- [23:38:13] Elia Schito(@elia):a rails initializer for example ---------------------------------------------------------------------------------------------------- [23:41:20] Mitch VanDuyn(@catmando):/Users/mitch/railsdev/reactor/config/application.rb:5:in `': undefined method `use_gem' for Opal:Module (NoMethodError) ---------------------------------------------------------------------------------------------------- [23:41:27] Mitch VanDuyn(@catmando):in application.rb ---------------------------------------------------------------------------------------------------- [23:41:46] Elia Schito(@elia):@catmando which opal version? ---------------------------------------------------------------------------------------------------- [23:43:03] Mitch VanDuyn(@catmando):0.7.1 ---------------------------------------------------------------------------------------------------- [23:44:08] Elia Schito(@elia):have you required opal? ---------------------------------------------------------------------------------------------------- [23:44:18] Elia Schito(@elia):I see it defined in "opal/paths" ---------------------------------------------------------------------------------------------------- [23:44:44] Elia Schito(@elia):which is requireed when you `require 'opal'` ---------------------------------------------------------------------------------------------------- [23:46:47] Mitch VanDuyn(@catmando):```` /Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/lib/opal/builder.rb:45:in `rescue in build_str': A file required by "components/friends/state_machine" wasn't found. (Opal::Builder::MissingRequire) A file required by "state_machine" wasn't found. A file required by "state_machine/core" wasn't found. A file required by "state_machine/graph" wasn't found. can't find file: "rubygems" in ["/Users/mitch/railsdev/reactor/tmp/react-rails", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/stdlib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/state_machine-1.2.0/lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-jquery-38e608103054/lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-activesupport-0.1.0/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rspec-0.4.2/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rspec-0.4.2/vendor_lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-browser-0.1.0.beta1/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/paggio-0.2.4/lib", "/Users/mitch/railsdev/react.rb/lib", "/Users/mitch/railsdev/react.rb/vendor", "/Users/mitch/railsdev/reactor/app/assets/images", "/Users/mitch/railsdev/reactor/app/assets/javascripts", "/Users/mitch/railsdev/reactor/app/assets/stylesheets", "/Users/mitch/railsdev/reactor/vendor/assets/javascripts", "/Users/mitch/railsdev/reactor/vendor/assets/stylesheets", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/react-rails-1.0.0/lib/assets/javascripts", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/jquery-rails-3.1.2/vendor/assets/javascripts", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rails-0.7.0/lib/assets/javascripts"] (in /Users/mitch/railsdev/reactor/app/assets/javascripts/components/friends/state_machine.rb) from /Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/lib/opal/builder.rb:38:in `build_str' ```` ---------------------------------------------------------------------------------------------------- [23:51:33] Mitch VanDuyn(@catmando):im getting that error if I `require 'state_machine'` ---------------------------------------------------------------------------------------------------- [23:51:52] Mitch VanDuyn(@catmando):but if I don't require it, then it doesn't seem to be loading it at all ---------------------------------------------------------------------------------------------------- [23:56:00] Elia Schito(@elia):seems you're on the right path ---------------------------------------------------------------------------------------------------- [23:56:19] Elia Schito(@elia):@catmando state_machine is trying to require rubygems ---------------------------------------------------------------------------------------------------- [23:56:45] Mitch VanDuyn(@catmando):yeah that is what it looks like :-) ---------------------------------------------------------------------------------------------------- [23:56:51] Elia Schito(@elia):add an empty rubygems.rb to your assets and it should jump to the next error ;) ---------------------------------------------------------------------------------------------------- [23:56:54] Elia Schito(@elia):gotta go ---------------------------------------------------------------------------------------------------- [23:59:28] Mitch VanDuyn(@catmando):thanks... seems like state-machine is trying to use rubygems to dynamically do something related to its graphing function, which of course doesn't make any sense in the browser... I think I will have to fork a branch :-( ---------------------------------------------------------------------------------------------------- ############################## [2015-06-02] ############################## [18:21:54] Mitch VanDuyn(@catmando):the above is being tested at opalrb.org/try which reports version 0.8.1 ---------------------------------------------------------------------------------------------------- [18:31:58] Mitch VanDuyn(@catmando):the test spec is at line 368 of minitest/assertions.rb ---------------------------------------------------------------------------------------------------- [00:12:44] Elia Schito(@elia):hopefully will end up in a PR on their side avoiding usage of rubygems :) ---------------------------------------------------------------------------------------------------- [00:30:17] Jeremy Evans(@jeremyevans):@elia Any chance of the recv.JS.meth stuff making 0.8.0 final? The PR is ready now and all issues have been addressed as far as I know. ---------------------------------------------------------------------------------------------------- [01:10:37] Vais Salikhov(@vais):@elia no objections, it's long overdue IMHO. I mean if someone's like "I'm gonna try this Opal thing out to see what everybody's talking about..." and does `gem install opal` right now, they'll be getting `0.7.2`:scream: ---------------------------------------------------------------------------------------------------- [01:14:22] Vais Salikhov(@vais)::+1: on @jeremyevans https://github.com/opal/opal/pull/879 ---------------------------------------------------------------------------------------------------- [01:42:58] CJ Lazell(@cj):@jeremyevans hey, long time no speak :) Glad to see you getting into Opal! So your pull request would get rid of the need for this code I have? https://github.com/wedgeio/wedge/blob/master/lib/wedge/component.rb#L270-L294 ---------------------------------------------------------------------------------------------------- [02:36:32] Mitch VanDuyn(@catmando):does anybody know if class_eval is not fully implemented? Looking at the code it seems not, but there is no caveat in the documentation. Seems it will not work on a string, only if a block is supplied. ---------------------------------------------------------------------------------------------------- [05:24:06] Vais Salikhov(@vais):@catmando that' right, it's not. The reasoning behind this, AFAIK, is that a block can be used without needing the compiler at runtime, but a string would require one. ---------------------------------------------------------------------------------------------------- [12:56:59] Mitch VanDuyn(@catmando): Okay... I'm going to do a PR that will add the capability by requiring the parser. I.e. if parser is loaded then you get the full capability... ---------------------------------------------------------------------------------------------------- [13:54:58] Adam Beynon(@adambeynon):@catmando bare in mind, the compiler can only compile code that gets evaluated in the top/main context. It can’t take an optional context (object or class) to run against ---------------------------------------------------------------------------------------------------- [14:28:50] Mitch VanDuyn(@catmando):so far this seems to work, but only with limited testing :-) ```ruby class Module alias_method :old_class_eval, :class_eval def class_eval(*args, &block) #puts "new class eval has block?: #{!!block}" if !block cstring = "lambda {\n#{args[0]}\n}" #puts "building block from #{cstring}" #puts "testing Opal #{Opal.compile('puts "hi"')}" #puts compiled = Opal.compile(cstring) #puts "got some compiled stuff here #{compiled}" block = `eval(#{compiled})` #puts "got a nice block #{block}" end #puts "should be good to go #{block}" return old_class_eval(&block) end end ``` ---------------------------------------------------------------------------------------------------- [14:37:15] Mitch VanDuyn(@catmando):@adambeynon Should this work okay? Seems like it does... ---------------------------------------------------------------------------------------------------- [14:38:40] meh.(@meh):catmando, yeah, it's not a bad idea ---------------------------------------------------------------------------------------------------- [16:13:31] Adam Beynon(@adambeynon):@catmando yeah, but what Im saying is that any code inside that string will evaluate with ‘main’ as the self context. The class won’t be the value of `self` ---------------------------------------------------------------------------------------------------- [16:15:16] Mitch VanDuyn(@catmando):@adambeynon I thought wrapping it the lambda and then passing it back to the original class_eval would take care fo setting the context? ---------------------------------------------------------------------------------------------------- [16:16:34] Adam Beynon(@adambeynon):@catmando sorry ---------------------------------------------------------------------------------------------------- [16:16:36] Adam Beynon(@adambeynon):yes ---------------------------------------------------------------------------------------------------- [16:16:38] Adam Beynon(@adambeynon):you’re right ---------------------------------------------------------------------------------------------------- [16:16:53] Adam Beynon(@adambeynon):I missed that part :+1: ---------------------------------------------------------------------------------------------------- [16:27:24] Mitch VanDuyn(@catmando):no drama... the nice thing that i discovered is that if the parser is not present then compile returns nothing. So this method can just raise a nice error explaining that "require 'opal-parser' in order to use string blocks" ---------------------------------------------------------------------------------------------------- [16:29:21] Adam Beynon(@adambeynon):nice, yeap, sounds good to me :+1: ---------------------------------------------------------------------------------------------------- [16:43:32] Mitch VanDuyn(@catmando):hey has anybody seen this problem: Looks like you can't call super from self.included in a module. For example: ```ruby module ModuleToInclude def self.included(base) puts "about to call super" super puts "done with super" rescue Exception => e puts "whoops #{e}" end end class TheIncluder include ModuleToInclude end ``` in MRI you get: ```` about to call super done with super => TheIncluder ```` but in Opal you get ```` about to call super whoops ReferenceError: $ModuleToInclude is not defined ```` ---------------------------------------------------------------------------------------------------- [17:51:14] Mitch VanDuyn(@catmando):Folks - I'm full of obscure questions today! Is `catch symbol do ... end` not implemented? ---------------------------------------------------------------------------------------------------- [17:53:31] Mitch VanDuyn(@catmando):```ruby catch :foo do puts 'hi' end ``` fails with undefined method catch for main! ---------------------------------------------------------------------------------------------------- ############################## [2015-06-03] ############################## [00:28:27] Vais Salikhov(@vais):@catmando try/catch is not part of Opal AFAIK. Re calling super from self.included, please submit an issue. Re sending a PR for class_eval - awesome! ---------------------------------------------------------------------------------------------------- [00:29:20] Mitch VanDuyn(@catmando):@vais - well no big problem but isn't try/catch standard ruby? and there is a spec for it... ---------------------------------------------------------------------------------------------------- [00:29:50] Vais Salikhov(@vais):throw/catch I mean :sweat_smile: ---------------------------------------------------------------------------------------------------- [00:30:04] Mitch VanDuyn(@catmando):catch/throw I mean :-) ---------------------------------------------------------------------------------------------------- [00:30:36] Mitch VanDuyn(@catmando):I think we all mean the same thing :-) point being above example runs fine in mri 1.9.3 ---------------------------------------------------------------------------------------------------- [00:30:46] Vais Salikhov(@vais):yes, it is standard ruby, but that never stopped something from not being implemented in opal *yet* :wink: ---------------------------------------------------------------------------------------------------- [00:33:15] Mitch VanDuyn(@catmando):well its easy enough to implement (if you are not worried about performance), I will just include in the other PR. Its just odd because it seems like its in the parser and everything... ---------------------------------------------------------------------------------------------------- [00:38:34] Vais Salikhov(@vais):@catmando give it a shot! ---------------------------------------------------------------------------------------------------- [00:39:28] Mitch VanDuyn(@catmando):well already have - it is used in Acts As State Machine which I am getting working in Opal, so I already had to monkey patch it in :-) ---------------------------------------------------------------------------------------------------- [03:27:38] Vais Salikhov(@vais):@catmando PR plz ---------------------------------------------------------------------------------------------------- [08:02:27] Elia Schito(@elia):@catmando good to hear about throw/catch, I did a quick implementation some time ago but hadn't the time to finish it properly, looking forward to your PR : ) ---------------------------------------------------------------------------------------------------- [11:10:56] Mitch VanDuyn(@catmando):@elia mine will also be super quick and dirty ---------------------------------------------------------------------------------------------------- [11:12:07] Elia Schito(@elia)::shipit: please do it anyway, I'll add my version to the thread and hopefully we'll come up with something meaningful ---------------------------------------------------------------------------------------------------- [11:51:38] Vais Salikhov(@vais):@catmando what @elia said, just :shipit: :) ---------------------------------------------------------------------------------------------------- [13:18:28] Christian Käser(@dfyx):@elia I've just seen a really weird problem with opal-rails (might be a general rails/sprockets problem but I don't think so) ---------------------------------------------------------------------------------------------------- [13:21:16] Christian Käser(@dfyx):To reproduce: * Use rails 4.2.1 and opal-rails 0.7.0 * Run `rake assets:precompile` * Run rails in production * Visit the rails app in your browser * Stop rails and start it in development * Visit the rails app again ---------------------------------------------------------------------------------------------------- [13:21:23] Christian Käser(@dfyx):Result: "Opal already loaded. Loading twice can cause troubles, please fix your setup." ---------------------------------------------------------------------------------------------------- [13:22:35] Christian Käser(@dfyx):For some reason it loads both versions of application.js when a precompiled one exists while you're in development ---------------------------------------------------------------------------------------------------- [13:23:03] Christian Käser(@dfyx):Removing the precompiled assets and clearing the browser cache helped ---------------------------------------------------------------------------------------------------- [14:06:55] Mitch VanDuyn(@catmando):@elia @vais - pull requests for the instance/class/module_eval update, and catch/throw updates are in. ---------------------------------------------------------------------------------------------------- [14:09:28] Elia Schito(@elia):@catmando what's the PR number? ---------------------------------------------------------------------------------------------------- [14:11:32] Mitch VanDuyn(@catmando)::worried: I made a PR on myself... will fix sorry ---------------------------------------------------------------------------------------------------- [14:12:08] Elia Schito(@elia):ha! that explains why I wasn't able to find it :D ---------------------------------------------------------------------------------------------------- [14:17:31] Mitch VanDuyn(@catmando):yeah it seems like my master branch on the fork is way out of date, and has changes I did PRs for last year. I can start all over again, or you can just cherry pick the last two set of changes. Let me know ---------------------------------------------------------------------------------------------------- [14:17:56] Mitch VanDuyn(@catmando):I don't do enough PRs to do them gracefully, sorry. ---------------------------------------------------------------------------------------------------- [14:18:28] Mitch VanDuyn(@catmando):Let me know if you want me to just start over or if you can use the changes as is. ---------------------------------------------------------------------------------------------------- [14:22:54] Elia Schito(@elia):@catmando cherry pick should be fine (and easy to do) ---------------------------------------------------------------------------------------------------- [14:23:26] Mitch VanDuyn(@catmando):@elia - thanks ---------------------------------------------------------------------------------------------------- [14:23:46] Elia Schito(@elia):or alternatively you can `git rebase opal/master` ---------------------------------------------------------------------------------------------------- [14:24:23] Elia Schito(@elia):that should be fine to, @catmando let me know if you need any git assistance ;) ---------------------------------------------------------------------------------------------------- [14:58:04] meh.(@meh):catmando, ah snap, just commented about it in the pull request :P ---------------------------------------------------------------------------------------------------- [19:28:27] Mitch VanDuyn(@catmando):checkout the latest logo concept for opal-react ![opal-react](https://raw.githubusercontent.com/catprintlabs/react.rb/opal-0.8/logo3.png) ---------------------------------------------------------------------------------------------------- [19:46:44] Mitch VanDuyn(@catmando):So I have a gem I am about to publish that integrates acts-as-state-machine with opal. To use the aasm gem something needs to execute `Opal.use_gem 'aasm'` ... while I have been developing this, I just stuck the line in my rails application.rb file. Is there someplace this line should go in the gem so that the gem will work regardless of what is using it? ---------------------------------------------------------------------------------------------------- [19:47:46] Mitch VanDuyn(@catmando):Do I just put this in the gem's .rb file like `Opal.use_gem 'aasm' unless RUBY_ENGINE == 'opal'` ---------------------------------------------------------------------------------------------------- [19:52:36] Jamie Gaskins(@jgaskins):@catmando I'm pretty sure there is an optimization in the parser for `if RUBY_ENGINE != 'opal'`. The body of that `if` block won't even be compiled. I don't know if using the postfix `unless` has the same optimization. ---------------------------------------------------------------------------------------------------- [19:52:51] Jamie Gaskins(@jgaskins):@catmando To actually answer your question, though, I'm pretty sure that'll still work. :-) ---------------------------------------------------------------------------------------------------- [21:58:49] Elia Schito(@elia):@catmando the logo looks great! ---------------------------------------------------------------------------------------------------- [22:00:06] Mitch VanDuyn(@catmando):@elia thanks! ---------------------------------------------------------------------------------------------------- [22:01:59] Elia Schito(@elia):@catmando @jgaskins yes it's optimized at compiler level ---------------------------------------------------------------------------------------------------- [22:02:00] Elia Schito(@elia):https://github.com/opal/opal/blob/91f868e2d56b3467afa10fd90164da64f05bf309/lib/opal/nodes/if.rb#L10-L20 ---------------------------------------------------------------------------------------------------- [22:02:34] Mitch VanDuyn(@catmando):but it works with unless and if right? ---------------------------------------------------------------------------------------------------- [22:02:50] Elia Schito(@elia):not sure :P ---------------------------------------------------------------------------------------------------- [22:05:16] Elia Schito(@elia):`opal -Oce 'unless RUBY_ENGINE == "opal"; puts 5; end'` ---------------------------------------------------------------------------------------------------- ############################## [2015-06-04] ############################## [11:54:33] Vais Salikhov(@vais):@elia any idea what happened with `is_phantom` method? ---------------------------------------------------------------------------------------------------- [11:55:01] Vais Salikhov(@vais):mspec_phantom is failing on master for me :( ---------------------------------------------------------------------------------------------------- [12:13:24] Elia Schito(@elia):was/is a typo ---------------------------------------------------------------------------------------------------- [12:13:47] Elia Schito(@elia):I rwote is_phatnom or something like htat ---------------------------------------------------------------------------------------------------- [12:14:29] Elia Schito(@elia):@vais should be fixed on master tho ---------------------------------------------------------------------------------------------------- [12:20:01] Vais Salikhov(@vais):Sweet, rebasing with the latest master fixed it. As always, thank you, @elia! ---------------------------------------------------------------------------------------------------- [12:20:52] Elia Schito(@elia):typos are alwasy lovley :heart: ---------------------------------------------------------------------------------------------------- [12:21:57] Vais Salikhov(@vais):Speaking of which, I'm almost done with my jshint-a-palooza :sweat_smile: ---------------------------------------------------------------------------------------------------- [12:24:07] Vais Salikhov(@vais):There's a couple more compiler fixes in there to take care of some edge cases with `for-in` loop that came up when jshinting our entire spec suite. That's a lot of ruby and a lot of js, a real good smoke test for the compiler! ---------------------------------------------------------------------------------------------------- [12:25:23] Elia Schito(@elia)::top: ---------------------------------------------------------------------------------------------------- [12:41:40] Vais Salikhov(@vais):@elia travis is driving me nuts. Is it possible it is not grabbing the latest commit for the spec/corelib submodule somehow? ---------------------------------------------------------------------------------------------------- [12:42:07] Elia Schito(@elia):seems unlikely given how subm… ---------------------------------------------------------------------------------------------------- [12:42:10] Elia Schito(@elia):wait, ---------------------------------------------------------------------------------------------------- [12:42:18] Elia Schito(@elia):try removing spec/corelib from cached paths ---------------------------------------------------------------------------------------------------- [12:42:24] Elia Schito(@elia):@vais ---------------------------------------------------------------------------------------------------- [12:43:02] Vais Salikhov(@vais):Where would one manage cached paths in travis? ---------------------------------------------------------------------------------------------------- [12:43:56] Vais Salikhov(@vais):Settings > Caches I just see Pushes and Pull Requests :confused: ---------------------------------------------------------------------------------------------------- [12:44:20] Elia Schito(@elia):sorry I mean .travis.yml ---------------------------------------------------------------------------------------------------- [12:46:14] Vais Salikhov(@vais):Sorry, @elia, you mean, like, delete that line from .travis.yml and push another commit? ---------------------------------------------------------------------------------------------------- [12:46:20] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [12:46:44] Elia Schito(@elia):was an attempt I made at speeding up the build ---------------------------------------------------------------------------------------------------- [12:48:03] Vais Salikhov(@vais):Ok, keeping my fingers crossed :) ---------------------------------------------------------------------------------------------------- [12:59:27] Vais Salikhov(@vais):Nice, that did it, @elia, you da man, I never would have guessed that was the problem! ---------------------------------------------------------------------------------------------------- [12:59:31] Vais Salikhov(@vais):https://github.com/opal/opal/pull/903 ---------------------------------------------------------------------------------------------------- [12:59:50] Vais Salikhov(@vais):"Run JSHint as part of Opal test suite" ---------------------------------------------------------------------------------------------------- [13:00:42] Vais Salikhov(@vais):a.k.a jshint-a-palooza is finished :shipit: ---------------------------------------------------------------------------------------------------- [13:02:43] Vais Salikhov(@vais):Really could use @adambeynon's expertise reviewing https://github.com/vais/opal/commit/5da42a723640793c47e44009116b772105773aa9, https://github.com/vais/opal/commit/a5282a4fcb7bd712d9ca13ff733caf6eaa78e6ac, and https://github.com/vais/opal/commit/843968dd7752d6c06ba7ea1b5dd5de6afe694904 though. Holding by breath :sweat_smile: ---------------------------------------------------------------------------------------------------- [14:09:33] Jared White(@jaredcwhite):Hi folks - just a reminder that next week is Opalist week (Issue #5). :) cc @fkchang ---------------------------------------------------------------------------------------------------- [14:11:00] Adam Jahn(@ajjahn):Hey everyone, I've been interested in using opal on a project that requires a few jQuery plugins. I assume I'll need to wrap the plugins in someway (using native, or a wrapper class/module). It's seems straight forward looking at opal-jquery's source how it's wrapping jQuery, but for some reason I'm not grasping how to do it with a plugin. Can anyone point me in the right direction? Or suggest some existing jQuery plugin wrappers at which I could look? ---------------------------------------------------------------------------------------------------- [15:37:30] Adam Beynon(@adambeynon):@ajjahn if it is a simple method, which takes simple parameters you can use the expose method ---------------------------------------------------------------------------------------------------- [15:37:37] Adam Beynon(@adambeynon):e.g., with bootstrap’s modal() plugin: ---------------------------------------------------------------------------------------------------- [15:37:44] Adam Beynon(@adambeynon):`Element.expose :modal` ---------------------------------------------------------------------------------------------------- [15:38:04] Adam Beynon(@adambeynon):that assumes we can pass parameters which can be handled directly, e.g. strings, numbers etc ---------------------------------------------------------------------------------------------------- [15:38:08] Adam Beynon(@adambeynon):or no args at all ---------------------------------------------------------------------------------------------------- [15:53:58] Adam Jahn(@ajjahn):@adambeynon Intersting; I'll have a look at that! One road I traveled down for more complex methods was to create a module that implements the plugin's method(s) by shelling out to JS and then including it in the Element class: `Element.send(:include, PluginModule)`. Works, but I wouldn't know if there is a better way. ---------------------------------------------------------------------------------------------------- [17:33:52] BrandonMathis(@BrandonMathis):@RickCarlino We promoted one of our devs to a Volt developer ---------------------------------------------------------------------------------------------------- [20:24:25] Rick Carlino(@RickCarlino):@BrandonMathis I saw that. What a valiant developer indeed. ---------------------------------------------------------------------------------------------------- [21:56:24] Ryan Stout(@ryanstout):@jaredcwhite when does the next opalist come out? (The next volt release and a blog post about the new stuff is almost ready - if your interested in including it :-) ---------------------------------------------------------------------------------------------------- [22:33:36] Ryan Stout(@ryanstout):is there a good way to check if I have an opal object from opal? (as opposed to just a JS object) ---------------------------------------------------------------------------------------------------- [22:37:08] Jeremy Evans(@jeremyevans):Ugly: object.object_id rescue (it's a JS object) ---------------------------------------------------------------------------------------------------- [22:49:51] meh.(@meh):ryanstout, if it has $$class it's an opal object ---------------------------------------------------------------------------------------------------- [22:50:00] meh.(@meh):but it will obviously fail on null and undefined ---------------------------------------------------------------------------------------------------- [22:50:13] meh.(@meh):in theory BasicObject === object would work in all cases ---------------------------------------------------------------------------------------------------- [22:55:34] Ryan Stout(@ryanstout):@meh cool, even for null and undefined? ---------------------------------------------------------------------------------------------------- [22:57:56] Jeremy Evans(@jeremyevans):@ryanstout Yes, that appears to work for both null and undefined ---------------------------------------------------------------------------------------------------- [23:02:18] Ryan Stout(@ryanstout):@jeremyevans cool, thanks (guess I could have checked :-) ---------------------------------------------------------------------------------------------------- [23:07:34] meh.(@meh):ryanstout, the last one should be ---------------------------------------------------------------------------------------------------- ############################## [2015-06-05] ############################## [03:15:18] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- [10:57:56] AstonJ(@AstonJ):@pencilcheck If you want to join the Srategies team just let me know :) // @vais. Also don’t worry about Ruby not being cool atm - once we get our first killer app in Volt(/Opal) it will be again! Mark my words haha ---------------------------------------------------------------------------------------------------- [11:24:57] Adam Jahn(@ajjahn):@AstonJ Tell me more about the strategy team. ---------------------------------------------------------------------------------------------------- [11:36:06] AstonJ(@AstonJ):@ajjahn Have added you to the room Adam :) ---------------------------------------------------------------------------------------------------- [12:10:14] Elia Schito(@elia):@adambeynon out of curiosity, you connect to gitter through irc? ---------------------------------------------------------------------------------------------------- [14:56:37] Christian Käser(@dfyx):@adambeynon, @elia, @meh, @vais: I guess I owe each (and probably some others) of you a drink. The rails app that I've started this week contains exactly **one** line of (inline) javascript on the frontend, the rest is pure ruby ---------------------------------------------------------------------------------------------------- [14:56:58] meh.(@meh):dfyx, noice ---------------------------------------------------------------------------------------------------- [14:57:07] Christian Käser(@dfyx):That line: `element.selectize(#{@options.to_n})` ---------------------------------------------------------------------------------------------------- [15:00:44] Elia Schito(@elia)::clap: ---------------------------------------------------------------------------------------------------- [15:00:50] Elia Schito(@elia)::beers: ---------------------------------------------------------------------------------------------------- [15:01:50] Christian Käser(@dfyx):So if any of you happens to be nearby (southern Germany) in the next months, give me a call ;) ---------------------------------------------------------------------------------------------------- [15:11:29] Vais Salikhov(@vais):LOL @dfyx congratulations! :beers: ---------------------------------------------------------------------------------------------------- [15:22:28] Steve Tuckner(@boberetezeke):@dfyx How did you integrate with rails? Did you share code between client and server? ---------------------------------------------------------------------------------------------------- [15:24:32] Elia Schito(@elia):@vais it'd be fun to see how [this benchmark](http://devblog.avdi.org/2015/06/03/benchmarking-ruby-dispatch-strategies/?utm_source=rubyweekly&utm_medium=email) looks with opal… ---------------------------------------------------------------------------------------------------- [15:36:41] Jared White(@jaredcwhite):@ryanstout next issue is Wednesday next week, so I think you're good. Congrats on the new release! ---------------------------------------------------------------------------------------------------- [15:45:42] BrandonMathis(@BrandonMathis):How can I make https requests using opal? ---------------------------------------------------------------------------------------------------- [15:53:53] Christian Käser(@dfyx):@BrandonMathis You mean AJAX requests? ---------------------------------------------------------------------------------------------------- [15:54:30] Christian Käser(@dfyx):The easiest way should be http://www.rubydoc.info/github/opal/opal-jquery/HTTP ---------------------------------------------------------------------------------------------------- [17:23:34] BrandonMathis(@BrandonMathis):will it do https though? ---------------------------------------------------------------------------------------------------- [18:33:13] BrandonMathis(@BrandonMathis):I will try opal-jquery then ---------------------------------------------------------------------------------------------------- [18:33:16] BrandonMathis(@BrandonMathis):I just need to poll an API ---------------------------------------------------------------------------------------------------- [18:33:19] BrandonMathis(@BrandonMathis):but it uses https ---------------------------------------------------------------------------------------------------- [18:47:30] Adam Beynon(@adambeynon):@BrandonMathis yeap, https works just fine ---------------------------------------------------------------------------------------------------- [18:51:07] Adam Jahn(@ajjahn):@BrandonMathis If you're having issues making an ajax request across HTTPS and HTTP, you may be having a CORS related problem: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing ---------------------------------------------------------------------------------------------------- [20:25:45] Jared White(@jaredcwhite):Here's the link for submitting Opalist content: http://www.opalist.co/submit-link/ cc @ryanstout @fkchang @RickCarlino @AstonJ ---------------------------------------------------------------------------------------------------- [20:26:05] Ryan Stout(@ryanstout):@jaredcwhite thanks! ---------------------------------------------------------------------------------------------------- [20:26:54] Forrest Chang(@fkchang):@jaredcwhite thx for the reminder ---------------------------------------------------------------------------------------------------- [21:23:10] AstonJ(@AstonJ):@jaredcwhite :+1: ---------------------------------------------------------------------------------------------------- [00:34:49] Penn Su(@pencilcheck):I wonder if most people now would view ruby bad in web development and not sexy anymore. And if Node.JS is more hip and more sexy? ---------------------------------------------------------------------------------------------------- [01:01:12] Vais Salikhov(@vais):@pencilcheck you mean the same "most people" that view Justin Bieber as hip and sexy? Oh, wait, he's probably old hat by now :) ---------------------------------------------------------------------------------------------------- [01:03:15] Penn Su(@pencilcheck):well, some people told me that ruby is slow and old, node js is more attractive especially in some VC eyes, some college students told me this as well, they think angular nodejs is the definite future lol. ---------------------------------------------------------------------------------------------------- [01:03:32] Penn Su(@pencilcheck):so funny when I hear that, but it's a sad truth it's hard to find ruby programmers ---------------------------------------------------------------------------------------------------- [02:32:18] Vais Salikhov(@vais):It's hard to find *good* programmers in any language, and the more popular, the harder it is. In my mind, the subject of Ruby's demise has been beaten to death already. The definitive piece to me was Jeff Atwood's http://blog.codinghorror.com/why-ruby from 2013 (!): > Ruby isn't cool any more. Yeah, you heard me. It's not cool to write Ruby code any more. All the cool people moved on to slinging Scala and Node.js years ago. Our project isn't cool, it's just a bunch of boring old Ruby code. Personally, I'm thrilled that Ruby is now mature enough that the community no longer needs to bother with the pretense of being the coolest kid on the block. That means the rest of us who just like to Get Shit Done can roll up our sleeves and focus on the mission of building stuff with our peers rather than frantically running around trying to suss out the next shiny thing. That said, if you feel strongly about Ruby (Opal) advocacy, they could use your help over at https://gitter.im/AstonJ/Opal-and-Co--Strategies cc @AstonJ ---------------------------------------------------------------------------------------------------- [02:36:40] Ryan Stout(@ryanstout):@meh is the "a promise has already been chained" exception standard behavior in A+? (just curious) ---------------------------------------------------------------------------------------------------- [02:37:04] meh.(@meh):ryanstout, dunno ---------------------------------------------------------------------------------------------------- [03:15:09] Ryan Stout(@ryanstout):@meh ok ---------------------------------------------------------------------------------------------------- ############################## [2015-06-06] ############################## [02:29:10] Vais Salikhov(@vais):@elia it would indeed be fun if the `method_added` hook and stringy `class_eval` were actually available in Opal :) That said, I managed to cheat around the `method_added` issue, but `class_eval` is a show-stopper, so no code-gen benchmarks. (@catmando, btw, [this](https://github.com/catprintlabs/opal/blob/module-class-eval-compilation/opal/corelib/module.rb#L378) does not seem to work in [this](https://github.com/vais/opal/blob/benchmark-dispatch/benchmark/bm_dispatch_code_gen.rb#L26) case.) Here are the results I got on my machine for 100_000 iterations: ``` $ bundle exec opal benchmark/run.rb benchmark/bm_dispatch_bind_table.rb benchmark/bm_dispatch_hardcoded.rb benchmark/bm_dispatch_send.rb benchmark/bm_dispatch_send_table.rb benchmark/bm_dispatch_bind_table.rb 11.864 benchmark/bm_dispatch_hardcoded.rb 10.85 benchmark/bm_dispatch_send.rb 11.246 benchmark/bm_dispatch_send_table.rb 11.26 =================================== Executed 4 benchmarks in 45.778 sec ``` https://github.com/opal/opal/pull/914 ---------------------------------------------------------------------------------------------------- [02:34:48] Vais Salikhov(@vais):Notable difference from Avdi's MRI results is that there is no 2x slowness for `send` on Opal - all methods of dispatch seem to have pretty much the same performance, with hard-coded dispatch being slightly faster. Unless, of course, there's something horribly wrong with [my implementation of these benchmarks](https://github.com/opal/opal/pull/914) :wink2: ---------------------------------------------------------------------------------------------------- [03:28:54] Mitch VanDuyn(@catmando):@vais hopefullybi can have a look tomorrow ---------------------------------------------------------------------------------------------------- [10:56:49] Adam Beynon(@adambeynon):@elia sorry, missed that question - no I dont use the irc bridge, just use the gitter app ---------------------------------------------------------------------------------------------------- [11:30:19] Elia Schito(@elia):@adambeynon Hey thanks , was related to the idea of preparing you a digest ---------------------------------------------------------------------------------------------------- [14:34:15] Vais Salikhov(@vais):@adambeynon @elia good news: just noticed that on some benchmarks, Opal actually outperforms MRI (check out factorial and fib below) ``` $ ruby -v benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb test/cruby/benchmark/bm_app_fib.rb ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] test/cruby/benchmark/bm_app_answer.rb 0.051471181999659166 test/cruby/benchmark/bm_app_factorial.rb 1.0908229779961403 test/cruby/benchmark/bm_app_fib.rb 0.6289317679984379 ``` ``` $ bundle exec opal -v benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb test/cruby/benchmark/bm_app_fib.rb Opal v0.8.0.rc1 test/cruby/benchmark/bm_app_answer.rb 0.7990000247955322 test/cruby/benchmark/bm_app_factorial.rb 0.08100008964538574 test/cruby/benchmark/bm_app_fib.rb 0.10800004005432129 =============================================== Executed 3 benchmarks in 0.9880001544952393 sec ``` Easier head-to-head benchmarking will follow https://github.com/opal/opal/pull/915 ---------------------------------------------------------------------------------------------------- [15:32:37] Jamie Gaskins(@jgaskins):@vais What kind of setup is needed to run these benchmarks? I get this: ``` ➜ opal git:(master) ruby -v benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb test/cruby/benchmark/bm_app_fib.rb ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] RUBY_GC_HEAP_INIT_SLOTS=1000000 (default value: 10000) RUBY_GC_MALLOC_LIMIT=1000000000 (default value: 16777216) benchmark/run.rb:18: warning: assigned but unused variable - code /Users/jamie/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- opal/compiler (LoadError) from /Users/jamie/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from benchmark/run.rb:1:in `
' ``` ---------------------------------------------------------------------------------------------------- [15:32:55] Jamie Gaskins(@jgaskins):@vais if I run with `bundle exec`, I get `benchmark/run.rb:3:in 'require': cannot load such file -- nodejs (LoadError)` ---------------------------------------------------------------------------------------------------- [15:50:01] Vais Salikhov(@vais):@jgaskins https://github.com/opal/opal/pull/915, it's not merged into master yet :wink: ---------------------------------------------------------------------------------------------------- [15:50:53] Jamie Gaskins(@jgaskins):@vais Oooh, okay. Sweet, I'll check that out. ---------------------------------------------------------------------------------------------------- [15:58:20] Jamie Gaskins(@jgaskins):@vais Still having a few problems with it. The benchmark files don't appear to be in the repo on your branch? ---------------------------------------------------------------------------------------------------- [16:07:22] Vais Salikhov(@vais):@jgaskins looks like maybe you did not `git submodule update --init`? ---------------------------------------------------------------------------------------------------- [16:07:57] Vais Salikhov(@vais):The benchmarks are in the cruby submodule ---------------------------------------------------------------------------------------------------- [16:10:37] Jamie Gaskins(@jgaskins):Ahhh, okay. You're right, I did not run that because I've never run any `git submodule` command in my life. :-) ---------------------------------------------------------------------------------------------------- [16:12:16] Jamie Gaskins(@jgaskins):@vais Is that documented somewhere and I just missed it? ---------------------------------------------------------------------------------------------------- [16:17:20] Vais Salikhov(@vais):@jgaskins LOL, yeah, I too never used git submodules before Opal :) It's documented [here](https://github.com/opal/opal#running-tests) and [here](https://github.com/opal/opal/blob/master/CONTRIBUTING.md#quick-start) ---------------------------------------------------------------------------------------------------- [16:22:14] Jamie Gaskins(@jgaskins):Now that you point them out, I do remember seeing it. Still never ran it. :-) ---------------------------------------------------------------------------------------------------- [18:41:35] Benoit Daloze(@eregon):Hello, I am trying to run the specs with phantomjs, but opening a browser to localhost:9292 does not seem to do anything ---------------------------------------------------------------------------------------------------- ############################## [2015-06-07] ############################## [04:08:23] Vais Salikhov(@vais):@eregon `$ bundle exec rake mspec_phantom` should do it, no need to open the browser. Please let me know if that works for you... ---------------------------------------------------------------------------------------------------- [15:09:22] Benoit Daloze(@eregon):@vais Apparently not: ``` Starting MSpec Runner... [filters] Adding 42 spec files... [shared] Adding 162 spec files... [lexer] Adding 1 spec files... [parser] Adding 30 spec files... [rubyspecs] Adding 230 spec files... Thin web server (v1.6.3 codename Protein Powder) Maximum connections set to 1024 Listening on localhost:9999, CTRL+C to stop TypeError: undefined is not an object (evaluating 'args[0]') /home/eregon/code/opal/lib/mspec/opal/sprockets.js:34 in global code ``` ---------------------------------------------------------------------------------------------------- [15:10:33] Benoit Daloze(@eregon):Maybe my phantomjs 2.0.0 (compiled it on Linux following their website instructions) is wrong somehow ---------------------------------------------------------------------------------------------------- [15:30:28] Elia Schito(@elia):@eregon we're stuck on 1.9 ---------------------------------------------------------------------------------------------------- [15:34:10] Benoit Daloze(@eregon):@elia ah, I see. Anyway running with phantom is just another way to run the specs? ---------------------------------------------------------------------------------------------------- [15:38:08] Benoit Daloze(@eregon):@elia Do you plan to change to ruby/rubyspec for the submodule in opal? ---------------------------------------------------------------------------------------------------- [15:43:20] Elia Schito(@elia):Sure ---------------------------------------------------------------------------------------------------- [15:43:52] Elia Schito(@elia): you can also rake mspec_node ---------------------------------------------------------------------------------------------------- [15:45:10] Benoit Daloze(@eregon):yeah that's what I do ---------------------------------------------------------------------------------------------------- [16:05:27] DevotionGeo(@DevotionGeo):Hi everyone ---------------------------------------------------------------------------------------------------- [16:06:47] DevotionGeo(@DevotionGeo): ---------------------------------------------------------------------------------------------------- [17:28:04] Vais Salikhov(@vais):Benchmarking workflow preview (https://github.com/opal/opal/pull/915): ``` $ bundle exec rake -T | grep bench (in /Users/vais/GitHub/opal) rake bench:clear # Delete all benchmark results rake bench:opal # Benchmark Opal rake bench:report # Combined report of all benchmark results rake bench:ruby # Benchmark Ruby ``` ``` $ bundle exec rake bench:clear (in /Users/vais/GitHub/opal) rm tmp/bench/* ``` ``` $ bundle exec rake bench:opal[test/cruby/benchmark/bm_app_answer.rb,test/cruby/benchmark/bm_app_factorial.rb] (in /Users/vais/GitHub/opal) bundle exec opal benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb | tee tmp/bench/Opal1 test/cruby/benchmark/bm_app_answer.rb 0.7710001468658447 test/cruby/benchmark/bm_app_factorial.rb 0.0820000171661377 =============================================== Executed 2 benchmarks in 0.8530001640319824 sec ``` ``` $ bundle exec rake bench:ruby[test/cruby/benchmark/bm_app_answer.rb,test/cruby/benchmark/bm_app_factorial.rb] (in /Users/vais/GitHub/opal) bundle exec ruby benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb | tee tmp/bench/Ruby1 test/cruby/benchmark/bm_app_answer.rb 0.04913724200014258 test/cruby/benchmark/bm_app_factorial.rb 1.3288652799965348 =============================================== Executed 2 benchmarks in 1.3780025219966774 sec ``` ``` $ bundle exec rake bench:report (in /Users/vais/GitHub/opal) Benchmark Opal1 Ruby1 test/cruby/benchmark/bm_app_answer.rb 0.771 0.049 test/cruby/benchmark/bm_app_factorial.rb 0.082 1.329 ``` I think I will stop here. The report could be further post-processed using something like `awk` to provide other views of the data, e.g. show only those rows where a specified column is the winner, etc. Or uploaded to an online service for further analysis and longitudinal tracking of results. I think this is outside of the scope of this tool. Keep it Unix. ---------------------------------------------------------------------------------------------------- [19:54:31] Benoit Daloze(@eregon):@vais Looks good! Ahah of course app_factorial is good for opal :smile: ---------------------------------------------------------------------------------------------------- ############################## [2015-06-08] ############################## [15:05:24] Mitch VanDuyn(@catmando):that seemed weird to me as well ---------------------------------------------------------------------------------------------------- [15:05:47] Elia Schito(@elia):I know bundler improved error messages over time ---------------------------------------------------------------------------------------------------- [15:05:52] Elia Schito(@elia):maybe it's an older version ---------------------------------------------------------------------------------------------------- [15:07:59] Mitch VanDuyn(@catmando):still I think I went through this already with react.rb and it was a black hole ---------------------------------------------------------------------------------------------------- [15:08:45] Elia Schito(@elia):@catmando if you can share the Gemfile + .lock I can try to make it work locally ---------------------------------------------------------------------------------------------------- [15:10:54] Mitch VanDuyn(@catmando):i did on your private chat line ---------------------------------------------------------------------------------------------------- [15:11:24] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [18:36:09] Ryan Stout(@ryanstout):I've got a weird opal-rspec issue I was wondering if anyone could help me with or point me in the right direction to fix. I'm using RSpec.shared_context. In MRI if I have a ```let``` block in my shared_context and the same ```let``` in a describe block, the describe block is used. But in opal, the shared_context one is. ---------------------------------------------------------------------------------------------------- [18:54:38] Jared White(@jaredcwhite):@vais I'd love to promote your quote about the RubySpec examples and cruby test suite, etc. If you want to elaborate slightly more in a marketing-ish way, I'll put it in this week's Opalist issue :) ---------------------------------------------------------------------------------------------------- [20:12:34] Elia Schito(@elia):@ryanstout can it be related to the fact that current opal-rspec is 3.0.0.beta? ---------------------------------------------------------------------------------------------------- [20:42:18] Ryan Stout(@ryanstout):@elia I'm not running a pre-release and am on opal 0.7.2 ---------------------------------------------------------------------------------------------------- [21:41:27] Elia Schito(@elia):@ryanstout what I meant is that opal-rspec ships a rather outdated rspec version ---------------------------------------------------------------------------------------------------- [21:41:33] Elia Schito(@elia):which is 3.0 beta ---------------------------------------------------------------------------------------------------- [21:41:40] Ryan Stout(@ryanstout):ah ---------------------------------------------------------------------------------------------------- [21:42:21] Ryan Stout(@ryanstout):I doubt this behavior has changed recently, but I'll look through their commit log to see if I can verify ---------------------------------------------------------------------------------------------------- [01:45:20] Vais Salikhov(@vais):@eregon yeah, I was surprised that some benchmarks are actually faster on Opal. Kinda makes me doubt my code to be honest, hope I didn't mess up somewhere :sweat_smile: ---------------------------------------------------------------------------------------------------- [02:21:19] Vais Salikhov(@vais):Just a little over a week ago we celebrated Opal passing 5005 RubySpec examples. That number today is 5122 (!) Not only that, but we are running more of the cruby (MRI) test suite now, albeit that number is only a total of 43 assertions thus far. Go Opal team and everyone who has contributed! Looking forward to the next week in Opal! ---------------------------------------------------------------------------------------------------- [06:06:46] Elia Schito(@elia):✨ ---------------------------------------------------------------------------------------------------- [06:16:11] Adam Beynon(@adambeynon):@vais good work! :+1: ---------------------------------------------------------------------------------------------------- [09:31:19] Elia Schito(@elia):@adambeynon @meh @vais I think we should release v0.8.0 ---------------------------------------------------------------------------------------------------- [09:51:08] Adam Beynon(@adambeynon):@elia yeap, happy with that. what was the outcome with the native calling stuff? leaving it on master or in the release? ---------------------------------------------------------------------------------------------------- [09:51:53] Elia Schito(@elia):I'd leave them on master until we try them out on some of our apps ---------------------------------------------------------------------------------------------------- [09:54:56] Adam Beynon(@adambeynon):agreed. seeing as I havent been able to do much in regards to 0.8, want the honours of releasing? ---------------------------------------------------------------------------------------------------- [09:55:54] Elia Schito(@elia):thanks for the offer, but if you can do that I'd prefer as I'm a bit busy here at work :) ---------------------------------------------------------------------------------------------------- [09:56:55] Adam Beynon(@adambeynon):ha ---------------------------------------------------------------------------------------------------- [09:56:58] Adam Beynon(@adambeynon):no problem ---------------------------------------------------------------------------------------------------- [09:57:08] Adam Beynon(@adambeynon):is opal-rails etc working with master ---------------------------------------------------------------------------------------------------- [09:57:36] Elia Schito(@elia):_just realized "on the fence" doesn't mean what I thought :)_ ---------------------------------------------------------------------------------------------------- [09:57:55] Elia Schito(@elia):@adambeynon yes, I just have some problems with travis file-system ---------------------------------------------------------------------------------------------------- [09:58:43] Elia Schito(@elia):but just for running specs, so, even if it turns out to be something else I don't think it should be a problem ---------------------------------------------------------------------------------------------------- [14:16:55] Mitch VanDuyn(@catmando):is there a way in the browser to tell what version of opal happens to be running? ---------------------------------------------------------------------------------------------------- [14:35:44] Adam Jahn(@ajjahn):@catmando `console.log(Opal.RUBY_ENGINE_VERSION)` ---------------------------------------------------------------------------------------------------- [14:36:39] Mitch VanDuyn(@catmando):@ajjahn thanks! ---------------------------------------------------------------------------------------------------- [14:38:45] Adam Jahn(@ajjahn):You bet! ---------------------------------------------------------------------------------------------------- [14:47:48] Mitch VanDuyn(@catmando):what is the state of 0.8? I am just considering moving to that from 0.7.2... wondering how stable it is? Should we wait a bit or go for it. I have a a team using it, so I don't want to be too disruptive :-) to them ---------------------------------------------------------------------------------------------------- [14:49:50] Elia Schito(@elia):@catmando I'm using it on a site we have in production, but any other feedback would be useful ---------------------------------------------------------------------------------------------------- [14:49:56] Elia Schito(@elia):@catmando rails? ---------------------------------------------------------------------------------------------------- [14:50:07] Mitch VanDuyn(@catmando):@elia yes rails ---------------------------------------------------------------------------------------------------- [14:50:32] Mitch VanDuyn(@catmando):Okay well first step is I will give it a whirl, and see if all the tests pass :-) ---------------------------------------------------------------------------------------------------- [14:50:55] Elia Schito(@elia):@catmando should be fine, possible issues are related to opal-rspec ---------------------------------------------------------------------------------------------------- [14:50:59] Elia Schito(@elia):please let me know ---------------------------------------------------------------------------------------------------- [14:51:25] Mitch VanDuyn(@catmando):So perhaps tests won't pass :-( ---------------------------------------------------------------------------------------------------- [14:51:51] Elia Schito(@elia):it's more like checking if they start at all ---------------------------------------------------------------------------------------------------- [14:55:28] Mitch VanDuyn(@catmando):@elia so I get Could not find gem 'opal (~> 0.7.0) ruby', which is required by gem 'opal-rails (>= 0) ruby', in any of the sources. do I have to also pull in a different opal-rails version? ---------------------------------------------------------------------------------------------------- [14:55:56] Elia Schito(@elia):``` gem 'opal-rails', github: 'opal/opal-rails' gem 'opal', github: 'opal/opal' gem 'opal-haml', github: 'opal/opal-haml' gem 'opal-rspec', github: 'opal/opal-rspec' gem 'opal-jquery', github: 'opal/opal-jquery' ``` ---------------------------------------------------------------------------------------------------- [14:56:08] Elia Schito(@elia):@catmando that's what I'm using right now ---------------------------------------------------------------------------------------------------- [14:58:49] Mitch VanDuyn(@catmando):we are still on rails 3.2 .... i think that is problematic? I am getting ---------------------------------------------------------------------------------------------------- [14:59:11] Mitch VanDuyn(@catmando):```` Bundler could not find compatible versions for gem "sprockets": In snapshot (Gemfile.lock): sprockets (2.2.3) In Gemfile: opal-rspec (>= 0) x86-mingw32 depends on opal (< 0.9, >= 0.7.0) x86-mingw32 depends on sprockets (~> 3.1) x86-mingw32 Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict. ```` ---------------------------------------------------------------------------------------------------- [14:59:45] Elia Schito(@elia):Not sure if sprockets 3 is supported on rails 3… ---------------------------------------------------------------------------------------------------- [14:59:57] Mitch VanDuyn(@catmando):I don't think easily ---------------------------------------------------------------------------------------------------- [15:00:03] Elia Schito(@elia):try with `bundle update sprockets` ---------------------------------------------------------------------------------------------------- [15:00:37] Elia Schito(@elia):My current app is 4.1 ---------------------------------------------------------------------------------------------------- [15:04:27] Mitch VanDuyn(@catmando):no joy - oh well :-( ```` Bundler could not find compatible versions for gem "sprockets": In Gemfile: sprockets (~> 2.2.1) x86-mingw32 sprockets (3.1.0) ```` ---------------------------------------------------------------------------------------------------- [15:04:38] Elia Schito(@elia)::( ---------------------------------------------------------------------------------------------------- [15:05:06] Elia Schito(@elia):@catmando do you have sprockets directly in the gemfile? ---------------------------------------------------------------------------------------------------- [15:05:13] Mitch VanDuyn(@catmando):nope ---------------------------------------------------------------------------------------------------- ############################## [2015-06-09] ############################## [03:42:05] Vais Salikhov(@vais):@jaredcwhite, LOL, that was me at my most marketing-ish-est, not sure I get more marketing-ish than that :)In other news, opal/rubyspec is in the process of merging with the canonical rubyspec fork used by ruby itself, ruby/rubyspec. Even though we've been pulling latest changes from ruby/rubyspec for a little while now to keep opal/rubyspec up-to-date, a few days ago @eregon kindly landed a hand to merge our changes into ruby/rubyspec and extended an invitation for Opal to use and contribute to ruby/rubyspec directly (i.e. opal/rubyspec is going away). ---------------------------------------------------------------------------------------------------- [05:10:33] Vais Salikhov(@vais):...and opal/rubyspec is gone, we are now working with :sparkles: the canonical ruby/rubyspec :sparkles: directly https://github.com/opal/opal/commit/e573e8f6417071e158835cce711ebb9a208de967 ---------------------------------------------------------------------------------------------------- [07:58:50] Vais Salikhov(@vais):https://github.com/opal/opal/blob/master/CONTRIBUTING.md#benchmarking ---------------------------------------------------------------------------------------------------- [07:58:53] Vais Salikhov(@vais):*"Everything you wanted to know about benchmarking Opal but were afraid to ask"* ---------------------------------------------------------------------------------------------------- [07:59:04] Vais Salikhov(@vais)::wink: ---------------------------------------------------------------------------------------------------- [08:07:31] Elia Schito(@elia):great! ---------------------------------------------------------------------------------------------------- [12:21:17] Elia Schito(@elia):@adambeynon https://www.youtube.com/playlist?list=PLE7tQUdRKcyYo1VtPcjHhtPxQ0cTzq5Tn anything I shuold absolutely watch? (excluding sandi and tom stuart) ---------------------------------------------------------------------------------------------------- [15:20:45] Mitch VanDuyn(@catmando):hello - I just upgraded from opal 0.6 to 0.7 and opal-rspec is throwing this error: ---------------------------------------------------------------------------------------------------- [15:20:51] Mitch VanDuyn(@catmando):`Uncaught TypeError: Cannot set property 'hash' of undefined kernel.rb:482Uncaught NameError: uninitialized constant Object::RSpec` ---------------------------------------------------------------------------------------------------- [15:30:10] Mitch VanDuyn(@catmando):just moved back to opal 0.6 and it works, then moved to opal 0.7 and it fails ---------------------------------------------------------------------------------------------------- [15:30:40] Christian Käser(@dfyx):@elia Is it intended that opal-jquery doesn't wrap `replaceWith()`? ---------------------------------------------------------------------------------------------------- [15:30:59] Elia Schito(@elia):@dfyx consider that a PR opportunity ;) ---------------------------------------------------------------------------------------------------- [15:31:16] Christian Käser(@dfyx):Will do ---------------------------------------------------------------------------------------------------- [15:31:35] Elia Schito(@elia):@catmando sometimes trashing tmp/cache/assets and restarting the server helps ---------------------------------------------------------------------------------------------------- [15:32:42] Mitch VanDuyn(@catmando):@elia - this is just a simple rack server ---------------------------------------------------------------------------------------------------- [15:33:01] Mitch VanDuyn(@catmando):is there an equivilent cache? ---------------------------------------------------------------------------------------------------- [15:34:14] Elia Schito(@elia):oh, I guess no ---------------------------------------------------------------------------------------------------- [15:42:19] Mitch VanDuyn(@catmando):do you have to require opal some place in 0.7? ---------------------------------------------------------------------------------------------------- [15:44:02] Mitch VanDuyn(@catmando):for what its worth here is config.ru ```ruby require 'bundler' Bundler.require require "opal-rspec" Opal.append_path File.expand_path('../spec', __FILE__) run Opal::Server.new { |s| s.main = 'opal/rspec/sprockets_runner' s.append_path 'spec' s.append_path 'spec/vendor' s.append_path Opal::React.bundled_path s.debug = true s.index_path = 'spec/reactjs/index.html.erb' } ``` ---------------------------------------------------------------------------------------------------- [15:52:37] Mitch VanDuyn(@catmando):and when I change so that it reads just like the instructions on the github page I get this: http://localhost:9292/assets/opal/rspec/sprockets_runner.js 404 not found!!!! ---------------------------------------------------------------------------------------------------- [15:53:26] Elia Schito(@elia):sorry, but can't help very much right now ---------------------------------------------------------------------------------------------------- [16:00:14] Mitch VanDuyn(@catmando):understood, but man I hope somebody can give me a clue what is going on... going to try a fresh setup from scratch ---------------------------------------------------------------------------------------------------- [16:33:24] Forrest Chang(@fkchang):@catmando I've not done it as a simple rack server, but from experience w/using in opal-rails, I'd say the message is pretty clear, that it can't find the sprockets_runner.js. You specify it as the main file, so either you have your own copy of it, or you want to access the sprockets_runner in opal-rspec gem, which means you'll have to add it to opal's load path so it finds it as you've specified it (or specify it differently) ---------------------------------------------------------------------------------------------------- [17:27:48] Mitch VanDuyn(@catmando):@fkchang head is spinning... I'll take any suggestion. Right now I can get rid of that error (sprockets runner not found) by requiring 'opal-rspec' but perhaps that is what is causing the other breakages. I just don't fully follow your suggestion, I got that I have to include sprockets_runner.js someplace, but where exactly, and where do I get it? ---------------------------------------------------------------------------------------------------- [17:27:56] Mitch VanDuyn(@catmando):Sorry to be dim :-) ---------------------------------------------------------------------------------------------------- [17:28:51] Mitch VanDuyn(@catmando):I mean I see a "spec_runner.js" in opal_spec/vendor... ---------------------------------------------------------------------------------------------------- [17:30:44] Mitch VanDuyn(@catmando):I see the .rb.erb file, so I guess I can bodge this up someway... ---------------------------------------------------------------------------------------------------- [18:37:39] Mitch VanDuyn(@catmando):Hi ---------------------------------------------------------------------------------------------------- [19:54:38] Forrest Chang(@fkchang):@catmando ``` s.main = 'opal/rspec/sprockets_runner'``` specifies the file for Opal::Server to run - somehow the you need the spec files, the class files, need to get loaded and rspec needs to get kicked off. This can be done in a number of ways, all via the code file run, or in the index_path file or some combination of both (i.e. load the files in the index, kick off the suite in the js.rb). That being said, IIRC, there are sprocket_runners in both opal-rspec and opal-rails (at least to facilitate being able to run a rake task and to hit the /opal_spec in the app itself, you can imagine the 2 end points would be different). Since you are not using opal-rails, I would have to assume the sprockets_runner.js.rb you want to run is the one in opal-rspec gem. Re: your error I can't tell if```uninitialized constant Object::RSpec``` is the problem, but I would suspect that maybe you are missing an opal-rspec reference. It might be one of those cases where you need to require it on the server side for 1 thing, and on the client for the other half ---------------------------------------------------------------------------------------------------- [19:57:55] Mitch VanDuyn(@catmando):@fkchang. Hey thanks a lot. Meanwhile I looked at another gem source I have that DOES have seem to work okay (opal-aasm) and I see that the developer of react.rb has some things I don't understand in the way files are required. I think that may be causing the problem. Thanks again, I'll let everybody know what I figure out for future reference. ---------------------------------------------------------------------------------------------------- [20:18:41] Mitch VanDuyn(@catmando):@/all So can somebody explain why (and how it works) I see opal gem structures like this: top-level ``` top-level | - lib | - opal | - opal-gemname.rb | - opal | - opal | - opal-remname.rb ``` Am I right in guessing that the code in the lib directory only runs on the server, while in outer opal directory is common? I have been doing an ```ruby if RUBY_ENGINE = = 'opal' ... else ... end ``` to achieve this, but I am looking at some other gems it does not have the RUBY_ENGINE == 'opal' anywhere, but yet I am pretty sure some of these gems (like opal-rspec) must have some differences between server and client. I think this is at this is related to why I can't get react.rb to run opal-rspec. I have an older version of react.rb that has the `if RUBY_ENGINE... ` and it works fine. Any help appreciated! ---------------------------------------------------------------------------------------------------- [20:53:57] Mitch VanDuyn(@catmando):figured it out... you have to use latest released opal-rspec with latest released opal. Gemfile was locked at opal-rspec 3x... ---------------------------------------------------------------------------------------------------- [21:05:20] Jared White(@jaredcwhite):@catmando the lib ... opal structure is actually an older convention. Using the if conditional within /lib alone is newer and preferred AFAIK. ---------------------------------------------------------------------------------------------------- ############################## [2015-06-10] ############################## [22:54:45] Srikanth Kuppuswamy(@Hospira-MedNet):direct call from .JS file ---------------------------------------------------------------------------------------------------- [22:56:59] Srikanth Kuppuswamy(@Hospira-MedNet):@elia or anyone plz help me out on this ---------------------------------------------------------------------------------------------------- [01:26:24] Forrest Chang(@fkchang):@jaredcwhite submitted my opalist entry ---------------------------------------------------------------------------------------------------- [09:07:39] Christian Käser(@dfyx):@elia I found some other weird behavior with opal-jquery ---------------------------------------------------------------------------------------------------- [09:08:46] Christian Käser(@dfyx):Assume I have the following html: `...` ---------------------------------------------------------------------------------------------------- [09:09:28] Christian Käser(@dfyx):Now I run `Element.find('#foobar').data('some-object')` ---------------------------------------------------------------------------------------------------- [09:10:34] Christian Käser(@dfyx):jQuery parses the JSON and returns a JS object. opal-jquery doesn't wrap this object and just returns it ---------------------------------------------------------------------------------------------------- [09:11:24] Adam Beynon(@adambeynon):@dfyx yeah, its a bug. until now Element#data assumed it was either a string or numeric - it needs to check for js objects and wrap them in a hash ---------------------------------------------------------------------------------------------------- [09:12:07] Christian Käser(@dfyx):@adambeynon What's the best way to wrap an object in a hash? Couldn't find it in the documentation ---------------------------------------------------------------------------------------------------- [09:12:42] Adam Beynon(@adambeynon):@dfyx I think `Hash.new(js_object)` should do the trick ---------------------------------------------------------------------------------------------------- [09:13:19] Christian Käser(@dfyx):Ah, thanks ---------------------------------------------------------------------------------------------------- [09:14:33] Christian Käser(@dfyx):Appears to work ---------------------------------------------------------------------------------------------------- [09:14:47] Christian Käser(@dfyx):If I find the time later today, I'll send a pull request ---------------------------------------------------------------------------------------------------- [09:14:58] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [10:15:46] Christian Käser(@dfyx):Alright, I got it: opal + raphael.js == pie charts in 50 lines of code ---------------------------------------------------------------------------------------------------- [13:13:30] Mitch VanDuyn(@catmando):does anybody know? in 0.6 you could say get klass._proto but in 0.7.2 it seems like ._proto is no longer there... does anything replace it that I could grab? ---------------------------------------------------------------------------------------------------- [13:20:32] Elia Schito(@elia):@catmando it's `$$proto` now ---------------------------------------------------------------------------------------------------- [13:20:58] Elia Schito(@elia):that's because otherwise _proto was accessible as `@_proto` from the class instance ---------------------------------------------------------------------------------------------------- [13:21:14] Elia Schito(@elia):the same is true for other internal properties ---------------------------------------------------------------------------------------------------- [13:23:44] Mitch VanDuyn(@catmando):@elia, gotcha. so anything _foo became $$foo? Thanks ---------------------------------------------------------------------------------------------------- [13:24:17] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [14:19:14] Elia Schito(@elia):@jaredcwhite props to the opalist sponsor! ---------------------------------------------------------------------------------------------------- [14:24:42] Rick Carlino(@RickCarlino):@jaredcwhite Yeah! I love having one place to get my Opal fix every week. Keep up the good work. ---------------------------------------------------------------------------------------------------- [14:45:54] Elia Schito(@elia):@ryanstout CFP for https://jsremoteconf.com seems open ---------------------------------------------------------------------------------------------------- [16:29:40] Jared White(@jaredcwhite):@elia Haha, well...the sponsor is me. :) More specifically, my newly branded consulting company. But maybe at some point I can get a sponsor or two elsewhere to help support the newsletter and other Opal-related projects. :) ---------------------------------------------------------------------------------------------------- [16:30:15] Jared White(@jaredcwhite):@RickCarlino Thanks Rick! Every other week for now, but maybe down the road we can do every week when there's enough interesting news and I have enough time. :) ---------------------------------------------------------------------------------------------------- [20:37:36] Srikanth Kuppuswamy(@Hospira-MedNet):i am new to opal, i am looking something where i can call my existing ruby methods in a protractor test (.JS file). ---------------------------------------------------------------------------------------------------- [20:38:13] Srikanth Kuppuswamy(@Hospira-MedNet): when i read this page - http://opalrb.org/docs/compiled_ruby/ - Ruby from Javascript, so i have the class Foo in a ruby file.. how i need to make a call .JS file ---------------------------------------------------------------------------------------------------- [20:39:05] Srikanth Kuppuswamy(@Hospira-MedNet):can anyone help me ---------------------------------------------------------------------------------------------------- [22:18:08] Elia Schito(@elia):@Hospira-MedNet you an use the command line ---------------------------------------------------------------------------------------------------- [22:18:37] Elia Schito(@elia):opal -c foo.rb > foo.js ---------------------------------------------------------------------------------------------------- [22:27:29] Srikanth Kuppuswamy(@Hospira-MedNet):@elia, i called like you said in a terminal but no result.. ---------------------------------------------------------------------------------------------------- [22:32:31] Srikanth Kuppuswamy(@Hospira-MedNet):i got some exceptions.. C:/Ruby/lib/ruby/gems/1.9.1/gems/opal-0.7.2/lib/opal/builder.rb:45:in `rescue in build_str': A file required by "srikanth.rb" wasn't found. (Opal::Builder::Miss ingRequire) can't find file: "Opal" in ["C:/Ruby/lib/ruby/gems/1.9.1/gems/opal-0.7.2/opal", "C:/Ruby/lib/ruby/gems/1.9.1/gems/opal-0.7.2/stdlib", "C:/Ruby/lib/ruby/gems/1.9 .1/gems/opal-0.7.2/lib"] ---------------------------------------------------------------------------------------------------- [22:32:49] Srikanth Kuppuswamy(@Hospira-MedNet):@elia can u help me on this ---------------------------------------------------------------------------------------------------- [22:33:46] Elia Schito(@elia):"""can't find file: "Opal" in """ ---------------------------------------------------------------------------------------------------- [22:34:10] Elia Schito(@elia):are you trying to require Opal with the capital letter? ---------------------------------------------------------------------------------------------------- [22:34:31] Elia Schito(@elia):it should be opal (lowercase ) ---------------------------------------------------------------------------------------------------- [22:34:58] Srikanth Kuppuswamy(@Hospira-MedNet):oh i have in the ruby file as require 'Opal' ---------------------------------------------------------------------------------------------------- [22:35:16] Elia Schito(@elia):That's the problem ---------------------------------------------------------------------------------------------------- [22:35:21] Srikanth Kuppuswamy(@Hospira-MedNet):i changed and executed now ---------------------------------------------------------------------------------------------------- [22:35:40] Srikanth Kuppuswamy(@Hospira-MedNet):now no exception but no result in terminal ---------------------------------------------------------------------------------------------------- [22:36:03] Elia Schito(@elia):It should have created a foo.js file ---------------------------------------------------------------------------------------------------- [22:36:35] Elia Schito(@elia):that you can use in your browser ---------------------------------------------------------------------------------------------------- [22:36:40] Elia Schito(@elia):gotta go ---------------------------------------------------------------------------------------------------- [22:36:43] Elia Schito(@elia):bye ---------------------------------------------------------------------------------------------------- [22:37:17] Srikanth Kuppuswamy(@Hospira-MedNet):oh elia whn u will be online again ---------------------------------------------------------------------------------------------------- [22:37:59] Srikanth Kuppuswamy(@Hospira-MedNet):plzz or let me know can i send an email to u.. with my doubts plzz ---------------------------------------------------------------------------------------------------- [22:47:05] Srikanth Kuppuswamy(@Hospira-MedNet):then when we will call like this - Opal.Foo.$new().$bar(); ---------------------------------------------------------------------------------------------------- [22:48:22] Elia Schito(@elia):Write here or post a question on stack overflow with the tag opalrb ---------------------------------------------------------------------------------------------------- [22:48:42] Elia Schito(@elia):someone will reply ;) ---------------------------------------------------------------------------------------------------- [22:50:02] Srikanth Kuppuswamy(@Hospira-MedNet):so i read like we can make a call like above from javascript , how? ---------------------------------------------------------------------------------------------------- [22:51:18] Srikanth Kuppuswamy(@Hospira-MedNet):actually i need to use the available functions in ruby in protractor test which is in .JS file ---------------------------------------------------------------------------------------------------- [22:52:45] Srikanth Kuppuswamy(@Hospira-MedNet):when i say available functions which we have written already based on features ---------------------------------------------------------------------------------------------------- [22:54:20] Srikanth Kuppuswamy(@Hospira-MedNet):so i am looking one example where some methods available in ruby class. how i can call those methods from .JS file using opal ---------------------------------------------------------------------------------------------------- ############################## [2015-06-11] ############################## [00:19:16] Forrest Chang(@fkchang):@Hospira-MedNet I think http://opalrb.org/docs/compiled_ruby/#ruby-from-javascript will tell you what u need ---------------------------------------------------------------------------------------------------- [05:54:31] Srikanth Kuppuswamy(@Hospira-MedNet):@fkchang . Thanks i have checked the link and this is my question - http://stackoverflow.com/questions/30769063/how-to-call-ruby-methods-directly-in-protractor-tests-js-file-using-opal ---------------------------------------------------------------------------------------------------- [05:54:50] Srikanth Kuppuswamy(@Hospira-MedNet):can any answer share your thoughts on this ---------------------------------------------------------------------------------------------------- [06:05:38] Forrest Chang(@fkchang):@Hospira-MedNet not sure what you don't understand, if you compile the Foo class, then the way you would access it is ```Opal.Foo.$new().$bar();``` ---------------------------------------------------------------------------------------------------- [06:06:56] Forrest Chang(@fkchang):Because classes get hung of the Opal object in JS, thus the ```Opal.Foo```, and opal methods get prefixed with $, so to create a Foo object, you'd do ```Opal.Foo.$new()```, and you would just call $bar() off of that ---------------------------------------------------------------------------------------------------- [06:07:59] Forrest Chang(@fkchang):```Opal.Foo.$new().$bar();``` is basically what ```Foo.new.bar``` would get compiled to ---------------------------------------------------------------------------------------------------- [06:09:52] Forrest Chang(@fkchang):Actually, what gets compiled is ```return $scope.get('Foo').$new().$bar();``` after all the opal setup, but if you wanted the equivalent of Foo.new.bar in javascript, you'd write ```Opal.Foo.$new().$bar();``` ---------------------------------------------------------------------------------------------------- [06:51:16] Srikanth Kuppuswamy(@Hospira-MedNet):@fkchang , So first we need to compile the ruby code in .rb file , so i called like Opal.compile(Foo). But i am getting some exceptions ---------------------------------------------------------------------------------------------------- [07:02:44] Forrest Chang(@fkchang):@adambeynon @meh @elia @vais shouldn't an instance Native::Object return something other than nil for methods? Seems more consistent behavior ---------------------------------------------------------------------------------------------------- [08:02:37] Elia Schito(@elia):@fkchang can you provide an example? (just to help me understand) ---------------------------------------------------------------------------------------------------- [08:17:58] Srikanth Kuppuswamy(@Hospira-MedNet):@fkchang let me know whether am i compiling correctly. If not , Please let me know on how to compile class Foo ---------------------------------------------------------------------------------------------------- [12:11:41] Vais Salikhov(@vais):@adambeynon @elia guys, with arity check enabled (which is how specs are running), the following fails with an `ArgumentError`, `wrong number of arguments(1 for 0)` ```ruby def test puts 'ok' end a = nil test(*a) ``` But this works on MRI just fine. I think splat with a `nil` is a special case. Any idea where I could begin fixing this? I need this to work to pass some new rubyspecs... ---------------------------------------------------------------------------------------------------- [12:25:32] Srikanth Kuppuswamy(@Hospira-MedNet):can anyone give me some suggestions on my question plzz ---------------------------------------------------------------------------------------------------- [12:31:45] Vais Salikhov(@vais):@Hospira-MedNet in your stackoverflow question it looks like you are answering your own question. It's not clear what exactly is your question?? ---------------------------------------------------------------------------------------------------- [12:42:34] Srikanth Kuppuswamy(@Hospira-MedNet):@vais my question is how i can call ruby method in my protractor tests (.JS file) ---------------------------------------------------------------------------------------------------- [12:43:21] Srikanth Kuppuswamy(@Hospira-MedNet):@fkchang told me that you need to compile first.. so i called like Opal.compile(Foo) in my ruby file but i got some exceptions ---------------------------------------------------------------------------------------------------- [12:51:23] Vais Salikhov(@vais):@Hospira-MedNet the easiest way for you to compile `file.rb` into `file.js` is to write this on the command line: `opal -c file.rb > file.js` Now you can include `file.js` into your html page using a script tag, like any other javascript file. Make sense? ---------------------------------------------------------------------------------------------------- [12:59:21] Srikanth Kuppuswamy(@Hospira-MedNet):i did i am getting other general opal related stuff with at the end our class name is now converted into function name ---------------------------------------------------------------------------------------------------- [12:59:53] Srikanth Kuppuswamy(@Hospira-MedNet):as you said using script tag we can call this .js file ---------------------------------------------------------------------------------------------------- [13:00:24] Srikanth Kuppuswamy(@Hospira-MedNet):so i can call directly like this Opal.Foo.$new().$bar(); in .JS file am i right? ---------------------------------------------------------------------------------------------------- [13:16:41] Vais Salikhov(@vais):@Hospira-MedNet yep, what you get in that .js file is all of Opal compiled to javascript + your ruby compiled to javascript. Now if you include this file into your page, other javascript included after this file should be able to call into your ruby-compiled-to-js code. Hope this helps! ---------------------------------------------------------------------------------------------------- [14:34:37] CJ Lazell(@cj):@vais found another bug to do with procs ---------------------------------------------------------------------------------------------------- [14:35:54] CJ Lazell(@cj):https://github.com/opal/opal/issues/932 ---------------------------------------------------------------------------------------------------- [14:36:27] CJ Lazell(@cj):I created an opalrb gist with a refined example ---------------------------------------------------------------------------------------------------- [15:30:33] Vais Salikhov(@vais):@cj wait, that's the refined example?! Oh... ---------------------------------------------------------------------------------------------------- [15:30:45] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [16:20:48] Forrest Chang(@fkchang):@elia file:///Users/fkchang/src/opal-irb/index-embeddable.html#code:w%20%3D%20Native(%60window%60)%0Aw.methods ---------------------------------------------------------------------------------------------------- [16:21:03] Forrest Chang(@fkchang):sorry, lemme give you the github.io link ---------------------------------------------------------------------------------------------------- [16:21:42] Forrest Chang(@fkchang):@elia http://fkchang.github.io/opal-irb/index-embeddable.html#code:w%20%3D%20Native(%60window%60)%0Aw.methods ---------------------------------------------------------------------------------------------------- [16:22:46] Forrest Chang(@fkchang):If I were to guess what's happening, Native::Object inherits from BasicObjects and since it may not support methods(), it's instead call the methods property on @navtive, which is generally null ---------------------------------------------------------------------------------------------------- [16:22:58] Elia Schito(@elia):@fkchang ```Native(`{methods: 123}`)``` ---------------------------------------------------------------------------------------------------- [16:23:07] Elia Schito(@elia):that's supported on the other hand ---------------------------------------------------------------------------------------------------- [16:23:18] Forrest Chang(@fkchang):The reason I think it's inconsistent is that you expect ruby objects to know what their methods are ---------------------------------------------------------------------------------------------------- [16:23:21] Elia Schito(@elia):not sure what's the right thing to do ---------------------------------------------------------------------------------------------------- [16:24:16] Forrest Chang(@fkchang):it's a pain to have to do an ```if obj.is_a?(Native::Object) blah``` and ``` if native?(obj)``` ---------------------------------------------------------------------------------------------------- [16:24:44] Forrest Chang(@fkchang):kind of defeats the `everything is an object` beauty of Ruby ---------------------------------------------------------------------------------------------------- [16:28:07] Forrest Chang(@fkchang):@elia on a different front when would one want to do ```ruby class Wrapper < `JsClass` alias_native :method_name def initialize `return new JsClass()` end end ``` vs ```ruby class Wrapper include Native def initialize @native = `new JsClass()` end end ``` ---------------------------------------------------------------------------------------------------- [16:31:55] Forrest Chang(@fkchang):@Hospira-MedNet can you make a gist so we can see what your doing? ---------------------------------------------------------------------------------------------------- [18:18:37] Mitch VanDuyn(@catmando):Folks... does anybody have some concepts for internationalization? We are hitting a bunch of code that depends on internationalization, and are just wondering if anybody has come up with a general solution for getting this stuff to the browser for opal code to use... ---------------------------------------------------------------------------------------------------- [22:03:00] Michał Kalbarczyk(@fazibear):Hi, I’m trying to make `opal-slim` work but get `NoMethodError: undefined method `indent_dynamic' for Temple::Utils`. Every one use it ? Thanks ---------------------------------------------------------------------------------------------------- [22:08:13] Michał Kalbarczyk(@fazibear):@jgaskins, any clues ? ---------------------------------------------------------------------------------------------------- [22:15:20] Mitch VanDuyn(@catmando):I am trying to make a directory in rails (lets call it app/shared) that will contain ruby code that rails will find on the server (I think this is the easy part) but also that will get compiled and downloaded with the assets. Any clues? (anybody else?) ---------------------------------------------------------------------------------------------------- [22:17:48] Michał Kalbarczyk(@fazibear):@catmando maybe that will help ``` # config/initializers/opal.rb Rails.application.config.assets.paths << Rails.root.join('app', ’shared').to_s ``` ---------------------------------------------------------------------------------------------------- [22:25:07] Mitch VanDuyn(@catmando):@fazibear - that was it! works great. thanks ---------------------------------------------------------------------------------------------------- [22:33:22] Mitch VanDuyn(@catmando):but now the problem is (not a big problem) I want to just pull in all the files in that shared directory without requiring them. I would like to keep the require_tree directive in the assets folder, but I don't think there is a way. I guess will have to add a file in the shared directory called shared.rb that just has a require_tree "." or something? ---------------------------------------------------------------------------------------------------- [22:46:21] Forrest Chang(@fkchang):@catmando don't have time to write it now, but I've been meaning to blog about how we approached the shared code in our production app ---------------------------------------------------------------------------------------------------- [22:47:07] Mitch VanDuyn(@catmando):@fkchang - any quick hints? We are right there and I don't want to reinvent the wheel. ---------------------------------------------------------------------------------------------------- [22:49:07] Forrest Chang(@fkchang):there were some issues, we had to resolve, but in short, we made a lib/client_and_server directory that we softlinked into app/assets/javascripts ---------------------------------------------------------------------------------------------------- [22:49:26] Forrest Chang(@fkchang):we did have some load order issues that we had to specifically specify require order, which may or may not hit you ---------------------------------------------------------------------------------------------------- [22:50:23] Mitch VanDuyn(@catmando):So far I am setting up a directory shared, which will contain ruby code that will get included in the server as well as the client... So for works okay, except I wanted to do this: ```ruby class Jobs # bunch of stuff that only is relevant to the server end ``` and in the shared directory ```ruby class Jobs # stuff related to both client and server end ``` The only problem is that rails will only find one (I think) so one has to require the other... not a big deal I guess ---------------------------------------------------------------------------------------------------- [22:51:22] Mitch VanDuyn(@catmando):why did you go with the softlink approach and not just a directory at the top level (i.e. app/client_and_server) ---------------------------------------------------------------------------------------------------- [22:52:13] Forrest Chang(@fkchang):I would put the common code in the lib/client_and_server dir, and the extend the class respectively in the appropriate server/link ---------------------------------------------------------------------------------------------------- [22:53:39] Forrest Chang(@fkchang):re softlink, I guess we could've done that. We messed around w/autoloader no autoloading on both front and back end for various things, ended up with something different than we started with ---------------------------------------------------------------------------------------------------- [22:53:49] Forrest Chang(@fkchang):could've worked w/the toplevel dir ---------------------------------------------------------------------------------------------------- [22:54:28] Forrest Chang(@fkchang):I'd be curious to what @elia and @adambeynon have done, they've deployed the most opal rails apps of anyone ---------------------------------------------------------------------------------------------------- [22:57:09] Mitch VanDuyn(@catmando):@fkchang - yeah I guess the extend will be okay, but it would be nice to just have it be automagic ---------------------------------------------------------------------------------------------------- [23:13:15] Forrest Chang(@fkchang):u could check the ruby engine for opal in a single file ---------------------------------------------------------------------------------------------------- [23:13:32] Forrest Chang(@fkchang):not certain I like the cleanliness of that, but it'd work w/o extending the classes ---------------------------------------------------------------------------------------------------- ############################## [2015-06-12] ############################## [07:48:59] Elia Schito(@elia):@kofno https://gist.github.com/kofno/2762bcc615ce7440b7f0#comment-1472177 ---------------------------------------------------------------------------------------------------- [09:23:53] Keith Salisbury(@globalkeith):Hi all, I'm doing a presentation to my company at lunchtime about Opal and I've compiled a gist with all the links I can find to useful stuff - if you have another useful link please can you let me know.... https://gist.github.com/globalkeith/fd1e3c7144dc67f21463 ---------------------------------------------------------------------------------------------------- [09:24:22] Keith Salisbury(@globalkeith):Sorry I didn't realise it would add it all here.... ---------------------------------------------------------------------------------------------------- [13:47:13] Gabriel Rios(@gabrielrios):Is there any doc on native inheritance? I see that its used on opal-jquery `Element`, but I couldn’t use it. All the methods that I try to alias from my parent class are returning nil ---------------------------------------------------------------------------------------------------- [13:58:55] Elia Schito(@elia):@gabrielrios please paste some code ---------------------------------------------------------------------------------------------------- [13:59:39] Gabriel Rios(@gabrielrios):@elia https://gist.github.com/gabrielrios/d45ec009830d814b266e ---------------------------------------------------------------------------------------------------- [17:12:08] Forrest Chang(@fkchang):@globalkeith I would use http://fkchang.github.io/opal-irb/index-embeddable.html for the opal-irb demo, the jqconsole versions are much more fully featured than the homebrew console one. I would also include https://www.youtube.com/watch?v=GH9FAfKG-qY as it's a very broad overview -- start with https://vimeo.com/82573680 coz the sound makes the difference, and then switch to youtube. All my blogposts on opal are here: http://funkworks.blogspot.com/search/label/opal - the latest one is probably pretty useful ---------------------------------------------------------------------------------------------------- [20:15:07] CJ Lazell(@cj):@vais @elia created a much shorter example :) http://goo.gl/iYJWE0 ---------------------------------------------------------------------------------------------------- [21:24:06] ylluminate(@ylluminate):@elia did that help or did you need a more concise example re: @gabrielrios's note earlier? ---------------------------------------------------------------------------------------------------- [21:38:34] Elia Schito(@elia):@ylluminate @gabrielrios you should open an issue with a bit more specific description of the issue, including what you tried and the expected outcome ---------------------------------------------------------------------------------------------------- [21:38:50] Elia Schito(@elia):quite busy these days, so I need it to be pre-digested :) ---------------------------------------------------------------------------------------------------- [21:38:54] Elia Schito(@elia):thanks! ---------------------------------------------------------------------------------------------------- [21:50:01] ylluminate(@ylluminate):thanks. i was afraid of that ;) ---------------------------------------------------------------------------------------------------- [21:52:55] Elia Schito(@elia):@/all opal 0.8.0.rc1 and opal-rails 0.8.0.rc1 are out, give it a whirl plz! ---------------------------------------------------------------------------------------------------- ############################## [2015-06-13] ############################## [00:01:17] Vais Salikhov(@vais):@cj thanks, I'll take a look ---------------------------------------------------------------------------------------------------- [11:21:01] Keith Salisbury(@globalkeith):Thanks Forrest, unfortunately other company presentations blocked my workshop but I'm going to do it next week! ---------------------------------------------------------------------------------------------------- [12:31:19] Mitch VanDuyn(@catmando):Any hints / tips on structuring specs for a gem that runs in opal on the client, but also has a server side controller as well? I.e. I need to run tests for the opal libraries in phantomjs (okay can do that) and also have specs that will test the functionality of the server side controller. From looking at the opal-rails code, it looks like I have this in the rake task: ```ruby require 'rspec/core/rake_task' RSpec::Core::RakeTask.new :rspec require File.expand_path('../test_app/config/application', __FILE__) TestApp::Application.load_tasks task :default => [:rspec, 'opal:spec'] ``` and then the normal server side tests go in the normal spec directory... but I don't quite see where the opal side tests would go? Is there a directory somewhere i missed? ---------------------------------------------------------------------------------------------------- ############################## [2015-06-14] ############################## [13:43:15] Elia Schito(@elia):@adambeynon @meh @vais here's what's going to be released in 0.8 https://github.com/opal/opal/compare/0-7-stable...0-8-stable ---------------------------------------------------------------------------------------------------- [13:44:05] Elia Schito(@elia):I'd like some help in making sure CHANGELOG.md is up to date, after that I think the time has come to release ---------------------------------------------------------------------------------------------------- [16:14:11] Adam Jahn(@ajjahn):Is there anyway to use opal-rails without Haml? Currently using opal-rails-0.8.0.rc1 and getting `opal-rails-0.8.0.rc1/lib/opal/rails/haml_filter.rb:1:in '': uninitialized constant Haml::Filters (NameError)`. I can fix by requiring Haml, but it'd be nice to make it optional. Thoughts? ---------------------------------------------------------------------------------------------------- ############################## [2015-06-15] ############################## [00:11:02] Mitch VanDuyn(@catmando):if anybody cares [here is a gist](https://gist.github.com/catmando/d283739ef34e9368518c) on how to get opal-rspec working together with normal rspec in the same app (pre opal-rails v 0.8 which we can't use because we are on rails 3.2) ---------------------------------------------------------------------------------------------------- [01:49:47] Vais Salikhov(@vais):@elia I will work on a draft of the CHANGELOG.md based on https://github.com/opal/opal/compare/0-7-stable...0-8-stable tonight and submit as a PR ---------------------------------------------------------------------------------------------------- [03:27:48] Shaun August(@tsugua):Does anyone know if there is a CDN for opal-jquery 0.3.0 and opal-browser? ---------------------------------------------------------------------------------------------------- [04:47:53] Shaun August(@tsugua): ---------------------------------------------------------------------------------------------------- [12:23:13] Vais Salikhov(@vais):Another week has passed, and this means it's time for another Opal RubySpec update! :tada: The number of passing specs this week is... :sparkles: 6100 :sparkles:, up from the measly 5122 number reported last week :smile: *But how is that even possible?...*, I hear you ask. Well, it turns out there were a lot of specs that Opal was already passing without us knowing about it, because those specs were simply not being run. LOL, here's to another 1000 passing specs! :beers: ---------------------------------------------------------------------------------------------------- [14:58:22] AstonJ(@AstonJ):# MetaRuby.com has gone live Hi Everyone - MetaRuby.com has just gone live! Please drop by and help promote Ruby on the client side via Opal :-) If you are also interested in being part of the Opal Strategies team, please PM me your username and I'll add you to the group giving you access to the private section - our first set of threads have just gone up too so your input would be greatly appreciated: [Do you think Opal and Volt need to pick a fight like Rails did? (Rails Envy)](http://metaruby.com/t/do-you-think-opal-and-volt-need-to-pick-a-fight-like-rails-did-rails-envy/46/1) [Side by side comparisons - showing how doing things are easier/better in Opal & Volt](http://metaruby.com/t/side-by-side-comparisons-showing-how-doing-things-are-easier-better-in-opal-volt/47/1) [How do you think we can get more developers interested in Opal?](http://metaruby.com/t/how-do-you-think-we-can-get-more-developers-interested-in-opal/50/1) If you have any questions, suggestions or feedback these would be appreciated too :) ---------------------------------------------------------------------------------------------------- [16:30:31] Forrest Chang(@fkchang):@globalkeith no prob, glad to help ---------------------------------------------------------------------------------------------------- [16:34:36] Forrest Chang(@fkchang):@catmando looks like u took the path similar to how opal-rails runs opal specs in a different directory. I don't remember it being a big deal to support, except wrt load paths and not auto compiling specs in app code ---------------------------------------------------------------------------------------------------- [17:04:20] Mitch VanDuyn(@catmando):@fkchang yeah that last bit was where I got stuck last night and gave up :-(. I.e. I could not get it to compile the opal code when I wanted. It was compiling it during the startup of the server tests ---------------------------------------------------------------------------------------------------- [22:36:15] Jared White(@jaredcwhite):@AstonJ Awesome! I'll check it out shortly ---------------------------------------------------------------------------------------------------- [23:24:09] Chris Seaton(@chrisseaton):How does Opal run RubySpecs? I see the RubySpec repo, but no tags, and no MSpec. ---------------------------------------------------------------------------------------------------- [23:53:51] Elia Schito(@elia):@chrisseaton precompiles the whole suite to JavaScript and then runs it in the browser ---------------------------------------------------------------------------------------------------- [23:54:32] Chris Seaton(@chrisseaton):Ok - are there no tags though? You can't run *all* the specs, right? ---------------------------------------------------------------------------------------------------- [23:55:10] Elia Schito(@elia):No, look into spec/filters ---------------------------------------------------------------------------------------------------- [23:55:29] Elia Schito(@elia):and spec/rubyspecs ---------------------------------------------------------------------------------------------------- [23:56:06] Elia Schito(@elia):the latter is the list of specs we run ---------------------------------------------------------------------------------------------------- [23:56:34] Chris Seaton(@chrisseaton):Ah got it, thanks ---------------------------------------------------------------------------------------------------- [23:56:56] Elia Schito(@elia):i think we're ranging around 6.1k specs ---------------------------------------------------------------------------------------------------- [23:58:03] Elia Schito(@elia):gotta go (btw truffle is super cool) ---------------------------------------------------------------------------------------------------- ############################## [2015-06-16] ############################## [00:01:33] Chris Seaton(@chrisseaton):I was interested in how do you do method_missing in JS, but now I see your stubs technique ---------------------------------------------------------------------------------------------------- [01:38:18] Shaun August(@tsugua):I'm having difficulty using opal-jquery. Question is here: http://stackoverflow.com/questions/30857521/how-to-use-opal-jquery-ajax-to-post-get-values ---------------------------------------------------------------------------------------------------- [01:38:24] Shaun August(@tsugua):Any suggestions would be greatly appreciated! ---------------------------------------------------------------------------------------------------- [04:42:04] Ryan Stout(@ryanstout):@chrisseaton keep up the good work on truffle! ---------------------------------------------------------------------------------------------------- [11:35:45] AstonJ(@AstonJ):Hi Guys, I think it’s threads like this where we have a really good chance to win people round - people who take the time and effort to put their thoughts together like this are often open to reason. Please drop by and add your thoughts too: http://metaruby.com/t/if-youre-not-into-opal-how-can-we-convince-you //CC @ryanstout @vais @fkchang @elia ---------------------------------------------------------------------------------------------------- [18:08:25] ylluminate(@ylluminate):@AstonJ unfortunately the posts you mention in the https://gitter.im/opal/opal?at=557ee80e630346ab3b0406fb post are not accessible... even after signing up they're still inaccessible. ---------------------------------------------------------------------------------------------------- [18:13:37] AstonJ(@AstonJ):You need to be part of the Strategies team @ylluminate - I’ve added you :D Can you see them now? ---------------------------------------------------------------------------------------------------- [18:14:04] AstonJ(@AstonJ):I think there’s 12 of us in the Strategies team over at MR so far :+1: ---------------------------------------------------------------------------------------------------- [18:21:18] ylluminate(@ylluminate):lol, gotcha ---------------------------------------------------------------------------------------------------- [19:19:12] ylluminate(@ylluminate):@AstonJ having problems with posting links sometimes... ---------------------------------------------------------------------------------------------------- [19:20:17] ylluminate(@ylluminate):tried to post a reply on this thread (http://metaruby.com/t/how-do-you-think-we-can-get-more-developers-interested-in-opal/50/2): Just tried an experiment to see if these guys say anything: [Twitter post][1] Re: Macaw [Scarlet][2] I think relatively small efforts like this might be worth a shot as far as reaching out and educating via infiltration. [1]: https://twitter.com/ylluminate/status/610887843980906496 [2]: http://scarlet.macaw.co ---------------------------------------------------------------------------------------------------- [19:20:48] ylluminate(@ylluminate):was rejected saying that "Sorry you cannot post a link to that host" ---------------------------------------------------------------------------------------------------- [19:24:06] ylluminate(@ylluminate):also it appears that you've got a flagging issue going on. got this "Post hidden due to community flagging" message for all posts that i've made to your site so far ---------------------------------------------------------------------------------------------------- [19:25:30] AstonJ(@AstonJ):There is a ‘newuser_spam_host_threshold’ setting in Discourse and it was set to 3 (posts) I’ve changed it to 20 - please retry :) ---------------------------------------------------------------------------------------------------- [00:00:30] Chris Seaton(@chrisseaton):thanks - just checking out how Opal does a few things ---------------------------------------------------------------------------------------------------- ############################## [2015-06-17] ############################## [09:51:56] Srikanth Kuppuswamy(@Hospira-MedNet):i am getting an problem where opal couldn't understand the ruby gem during compile ---------------------------------------------------------------------------------------------------- [09:52:48] Srikanth Kuppuswamy(@Hospira-MedNet):for ex: if we add in the .rb file like require 'log4r' , getting an error like below ---------------------------------------------------------------------------------------------------- [09:52:48] Srikanth Kuppuswamy(@Hospira-MedNet):can't find file: "log4r" in ["C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/opal", "C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/stdlib", "C:/Ruby193/lib/ruby/gems/1.9.1/gems/opal-0.7.2/lib"] (Opal::Builder::MissingRequire ---------------------------------------------------------------------------------------------------- [09:53:25] Srikanth Kuppuswamy(@Hospira-MedNet):can anyone let me know how to resolve this ---------------------------------------------------------------------------------------------------- [09:54:23] Elia Schito(@elia):opal doesn't "understand" ruby gems ---------------------------------------------------------------------------------------------------- [09:54:56] Elia Schito(@elia):it runs on a different platform from ruby193 so many gems can't work with opal by their nature ---------------------------------------------------------------------------------------------------- [10:01:20] Srikanth Kuppuswamy(@Hospira-MedNet):thanks @elia ---------------------------------------------------------------------------------------------------- [19:55:23] Ryan Stout(@ryanstout):@adambeynon or @elia is there any docs on require_tree (in 0.7.2) ---------------------------------------------------------------------------------------------------- [19:55:34] Ryan Stout(@ryanstout):I'm trying it and it's looking like its just not requiring at all for some reason (but no error) ---------------------------------------------------------------------------------------------------- [19:55:51] Ryan Stout(@ryanstout):do I pass it a full path, or just a path based on $LOAD_PATH ---------------------------------------------------------------------------------------------------- [20:13:18] Elia Schito(@elia):@ryanstout on the client it will look in the paths it finds in Opal.modules ---------------------------------------------------------------------------------------------------- [20:13:37] Elia Schito(@elia):it can't deal with absolute paths ---------------------------------------------------------------------------------------------------- [20:14:54] Elia Schito(@elia):let me know if you want some help looking through the source, there's no other docs I'm aware of ---------------------------------------------------------------------------------------------------- [20:41:40] Ryan Stout(@ryanstout):@elia I think I found some docs. But its not requiring it for some reason. I see the requires in the generated JS: self.$require_tree("calendar/config/initializers"); ---------------------------------------------------------------------------------------------------- [20:41:49] Ryan Stout(@ryanstout):but its not including the files in that folder ---------------------------------------------------------------------------------------------------- [20:41:59] Ryan Stout(@ryanstout):Opal.paths has the right folder in it ---------------------------------------------------------------------------------------------------- [20:45:49] Ryan Stout(@ryanstout):@elia I'm using Opal::Builder.new.build_str, could that be the reason? ---------------------------------------------------------------------------------------------------- [20:45:55] Ryan Stout(@ryanstout):(again, in 0.7.2) ---------------------------------------------------------------------------------------------------- [21:02:53] Ryan Stout(@ryanstout):@elia let me know next time your around, I think I figured out an issue with the way it works. (looks like its still the same code in 0.8.x) ---------------------------------------------------------------------------------------------------- [21:04:36] Elia Schito(@elia):@ryanstout do you have some code? ---------------------------------------------------------------------------------------------------- [21:05:42] Ryan Stout(@ryanstout):@elia not yet. Maybe I'm understanding require_tree wrong though.. Let me pull something up... ---------------------------------------------------------------------------------------------------- ############################## [2015-06-18] ############################## [02:06:31] Jamie Gaskins(@jgaskins):@ryanstout I remember at one point in 0.7 beta, using `require_tree` with Rails wouldn't load files that were added after the first compilation — for example, if you had `require_tree 'foo'`, it would load the existing `foo/bar`, but if you added the file `foo/baz` after loading the app, it wouldn't load that. Is that similar to what you're seeing? ---------------------------------------------------------------------------------------------------- [02:06:43] Jamie Gaskins(@jgaskins):I was going to file an issue about this when I first saw it, but I forgot because I never use `require_tree`. :-) ---------------------------------------------------------------------------------------------------- [02:08:02] Ryan Stout(@ryanstout):@jgaskins thanks. I'm just using the builder in 0.7.2, so I think its specific to that. Basically, I was thinking that require_tree would look through the Opal.paths, but the current implementation just checks based on the current working directory. ---------------------------------------------------------------------------------------------------- [02:08:30] Ryan Stout(@ryanstout):https://github.com/opal/opal/blob/master/lib/opal/builder.rb#L88 ---------------------------------------------------------------------------------------------------- [02:08:47] Ryan Stout(@ryanstout):if I get some time, I might try to make it work with the paths, but for now I just went back to manual require's ---------------------------------------------------------------------------------------------------- [12:39:47] Rick Carlino(@RickCarlino):Hey guys- I'm having some issues compiling a static site that uses `opal-browser`: ---------------------------------------------------------------------------------------------------- [12:39:51] Rick Carlino(@RickCarlino):```ruby # Gemfile gem 'opal' gem 'opal-browser' # Rakefile require 'opal' require 'opal-browser' desc "Build our app to build.js" task :build do Opal.append_path "app" File.binwrite "build.js", Opal::Builder.build("application").to_s end # app/application.rb require 'opal' require 'browser' alert "Wow, running opal!" ``` ---------------------------------------------------------------------------------------------------- [12:40:51] Rick Carlino(@RickCarlino):``` $ rake build rake aborted! LoadError: cannot load such file -- opal-browser /home/rick/code/static-opal/Rakefile:3:in `' /home/rick/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval' /home/rick/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `
' (See full trace by running task with --trace) ``` ---------------------------------------------------------------------------------------------------- [12:43:13] Francesco 'makevoid' Canessa(@makevoid):maybe you need to load bundler correctly ---------------------------------------------------------------------------------------------------- [12:43:34] Francesco 'makevoid' Canessa(@makevoid):otherwise it will search for system gems ---------------------------------------------------------------------------------------------------- [12:43:43] Francesco 'makevoid' Canessa(@makevoid):or you could do ``` require 'bundler/setup' Bundler.require :default ``` and remove the two require statements ---------------------------------------------------------------------------------------------------- [12:43:47] Elia Schito(@elia):`require 'opal/browser'`? ---------------------------------------------------------------------------------------------------- [12:44:12] Francesco 'makevoid' Canessa(@makevoid):it fails in Rakefile not in application.rb ---------------------------------------------------------------------------------------------------- [12:47:48] Rick Carlino(@RickCarlino):Looks like @makevoid 's fix works. Thanks! ---------------------------------------------------------------------------------------------------- [12:47:56] Francesco 'makevoid' Canessa(@makevoid):your welcome! ---------------------------------------------------------------------------------------------------- [12:47:58] Francesco 'makevoid' Canessa(@makevoid):enjoy opal ---------------------------------------------------------------------------------------------------- [12:47:58] Francesco 'makevoid' Canessa(@makevoid)::D ---------------------------------------------------------------------------------------------------- [12:51:17] Francesco 'makevoid' Canessa(@makevoid): ---------------------------------------------------------------------------------------------------- [13:08:56] Rick Carlino(@RickCarlino):Has anyone gotten `uninitialized constant Opal::Tilt`? I'm using opal-browser 0.2.0.beta1 ---------------------------------------------------------------------------------------------------- [13:10:06] Elia Schito(@elia):which opal version? ---------------------------------------------------------------------------------------------------- [13:12:44] Rick Carlino(@RickCarlino):Had to downgrade to `0.6.3`. Was trying to work around this one: https://github.com/opal/opal-browser/issues/10 ---------------------------------------------------------------------------------------------------- [13:12:54] Rick Carlino(@RickCarlino):Ended up breaking it in the process, I think. ---------------------------------------------------------------------------------------------------- [15:06:41] Jared White(@jaredcwhite):@elia and others - great job on the latest Opal and opal-rails stuff -- source maps working!!! YAY!!! :clap: I do have one concern which I mentioned here: https://github.com/opal/opal-rails/issues/49#issuecomment-113186052 It seems there's no more require_tree for including many Opal files in a folder. My homegrown front-end framework expects there to be a variable number of files in each of the main folders (controllers, views, etc.), and it seems like a big pain to have to remember to go in and explicitly add require 'controller/foo' type statements for every single one. ---------------------------------------------------------------------------------------------------- [15:11:50] Elia Schito(@elia):@jaredcwhite see my answer, but basically you just have to use require_tree from opal instead of using the sprockets magic comment ---------------------------------------------------------------------------------------------------- [15:33:42] Mitch VanDuyn(@catmando):Does 0.8 still require sprockets 3.x? (Q1) Q2 - is there a from_n or some other concept like that, where I can add a method to a class that will convert from a native object to an instance of that class? Obviously I can do a JSON parse, and then allow the classes .new method to accept a hash, but it seems like there should be a standard way of announcing the intention ---------------------------------------------------------------------------------------------------- [15:44:30] Elia Schito(@elia):Q1 - yes, sorry Q2 - no, but it's a good idea, yet we should first look at how Ruby handles this kind of things first to see if there's some standard we can adhere to ---------------------------------------------------------------------------------------------------- [15:44:41] Elia Schito(@elia):cc @meh ^^ ---------------------------------------------------------------------------------------------------- [16:09:18] Forrest Chang(@fkchang):@RickCarlino I had that problem, on 6.2, and got around it. Don't remember how, search the irc, @meh had to help me out on it, IIRC ---------------------------------------------------------------------------------------------------- [16:17:27] Rick Carlino(@RickCarlino):Ah, no worries, I ended up just using Opal-JQ in the meantime ---------------------------------------------------------------------------------------------------- [18:05:06] Mitch VanDuyn(@catmando):@elia - that's what I was thinking (re from_native) I mean you could just have .new check to see if the incoming param is native, in which case do the conversion. Hmmm... maybe that is a good enough convention. ---------------------------------------------------------------------------------------------------- [19:48:08] Mitch VanDuyn(@catmando):So what is the canonical way to check if an object is native or not? ---------------------------------------------------------------------------------------------------- [20:03:31] Elia Schito(@elia):Hash.new word that way ---------------------------------------------------------------------------------------------------- [20:04:21] Elia Schito(@elia):and native.rb adds Kernel#native? iirc ---------------------------------------------------------------------------------------------------- [20:47:07] Ryan Stout(@ryanstout):how do I get a javascript date object into an opal time object? ---------------------------------------------------------------------------------------------------- [20:52:57] Ryan Stout(@ryanstout):nevermind, figured it out ---------------------------------------------------------------------------------------------------- [21:14:16] ylluminate(@ylluminate):@adambeynon thank you for taking action on those "issues" gone wild. ---------------------------------------------------------------------------------------------------- ############################## [2015-06-19] ############################## [16:52:22] meh.(@meh):but many methods come from the stdlib ---------------------------------------------------------------------------------------------------- [16:52:38] meh.(@meh):no idea why it was designed like that, but it's how it is ---------------------------------------------------------------------------------------------------- [16:56:46] Todd J Russell(@comexpressao):in the browser console I tried: ---------------------------------------------------------------------------------------------------- [16:56:49] Todd J Russell(@comexpressao):Opal.Date.$parse(Opal.Time.$now()) ---------------------------------------------------------------------------------------------------- [16:57:03] Todd J Russell(@comexpressao):Uncaught TypeError: Cannot read property '1' of null ---------------------------------------------------------------------------------------------------- [16:57:08] Todd J Russell(@comexpressao):oh well :-( ---------------------------------------------------------------------------------------------------- [16:57:34] meh.(@meh):comexpressao, yeah, that method is in the stdlib, you have to `require 'date'` to access it ---------------------------------------------------------------------------------------------------- [16:57:41] meh.(@meh):and IIRC the try doesn't support requires ---------------------------------------------------------------------------------------------------- [16:57:53] meh.(@meh):it will work when using Opal normally ---------------------------------------------------------------------------------------------------- [16:58:03] Todd J Russell(@comexpressao):we got it... the above was missing to_s... now works ---------------------------------------------------------------------------------------------------- [16:58:08] Todd J Russell(@comexpressao):yeah! ---------------------------------------------------------------------------------------------------- [16:59:48] Todd J Russell(@comexpressao):Thanks for all the help and input ---------------------------------------------------------------------------------------------------- [17:01:02] meh.(@meh):np ---------------------------------------------------------------------------------------------------- [17:04:59] Michał Kalbarczyk(@fazibear):is there any estmined date for 0.8 release ? ---------------------------------------------------------------------------------------------------- [18:08:25] Jared White(@jaredcwhite):@ylluminate @dfyx Yeah that WebAssembly stuff sounds fantastic. If some folks have been hesitant to use a compile-to-JS language because of a fear of leaky abstractions or some other perceived issues that compel them to stick with raw JS, this kind of thing could really be the tipping point. It turns the browser into a lower-level runtime that can execute code from a theoretically infinite variety of higher-level languages. What remains to be seen is what kind of language features end up really being supported. We benefit from the fact that most of the cool stuff Ruby does can actually be implemented on top of JS. But what about a language that has some kind of bizarre syntax/state/execution flow/data processing/whatever feature that WebAssembly simply doesn't support? I guess I will need to read up on the details as they come out... ---------------------------------------------------------------------------------------------------- [18:11:39] ylluminate(@ylluminate):well, i guess it depends on how close it comes to an assembly level implementation. everything runs atop a relatively simplistic set of rules when you look at it from a true asm perspective and if they're able to achieve that, then probably sky's the limits ---------------------------------------------------------------------------------------------------- [19:49:35] Elia Schito(@elia):@fazibear it's almost ready but there's some stuff going on now and I don't think a release will happen until it's settled ---------------------------------------------------------------------------------------------------- [21:58:45] Forrest Chang(@fkchang):@catmando I just now remembered why we did the client_and_server softlink the way we did. I wanted an explicit 'client_and_server' in the opal requires to indicate that the code was shared and not client only ---------------------------------------------------------------------------------------------------- [22:11:38] Mitch VanDuyn(@catmando):@fkchang thanks for that info ---------------------------------------------------------------------------------------------------- [03:00:05] ylluminate(@ylluminate):heads up @all http://techcrunch.com/2015/06/17/google-microsoft-mozilla-and-others-team-up-to-launch-webassembly-a-new-binary-format-for-the-web/ ---------------------------------------------------------------------------------------------------- [03:05:12] ylluminate(@ylluminate):> "The team notes that the idea here is not to replace JavaScript, by the way, but to allow many more languages to be compiled for the Web. Indeed, chances are that both JavaScript and WebAssembly will be used side-by-side and some parts of the application may use WebAssembly modules (animation, visualization, compression, etc.), while the user interface will still be mostly written in JavaScript, for example." ---------------------------------------------------------------------------------------------------- [15:10:25] Christian Käser(@dfyx):@ylluminate Sounds really promising. In fact I'm reading the design document right now ---------------------------------------------------------------------------------------------------- [15:10:32] Christian Käser(@dfyx):https://github.com/WebAssembly/design ---------------------------------------------------------------------------------------------------- [15:47:28] Todd J Russell(@comexpressao):Hey guys, I'm attempting to include the timeliness gem with no success. Any suggestions; I don't know how to include it. ---------------------------------------------------------------------------------------------------- [15:51:13] meh.(@meh):comexpressao, any errors? ---------------------------------------------------------------------------------------------------- [15:51:32] meh.(@meh):comexpressao, you should be calling `Opal.use_gem 'timeliness'` in the server side part ---------------------------------------------------------------------------------------------------- [15:51:42] meh.(@meh):so that it can add the paths ---------------------------------------------------------------------------------------------------- [15:53:17] Todd J Russell(@comexpressao):@meh In application.rb? ---------------------------------------------------------------------------------------------------- [15:53:37] meh.(@meh):comexpressao, what are you using to compile your stuff? ---------------------------------------------------------------------------------------------------- [15:53:44] meh.(@meh):it depends on that ---------------------------------------------------------------------------------------------------- [15:53:56] meh.(@meh):opal-rails, or a rake task, or something else? ---------------------------------------------------------------------------------------------------- [15:54:08] Todd J Russell(@comexpressao):opal-rails ---------------------------------------------------------------------------------------------------- [15:54:54] meh.(@meh):comexpressao, then yes, I think so ---------------------------------------------------------------------------------------------------- [15:55:11] meh.(@meh):I don't use Rails, but as long as it's called before anything is compiled by Opal, then it will work ---------------------------------------------------------------------------------------------------- [15:55:45] Elia Schito(@elia):probably config/initializers/assets.rb is a good place to do that ---------------------------------------------------------------------------------------------------- [16:16:24] Vais Salikhov(@vais):@opal/core I've been thinking for a while now to re-organize spec/filters/unsupported to have the same structure as spec/filters/bugs. I.e. each file is named after the directory name in RubySpec and contains the failing specs for all the files in that directory. It's a bit of a dumping ground right now. It's kinda organized by "topic", which makes it not quite straight-forward if you want to get a clear picture of what exactly is unsupported, or where to put a new failing item. Or to revise things down the road. It's a bit of work, so before I do, I'd like to know if there are any objections. ---------------------------------------------------------------------------------------------------- [16:31:48] meh.(@meh):vais, I'm fine with that, it was just a dumping ground, I think we didn't even have sections at the beginning ---------------------------------------------------------------------------------------------------- [16:33:24] Todd J Russell(@comexpressao):is DateTime implemented? I tried it opalrb/try and its not there??? ---------------------------------------------------------------------------------------------------- [16:34:55] Todd J Russell(@comexpressao):I'm getting NoMethod error for Date.parse? ---------------------------------------------------------------------------------------------------- [16:40:45] Todd J Russell(@comexpressao):I;m just trying to convert current time to a date! ---------------------------------------------------------------------------------------------------- [16:46:31] meh.(@meh):comexpressao, there's Time ---------------------------------------------------------------------------------------------------- [16:46:39] meh.(@meh):comexpressao, Date.parse is in the stdlib in MRI ---------------------------------------------------------------------------------------------------- [16:46:46] meh.(@meh):IIRC ---------------------------------------------------------------------------------------------------- [16:47:15] meh.(@meh):comexpressao, so just require 'date' ---------------------------------------------------------------------------------------------------- [16:51:57] Todd J Russell(@comexpressao):so what's going on with opalrb.org/try? it has Date but none of the functions ---------------------------------------------------------------------------------------------------- [16:52:08] meh.(@meh):comexpressao, it has the corelib, but not the stdlib available ---------------------------------------------------------------------------------------------------- [16:52:14] meh.(@meh):comexpressao, so you can't require from what I remember ---------------------------------------------------------------------------------------------------- [16:52:19] meh.(@meh):Date is part of the corelib in Ruby ---------------------------------------------------------------------------------------------------- ############################## [2015-06-21] ############################## [15:33:30] Rick Carlino(@RickCarlino):So does `Opal.append_path` just add a directory to a list of possible paths to load from? ---------------------------------------------------------------------------------------------------- [15:34:21] Rick Carlino(@RickCarlino):Ah, it just forwards to sprockets, looks like ---------------------------------------------------------------------------------------------------- [19:57:19] Rick Carlino(@RickCarlino):Is Vienna still recommended for use? I might mention it as an additional resource on some stuff I'm writing- wanted to make sure it's still advisable to use it. ---------------------------------------------------------------------------------------------------- [20:05:07] meh.(@meh):@adambeynon ^ ---------------------------------------------------------------------------------------------------- [20:51:00] Adam Beynon(@adambeynon):@RickCarlino I still use Vienna in all my apps. I extend from it heavily, especially with the models. It forms the basis of everything I do though ---------------------------------------------------------------------------------------------------- [20:51:13] Adam Beynon(@adambeynon):Really need to release some real app code using it ---------------------------------------------------------------------------------------------------- [20:54:40] Rick Carlino(@RickCarlino):@adambeynon Cool. I would be willing to write a screencast tutorial for it if you want. This week I'm covering `opal-jquery`, but might be able to get something out after next week if you think its stable enough to showcase. ---------------------------------------------------------------------------------------------------- [21:08:44] Adam Beynon(@adambeynon):@RickCarlino sure thing! Let me know if you need any help etc. one of its strengths is that, like backbone, it's really flexible. Can hook it up with pure jquery views, or haml driven content ---------------------------------------------------------------------------------------------------- [23:15:18] ylluminate(@ylluminate):@elia could you repeat the steps you follow each time you push another opal release to the cdn? ---------------------------------------------------------------------------------------------------- [23:54:16] Rick Carlino(@RickCarlino):@adambeynon Will do! Also: did a quick 5 minute one on Opal-JQuery. Just released it right now for those interested: http://datamelon.io/blog/2015/static-frontend-apps-in-pure-ruby.html ---------------------------------------------------------------------------------------------------- ############################## [2015-06-22] ############################## [03:42:21] Mitch VanDuyn(@catmando):Man why is this so hard for me? Everytime I try to use every/after I have trouble getting the right things included. I have opal-browser included in my gemspec and gem file, but when I require it its not there, unless I do this: if RUBY_ENGINE == 'opal' require 'browser/interval' end which will at least boot, but then I get this: A file required by "reactive_record/cache" wasn't found. can't find file: "browser/interval" in ["/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/stdlib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/bundler/gems/opal-3682db6f2b23/lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-activesupport-0.1.0/opal", "/Users/mitch/railsdev/opal-react/lib", "/Users/mitch/railsdev/opal-react/vendor", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-jquery-0.3.0/lib", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rspec-0.4.2/opal", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rspec-0.4.2/vendor_lib", "/Users/mitch/railsdev/reactive_record/lib", "/Users/mitch/railsdev/reactive_record/vendor", "/Users/mitch/railsdev/reactive_record/spec/dummy/app/assets/images", "/Users/mitch/railsdev/reactive_record/spec/dummy/app/assets/javascripts", "/Users/mitch/railsdev/reactive_record/spec/dummy/app/assets/stylesheets", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/jquery-rails-3.1.2/vendor/assets/javascripts", "/Users/mitch/.rvm/gems/ruby-1.9.3-p194/gems/opal-rails-0.7.0/lib/assets/javascripts", "/Users/mitch/railsdev/react-rails/lib/assets/javascripts", "/Users/mitch/railsdev/react-rails/lib/assets/react-source", "/Users/mitch/railsdev/reactive_record/spec/dummy/app/models/shared", "/Users/mitch/railsdev/react-rails/lib/assets/react-source/development", "/Users/mitch/railsdev/react-rails/lib/assets/javascripts"] I am thinking its because I want to run this code isomorphically? But I am not actually calling "every" on the server, just on the client side... any clues? ---------------------------------------------------------------------------------------------------- [03:50:00] Mitch VanDuyn(@catmando):For now I just copied both browser/interval and browser/delay into my directory... there must be a better way :-) ---------------------------------------------------------------------------------------------------- [08:35:14] Elia Schito(@elia):@ylluminate I keep a copy of the cdn repo in `cdn/` ---------------------------------------------------------------------------------------------------- [08:35:38] Elia Schito(@elia):and then basically follow the examples I added to the `rake dist` task description ---------------------------------------------------------------------------------------------------- [08:35:43] Elia Schito(@elia):``` rake dist Build *corelib* and *stdlib* to "build/" You can restrict the file list with the FILES env var (comma separated) and the destination dir with the DIR env var. Example: rake dist DIR=/tmp/foo FILES='opal.rb,base64.rb' Example: rake dist DIR=cdn/opal/0.8.0.rc1 Example: rake dist DIR=cdn/opal/master ``` ---------------------------------------------------------------------------------------------------- [08:36:34] Elia Schito(@elia):then go to the cdn repo and push (wihout commit access it would be a PR of course) ---------------------------------------------------------------------------------------------------- [13:33:00] ylluminate(@ylluminate):@elia right. I'm interested more in the workflow as it would seem prudent to have a `cdnify` option or support library for other opal wrapper projects as well to generate and deploy cdn drops efficiently on updates. ---------------------------------------------------------------------------------------------------- [13:41:16] ylluminate(@ylluminate):and how are the externals (https://github.com/opal/opal-cdn/tree/gh-pages/external) supposed to be added right now or is that a manual process sans a rake task? ---------------------------------------------------------------------------------------------------- [13:43:58] Elia Schito(@elia):@ylluminate it's manual, at a point I was pondering the removal of the cdn completely but I noticed it's useful to some people ---------------------------------------------------------------------------------------------------- [13:44:42] Elia Schito(@elia):@Mogztter ^^^ ---------------------------------------------------------------------------------------------------- [14:21:39] ylluminate(@ylluminate):well the cdn approach is really useful at quickly introducing opal and doing things fast and dirty to get ppl moving and excited. we're going to be making an opal-phaser cdn to do just that for examples, etc. ---------------------------------------------------------------------------------------------------- [14:21:57] ylluminate(@ylluminate):nothing beats in browser examples ---------------------------------------------------------------------------------------------------- [14:23:03] Elia Schito(@elia):that's true, so, the idea is to add phaser to the external dir, right? ---------------------------------------------------------------------------------------------------- [14:25:32] ylluminate(@ylluminate):maybe. i'm not yet sure if we'll do that or make our own cdn. i was kind of thinking that it'd be nice to have a central repo for interesting wrappers, but it might be too inconvenient. BUT, as noted, i was thinking of making a tool to make quick work of making and updating cdns ---------------------------------------------------------------------------------------------------- [14:28:54] Elia Schito(@elia):I think it would be ok to give more ppl commit access to the cdn repo ---------------------------------------------------------------------------------------------------- [14:30:34] ylluminate(@ylluminate):that might not be a bad idea then to have a single umbrella ---------------------------------------------------------------------------------------------------- [16:48:19] Jared White(@jaredcwhite):@elia Anything I can do to help troubleshoot that require_tree bug? Is that actually an issue with the opal-rails gem, or the Sprockets stuff in the opal gem? ---------------------------------------------------------------------------------------------------- [17:04:04] CJ Lazell(@cj):morning, how would you mount a rack app to Opal::Server? I’m trying to allow https://github.com/opal/opal-rspec/blob/master/lib/opal/rspec/rake_task.rb#L18 to make ajax calls to an app ---------------------------------------------------------------------------------------------------- [18:00:47] CJ Lazell(@cj):also found a new bug when compiling https://github.com/opal/opal/issues/959 ---------------------------------------------------------------------------------------------------- ############################## [2015-06-23] ############################## [07:07:26] Elia Schito(@elia):@jaredcwhite I think the bug is in opal, best starting point is to add a spec example for require_tree "." ---------------------------------------------------------------------------------------------------- [07:13:09] Elia Schito(@elia):@cj Opal server is a rack app, so you can use all sorts of rack tricks ---------------------------------------------------------------------------------------------------- [07:14:52] Elia Schito(@elia):e. g. cascade is quite easy when you have multiple apps ---------------------------------------------------------------------------------------------------- [07:15:40] Elia Schito(@elia):it's basically an array of apps which get called in sequence ---------------------------------------------------------------------------------------------------- [07:16:04] Elia Schito(@elia):the first not returning 404 wins the request ---------------------------------------------------------------------------------------------------- [10:47:58] Christian Käser(@dfyx):@elia @meh @adambeynon any ETA on 0.8 stable? ---------------------------------------------------------------------------------------------------- [13:13:11] Adam Beynon(@adambeynon):@dfyx as soon as possible. Will try and push it through in the next day or so. Have you tried the beta or release candidate. ---------------------------------------------------------------------------------------------------- [14:09:40] CJ Lazell(@cj):@elia yee, I understand that part. so I just have to override the code where the opal-rspec server gets created… I was just hoping there was a way to do it from the opal server block ---------------------------------------------------------------------------------------------------- [14:12:53] Elia Schito(@elia):@cj it probably depends on what you need to override ---------------------------------------------------------------------------------------------------- [14:13:40] CJ Lazell(@cj):https://github.com/opal/opal-rspec/blob/master/lib/opal/rspec/rake_task.rb#L28-L32 ---------------------------------------------------------------------------------------------------- [14:14:28] CJ Lazell(@cj):well the block gets called here https://github.com/opal/opal-rspec/blob/master/lib/opal/rspec/rake_task.rb#L18-L24 ---------------------------------------------------------------------------------------------------- [14:16:17] Elia Schito(@elia):@cj ok, if I understood correctly you want to use modify the rack app from within the opal-rspec rake task ---------------------------------------------------------------------------------------------------- [14:16:21] Elia Schito(@elia):that's correct? ---------------------------------------------------------------------------------------------------- [14:17:01] CJ Lazell(@cj):yee, I want to be able to pass it another rack app; so that in the tests if it does an ajax call it will hit that append app. ---------------------------------------------------------------------------------------------------- [14:18:14] CJ Lazell(@cj):I already did it by editing that file, but it seems to me it would be nice to just do `s.apps << my_rack_app` or something inside opal server ---------------------------------------------------------------------------------------------------- [14:21:18] Elia Schito(@elia):@cj you're right, I think you need to copy/paste the whole thing, doesn't seem to be possible to modify the rack app from within the block ---------------------------------------------------------------------------------------------------- [14:23:48] CJ Lazell(@cj):@elia an Ideal syntax would probably be Opal::Server.new { |s| s.use some_middlware } ---------------------------------------------------------------------------------------------------- [15:01:04] Adam Beynon(@adambeynon):@elia , @cj perhaps we need to expose the raw sprockets/rack object so it can be modified. I think @meh did something like this for testing opal-browser and lissio apps with server responses ---------------------------------------------------------------------------------------------------- [15:51:07] CJ Lazell(@cj):ye, that would be a good idea and make things a lot more flexiable. ---------------------------------------------------------------------------------------------------- [19:43:29] Forrest Chang(@fkchang):@jaredcwhite opalist deadline ~ 10pm PT tonight right? ---------------------------------------------------------------------------------------------------- [19:43:41] Rick Carlino(@RickCarlino):Wooo! ---------------------------------------------------------------------------------------------------- [19:43:49] Rick Carlino(@RickCarlino):Goes out tomorrow? ---------------------------------------------------------------------------------------------------- [19:43:51] Chris Seaton(@chrisseaton):What's opalist? ---------------------------------------------------------------------------------------------------- [19:43:57] Rick Carlino(@RickCarlino):www.opalist.co ---------------------------------------------------------------------------------------------------- [19:43:59] Rick Carlino(@RickCarlino):I think ---------------------------------------------------------------------------------------------------- [19:44:20] Rick Carlino(@RickCarlino):Yeah. that one. It's the community digest of Opal activity ---------------------------------------------------------------------------------------------------- [19:44:47] Rick Carlino(@RickCarlino):Pretty awesome content. Comes out every other thursday iirc ---------------------------------------------------------------------------------------------------- [19:45:02] Chris Seaton(@chrisseaton):Wow didn't realise there was so much Opal activity ---------------------------------------------------------------------------------------------------- [19:45:25] Rick Carlino(@RickCarlino):it's a pretty active ecosystem. ---------------------------------------------------------------------------------------------------- [19:45:45] Forrest Chang(@fkchang):A small group of 'peppy' contributors ---------------------------------------------------------------------------------------------------- [19:45:58] Forrest Chang(@fkchang):@RickCarlino is a screencast machine, BTW ---------------------------------------------------------------------------------------------------- [19:46:26] Forrest Chang(@fkchang):It comes out every other Wednesday ---------------------------------------------------------------------------------------------------- [19:46:44] Forrest Chang(@fkchang):the opalist that is, though @RickCarlino might exceed that output (stud!) ---------------------------------------------------------------------------------------------------- [19:48:05] Forrest Chang(@fkchang):@chrisseaton on the side, if I'm ever speaking at a conference you're at, I'd love to have you do a guest 'voiceover' ---------------------------------------------------------------------------------------------------- [19:49:53] Chris Seaton(@chrisseaton):ha from my deoptimising talk? ---------------------------------------------------------------------------------------------------- [19:51:01] Forrest Chang(@fkchang):yeah, aside from marveling at the truffle performance, I was thinking, "I wish I sounded as smart as Chris" ---------------------------------------------------------------------------------------------------- [21:17:25] Jared White(@jaredcwhite):@fkchang @RickCarlino I usually schedule the Opalist newsletter to go out on Wednesday, but this week will probably go out Thursday as I am out sick today. So Forrest, you have a little more time :) ---------------------------------------------------------------------------------------------------- [21:26:07] Rick Carlino(@RickCarlino):Get well soon, @jaredcwhite . Thanks for keeping it going. ---------------------------------------------------------------------------------------------------- ############################## [2015-06-24] ############################## [21:13:10] Elia Schito(@elia):@cj here's an example on how to use the server with sourcemaps in a more low-level way: https://github.com/opal/opal/blob/master/examples/sinatra/config.ru ---------------------------------------------------------------------------------------------------- [21:14:08] Elia Schito(@elia):@adambeynon you had a chance to see this yet? https://github.com/opal/opal-rails/issues/51 ---------------------------------------------------------------------------------------------------- [21:15:21] Elia Schito(@elia):I ran with opal collapsed to a single file during the last months and it's great for development, I'm wondering if it's worth supporting it in opal-rails or in the opal processor directly ---------------------------------------------------------------------------------------------------- [21:16:53] CJ Lazell(@cj):@elia thank you ---------------------------------------------------------------------------------------------------- [21:19:33] CJ Lazell(@cj):@elia @adambeynon roda has great asset handling, you might get some good ideas from it https://github.com/jeremyevans/roda/blob/master/lib/roda/plugins/assets.rb ---------------------------------------------------------------------------------------------------- [03:11:20] Forrest Chang(@fkchang):@jaredcwhite awesome, what's the new cutoff time, coz I sure can use it. SOrry about the sickness ---------------------------------------------------------------------------------------------------- [10:06:15] Pierre-Alexandre Kofron(@kofronpi):Hi, I'd like to give a try to Opal. I could install it with rvm and ruby 2.2.1 but not ruby 2.2.2 ---------------------------------------------------------------------------------------------------- [10:06:44] Pierre-Alexandre Kofron(@kofronpi):***@*** λ ~ (master)$ gem install opal ERROR: Error installing opal: invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /home/***/.rvm/gems/ruby-2.2.2/cache/opal-0.7.2.gem ---------------------------------------------------------------------------------------------------- [10:07:58] Elia Schito(@elia):@kofronpi seems a rubygems problem ---------------------------------------------------------------------------------------------------- [10:08:28] Elia Schito(@elia):try removing the cache: `cd ~/.rvm/gems/ruby-2.2.2/cache; rm opal-0.7.2.gem` ---------------------------------------------------------------------------------------------------- [11:17:21] Pierre-Alexandre Kofron(@kofronpi):@elia thanks that did the trick ! ---------------------------------------------------------------------------------------------------- [11:17:53] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [14:39:26] Jared White(@jaredcwhite):@fkchang Been getting to bed earlier these days (kids, work, etc. takes its toll) so probably around 8pm PT tonight. ---------------------------------------------------------------------------------------------------- [20:52:02] CJ Lazell(@cj):do source maps work now? ---------------------------------------------------------------------------------------------------- [20:55:59] CJ Lazell(@cj):setting the opal server debug to true doesn’t appear to do anything ---------------------------------------------------------------------------------------------------- [20:56:21] Adam Beynon(@adambeynon):@cj running master branch? or gem release? ---------------------------------------------------------------------------------------------------- [20:56:30] CJ Lazell(@cj):yep ---------------------------------------------------------------------------------------------------- [20:56:47] CJ Lazell(@cj):I’m running off of master ---------------------------------------------------------------------------------------------------- [20:58:10] CJ Lazell(@cj):@adambeynon here’s my middleware https://gist.github.com/42d8ea8c5bc4653b9f56 ---------------------------------------------------------------------------------------------------- ############################## [2015-06-25] ############################## [03:02:53] Forrest Chang(@fkchang):@jaredcwhite hope you feel better, got my submission in, just under the wire ---------------------------------------------------------------------------------------------------- [03:20:09] Forrest Chang(@fkchang):@adambeynon @elia @meh what exactly do you guys mean by 'toll free bridged class' ? ---------------------------------------------------------------------------------------------------- [03:52:29] Jared White(@jaredcwhite):@fkchang Yep, feeling better today, thanks. Got your submission! Issue's going out in the morning. Good night folks :) ---------------------------------------------------------------------------------------------------- [05:44:38] Adam Beynon(@adambeynon):@fkchang Array, String etc which are just instances of the JavaScript equivalents. Objects which we just use and extend rather than wrapping ---------------------------------------------------------------------------------------------------- [16:19:28] Forrest Chang(@fkchang):@adambeynon ok, so when opal-jquery says that Element is a toll free bridged class by doing ---------------------------------------------------------------------------------------------------- [16:20:18] Forrest Chang(@fkchang):```ruby class Element < `#{JQUERY_CLASS.to_n}` ``` What it means is that you're extending JQUERY_CLASS via the above line? ---------------------------------------------------------------------------------------------------- [16:21:17] Adam Beynon(@adambeynon):@fkchang Yeap. If you pass a javascript class (i.e. just a Function) as a superclass, then we extend the function prototype and make it toll free ---------------------------------------------------------------------------------------------------- [16:21:27] Adam Beynon(@adambeynon):We then mix in all methods from Object and Kernel ---------------------------------------------------------------------------------------------------- [16:21:39] Adam Beynon(@adambeynon):and any future method defined on Object and Kernel get added to it as well ---------------------------------------------------------------------------------------------------- [16:22:30] Adam Beynon(@adambeynon):but do bare in mind, we also treat it as a method_missing target, so we adds all those dummy methods to its prototype so method_missing works on it like any other ruby object ---------------------------------------------------------------------------------------------------- [16:24:25] Forrest Chang(@fkchang):@adambeynon ok, so side effect is I can now call $ opal methods off of $ in js ---------------------------------------------------------------------------------------------------- [16:25:03] Elia Schito(@elia):I do that all the time ---------------------------------------------------------------------------------------------------- [16:25:24] Forrest Chang(@fkchang):interesting ---------------------------------------------------------------------------------------------------- [16:37:47] Forrest Chang(@fkchang):while I have @adambeynon and @elia online, how is $$ defined? because ```ruby $$ == `window` # true $$[:jQuery] # works `window`[:jQuery] # fails no method [] $$ != Native(`window`) # true, but Native(`window`)[:jQuery] works ``` ---------------------------------------------------------------------------------------------------- [16:38:46] Elia Schito(@elia):$$ is ```Native(`Opal.global`)``` ---------------------------------------------------------------------------------------------------- [16:38:57] Elia Schito(@elia):which in the browser is window of course ---------------------------------------------------------------------------------------------------- [16:39:16] Forrest Chang(@fkchang):also what terminology do we use for what's returned by x strings, I want to say native, but it's not the same as what's returned by Native() ---------------------------------------------------------------------------------------------------- [16:39:30] Elia Schito(@elia):I think ```$$ != Native(`window`)``` is a bug ---------------------------------------------------------------------------------------------------- [16:53:21] meh.(@meh):sounds like a bug indeed ---------------------------------------------------------------------------------------------------- [16:53:23] meh.(@meh):gonna fix that ---------------------------------------------------------------------------------------------------- [16:54:57] Rick Carlino(@RickCarlino):So `$$` is an interface to native JS functions? Does it allow dot notation, also? ---------------------------------------------------------------------------------------------------- [16:55:02] Rick Carlino(@RickCarlino):Had no idea, that's really cool. ---------------------------------------------------------------------------------------------------- [16:55:05] meh.(@meh):RickCarlino, $$ is a Native::Object ---------------------------------------------------------------------------------------------------- [16:55:25] Rick Carlino(@RickCarlino):I will have to play around with that one. Nice. ---------------------------------------------------------------------------------------------------- [17:06:48] meh.(@meh):elia, fkchang, I retract that, I don't understand why $$ != Native(`window`) ---------------------------------------------------------------------------------------------------- [17:10:34] meh.(@meh):unless our != compilation is broken ---------------------------------------------------------------------------------------------------- [17:18:25] Forrest Chang(@fkchang):@meh might it be a 0.7 vs 0.8 diff? ---------------------------------------------------------------------------------------------------- [17:18:50] Forrest Chang(@fkchang):actually, maybe it was a fat finger of mine ---------------------------------------------------------------------------------------------------- [17:19:47] meh.(@meh):fkchang, I don't know, the implementation of Native::Object#== is very straightforward ---------------------------------------------------------------------------------------------------- [17:19:47] meh.(@meh):`#@native === #{Native.try_convert(other)}` ---------------------------------------------------------------------------------------------------- [17:20:45] Forrest Chang(@fkchang):@meh lemme see if I can recreate what made me think there was a problem ---------------------------------------------------------------------------------------------------- [17:22:27] Forrest Chang(@fkchang):@meh @elia ok, looks like I was wrong about $$ != Native(`window`), ---------------------------------------------------------------------------------------------------- [17:23:31] meh.(@meh):cool ---------------------------------------------------------------------------------------------------- [18:55:42] Ryan Stout(@ryanstout):I saw somewhere that Time.parse is in stdlib, how do I require it in ---------------------------------------------------------------------------------------------------- [19:45:53] meh.(@meh):ryanstout, require 'time' ---------------------------------------------------------------------------------------------------- [19:46:00] meh.(@meh):if it's implemented ---------------------------------------------------------------------------------------------------- [19:46:07] meh.(@meh):I don't remember if it is, I know Date.parse is ---------------------------------------------------------------------------------------------------- ############################## [2015-06-26] ############################## [01:58:39] Vais Salikhov(@vais):@ryanstout the relationship between date, time, datetime, etc. in Ruby always confused the heck out of me. That's why I'm working on implementing these things in Opal now, hoping to figure it out once and for all, but it's been a slog :sweat_smile: ---------------------------------------------------------------------------------------------------- [02:00:33] Ryan Stout(@ryanstout):@vais yea, I think there's one (or probably two) too many date/time classes in ruby :-) ---------------------------------------------------------------------------------------------------- [02:00:50] Ryan Stout(@ryanstout):@vais thanks for the hard work, let me know if there's something I can help with. ---------------------------------------------------------------------------------------------------- [02:06:34] Vais Salikhov(@vais):Thanks @ryanstout. Right now, if you `require 'time'`, you can do `Time.parse`, which simply calls `Date.parse`, whose implementation is just two lines of code that uses this regex: `/^(\d*)-(\d*)-(\d*)/`. Leaves much to be desired to say the least. You may not want to lean too heavily on it at this time. ---------------------------------------------------------------------------------------------------- [02:14:49] Ryan Stout(@ryanstout):@vais no worries. Yea, I figured too you probably don't want all of the parse logic in corelib because its probably huge (file size wise :-) ---------------------------------------------------------------------------------------------------- [02:30:23] George Plymale II(@ylluminarious):some weird problems with native inheritance: http://cl.ly/400W070w1z2F ---------------------------------------------------------------------------------------------------- [02:30:42] George Plymale II(@ylluminarious):@elia @meh @adambeynon got any suggestions / input? ---------------------------------------------------------------------------------------------------- [02:31:28] Vais Salikhov(@vais):@ryanstout right, but it wouldn't go into corelib's Time, it would go into stdlib Date or Time, which you'd then `require` if you need it, so file size should not be an issue. ---------------------------------------------------------------------------------------------------- [02:31:59] Ryan Stout(@ryanstout):cool ---------------------------------------------------------------------------------------------------- [16:09:21] Forrest Chang(@fkchang):@ylluminarious in 'toll free bridging' you need to redefine Klass.new because the original javascript constructor maps to Ruby's allocate (http://seejohncode.com/2012/03/16/ruby-class-allocate/) ---------------------------------------------------------------------------------------------------- [17:55:19] Nathan Hopkins(@hopsoft):Is it possible to use opal + react-rails + react.rb? I keep getting `parse error on value "Unobtrusive" (tCONSTANT) :react_ujs:3` when the pipeline tries to load `react_ujs.js.erb`. Is opal is attempting to process this file because it's erb? ---------------------------------------------------------------------------------------------------- [17:59:18] Nathan Hopkins(@hopsoft):Here is the start of the file it dies on: ``` /*globals React, Turbolinks*/ // Unobtrusive scripting adapter for React ;(function(document, window) { // jQuery is optional. Use it to support legacy browsers. var $ = (typeof window.jQuery !== 'undefined') && window.jQuery; ``` ---------------------------------------------------------------------------------------------------- [18:36:03] Mitch VanDuyn(@catmando):@hopsoft - We have been using opal + react-rails + react.rb. I don't remember ever seeing that problem (but I saw so many :-)... I could get together with you and try to figure this out. Let me know ---------------------------------------------------------------------------------------------------- [18:38:34] Nathan Hopkins(@hopsoft):@catmando now that you have some battle scars, would you choose this path again? ---------------------------------------------------------------------------------------------------- [18:38:48] Mitch VanDuyn(@catmando):Experts! I have a loading twist here I just can't work out: I have opal running on the server (in rubyracer under react-rails) + ruby code on server + opal in browser. The problem I just ran into is need opal-jquery on the browser, but not (obviously) on the opal server side. This is all going into a gem, so its a bit unclear how I can require opal-jquery only if the browser is loading ---------------------------------------------------------------------------------------------------- [18:39:06] Mitch VanDuyn(@catmando):@hopsoft - I am betting my whole company on it :-) ---------------------------------------------------------------------------------------------------- [18:40:31] Nathan Hopkins(@hopsoft):@catmando Thanks. I'll reach out to you in a bit if I can't get past it. ---------------------------------------------------------------------------------------------------- [18:40:35] Mitch VanDuyn(@catmando):@hopsoft - but we not using JSX at all. Its pure ruby, with a highly modified version of react.rb. My developers are really loving it. ---------------------------------------------------------------------------------------------------- [18:41:36] Mitch VanDuyn(@catmando):@hopsoft - yeah just ping me. I'll try to keep one eye on gitter ---------------------------------------------------------------------------------------------------- [19:01:07] Mitch VanDuyn(@catmando):regarding my request for conditionally loading: I just did this which seems to work: ```ruby if RUBY_ENGINE == 'opal' if `typeof window.ReactiveRecordCache == 'undefined'` require 'opal-jquery' end end ``` where `window.ReactiveRecordCache ` is a variable defined only if running opal on the server This works, but I was SURE that i saw warnings when I was getting the AASM gem working whenever that gem did conditional requires. ---------------------------------------------------------------------------------------------------- [21:27:04] Elia Schito(@elia):@catmando that's the way to go ---------------------------------------------------------------------------------------------------- [21:52:05] Elia Schito(@elia):warnings are printed for dynamic requires, which can't be clearly inferred by the compiler ---------------------------------------------------------------------------------------------------- ############################## [2015-06-27] ############################## [00:26:22] Mitch VanDuyn(@catmando):Cool... ---------------------------------------------------------------------------------------------------- [00:27:05] Mitch VanDuyn(@catmando):I assume that checking predefined constants etc should work as well. In that case there is a bunch of things I can do with this to clean stuff up! ---------------------------------------------------------------------------------------------------- [02:47:57] ylluminate(@ylluminate):https://github.com/opal/opal/issues/965 ---------------------------------------------------------------------------------------------------- [08:44:41] Guillaume Grossetie(@Mogztter):@elia Sorry I'm late to the discussion but don't remove the CDN please ! :) ---------------------------------------------------------------------------------------------------- [10:00:38] Anthony Eufemio(@tymat):the -F doesn't seem to work ---------------------------------------------------------------------------------------------------- [10:08:28] Vais Salikhov(@vais):@tymat yep, cli needs some work :sweat_smile: In the meantime, I think everyone just does `opal input.rb > output.js` ---------------------------------------------------------------------------------------------------- [10:09:00] Anthony Eufemio(@tymat):thanks ---------------------------------------------------------------------------------------------------- [10:09:47] Vais Salikhov(@vais):Oops, I meant `opal -c input.rb > output.js` ---------------------------------------------------------------------------------------------------- [10:10:04] Anthony Eufemio(@tymat):yep that's what I was doing ---------------------------------------------------------------------------------------------------- [10:16:48] Anthony Eufemio(@tymat):I have a simple ruby class that I compiled... how do I initialize this in nodejs? ---------------------------------------------------------------------------------------------------- [10:17:39] Anthony Eufemio(@tymat):```ruby class SomeContract attr_accessor :name, :email, :password def initialize @name = "foo" @email = "bar" @password = "baz" end def contactinfo puts "#{@name} <#{@email}>" end def authenticate(password) password == @password end end ``` ---------------------------------------------------------------------------------------------------- [10:19:04] Anthony Eufemio(@tymat):``` > var Opal = require('./sample.js') undefined > var m = Opal.SomeContract.$$new TypeError: Cannot read property '$$new' of undefined at repl:1:26 at REPLServer.defaultEval (repl.js:132:27) at bound (domain.js:254:14) at REPLServer.runBound [as eval] (domain.js:267:12) at REPLServer. (repl.js:279:12) at REPLServer.emit (events.js:107:17) at REPLServer.Interface._onLine (readline.js:214:10) at REPLServer.Interface._line (readline.js:553:8) at REPLServer.Interface._ttyWrite (readline.js:830:14) at ReadStream.onkeypress (readline.js:109:10) > ``` ---------------------------------------------------------------------------------------------------- [11:14:15] Elia Schito(@elia):@tymat whats the command you used to compile it? ---------------------------------------------------------------------------------------------------- [11:15:03] Anthony Eufemio(@tymat):opal -rnodejs -c somefile.rb > sample.js ---------------------------------------------------------------------------------------------------- [11:15:14] Elia Schito(@elia):doing it with just `-c` should include the opal runtime as well ---------------------------------------------------------------------------------------------------- [11:15:21] Anthony Eufemio(@tymat):also tried opal --no-exit -rnodejs -c somefile.rb > sample.js ---------------------------------------------------------------------------------------------------- [11:15:32] Anthony Eufemio(@tymat):yes I see the runtime included ---------------------------------------------------------------------------------------------------- [11:16:11] Elia Schito(@elia):so it shoul work e.g. doing `node sample.js` ---------------------------------------------------------------------------------------------------- [11:16:12] Anthony Eufemio(@tymat):it works when I run the js from command line ---------------------------------------------------------------------------------------------------- [11:16:18] Anthony Eufemio(@tymat):but not inside interpreter ---------------------------------------------------------------------------------------------------- [11:17:00] Anthony Eufemio(@tymat):I want to be able to do Opal.SomeClass.$new() ---------------------------------------------------------------------------------------------------- [11:17:07] Elia Schito(@elia):ah ok, then it looks like something that needs fixing ---------------------------------------------------------------------------------------------------- [11:17:25] Anthony Eufemio(@tymat):should I open an issue on GH? ---------------------------------------------------------------------------------------------------- [11:17:33] Elia Schito(@elia):can you open an issue for that on opal/… ---------------------------------------------------------------------------------------------------- [11:17:37] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [11:17:40] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [11:21:28] Elia Schito(@elia):@tymat thanks, if you can also add steps to reproduce would be great ---------------------------------------------------------------------------------------------------- [11:22:16] Anthony Eufemio(@tymat):yep ---------------------------------------------------------------------------------------------------- [11:35:25] Anthony Eufemio(@tymat):https://github.com/opal/opal/issues/966 ---------------------------------------------------------------------------------------------------- ############################## [2015-06-28] ############################## [18:14:15] Elia Schito(@elia):yep :) ---------------------------------------------------------------------------------------------------- [18:28:31] Forrest Chang(@fkchang):poo, middleman sprockets hasn't upgraded to sprockets 3, though I see some work in master ---------------------------------------------------------------------------------------------------- [18:56:52] Forrest Chang(@fkchang):ok, put in the ? change, also updated to 7.2, won't be able to do 8 until middleman-sprockets can do sprockets 3 ---------------------------------------------------------------------------------------------------- [18:57:11] Forrest Chang(@fkchang):Have you guys seen the new Atom 1.0 video? We need a video like this https://www.youtube.com/watch?v=Y7aEiVwBAdk&feature=youtu.be ---------------------------------------------------------------------------------------------------- [19:41:15] Forrest Chang(@fkchang):I broke opal-playground, won't be able to fix until later in the day ---------------------------------------------------------------------------------------------------- [20:32:02] Rick Carlino(@RickCarlino):No worries @fkchang looks awesome so far. ---------------------------------------------------------------------------------------------------- [20:32:41] Rick Carlino(@RickCarlino):Also, question: Have you guys been following the WebASM stuff? Does that mean that if we can compile opal to ASM.js we will be ready for webasm?? ---------------------------------------------------------------------------------------------------- [20:34:55] Rick Carlino(@RickCarlino):From what I was reading, webasm is just going to be a binary format of asm.js AST. That sounds too simple for me, but I'm not familiar with either of the technologies ---------------------------------------------------------------------------------------------------- [18:01:38] Forrest Chang(@fkchang):I've tweaked @adambeynon 's opal-playground to support saving/link creation. I have a bunch of other improvements planned, see http://fkchang.github.io/opal-playground/#code:Document.ready%3F%20do%0A%20%20Element.find('%23main').on(%3Aclick)%20do%0A%20%20%20%20alert%20%22jQuery%20loves%20Opal!%22%0A%20%20end%0Aend%0A&html_code=%3Ch1%3EDear%20Opalists%3C%2Fh1%3E%0A%3Cp%3EWork%20in%20progress.%20%20Includes%20opal-jquery%2C%20opal-browser%2C%20lissio%2C%0A%20%20Still%20running%200.6.0%20at%20the%20momement%3C%2Fp%3E%0A%3Cbutton%20id%3D%22main%22%3E%0A%20%20Click%20me%0A%3C%2Fbutton%3E%0A%0A%3Ch2%3ETodos%3C%2Fh2%3E%0A%3Cul%3E%0A%20%20%3Cli%3EUpdate%20to%20latest%20opal%3C%2Fli%3E%0A%20%20%3Cli%3EShow%20compiler%20errors%2Fcompiled%20js%3C%2Fli%3E%0A%20%20%3Cli%3EAdd%20log%2Fopal-irb%3C%2Fli%3E%0A%20%20%3Cli%3Econvenience%20tweaks%3C%2Fli%3E%0A%20%20%3Cli%3ESupport%20haml%3C%2Fli%3E%0A%20%20%3Cli%3EAdd%20other%20libraries%3C%2Fli%3E%0A%20%20%3Cli%3EMake%20libraries%20selectable%3C%2Fli%3E%0A%20%20%3Cli%3EYou%20tell%20me%3C%2Fli%3E%0A%3C%2Ful%3E%0A%0A%0A&css_code=body%20%7B%0A%20%20background%3A%20%23eeeeee%3B%0A%7D%0A ---------------------------------------------------------------------------------------------------- [18:06:08] Elia Schito(@elia):@fkchang suggestion: using ? Instead of # plays well with URL shorteners (via window.location.search) ---------------------------------------------------------------------------------------------------- [18:06:58] Forrest Chang(@fkchang):ok ---------------------------------------------------------------------------------------------------- [18:09:17] Forrest Chang(@fkchang):I'll look at that, it breaks the decodeURIComponent trick I copied from try opal, though, so I'd have to change that ---------------------------------------------------------------------------------------------------- [18:13:33] Elia Schito(@elia):I think I did that change to try Opal some time ago ---------------------------------------------------------------------------------------------------- [18:14:00] Forrest Chang(@fkchang):shows u how long I lifted that trick ---------------------------------------------------------------------------------------------------- [18:14:10] Elia Schito(@elia):should be still there ---------------------------------------------------------------------------------------------------- ############################## [2015-06-29] ############################## [05:14:41] Forrest Chang(@fkchang):fixed opal-playground ---------------------------------------------------------------------------------------------------- [05:28:21] Forrest Chang(@fkchang):@adambeynon any ideas on how to run opal-irb in the context of the iframe in opal-playground? ---------------------------------------------------------------------------------------------------- [05:57:19] Forrest Chang(@fkchang):@adambeynon I think I have something ---------------------------------------------------------------------------------------------------- [13:57:06] Ángel M(@Angelmmiguel):hello all ---------------------------------------------------------------------------------------------------- [13:57:20] Rick Carlino(@RickCarlino):Good morning. ---------------------------------------------------------------------------------------------------- [13:57:49] Ángel M(@Angelmmiguel):I'm start a blog about ruby ---------------------------------------------------------------------------------------------------- [13:58:12] Ángel M(@Angelmmiguel):and I want to insert a box to execute ruby code (as example) on blog posts ---------------------------------------------------------------------------------------------------- [13:58:31] Rick Carlino(@RickCarlino):Cool idea. ---------------------------------------------------------------------------------------------------- [13:58:33] Ángel M(@Angelmmiguel):so I find your library :) ---------------------------------------------------------------------------------------------------- [13:58:48] Ángel M(@Angelmmiguel):and create a simple Jquery plugin to add a "Opal Box" ---------------------------------------------------------------------------------------------------- [13:58:58] Ángel M(@Angelmmiguel):https://github.com/Angelmmiguel/opalbox-jquery ---------------------------------------------------------------------------------------------------- [13:59:32] Ángel M(@Angelmmiguel):It's for educational purpose ---------------------------------------------------------------------------------------------------- [14:01:56] Vais Salikhov(@vais):Very nice, @Angelmmiguel :+1: ---------------------------------------------------------------------------------------------------- [14:02:20] Rick Carlino(@RickCarlino):@Angelmmiguel I would share it on Reddit. People would like to see this sort of thing. ---------------------------------------------------------------------------------------------------- [14:02:34] Vais Salikhov(@vais):The screenshot looks awesome, but a live demo would be even better :wink: ---------------------------------------------------------------------------------------------------- [14:03:00] Rick Carlino(@RickCarlino):Yeah. People would love to have a link where they can play around. ---------------------------------------------------------------------------------------------------- [14:03:26] Ángel M(@Angelmmiguel):yes! :D ---------------------------------------------------------------------------------------------------- [14:03:40] Ángel M(@Angelmmiguel):I will create a github page with a simple playground to touch the box haha ---------------------------------------------------------------------------------------------------- [14:03:49] Ángel M(@Angelmmiguel):thanks for feedback ;) ---------------------------------------------------------------------------------------------------- [14:05:14] Vais Salikhov(@vais):@Angelmmiguel once you do, definitely post to http://reddit.com/r/ruby or I will :smile: ---------------------------------------------------------------------------------------------------- [14:05:34] Ángel M(@Angelmmiguel):ok @vais ---------------------------------------------------------------------------------------------------- [14:05:40] Ángel M(@Angelmmiguel):I will notify you ---------------------------------------------------------------------------------------------------- [14:05:43] Ángel M(@Angelmmiguel):thanks! ---------------------------------------------------------------------------------------------------- [14:32:26] AstonJ(@AstonJ):### Opal Resources - please add any you can think of here http://metaruby.com/t/opal-resources/201 ---------------------------------------------------------------------------------------------------- [14:33:17] Ángel M(@Angelmmiguel):@vais @RickCarlino done ;) ---------------------------------------------------------------------------------------------------- [14:33:18] Ángel M(@Angelmmiguel):http://angelmmiguel.github.io/opalbox-jquery/ ---------------------------------------------------------------------------------------------------- [14:33:34] Elia Schito(@elia):@AstonJ https://duckduckgo.com/?q=site:dev.mikamai.com+opal this should be good stuff for the blog section ---------------------------------------------------------------------------------------------------- [14:33:40] Ángel M(@Angelmmiguel):I will improve the page, but now, it runs haha ---------------------------------------------------------------------------------------------------- [14:36:57] AstonJ(@AstonJ):Thanks @elia! Can you let me know an order for a reading list please? (So starting with the introductory stuff moving up to the more complicated stuff.) I’ll add a link to each post then ;) ---------------------------------------------------------------------------------------------------- [14:37:25] Ángel M(@Angelmmiguel):@AstonJ I reply you on metaruby ---------------------------------------------------------------------------------------------------- [14:37:27] Ángel M(@Angelmmiguel):thanks! ---------------------------------------------------------------------------------------------------- [14:38:00] Vais Salikhov(@vais):@Angelmmiguel that was quick! Posted: https://www.reddit.com/r/ruby/comments/3biidf/a_box_to_compile_and_run_ruby_code_on_your_website/ :sparkles: ---------------------------------------------------------------------------------------------------- [14:38:41] Vais Salikhov(@vais):@Angelmmiguel maybe something more interesting than `return 1` for the example code? :wink2: ---------------------------------------------------------------------------------------------------- [14:38:54] Ángel M(@Angelmmiguel):thanks @vais. I love gh-pages hahahahha ---------------------------------------------------------------------------------------------------- [14:39:08] Ángel M(@Angelmmiguel):that's right... ---------------------------------------------------------------------------------------------------- [14:42:07] Vais Salikhov(@vais):Off topic: http://blog.juxt.pro/posts/why-clojurescript-matters.html really interesting piece in that it applies equally well to Opal (at least the first half of the article, titled "Avoid Splitting"). I feel there's a sea change taking place - just a year ago splitting a product team into back-end and front-end made all the sense in the word to me, and felt like *the* right way to do it. ---------------------------------------------------------------------------------------------------- [15:58:59] Ángel M(@Angelmmiguel):Updated the example code 😁 ---------------------------------------------------------------------------------------------------- [16:20:31] Forrest Chang(@fkchang):@Angelmmiguel pretty cool, you've given me an idea on how to write instructional posts ---------------------------------------------------------------------------------------------------- [16:27:51] Ángel M(@Angelmmiguel):thanks @fkchang. Yes, I will use it to allow readers interact with the code :) ---------------------------------------------------------------------------------------------------- [17:09:59] Rick Carlino(@RickCarlino):http://qiezi.me/projects/mruby-web-irb/mruby.html ---------------------------------------------------------------------------------------------------- [17:10:13] Rick Carlino(@RickCarlino):Whoah! Compiled MRuby -> JS using emscripten. Has anyone seen that? ---------------------------------------------------------------------------------------------------- [17:11:38] Rick Carlino(@RickCarlino):The executable is 2.2 mb, which is gigantic. WOnder how much WebASM will optimize that ---------------------------------------------------------------------------------------------------- [17:15:18] meh.(@meh):RickCarlino, I don't think it will be optimized out much ---------------------------------------------------------------------------------------------------- [20:13:14] ylluminate(@ylluminate):@elia @meh @adambeynon any thoughts on this: https://github.com/opal/opal/issues/965 ---------------------------------------------------------------------------------------------------- [23:23:26] AstonJ(@AstonJ):### Opal Resources - updated and now a Wiki on MetaRuby http://metaruby.com/t/opal-resources/201 Anyone at trust level one or higher can submit changes. ---------------------------------------------------------------------------------------------------- [23:23:39] Forrest Chang(@fkchang):So I took 2 separate approaches at integrating opal-irb w/opal-playground * embedding it in the object * pros - easy to make it span the bottom * cons - need to extend it to communicate remotely w/the iframe (coz we want to run everything against the iframe's objects, not that of opal-playground) * embedding it in the iframe directly * pros - it runs against the objects in the iframe * can't pull the ui away from the iframe Kind of stuck at which way to continue, approach 1 would require rewriting a lot of opal-irb to make it work w/a remote iframe, approach 2 limits the UI strongly. Maybe approach 2 to start, giving the capability now, and then down the road doing approach 1, but that would be reinforced more if I could see another use for this functionality Thoughts, tips? Thanks ---------------------------------------------------------------------------------------------------- ############################## [2015-06-30] ############################## [21:40:13] Mitch VanDuyn(@catmando):@ktec, am swamped right now, but if I get I chance I will have a look... ---------------------------------------------------------------------------------------------------- [21:40:17] Elia Schito(@elia):@ktec can you post any of the errors just to start from something? ---------------------------------------------------------------------------------------------------- [21:44:01] Forrest Chang(@fkchang):@ktec I looked at your repo, but I would need more specifics ---------------------------------------------------------------------------------------------------- [21:47:18] Keith(@ktec):hi guys, so the first problem is the inheritance, I would like to use the benefits of ruby and implement the base.rb class here https://github.com/globalkeith/opal-pixi/blob/master/lib/opal/pixi/base.rb and include it, as an example here: https://github.com/globalkeith/opal-pixi/blob/master/lib/opal/pixi/container.rb however when I include it, it runs the x-string stuff, but the instance methods are no longer available. ---------------------------------------------------------------------------------------------------- [21:49:20] Elia Schito(@elia):@ktec maybe you're overwriting some local vars, eval is dangerous as always :) ---------------------------------------------------------------------------------------------------- [21:49:56] Keith(@ktec):If i can use `include PIXI::Base` I can get rid of the x-strings in all the classes. Then i can start to implement some metaprogramming stuff like method missing. I couldn't get the x-string to interpolate without doing it like that ---------------------------------------------------------------------------------------------------- [21:50:09] Elia Schito(@elia):also beware that in opal 0.7 _proto and friends are all preceded by `$$`, e.g. `$$proto` ---------------------------------------------------------------------------------------------------- [21:50:39] Keith(@ktec):perhaps there's a problem with the way the project is set up, thats really why i was asking if someone could take a look and point me in the right direction ---------------------------------------------------------------------------------------------------- [21:50:39] Mitch VanDuyn(@catmando):@ktec, I am missing where you are doing teh include? ---------------------------------------------------------------------------------------------------- [21:51:23] Keith(@ktec):at the moment the includes are all commented out (all includes are in these classes https://github.com/globalkeith/opal-pixi/tree/master/lib/opal/pixi ---------------------------------------------------------------------------------------------------- [21:51:38] Keith(@ktec):i want to use `base.rb` ---------------------------------------------------------------------------------------------------- [21:54:40] Keith(@ktec):i've set up the https://github.com/globalkeith/opal-pixi/tree/master/demo directory to run the example, which uses the gem code in https://github.com/globalkeith/opal-pixi/tree/master/lib ---------------------------------------------------------------------------------------------------- [21:55:06] ylluminate(@ylluminate):hey @ktec, pop on over here: https://gitter.im/orbitalimpact/opal-pixi ---------------------------------------------------------------------------------------------------- [21:55:17] Keith(@ktec):thats where i started ---------------------------------------------------------------------------------------------------- [00:04:09] Forrest Chang(@fkchang):[![Pasted_Image_6_29_15__5_03_PM.png](https://files.gitter.im/opal/opal/cCNy/thumb/Pasted_Image_6_29_15__5_03_PM.png)](https://files.gitter.im/opal/opal/cCNy/Pasted_Image_6_29_15__5_03_PM.png) ---------------------------------------------------------------------------------------------------- [00:04:28] Forrest Chang(@fkchang):I need some styling help, this is what I've got but I don't think it scales out right ---------------------------------------------------------------------------------------------------- [04:33:49] Jared White(@jaredcwhite):I'm planning on writing an article with example code on how to use design patterns in rolling your own front-end framework with Opal. Anyone have any suggestions for what to focus on? Any pain points? I want to go beyond binding a method to a button click or rendering a list of li tags. That's obvious stuff. :) ---------------------------------------------------------------------------------------------------- [13:48:28] ylluminate(@ylluminate):@fkchang you know, i've always thought a pull request or fork of jsbin would be an incredibly useful approach along with an integration of the repl. it would definitely give opal more exposure to boot if it were integrated into the core. ---------------------------------------------------------------------------------------------------- [16:26:45] Rick Carlino(@RickCarlino):https://www.reddit.com/r/ruby/comments/3bi3qx/opal_playground_like_js_fiddle_but_dom/ Comments are flowing in on Reddit. ---------------------------------------------------------------------------------------------------- [16:29:41] Ángel M(@Angelmmiguel):Same onhttps://www.reddit.com/r/ruby/comments/3biidf/a_box_to_compile_and_run_ruby_code_on_your_website/ :) ---------------------------------------------------------------------------------------------------- [16:30:19] Ángel M(@Angelmmiguel):I'm developing multitab (multiple files) on voces ---------------------------------------------------------------------------------------------------- [16:30:31] Ángel M(@Angelmmiguel):boxes* ---------------------------------------------------------------------------------------------------- [16:31:07] Rick Carlino(@RickCarlino):Looks like you're loading Opal over insecure HTTP (no 's') and chrome won't let me load the page . ---------------------------------------------------------------------------------------------------- [16:36:26] Forrest Chang(@fkchang):@ylluminate that's a pretty good idea, except that I'd have to deal w/javascript. I'm planning on having stuff that is a fair amount different than what jsbin and clones do, so I'm probably going to pursue that direction, while I'm inspired ---------------------------------------------------------------------------------------------------- [16:36:56] Forrest Chang(@fkchang):@RickCarlino cool on the comments and ur presence on the reddit thread ---------------------------------------------------------------------------------------------------- [16:37:33] Forrest Chang(@fkchang):So should I push my current 'embedded in the iframe, but not too good looking or response opal-irb' that I have displayed in the screen shot? ---------------------------------------------------------------------------------------------------- [16:37:57] Forrest Chang(@fkchang):oh, and any style wizardry assistance would be appreciated ---------------------------------------------------------------------------------------------------- [17:49:03] Jikku Jose(@JikkuJose):Any idea why the `css class` isn't getting set in the initialize method?: http://tinyurl.com/opal-box-class ---------------------------------------------------------------------------------------------------- [17:50:05] Jikku Jose(@JikkuJose):If I uncomment the explicit setting of the class it works. ---------------------------------------------------------------------------------------------------- [19:16:47] Forrest Chang(@fkchang):how quick should I push to opal-playground, I like added 3 features, but I'd sort of like some vetting ---------------------------------------------------------------------------------------------------- [19:52:04] Rick Carlino(@RickCarlino):Maybe you could push a 'staging' that we can all QA off of and let you know. Is that what you're worried about? Bugs / compat issues? ---------------------------------------------------------------------------------------------------- [19:52:19] Mitch VanDuyn(@catmando):I was just using it with @JikkuJose problem, and it was very cool ---------------------------------------------------------------------------------------------------- [19:53:53] Mitch VanDuyn(@catmando):btw @JikkuJose I don't see anything wrong with that code... I suspect its because Element is just a thin wrapper on Jquery and hence does not work. But I'm not sure. Folks: Is there any known problem with circular requires? I have several classes that end up with a circular dependency. ---------------------------------------------------------------------------------------------------- [20:21:28] Forrest Chang(@fkchang):@RickCarlino something like that. I would like to make some sort of preview version available before I foist it upon the world ---------------------------------------------------------------------------------------------------- [20:24:43] Forrest Chang(@fkchang):On another note, I'm at an interesting place where working on opal-playground reinforces 2 'not particularly known/understood ideas' I want to pitch for opal, namely * being able to edit code in the app and not have to re setup state (ala smalltalk images and lisp machines) is a huge advance that most ppl can't appreciate (call it Editor/IDE Blub) * Lissio's way (doesn't have to be lissio, but no other framework does it) of combining markup, style and behavior into 1 coherent ruby class is both more productive, and responds to increasing complexity better. That being said, it's potentially a long rambling blog post I don't know I have time to write while it's fresh in my brain ---------------------------------------------------------------------------------------------------- [20:30:29] Mitch VanDuyn(@catmando):@fkchange - I am coming rapidly to the same conclusion working with opal-react (react.rb)... Current state of react.rb that my team is using is the same idea. behavior and markup are in together in small simple classes (have not really pushed my team to bring the style in, but I think that's next.) And like wise its pretty obvious you could have a great development environment where you developed these classes in a very interactive environment. I am imaging typing things like: edit Component::Navbar and having that fire up a window with the Navbar code. When you save it fires up a react rerender of the component... ---------------------------------------------------------------------------------------------------- [20:31:46] Mitch VanDuyn(@catmando):The whole thing could be somehow backed by github, so you have builtin config management too. ---------------------------------------------------------------------------------------------------- [20:33:22] Forrest Chang(@fkchang):@catmando react still does css in the normal (i.e. cascaded over all kinds of css files and not associated direct w/the component, nor in a dsl) way, no? My particular issue was w/css, looking for the right files, changing mental languages, etc. In lissio, I believe a lot of cascading types of practices would be unnecessary due to using css inheritance ---------------------------------------------------------------------------------------------------- [20:34:42] Mitch VanDuyn(@catmando):@fkchang - yes I hate that too, but there are folks in the react.js world who have tools that allow the css to be nicely placed right in the component. I want to look into that for opal-react. ---------------------------------------------------------------------------------------------------- [20:35:25] Forrest Chang(@fkchang):@catmando related, I had planned to make a lissio component editor, which is in 20/20 hindsight is functionally equivalent to opal-playground, but each editor is ruby and it maps down to 1 class, and had thought that I'd want to add opal-react to the playground, except that I haven't played w/it at all ---------------------------------------------------------------------------------------------------- [20:35:51] Forrest Chang(@fkchang):@catmando nice, got some links so I can see what they are doing? ---------------------------------------------------------------------------------------------------- [20:36:04] Mitch VanDuyn(@catmando):However main priority was to get the system up, and get the team productive and they are used to style sheets. Meanwhile we really needed a way to talk to the active-record objects from within react, so that is done now (at least enough to move on.) ---------------------------------------------------------------------------------------------------- [20:39:07] Mitch VanDuyn(@catmando):Why don't we set up a time, and I can get a staging version of what we have up and running and then do some code walk throughs and show you how it works. How does that sound? ---------------------------------------------------------------------------------------------------- [20:40:30] Mitch VanDuyn(@catmando):@fkchang - re: the editor. Exactly the idea. works good with react to, as each component = a class, so if you had a class editor then it = a component editor. ANd because react is well reactive, then it should be almost no work to make saving the changes == a render update! ---------------------------------------------------------------------------------------------------- [20:41:54] Mitch VanDuyn(@catmando):@fkchang - yes it would be nice to have some way to pull in various components depending on what people are doing. ---------------------------------------------------------------------------------------------------- [20:54:43] Forrest Chang(@fkchang):@catmando yeah, I'd love to see what you guys were doing, also the css in react component thing too ---------------------------------------------------------------------------------------------------- [20:56:34] Mitch VanDuyn(@catmando):@fkchang - well lets set a time! We can do it gitter tomorrow perhaps. To be clear... we are NOT doing the CSS thing in react (YET) but I am thinking we will just grab it right out lissio. It would work just the same I think. ---------------------------------------------------------------------------------------------------- [20:59:16] Forrest Chang(@fkchang):For a quickie thing, I could pull in opal-react lib and you could do everything thru the ruby window, does opal-react require everything, in lissio, you have to specifically require any components you want to subclass, so to do the lissio experiment, I'd have to do that ---------------------------------------------------------------------------------------------------- [20:59:40] Mitch VanDuyn(@catmando):@fkchang the only thing I might change about how lissio does it is to change this ```ruby css do rule '.title' do font size: 32.px end rule '.subtitle' do font size: 18.px, style: :italic end end ``` to just ```ruby rule '.title' do font size: 32.px end ``` as the css seems redundant. ---------------------------------------------------------------------------------------------------- [21:00:19] Forrest Chang(@fkchang):@catmando what time zone r u in? ---------------------------------------------------------------------------------------------------- [21:00:57] Forrest Chang(@fkchang):@catmando lissio does that, I believe, to 1) designate the css area 2), in that block is where the css dsl is active. @meh could answer definitively, but my explanation makes sense to me ---------------------------------------------------------------------------------------------------- [21:01:09] Mitch VanDuyn(@catmando):east coast. My only constraint though is my wife is returning from west coast tomorrow sometime so it would be best to do it before that. ---------------------------------------------------------------------------------------------------- [21:01:55] Forrest Chang(@fkchang):@catmando when does ur wife return? ---------------------------------------------------------------------------------------------------- [21:02:26] Mitch VanDuyn(@catmando):@re lissio... understood. In react.rb you `include React::Component` and then all the generator methods are available within that class. ---------------------------------------------------------------------------------------------------- [21:04:16] Mitch VanDuyn(@catmando):So thinking about a minimal experiment in opal-react: basically you need the gem loaded you need the component class defined then you need to attach the class to some dom element. ---------------------------------------------------------------------------------------------------- [21:06:25] Mitch VanDuyn(@catmando):There is a lot of magic being done to make the syntax very noise free, and I would have to think about what happens if you redefine the component. Should work....I will do a smoke test later and see what happens. ---------------------------------------------------------------------------------------------------- [21:15:18] Mitch VanDuyn(@catmando):@fkchang - not sure, but she is coming from Seattle so I am guessing pretty late... let me see if I can get txt her now. but I think we can assume anytime before 5:00 PM EDT ---------------------------------------------------------------------------------------------------- [21:33:44] Keith(@ktec):hi all, I wonder if someone could take a look at this for me when you have a minute. https://github.com/globalkeith/opal-pixi I'm trying to move the opal-pixi library forwards a get all the examples completed, however I've stumbled on some fairly simple stuff which I dont understand. Firstly when I try to implement an included Module, it seems to break all the inherited instance methods, and also when I upgrade to opal 7+ everything breaks and I dont really know where to start. If anyone can point me in the right direction with these and any other tips in general, I'm excited to take this project forward and complete all the examples on http://pixijs.github.io/examples/index.html many thanks ---------------------------------------------------------------------------------------------------- [21:37:38] Forrest Chang(@fkchang):@catmando that might be tough for me, I think I'm not available before 6pm ET ---------------------------------------------------------------------------------------------------- [21:38:11] Mitch VanDuyn(@catmando):i'll let you know when I know more... good chance i;ll be available late... ---------------------------------------------------------------------------------------------------- ############################## [2015-07-01] ############################## [00:20:34] Forrest Chang(@fkchang):ok, I've updated http://fkchang.github.io/opal-playground - added help, show compile error, show compiled js, embedded opal-irb, some other tweaks ---------------------------------------------------------------------------------------------------- [00:22:12] John Rizzo(@johnrizzo1):any good examples I can use to learn how to use components… the documentation only tells you the purpose and how they fit in but not how to create new ones... ---------------------------------------------------------------------------------------------------- [00:22:34] John Rizzo(@johnrizzo1):oops ---------------------------------------------------------------------------------------------------- [00:22:37] John Rizzo(@johnrizzo1)::) ---------------------------------------------------------------------------------------------------- [00:23:00] John Rizzo(@johnrizzo1):wrong chat ---------------------------------------------------------------------------------------------------- [00:51:48] Mitch VanDuyn(@catmando):@fkchang do u want to do a show and tell and 7:00 eastern tomorrow? ---------------------------------------------------------------------------------------------------- [00:58:44] Mitch VanDuyn(@catmando):And anybody else interested in react opal ---------------------------------------------------------------------------------------------------- [01:18:51] Forrest Chang(@fkchang):@catmando I think I can do that ---------------------------------------------------------------------------------------------------- [11:44:04] Andrzej Krzywda(@andrzejkrzywda):Hey all, as Arkency we launched React.js koans 2 days ago. To our surprise it gathered over 1500 GitHub stars and it's now a trending repo - https://github.com/arkency/reactjs_koans The original version uses ES6, but the main goal was to teach React.js not ES6 (not that much). Long story short - it would be great to put the Opal version as well. This may be a good promotion for Opal as React.js is nowe getting more and more popular. Someone already created an issue for that: https://github.com/arkency/reactjs_koans/issues/22 Just a full disclosure here - this repository has a book ad in the README - thanks to the people buying the book, we can spend more time/money on doing open source like this. If this is not a problem, then your help in doing the Opal version would be more than welcome. Even just porting the first exercise would be of much value - as then it would be easier for others to jump in and help with the next exercises. ---------------------------------------------------------------------------------------------------- [11:45:29] Elia Schito(@elia)::eyeglasses: watched ---------------------------------------------------------------------------------------------------- [13:11:27] Vais Salikhov(@vais):@andrzejkrzywda one of those 1500 stars is mine for what it's worth :) ---------------------------------------------------------------------------------------------------- [13:12:13] Andrzej Krzywda(@andrzejkrzywda):@vais thanks :) ---------------------------------------------------------------------------------------------------- [13:15:02] Vais Salikhov(@vais):@zetachang authored https://github.com/zetachang/react.rb which is an Opal wrapper around react.js ---------------------------------------------------------------------------------------------------- [13:15:02] Vais Salikhov(@vais):@zetachang authored https://github.com/zetachang/react.rb which is an Opal wrapper around react.js ---------------------------------------------------------------------------------------------------- [15:56:56] CJ Lazell(@cj):@elia morning. I’m trying to get the source maps working using that code you gave me. I intergrated like this https://gist.github.com/a8c42015f28f66f35afb. When debug is true and it goes directly through sprockets i get file not found. via opal server it finds the file just fine. Am I missing something? ---------------------------------------------------------------------------------------------------- [16:49:40] CJ Lazell(@cj):how is this code supposed to work? https://github.com/opal/opal/blob/master/lib/opal/sprockets/source_map_server.rb#L85 what is self? it’s never actually getting in there when path_info == wedge.map ---------------------------------------------------------------------------------------------------- [16:51:02] CJ Lazell(@cj):changing the regex to %r{^(.*)(\.self|\.map)$} makes it work ---------------------------------------------------------------------------------------------------- [16:51:23] CJ Lazell(@cj):gitter removed the backslashes ---------------------------------------------------------------------------------------------------- [17:05:27] CJ Lazell(@cj):created a ticket https://github.com/opal/opal/issues/968 ---------------------------------------------------------------------------------------------------- [20:46:49] Elia Schito(@elia):@cj `.self` comes from sprockets 3 and it's a "pipeline" intended to serve just the file you're requesting ---------------------------------------------------------------------------------------------------- [20:46:50] Elia Schito(@elia):https://github.com/rails/sprockets/blob/c46c6218573d3982879c6ef90074beb8077060e9/lib/sprockets.rb#L90-L92 ---------------------------------------------------------------------------------------------------- [20:47:50] Elia Schito(@elia):the main problem is that the whole thing is a huge hack on sprockets which won't support sourcemaps until v4 ---------------------------------------------------------------------------------------------------- [21:18:16] Mitch VanDuyn(@catmando):@fkchang Hey I don't think I can do this react-opal thing tonight, unless a bunch of people are going to e very dissappointed... I just have a bunch of stuff that I need to do. I think we can schedule it for next week. Okay? ---------------------------------------------------------------------------------------------------- [22:12:30] Forrest Chang(@fkchang):@catmando next week is fine ---------------------------------------------------------------------------------------------------- ############################## [2015-07-02] ############################## [16:41:06] CJ Lazell(@cj):@elia something just pushed to opal has broken opal-rspec it gives this error `TypeError: 'undefined' is not a function (evaluating 'lhs['$-'](rhs)') ` ---------------------------------------------------------------------------------------------------- [16:41:15] CJ Lazell(@cj):figuring out which commit broke it right now ---------------------------------------------------------------------------------------------------- [16:41:38] Elia Schito(@elia):thanks, that's useful work ---------------------------------------------------------------------------------------------------- [16:46:54] CJ Lazell(@cj):I think it’s the new time stuff… going to take me some time to pinpoint the commit, there are a lot! lol ---------------------------------------------------------------------------------------------------- [16:48:39] Elia Schito(@elia):@cj even a simple snippet that demonstrates the error would be great ---------------------------------------------------------------------------------------------------- [16:48:57] CJ Lazell(@cj):I’m just getting it when I run opal-rspec ---------------------------------------------------------------------------------------------------- [16:49:10] CJ Lazell(@cj):with the latest opal ---------------------------------------------------------------------------------------------------- [16:51:24] CJ Lazell(@cj):opal/master that is ---------------------------------------------------------------------------------------------------- [16:54:56] CJ Lazell(@cj):@elia ok, it’s this commit that broke it https://github.com/opal/opal/commit/c55b41b1698489f8b23fa7132d40694d287cf1fa ---------------------------------------------------------------------------------------------------- [16:56:39] Elia Schito(@elia):I guess @vais will have some fun with it when he comes back online :birthday: ---------------------------------------------------------------------------------------------------- [16:56:57] Elia Schito(@elia):@cj can you open an issue on GH? ---------------------------------------------------------------------------------------------------- [16:57:24] CJ Lazell(@cj):yee, trying to think of an easy re-create ---------------------------------------------------------------------------------------------------- [17:01:17] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [17:03:28] CJ Lazell(@cj):@elia @vais https://github.com/opal/opal/issues/972 ---------------------------------------------------------------------------------------------------- [17:05:21] CJ Lazell(@cj):I’m a bug magent lol ---------------------------------------------------------------------------------------------------- [18:32:39] ylluminate(@ylluminate):we're still looking for some input on this: https://github.com/opal/opal/issues/965 ---------------------------------------------------------------------------------------------------- [18:33:04] ylluminate(@ylluminate):been about 6 days... :) ---------------------------------------------------------------------------------------------------- [18:46:55] Forrest Chang(@fkchang):@ylluminate :point_up: [June 26, 2015 9:09 AM](https://gitter.im/opal/opal?at=558d793198f9c0bc3da03e02) ---------------------------------------------------------------------------------------------------- [18:51:57] Gabriel Rios(@gabrielrios):@fkchang I got that, but what I’m wondering is why can’t opal take cara of that ---------------------------------------------------------------------------------------------------- [18:57:49] Gabriel Rios(@gabrielrios):And I sure that ‘toll free bridge’ classes might not be something common, someone coming from ruby would expect the `#initialize` method to work, instead of having to overriding `.new` ---------------------------------------------------------------------------------------------------- [19:04:02] ylluminate(@ylluminate):@fkchang thus why we're hoping that @adambeynon @elia @meh or someone can chime in with some clarification on that front... :fire: ---------------------------------------------------------------------------------------------------- [20:28:56] Forrest Chang(@fkchang):hmm, would documenting that suffice? ---------------------------------------------------------------------------------------------------- [20:29:36] Forrest Chang(@fkchang):because I can see in Ruby-fying a toll free bridged class, you might change what you pass in vs automatically assuming they match 1 to 1 ---------------------------------------------------------------------------------------------------- [20:32:09] Forrest Chang(@fkchang):so you wouldn't necessarily auto generate a new function ---------------------------------------------------------------------------------------------------- [20:36:15] Gabriel Rios(@gabrielrios):Yes, that was exactly my point on the issue. I’m trying to clarify this so we can at least add documentation for this, as wrapping JS libraries as so important for opal and deserves some docs ---------------------------------------------------------------------------------------------------- [21:11:18] ylluminate(@ylluminate):Right, it is critically important for Opal to have an exceptionally well documented and authoritative wrapping tutorial / document. ---------------------------------------------------------------------------------------------------- [23:46:44] Forrest Chang(@fkchang):It's my intent to document wrapping and other stuff in a series of blog posts, possibly that'll be the basis of the official docs? ---------------------------------------------------------------------------------------------------- [03:14:46] Jamie Gaskins(@jgaskins):@fkchang Re: "Lissio's way (doesn't have to be lissio, but no other framework does it) of combining markup, style and behavior into 1 coherent ruby class" — Clearwater does it pretty similarly to React: https://gist.github.com/jgaskins/746f65ccbf267dca36a6 Notice `{ style: style }` in some of the attribute hashes. ---------------------------------------------------------------------------------------------------- [03:17:08] Jamie Gaskins(@jgaskins):It's pretty awesome. It makes components completely self-contained, which makes it possible to extract your components to gems without having to add stylesheets for them. ---------------------------------------------------------------------------------------------------- [05:20:33] Jikku Jose(@JikkuJose):@catmando thanks for taking a look; I was going mad about why that wasn't working! Did you mean to say `super` method cannot be trusted to work as it should be? ---------------------------------------------------------------------------------------------------- [05:21:24] Jikku Jose(@JikkuJose):Other than that; I don't see any problem with this: http://tinyurl.com/opal-box-class ---------------------------------------------------------------------------------------------------- [05:23:29] Jikku Jose(@JikkuJose):@fkchang great work with Opal playground; perhaps a short url generating system can be built to share the links easily ---------------------------------------------------------------------------------------------------- [06:59:35] Forrest Chang(@fkchang):@jgaskins cool, I will have to get around to checking it out ---------------------------------------------------------------------------------------------------- [07:00:06] Forrest Chang(@fkchang):@JikkuJose thx, maybe a bit.ly or similar interface or something ---------------------------------------------------------------------------------------------------- [07:21:56] Jikku Jose(@JikkuJose):@fkchang yes! It will make copying a breeze ---------------------------------------------------------------------------------------------------- [07:27:59] Elia Schito(@elia):@fkchang @JikkuJose I suggest https://git.io ---------------------------------------------------------------------------------------------------- [14:30:45] CJ Lazell(@cj):@elia so is the reason it’s not getting passed because it’s not in a white list. similar to roda assets? can’t we just remove the self for now so that it works? ---------------------------------------------------------------------------------------------------- [14:32:42] Elia Schito(@elia):@cj self it's a sprockets thing so it's not a choice. The code you posted uses sprockets or it's something based on roda or custom? ---------------------------------------------------------------------------------------------------- [14:33:51] CJ Lazell(@cj):It’s using the code you gave me before. but it can’t get past this line https://github.com/opal/opal/blob/master/lib/opal/sprockets/source_map_server.rb#L85 ---------------------------------------------------------------------------------------------------- [14:34:19] CJ Lazell(@cj):the .map file exists, because if I remove \.self it will work ---------------------------------------------------------------------------------------------------- [14:35:33] CJ Lazell(@cj):https://github.com/wedgeio/wedge/blob/master/lib/wedge/middleware.rb#L21-L25 and is used on line 115 ---------------------------------------------------------------------------------------------------- [14:37:31] CJ Lazell(@cj):that line in the opal code would never pass as the regex is looking for some_file.self.map ---------------------------------------------------------------------------------------------------- [14:37:40] CJ Lazell(@cj):but the file is just some_file.map ---------------------------------------------------------------------------------------------------- [14:38:36] Elia Schito(@elia):What I don't get is why the files are there without the .self extension ---------------------------------------------------------------------------------------------------- [14:39:20] CJ Lazell(@cj):@elia so are they supposed to be some_file.self.map? ---------------------------------------------------------------------------------------------------- [14:40:01] CJ Lazell(@cj):because the file it’s looking for and adds to the js is some_file.map ---------------------------------------------------------------------------------------------------- [14:50:15] Elia Schito(@elia):@cj yes, they're supposed to have that `.self`, is your sprockets environment using debug mode? ---------------------------------------------------------------------------------------------------- [14:50:47] CJ Lazell(@cj):https://github.com/wedgeio/wedge/blob/master/lib/wedge/middleware.rb#L16 ---------------------------------------------------------------------------------------------------- [14:53:20] Elia Schito(@elia):@cj maybe you're calling assets without the `?body=1` param ---------------------------------------------------------------------------------------------------- [14:53:21] Elia Schito(@elia):https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/rails/helper.rb#L60 ---------------------------------------------------------------------------------------------------- [14:53:56] CJ Lazell(@cj):@elia ye I’m not doing that, didn’t know you had too lol…. is that another hack? ---------------------------------------------------------------------------------------------------- [14:55:58] CJ Lazell(@cj):wow… adding that makes it work… random ---------------------------------------------------------------------------------------------------- [14:56:10] Elia Schito(@elia):no, it's how sprockets expect assets to be called for debugging, works out of the box in rails so I didn't thoght about it before ---------------------------------------------------------------------------------------------------- [14:56:21] Elia Schito(@elia):remove any sprockets cache you may have ---------------------------------------------------------------------------------------------------- [14:58:40] CJ Lazell(@cj):@elia thank you again. we should have docs for wedge soon. it’s pretty awesome :) ---------------------------------------------------------------------------------------------------- [14:58:57] Elia Schito(@elia)::+1: happy to help ---------------------------------------------------------------------------------------------------- [15:07:40] CJ Lazell(@cj):those links work btw ---------------------------------------------------------------------------------------------------- [15:07:42] CJ Lazell(@cj):@elia so another random issue when doing http://local.sh/assets/wedge/wedge.js?body=1 it doesn’t include opal, going to http://local.sh/assets/wedge/wedge.js does ---------------------------------------------------------------------------------------------------- [15:08:52] Elia Schito(@elia):yes because you're supposed to have a script[src] tag for each body=1 script ---------------------------------------------------------------------------------------------------- [15:09:19] Elia Schito(@elia):you can checkout the sprockets-rails helper.rb to see how it's done in rails ---------------------------------------------------------------------------------------------------- [15:10:00] Elia Schito(@elia):but more or less should be something like `sprockets_env['wedge.js'].to_a` ---------------------------------------------------------------------------------------------------- [15:10:15] Elia Schito(@elia):for each entry you need a script tag ---------------------------------------------------------------------------------------------------- [15:10:29] CJ Lazell(@cj):that seems terrible https://github.com/wedgeio/wedge/blob/master/lib/wedge.rb#L1-L21, I now see why that other person was suggesting being able to group them up ---------------------------------------------------------------------------------------------------- [15:11:20] Elia Schito(@elia):yep, I tried to merge maps together in 0.7 but they were broken and I wasnt' able to debug the problem ---------------------------------------------------------------------------------------------------- [15:11:49] Elia Schito(@elia):so in opal 0.8 we've gone back to separated assets ---------------------------------------------------------------------------------------------------- [15:13:51] CJ Lazell(@cj):http://www.giantfreakinrobot.com/wp-content/uploads/2011/08/vadernoo.jpg ---------------------------------------------------------------------------------------------------- [15:14:04] CJ Lazell(@cj):lol ---------------------------------------------------------------------------------------------------- [15:14:06] Elia Schito(@elia):lol ---------------------------------------------------------------------------------------------------- [15:15:28] Elia Schito(@elia):@cj try this impl ---------------------------------------------------------------------------------------------------- [15:15:29] Elia Schito(@elia):https://github.com/opal/opal/blob/2dce252fa67e5bd0afed83039d391fa5ab6edd12/lib/opal/sprockets/server.rb#L124-L142 ---------------------------------------------------------------------------------------------------- [15:15:49] CJ Lazell(@cj):I guess I’ll just add that in for now then, damn sprockets! that’s why I use roda assets :) ---------------------------------------------------------------------------------------------------- [15:16:39] CJ Lazell(@cj):ha… that’s what I was going to do… that’s fine for the main .js file. but the files you are requring via ajax I guess all need to be split up if they require other files right? ---------------------------------------------------------------------------------------------------- [15:17:39] Elia Schito(@elia):I guess so ---------------------------------------------------------------------------------------------------- [15:17:42] CJ Lazell(@cj):so basically if a rb file requires another file I have to make that a seperate file request, right? ---------------------------------------------------------------------------------------------------- [15:17:55] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [15:18:07] CJ Lazell(@cj):I think I just threw up a little ---------------------------------------------------------------------------------------------------- [15:19:25] Elia Schito(@elia):if you find a good way to merge sourcemaps when concatenating assets I'll add it immediately (so to speak) ---------------------------------------------------------------------------------------------------- [15:20:00] Jared White(@jaredcwhite):@elia BTW, that latest require_self patch you did fixed all my sprockets problems. Sooo excited for the final 0.8 release!!! ---------------------------------------------------------------------------------------------------- [15:20:27] Elia Schito(@elia):@jaredcwhite the one in the PR? ---------------------------------------------------------------------------------------------------- [15:20:27] CJ Lazell(@cj):@jaredcwhite what sprocket problems were you having? ---------------------------------------------------------------------------------------------------- [15:20:32] Jared White(@jaredcwhite):I mean require_tree ---------------------------------------------------------------------------------------------------- [15:20:53] Elia Schito(@elia):yeah, I'll backport it to the 0-8-stable branch ---------------------------------------------------------------------------------------------------- [15:21:17] Elia Schito(@elia):maybe it's time to release after all cc @meh @adambeynon ---------------------------------------------------------------------------------------------------- [15:21:19] CJ Lazell(@cj):@elia one other thing, what is the need for https://github.com/opal/opal/blob/2dce252fa67e5bd0afed83039d391fa5ab6edd12/lib/opal/sprockets/processor.rb#L119 ? ---------------------------------------------------------------------------------------------------- [15:22:25] Jared White(@jaredcwhite):@cj I had a require_tree '.' In my application.js.rb file and that wasn't working. But it's now with Elia's PR ---------------------------------------------------------------------------------------------------- [15:22:26] Elia Schito(@elia):@cj good point, that's to bootstrap the main file since letting sprockets manage single files makes them all compile as "requireable" ---------------------------------------------------------------------------------------------------- [15:23:02] Elia Schito(@elia):so the main file needs to be required (as in `Opal.require('wedge')`) ---------------------------------------------------------------------------------------------------- [15:23:33] Elia Schito(@elia):the code you linked also takes care of stubbed and non opal files ---------------------------------------------------------------------------------------------------- [15:23:53] CJ Lazell(@cj):interesting… thank you ---------------------------------------------------------------------------------------------------- ############################## [2015-07-03] ############################## [02:45:16] Jikku Jose(@JikkuJose):In case someone is interested: I was able to solve the problem of not being able to assign class through `initialize` (http://tinyurl.com/opal-box-class) by creating a class method to call `initialize`: http://git.io/vqJBs ---------------------------------------------------------------------------------------------------- [02:48:50] Rick Carlino(@RickCarlino):@JikkuJose Neat find. I wonder why it doesn't work with initialize? Did you try calling `super`? ---------------------------------------------------------------------------------------------------- [02:49:24] Rick Carlino(@RickCarlino):eh, actually, Im not sure ---------------------------------------------------------------------------------------------------- [05:23:45] Jikku Jose(@JikkuJose):@RickCarlino yes tried that. See the first example, I was assuming it will work just like in Ruby but somehow the class didn't get added. ---------------------------------------------------------------------------------------------------- [22:17:23] Ryan Stout(@ryanstout):if any opal core people are around, I think I found a regression in 0.8 (in process of upgrading volt): https://github.com/opal/opal/issues/973 ---------------------------------------------------------------------------------------------------- [22:17:33] Ryan Stout(@ryanstout):I'm wondering if there's an easy fix, it used to work ---------------------------------------------------------------------------------------------------- [22:20:41] Ryan Stout(@ryanstout):I'm working on moving volt over to 0.8 finally :-) ---------------------------------------------------------------------------------------------------- [22:21:02] Elia Schito(@elia):\o/ ---------------------------------------------------------------------------------------------------- [22:27:01] Ryan Stout(@ryanstout):@elia have you been following sprockets stuff at all? I'm curious what their ETA is for 4.0 ---------------------------------------------------------------------------------------------------- [22:28:13] Elia Schito(@elia):I asked a couple of times but the answer was either not in the near future or no answer at all ---------------------------------------------------------------------------------------------------- [22:28:35] Elia Schito(@elia):maybe it's time to ask @josh or @rafaelfranca again ---------------------------------------------------------------------------------------------------- [22:34:04] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:34:28] Ryan Stout(@ryanstout):I'm not sure it will ever happen :-) ---------------------------------------------------------------------------------------------------- [22:34:35] Elia Schito(@elia):eheheh ---------------------------------------------------------------------------------------------------- [22:34:48] Ryan Stout(@ryanstout):if I had more time I would build a replacement :-) ---------------------------------------------------------------------------------------------------- [22:35:29] Ryan Stout(@ryanstout):@vais you around by chance? ---------------------------------------------------------------------------------------------------- [22:35:46] Elia Schito(@elia):I think he's asleep ---------------------------------------------------------------------------------------------------- [22:36:01] Ryan Stout(@ryanstout):ok, no rush ---------------------------------------------------------------------------------------------------- [22:36:17] Ryan Stout(@ryanstout):trying to understand the split method. ---------------------------------------------------------------------------------------------------- [22:36:19] Ryan Stout(@ryanstout):on string ---------------------------------------------------------------------------------------------------- [22:46:12] Ryan Stout(@ryanstout):anyway, other than the string split issue, it looks like everything with the 0.8 upgrade works :-) ---------------------------------------------------------------------------------------------------- [22:46:16] Ryan Stout(@ryanstout):really excited to have sourcemaps back ---------------------------------------------------------------------------------------------------- [22:46:36] Elia Schito(@elia):yeah, it's a bliss ---------------------------------------------------------------------------------------------------- [22:47:49] Ryan Stout(@ryanstout):it adds a few seconds to my page load time, so I think I'll make it disabled by default ---------------------------------------------------------------------------------------------------- [22:48:12] Ryan Stout(@ryanstout):but I can take a few seconds when I need it ---------------------------------------------------------------------------------------------------- [22:48:24] Elia Schito(@elia):I think disabling them for all the black box code is enough ---------------------------------------------------------------------------------------------------- [22:48:39] Elia Schito(@elia):most app code is not that big ---------------------------------------------------------------------------------------------------- [22:49:08] Elia Schito(@elia):things changed for me when I collapsed opal.js in one file without sourcemaps ---------------------------------------------------------------------------------------------------- [22:49:36] Ryan Stout(@ryanstout):interesting. Yea, I might try that. ---------------------------------------------------------------------------------------------------- [22:49:56] Ryan Stout(@ryanstout):if I collapse volt and opal, that would lower the number of files quite a bit ---------------------------------------------------------------------------------------------------- [22:50:06] Elia Schito(@elia):indeed ---------------------------------------------------------------------------------------------------- [23:05:07] Elia Schito(@elia):@ryanstout can you do a quick search in rubyspec for that particular bug? that would help clarifying the behavior a lot and if it's missing it'd be an improvement for rubyspec :) ---------------------------------------------------------------------------------------------------- [23:05:38] Ryan Stout(@ryanstout):@elia sure, does opal use a fork of rubyspec ---------------------------------------------------------------------------------------------------- [23:06:08] Elia Schito(@elia):no, it's on ruby/rubyspec thanks to… guess who? ---------------------------------------------------------------------------------------------------- [23:06:18] Elia Schito(@elia):@vais of course :tophat: ---------------------------------------------------------------------------------------------------- [23:06:27] Ryan Stout(@ryanstout):nice ---------------------------------------------------------------------------------------------------- [23:06:30] Ryan Stout(@ryanstout):checking for it ---------------------------------------------------------------------------------------------------- [23:09:52] Ryan Stout(@ryanstout):so I didn't search everything, but it looks like they are missing a spec for if there is no match and a limit ---------------------------------------------------------------------------------------------------- [23:12:08] Ryan Stout(@ryanstout):yea, I'm pretty sure its missing it. I went through all of the specs with .split in it ---------------------------------------------------------------------------------------------------- [23:12:30] Elia Schito(@elia):I'll add it ---------------------------------------------------------------------------------------------------- [23:15:42] Elia Schito(@elia):@ryanstout am I doing something wrong? ``` >> '/'.split('?', 2) => ["/"] ``` ---------------------------------------------------------------------------------------------------- [23:16:19] Ryan Stout(@ryanstout):I get ["/", ""] ---------------------------------------------------------------------------------------------------- [23:16:29] Elia Schito(@elia):I see, I'll update the issue then ---------------------------------------------------------------------------------------------------- [23:16:30] Ryan Stout(@ryanstout):let me clear my changes real quick ---------------------------------------------------------------------------------------------------- [23:16:35] Ryan Stout(@ryanstout):sorry, one sec ---------------------------------------------------------------------------------------------------- [23:17:05] Ryan Stout(@ryanstout):sorry, yea, I put it wrong in the issue ---------------------------------------------------------------------------------------------------- [23:17:06] Ryan Stout(@ryanstout):let me update ---------------------------------------------------------------------------------------------------- [23:18:33] Ryan Stout(@ryanstout):ok, sorry, I updated it ---------------------------------------------------------------------------------------------------- [23:18:39] Ryan Stout(@ryanstout):was doing multiple assignment, so I got confused ---------------------------------------------------------------------------------------------------- [23:18:42] Ryan Stout(@ryanstout):still broke though ---------------------------------------------------------------------------------------------------- [23:18:48] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [23:18:50] Ryan Stout(@ryanstout):running master now ---------------------------------------------------------------------------------------------------- [23:18:55] Ryan Stout(@ryanstout):can you duplicate? ---------------------------------------------------------------------------------------------------- [23:19:39] Elia Schito(@elia):yes, also this is curious (opal) ``` >> "xy".split("z", 3) => ["xy", ""] ``` ---------------------------------------------------------------------------------------------------- [23:20:14] Ryan Stout(@ryanstout):yea, I ran into that one also ---------------------------------------------------------------------------------------------------- [23:20:28] Ryan Stout(@ryanstout):the problem is I don't really understand the code ---------------------------------------------------------------------------------------------------- [23:21:01] Ryan Stout(@ryanstout):something like this after ```match = pattern.exec(string);``` fixes my issue, but I have the feeling there's code below that was supposed to do that and just isn't working: ---------------------------------------------------------------------------------------------------- [23:21:09] Ryan Stout(@ryanstout):```ruby if (match === null && limit > 0) { return result; } ``` ---------------------------------------------------------------------------------------------------- [23:21:49] Ryan Stout(@ryanstout):like I have the feeling the if (limit < 0) { is broke (lt zero) ---------------------------------------------------------------------------------------------------- [23:21:55] Ryan Stout(@ryanstout):but maybe you can do a negative index ---------------------------------------------------------------------------------------------------- [23:22:14] Ryan Stout(@ryanstout):ok, yea you can ---------------------------------------------------------------------------------------------------- [23:28:14] Ryan Stout(@ryanstout):ok, I think I'll just wait until @vais comes back online :-) ---------------------------------------------------------------------------------------------------- [23:28:29] Ryan Stout(@ryanstout):@elia what's left before 0.8 gets released officially? ---------------------------------------------------------------------------------------------------- [23:29:50] Elia Schito(@elia):I guess the main problem was waiting for the dust to settle, then if I'm not mistaken it just depends on me ---------------------------------------------------------------------------------------------------- [23:30:12] Elia Schito(@elia):I think I'll push another rc with this fix and one for require_tree ---------------------------------------------------------------------------------------------------- [23:30:39] Elia Schito(@elia):master has already moved on with the new .JS syntax, it's really time to release ---------------------------------------------------------------------------------------------------- [23:31:13] Elia Schito(@elia):I hoped for a blog post explaining the changes but not really in the mood for it, let alone having the time ---------------------------------------------------------------------------------------------------- [23:42:52] Elia Schito(@elia):here's the little scheme https://github.com/opal/opal/milestones/0.8 ---------------------------------------------------------------------------------------------------- ############################## [2015-07-04] ############################## [10:02:30] Vais Salikhov(@vais):@elia What's up? ---------------------------------------------------------------------------------------------------- [10:03:15] Elia Schito(@elia):@vais hey, was just asking for help on how to test https://github.com/opal/opal/pull/969 before merging ---------------------------------------------------------------------------------------------------- [10:03:56] Elia Schito(@elia):question is still valid of course :grin: ---------------------------------------------------------------------------------------------------- [10:04:23] Elia Schito(@elia):btw I'm going to release rc2 in a few moments ---------------------------------------------------------------------------------------------------- [10:06:52] Vais Salikhov(@vais):Sorry, @elia, didn't have time to wrap my mind around that one. Now I am on mobile on a crappy wifi, so definitely have no answer for you at this time... ---------------------------------------------------------------------------------------------------- [10:08:10] Elia Schito(@elia):no worries at all ---------------------------------------------------------------------------------------------------- [10:19:42] Elia Schito(@elia):@/all 0.8.0.rc2 is out 🌝 please try it out! cc @ryanstout ---------------------------------------------------------------------------------------------------- [13:16:28] Vais Salikhov(@vais):@elia so will 0.8 include everything on master up to the point of release, or will it be capped at a certain commit? ---------------------------------------------------------------------------------------------------- [13:18:28] Elia Schito(@elia):@vais stops just before the merge of .JS stuff from jeremy evans ---------------------------------------------------------------------------------------------------- [13:18:50] Elia Schito(@elia):there was enough stuff already, had set a limit :D ---------------------------------------------------------------------------------------------------- [13:19:48] Elia Schito(@elia):the rest is set for 0.9 for which we can set our goals or just let some time pass by ---------------------------------------------------------------------------------------------------- [13:21:40] Vais Salikhov(@vais):@elia that's kind of a bummer cause there's been quite a fees bug fixes since then. ---------------------------------------------------------------------------------------------------- [13:22:32] Vais Salikhov(@vais):a few (typing on my phone, sorry) ---------------------------------------------------------------------------------------------------- [13:22:32] Elia Schito(@elia):Yeah, I know, my intention is to get out 0.9 way faster ---------------------------------------------------------------------------------------------------- [13:25:41] Vais Salikhov(@vais):Hmm I guess I'm trying to understand it from e.g. @ryanstout perspective maintaining a framework that depends on Opal. Volt is still on 0.6? If Volt updates to 0.8, how long will it be until Volt updates to 0.9? ---------------------------------------------------------------------------------------------------- [13:30:08] Vais Salikhov(@vais):I.e does it even make sense for them to update to 0.8 or just wait for 0.9? I'm definitely out of my depth here, just curious and wondering how people manage this kind of stuff. ---------------------------------------------------------------------------------------------------- [13:30:31] Elia Schito(@elia):@vais once 0.8 is out imo is time to start the works for 0.9 ---------------------------------------------------------------------------------------------------- [13:31:48] Elia Schito(@elia):also unless sprockets 4 is released in the meanwhile 0.9 will be mostly new feat & fixes ---------------------------------------------------------------------------------------------------- [13:32:31] Elia Schito(@elia):and 0.8 is so important for users bc it brings back working sourcmaps ---------------------------------------------------------------------------------------------------- [13:35:30] Vais Salikhov(@vais)::+1: ---------------------------------------------------------------------------------------------------- [13:36:36] Vais Salikhov(@vais):Re Sprockets 4.0 is that kinda like Perl 6 :trollface: ---------------------------------------------------------------------------------------------------- [13:55:51] Elia Schito(@elia):lol, I keep good hope tho, v3 is basically v4 with v2 backward compatibility, for opal 0.9 I might even be able to remove some hacks I had to do to make sourcemaps work for v2, but I need to update processors to the new format first ---------------------------------------------------------------------------------------------------- [14:02:16] Vais Salikhov(@vais):Yep, trolling aside, I really hope so as well. Thank you for all the work you've put in to make source maps work with the existing setup! Working source maps are absolutely critical to Opal' success if that even needs to be stated. ---------------------------------------------------------------------------------------------------- [14:04:41] Elia Schito(@elia):🌟 ---------------------------------------------------------------------------------------------------- [19:17:44] Ryan Stout(@ryanstout):@vais volt is currently on 0.7.2 ---------------------------------------------------------------------------------------------------- [19:18:10] Ryan Stout(@ryanstout):the upgrade to 0.8 wasn't too bad, so far the only thing that took some rethinking was the module system (since we were generating script tags ourself) ---------------------------------------------------------------------------------------------------- [19:18:29] Ryan Stout(@ryanstout):@elia and @vais thanks for fixing that issue, nice work ---------------------------------------------------------------------------------------------------- [02:33:29] Vais Salikhov(@vais):@elia something's broken in the latest rubyspec, I'm consistently getting this: ``` ..........FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory rake aborted! ``` I am able to run your new `String#split` specs separately though, so the problem must be somewhere else, I will track it down after I fix `String#split` per the new specs. When it rains it pours. ---------------------------------------------------------------------------------------------------- [03:50:51] Vais Salikhov(@vais):@elia fixed the FATAL ERROR problem above and updated to latest rubyspec here https://github.com/opal/opal/pull/976. Next step once this and https://github.com/opal/opal/pull/974 are merged into master is to uncomment the failures for your new `String#split` specs in filters/bugs/string.rb, run the spec suite (everything should pass at that point), and commit. Makes sense? ---------------------------------------------------------------------------------------------------- [03:52:02] Vais Salikhov(@vais):@ryanstout we're getting there :) ---------------------------------------------------------------------------------------------------- [03:53:07] Ryan Stout(@ryanstout):@vais thanks, I owe you one :-) ---------------------------------------------------------------------------------------------------- [09:44:31] Elia Schito(@elia):@vais still around? ---------------------------------------------------------------------------------------------------- ############################## [2015-07-05] ############################## [02:02:56] ylluminate(@ylluminate):@vais @elia I tried to get some better timeline info for you out of the sprockets guys to not much avail: https://github.com/rails/sprockets/issues/68 ---------------------------------------------------------------------------------------------------- [06:43:24] Elia Schito(@elia):Yeah saw that ---------------------------------------------------------------------------------------------------- [16:22:40] Rick Carlino(@RickCarlino): ---------------------------------------------------------------------------------------------------- [16:23:50] Rick Carlino(@RickCarlino): ---------------------------------------------------------------------------------------------------- [16:24:14] Rick Carlino(@RickCarlino):I got it to work for primitives, but Object is not possible ---------------------------------------------------------------------------------------------------- [16:26:36] Rick Carlino(@RickCarlino):D'oh - found the answer in the docs. Dumb question ---------------------------------------------------------------------------------------------------- [16:54:14] meh.(@meh):RickCarlino, yes, it's called Native ---------------------------------------------------------------------------------------------------- [16:54:18] meh.(@meh):require 'native' ---------------------------------------------------------------------------------------------------- [16:54:26] meh.(@meh):Native(`{a: 1, b: true}`) ---------------------------------------------------------------------------------------------------- [16:54:38] Rick Carlino(@RickCarlino):Yep! thus my statement "Dumb question". hahaha thanks for the help. ---------------------------------------------------------------------------------------------------- [20:14:03] Forrest Chang(@fkchang):@adambutler (or @vais if he knows) I want to index stuff on compile, look's like I'll have to instantiate Opal::Compiler myself, export @sexp and then parse the sexp for information -- back to the indexing I want, I think I can demonstrate some of the stuff in browser to make a compelling enough example that people would very much want it on the backend too. Any tips? ---------------------------------------------------------------------------------------------------- [20:14:34] Forrest Chang(@fkchang):on that note, how stable is the AST format going to be? ---------------------------------------------------------------------------------------------------- [20:18:55] Forrest Chang(@fkchang):@adambeynon above was meant for you and not adambutler, but it's a bit premature, I think I can probably leverage node handlers for some of the stuff I want, so I might expose something else ---------------------------------------------------------------------------------------------------- ############################## [2015-07-06] ############################## [00:50:01] Penn Su(@pencilcheck):@AstonJ sorry just got to see your message. What would I do as part of the Strategies team if I join? ---------------------------------------------------------------------------------------------------- [02:06:49] Rick Carlino(@RickCarlino):Has anyone tried using opal as a compiler in RiotJS? ---------------------------------------------------------------------------------------------------- [02:10:44] Rick Carlino(@RickCarlino):https://muut.com/riotjs/compiler.html#any-language ---------------------------------------------------------------------------------------------------- [02:11:03] Rick Carlino(@RickCarlino):Talking about that, specifically. ^ ---------------------------------------------------------------------------------------------------- [08:49:47] Jikku Jose(@JikkuJose):Has anyone used Handlebar templates with Opal? ---------------------------------------------------------------------------------------------------- [21:21:01] AstonJ(@AstonJ):@pencilcheck Hey, no probs. Basically whatever you can help with - whether that’s code, code examples, docs, spreading the word, etc ---------------------------------------------------------------------------------------------------- [21:21:14] AstonJ(@AstonJ):If you join MetaRuby I can add you to the room :) ---------------------------------------------------------------------------------------------------- [22:47:44] Penn Su(@pencilcheck):cool ---------------------------------------------------------------------------------------------------- [22:47:55] Penn Su(@pencilcheck):how do I join MetaRuby? ---------------------------------------------------------------------------------------------------- ############################## [2015-07-07] ############################## [20:08:57] Rick Carlino(@RickCarlino):Ofcourse ---------------------------------------------------------------------------------------------------- [21:20:39] Forrest Chang(@fkchang):this is @RickCarlino 's counterpart http://1.bp.blogspot.com/-o1oQ07pdFlA/VVP0SAuA36I/AAAAAAAAx7M/5uoa7l82lEo/s1600/ginger_ninjas_02.JPG ---------------------------------------------------------------------------------------------------- [21:21:56] Forrest Chang(@fkchang):The other 9 of her are doing screencasting post production ---------------------------------------------------------------------------------------------------- [21:22:01] Rick Carlino(@RickCarlino):I have no idea what that is a reference to, but will agree that it is a factual statement. ---------------------------------------------------------------------------------------------------- [21:22:46] Forrest Chang(@fkchang):Reference: "I'm actually 14 different people." ---------------------------------------------------------------------------------------------------- [21:23:12] Rick Carlino(@RickCarlino):I got that part, though I have never seen the show / film from the picture ^ ---------------------------------------------------------------------------------------------------- [21:23:25] Gabriel Rios(@gabrielrios):its from Agents of SHIELD ---------------------------------------------------------------------------------------------------- [21:23:33] Forrest Chang(@fkchang):Marvel's Agents of Shield. She's an inhuman who can duplicate herself ---------------------------------------------------------------------------------------------------- [21:23:48] Rick Carlino(@RickCarlino):...to promote Ruby ---------------------------------------------------------------------------------------------------- [21:23:49] Rick Carlino(@RickCarlino):lol ---------------------------------------------------------------------------------------------------- [21:24:34] Forrest Chang(@fkchang):So I saw in my head, how you split like her and then crank out screencasts at breakneck speeds ---------------------------------------------------------------------------------------------------- [22:57:12] Torsten Rüger(@dancinglightning):Newbie question: is there a pure ruby api for the dom? ---------------------------------------------------------------------------------------------------- [22:57:25] Torsten Rüger(@dancinglightning):Or do i have to finally learn jquery? ---------------------------------------------------------------------------------------------------- [22:57:29] Rick Carlino(@RickCarlino):@dancinglightning Yes! ---------------------------------------------------------------------------------------------------- [22:57:45] Rick Carlino(@RickCarlino):Use ```Native(`document`)```` ---------------------------------------------------------------------------------------------------- [22:57:47] Rick Carlino(@RickCarlino):Or ---------------------------------------------------------------------------------------------------- [22:57:58] Rick Carlino(@RickCarlino):yeah, you can use opal-jquery ---------------------------------------------------------------------------------------------------- [22:58:19] Elia Schito(@elia):and also don't forget opal-browser ---------------------------------------------------------------------------------------------------- [22:58:46] Rick Carlino(@RickCarlino):Take a look at [this](http://datamelon.io/blog/2015/using-js-libraries-with-opal.html) and [this](http://datamelon.io/blog/2015/static-frontend-apps-in-pure-ruby.html) if you're the screencast type. ---------------------------------------------------------------------------------------------------- [22:58:50] Torsten Rüger(@dancinglightning):@RickCarlino yes, i just came off the html dom docs. seems hmm, how to say this ---------------------------------------------------------------------------------------------------- [22:59:03] Elia Schito(@elia):which is pure ruby and features an api similar to nokogiri ---------------------------------------------------------------------------------------------------- [23:04:03] Torsten Rüger(@dancinglightning):@elia thanks, opal-browser may be what i was looking for. does it have docs more than the readme? ---------------------------------------------------------------------------------------------------- [23:04:34] meh.(@meh):dancinglightning, http://www.rubydoc.info/github/opal/opal-browser ---------------------------------------------------------------------------------------------------- [23:06:01] meh.(@meh):dancinglightning, or ask me if you have questions, I'm the one who wrote most of it ---------------------------------------------------------------------------------------------------- [23:07:27] Torsten Rüger(@dancinglightning):thanks @meh , should bookmark that , that's got like everything ---------------------------------------------------------------------------------------------------- [23:08:08] Elia Schito(@elia):yeah it's kinda like MDN in ruby ---------------------------------------------------------------------------------------------------- [23:08:08] Torsten Rüger(@dancinglightning):but there is a question, the dollar document? any way around the dollar ---------------------------------------------------------------------------------------------------- [23:09:46] meh.(@meh):dancinglightning, how do you mean? ---------------------------------------------------------------------------------------------------- [23:11:34] Torsten Rüger(@dancinglightning):@meh doesn't read like ruby code, is all i meant. probably works well enough. can't think of an alternative either ---------------------------------------------------------------------------------------------------- [23:12:12] meh.(@meh):dancinglightning, what are you trying to do exactly? ---------------------------------------------------------------------------------------------------- [23:13:06] Torsten Rüger(@dancinglightning):@meh just get my pixi element into the dom at the right place. ---------------------------------------------------------------------------------------------------- [23:13:31] Elia Schito(@elia):the document should be a global, you can either use the dollar or a constant (e.g. Document) ---------------------------------------------------------------------------------------------------- [23:14:24] Torsten Rüger(@dancinglightning):ok, that was what i was looking for, thanks @elia , so i'm good ---------------------------------------------------------------------------------------------------- [23:14:55] George Plymale II(@ylluminarious):that is, anywhere in the defined scope of the program ---------------------------------------------------------------------------------------------------- [23:15:09] George Plymale II(@ylluminarious):@dancinglightning the dollar sign just indicates it's a global variable (accessible anywhere) ---------------------------------------------------------------------------------------------------- [23:16:46] George Plymale II(@ylluminarious):@dancinglightning also, i sometimes use `$$[:document]` to access the document. `$$` is the wrapped window object, so you can access properties like the document from there. ---------------------------------------------------------------------------------------------------- [23:17:17] George Plymale II(@ylluminarious):huh, weird, gitter just switched some of my messages around ---------------------------------------------------------------------------------------------------- [23:18:23] George Plymale II(@ylluminarious):re: `$$`, you don't have to use opal-browser to use `$$` ---------------------------------------------------------------------------------------------------- [23:19:05] George Plymale II(@ylluminarious):as you can see [here](http://opalrb.org/try/?code:%24%24.alert(%22test%22)), i'm not using opal-browser to access the window object ---------------------------------------------------------------------------------------------------- [23:19:37] George Plymale II(@ylluminarious):but opal-browser is nice when you need more fine-grained control ---------------------------------------------------------------------------------------------------- [23:21:51] George Plymale II(@ylluminarious):shoot, i think gitter broke my link because of the markdown ---------------------------------------------------------------------------------------------------- [23:48:12] Forrest Chang(@fkchang):@meh @elia thoughts on :point_up: [July 7, 2015 12:55 AM](https://gitter.im/opal/opal?at=559b85f01c1634674f8a5e45) ---------------------------------------------------------------------------------------------------- [23:50:26] meh.(@meh):fkchang, bridged classes imply having the methods directly added on the native class prototype ---------------------------------------------------------------------------------------------------- [23:50:30] meh.(@meh):that may be unwanted ---------------------------------------------------------------------------------------------------- [23:56:56] Forrest Chang(@fkchang):@meh right, but why would I chose bridging over just including Native, the implications are different on the JS side only ---------------------------------------------------------------------------------------------------- [23:58:37] meh.(@meh):that's the only reason, they're implementation dependant ---------------------------------------------------------------------------------------------------- [04:51:57] Rick Carlino(@RickCarlino):So when is usage of `to_n` warranted? ---------------------------------------------------------------------------------------------------- [04:52:35] Rick Carlino(@RickCarlino):Is it used mostly when interpolating code? ---------------------------------------------------------------------------------------------------- [07:55:28] Forrest Chang(@fkchang):@adambeynon @elia @meh when wrapping JS, why would one choose toll free bridging over include Native? In both cases you have to expose the methods via alias_native, though in toll free you have to define Klass.new and w/include Native, you can set @native in Klass#initialize ---------------------------------------------------------------------------------------------------- [08:03:22] Forrest Chang(@fkchang):The difference seems larger on the Javascript side, where they seem equivalent on the opal side ---------------------------------------------------------------------------------------------------- [14:13:58] AstonJ(@AstonJ):@pencilcheck www.metaruby.com - just let me know your username when you get there :) ---------------------------------------------------------------------------------------------------- [15:43:44] Forrest Chang(@fkchang):@jaredcwhite opalist deadline 8pm PT ish again tonight? Gonna be a tight squeeze for me ---------------------------------------------------------------------------------------------------- [16:07:22] Rick Carlino(@RickCarlino):Thanks for the reminder, @fkchang almost forgot! ---------------------------------------------------------------------------------------------------- [16:41:10] Torsten Rüger(@dancinglightning):Hi, i'm trying to build some graphical application using html canvas. ---------------------------------------------------------------------------------------------------- [16:41:30] Torsten Rüger(@dancinglightning):Does anyone know of ruby wrappers for other libraries than three and phaser ---------------------------------------------------------------------------------------------------- [16:42:25] Torsten Rüger(@dancinglightning):Maybe Famous ? Anything not have to code on the canvas. ---------------------------------------------------------------------------------------------------- [16:45:23] Forrest Chang(@fkchang):@dancinglightning I think there's a opal-raphael, though simply wrapping in Native works pretty well for raphael ---------------------------------------------------------------------------------------------------- [16:52:59] Torsten Rüger(@dancinglightning):@fkchang Thanks. I was looking for something not so tied to svg. more 2d context, possibly with 3d later. But simple is good. ---------------------------------------------------------------------------------------------------- [16:53:13] Torsten Rüger(@dancinglightning):Do you know the maintainer, it seems quite dead ---------------------------------------------------------------------------------------------------- [16:54:44] Forrest Chang(@fkchang):@dancinglightning I don't know the maintainer, it hit my radar a while's back, so I remembered that it's there. Looking back at the example on his readme, doesn't seem like he put much over what just wrapping w/Native gives you ---------------------------------------------------------------------------------------------------- [16:57:43] Forrest Chang(@fkchang):hmm, maybe I should take that repo over at some point ---------------------------------------------------------------------------------------------------- [16:58:23] Torsten Rüger(@dancinglightning):@fkchang it does seem very thin. 100 lines of code ---------------------------------------------------------------------------------------------------- [16:59:15] Forrest Chang(@fkchang):Yeah, his wrapper doesn't do much in the way or Ruby-fying, so it's nearly equivalent to wrapping in Native, but w/more work involved ---------------------------------------------------------------------------------------------------- [17:00:57] Torsten Rüger(@dancinglightning):@fkchang sorry, newbie: what is wrapping Native? some link i can read. ---------------------------------------------------------------------------------------------------- [17:01:56] Torsten Rüger(@dancinglightning):Just asking because if it's easy, i might consider doing pixi.js myself. seems the better library ---------------------------------------------------------------------------------------------------- [17:05:49] George Plymale II(@ylluminarious):@dancinglightning there's an opal-pixi you're welcome to contribute to: https://github.com/orbitalimpact/opal-pixi ---------------------------------------------------------------------------------------------------- [17:06:27] George Plymale II(@ylluminarious):it's in its very early stages right now, and we've been busy with opal-phaser lately ---------------------------------------------------------------------------------------------------- [17:06:47] Torsten Rüger(@dancinglightning):@ylluminarious i see you're everywhere. Thanks for the offer. i may just do that ---------------------------------------------------------------------------------------------------- [17:07:17] Torsten Rüger(@dancinglightning):Pixi seems just what i need, small enough and big enough. And well documented ---------------------------------------------------------------------------------------------------- [17:07:32] Torsten Rüger(@dancinglightning):Now i just need that link to the Native wrapping ---------------------------------------------------------------------------------------------------- [17:08:11] George Plymale II(@ylluminarious):@dancinglightning lol, thanks. you know what they say about great minds ;) ---------------------------------------------------------------------------------------------------- [17:12:14] Torsten Rüger(@dancinglightning):@ylluminarious I hope that we're talking v3? Performance seems incredible, i had to crank it up to 40000 bunnies before it went down from 60fps. 50k was still at 40fps. ---------------------------------------------------------------------------------------------------- [17:12:31] Torsten Rüger(@dancinglightning):So do you have your own chat for that? ---------------------------------------------------------------------------------------------------- [17:16:56] George Plymale II(@ylluminarious):@dancinglightning sorry, i was away there for a sec. yes, we do have our own chat for it: https://gitter.im/orbitalimpact/opal-pixi ---------------------------------------------------------------------------------------------------- [17:17:10] George Plymale II(@ylluminarious):glad to hear it performs well under extreme conditions :) ---------------------------------------------------------------------------------------------------- [17:17:29] George Plymale II(@ylluminarious):yeah, should work well, it's just wrapping the library with some minimal ruby ---------------------------------------------------------------------------------------------------- [17:33:10] Forrest Chang(@fkchang):@dancinglightning check out me mucking w/raphael by wrapping it in native http://fkchang.github.io/opal-playground/?code:require_js%20'https%3A%2F%2Fcdnjs.cloudflare.com%2Fajax%2Flibs%2Fraphael%2F2.1.4%2Fraphael-min.js'%0ADocument.ready%3F%20do%20%0A%20%20Timeout.new(1000)%20%7B%20%23%20to%20give%20require_js%20enough%20time%20to%20load%0A%20%20%20%20%24paper%20%3D%20Native(%60Raphael(200%2C%200%2C%20200%2C%20200)%60)%0A%20%20%20%20rect%20%3D%20%24paper.rect(0%2C%200%2C%20640%2C%20480%2C%2010)%0A%20%20%20%20rect.attr(%20fill%3A%20'%23fff'%2C%20stroke%3A%20'none')%0A%20%20%20%20rect.attr(%20fill%3A%20'%23bbb'%2C%20stroke%3A%20'none')%0A%20%20%20%20%24circle%20%3D%20%24paper.circle(100%2C%20100%2C%2060)%0A%20%20%20%20%24fill%20%3D%20'%23223fa3'%0A%20%20%20%20%24stroke%20%3D%20'%23000'%0A%20%20%20%20%24stroke_width%20%3D%2080%0A%20%20%20%20%24stroke_opacity%20%3D%200.5%0A%20%20%20%20%24duration%20%3D%202200%0A%20%20%20%20animate%0A%20%20%20%20COLORS%20%3D%20%25w(red%20green%20blue%20orange%20yellow%20pink%20white%20gold)%0A%20%20%20%20i%20%3D%200%0A%20%20%20%20Element.id('main').on(%3Aclick)%20%7B%20%0A%20%20%20%20%20%20%24fill%20%3D%20COLORS%5Bi%25COLORS.size%5D%0A%20%20%20%20%20%20i%20%2B%3D%201%0A%20%20%20%20%20%20reset%0A%20%20%20%20%20%20animate%0A%20%20%20%20%7D%0A%20%20%7D%0Aend%0Adef%20animate%0A%20%20%24circle.animate(%20%7Bfill%3A%20%24fill%2C%0A%20%20%20%20%20%20stroke%3A%20%24stroke%2C%0A%20%20%20%20%20%20'stroke-width'%20%3D%3E%20%24stroke_width%2C%0A%20%20%20%20%20%20'stroke-opacity'%20%3D%3E%20%24stroke_opacity%7D%2C%20%0A%20%20%20%20%24duration)%0Aend%0Adef%20reset%0A%20%20%24paper.clear%0A%20%20%24circle%20%3D%20%24paper.circle(100%2C%20100%2C%2060)%0Aend&html_code=%3Cbutton%20id%3D%22main%22%3E%0A%20%20Reanimate%0A%3C%2Fbutton%3E%0A&css_code=body%20%7B%0A%20%20background%3A%20%23eeeeee%3B%0A%7D%0A ---------------------------------------------------------------------------------------------------- [17:34:04] Forrest Chang(@fkchang):All I had to do was wrap the initial paper in Native, and the rest was free ---------------------------------------------------------------------------------------------------- [17:34:37] Forrest Chang(@fkchang):@all this examples uses the non publicized require_js functionality from opal-irb and pulls in raphael from cdn ---------------------------------------------------------------------------------------------------- [17:35:18] Forrest Chang(@fkchang):I would like to be able to dynamically require in opal libs into the browser this way if there are compiled cdn versions around ---------------------------------------------------------------------------------------------------- [17:35:48] Torsten Rüger(@dancinglightning):@fkchang ool. But what about those dollars. are they necessary ? ---------------------------------------------------------------------------------------------------- [17:36:15] Torsten Rüger(@dancinglightning):c ---------------------------------------------------------------------------------------------------- [17:36:49] Forrest Chang(@fkchang):the globals are there so I can manipulate them from opal-irb in real time w/o changing the data state ---------------------------------------------------------------------------------------------------- [17:37:46] Forrest Chang(@fkchang):u can hit the 'show irb' window, and do something like ```ruby $fill = 'red' reset animate ``` and it will happen, and your old data state will still be there, vs reloading and starting from scratch ---------------------------------------------------------------------------------------------------- [17:39:00] Forrest Chang(@fkchang):I was going to make a screencast about playing around w/js libs in real time in opal-playground, this is me experimenting w/what I might present. I would show off the require_js, as well as how it's game changer to be able to change code, data live in the app w/o having to reload everything ---------------------------------------------------------------------------------------------------- [17:39:38] Torsten Rüger(@dancinglightning):@fkchang that is definitely cool. DO the screencast ---------------------------------------------------------------------------------------------------- [17:39:39] Forrest Chang(@fkchang):targeting @jaredcwhite 's opalist newsletter, but I don't think I'll get it in time. I need to take 'speed screencasting' lessons from @RickCarlino ---------------------------------------------------------------------------------------------------- [17:40:45] Forrest Chang(@fkchang):The global thing is a quickie trick that I do in my normal apps -- make easily accessible certain variables to opal-irb (else they are hidden via closure). You could scope them in a class, but it's less typing to selectively use globals ---------------------------------------------------------------------------------------------------- [18:11:10] Rick Carlino(@RickCarlino):@fkchang I use a combo of `Kazaam` + `KDENlive!` on linux ---------------------------------------------------------------------------------------------------- [18:11:38] Rick Carlino(@RickCarlino):Record each as seperate screens and then use `shift + r` to trim silence off the ends of scene transitions ---------------------------------------------------------------------------------------------------- [18:12:00] Rick Carlino(@RickCarlino):Speaking of which, [EPISODE 8](http://datamelon.io/blog/2015/using-js-libraries-with-opal.html) came out today. I cover `Native` and `to_n` breifly ---------------------------------------------------------------------------------------------------- [20:04:18] Jamie Gaskins(@jgaskins):@JikkuJose Haven't used Handlebars, but there's `opal-haml` (https://github.com/opal/opal-haml) and `opal-slim`(https://github.com/jgaskins/opal-slim) for Haml and Slim. ---------------------------------------------------------------------------------------------------- [20:07:59] Jared White(@jaredcwhite):@fkchang Yep, tonight's the night. @RickCarlino is a screencasting MACHINE! ---------------------------------------------------------------------------------------------------- [20:08:25] Rick Carlino(@RickCarlino):I'm actually 14 different people. ---------------------------------------------------------------------------------------------------- [20:08:28] Jared White(@jaredcwhite):BTW, I'm running behind too - I was planning to writing up a front end design pattern article with some code examples, but I've just been super busy opening up a new office IRL and that's taken up lots of time. ---------------------------------------------------------------------------------------------------- [20:08:50] Jamie Gaskins(@jgaskins):@RickCarlino All inside a single trench coat, right? :-) ---------------------------------------------------------------------------------------------------- [20:08:55] Rick Carlino(@RickCarlino):(that was a joke, btw) ---------------------------------------------------------------------------------------------------- ############################## [2015-07-08] ############################## [00:04:48] Forrest Chang(@fkchang):@meh so what's an example where you want to the extend the native class prototype? ---------------------------------------------------------------------------------------------------- [00:05:56] meh.(@meh):it's when you do not want to that matters ---------------------------------------------------------------------------------------------------- [00:06:12] meh.(@meh):for example in IE6..8 extending the DOM would cause an exception ---------------------------------------------------------------------------------------------------- [00:08:41] Forrest Chang(@fkchang):@meh then it would seem that there's no advantage to toll free bridging. include Native seems to be across the board safer, unless you are wanting to call opal methods off of native js objects. Is there any performance benefits? ---------------------------------------------------------------------------------------------------- [00:09:23] meh.(@meh):from my tests there's no meaningful overhead between wrapping and extending ---------------------------------------------------------------------------------------------------- [00:11:51] Forrest Chang(@fkchang):@meh any history to the name "toll free" bridging? It would seem to imply that include Native is "toll required" bridging, to which I ask, "what is the toll?" ---------------------------------------------------------------------------------------------------- [00:12:21] Forrest Chang(@fkchang):though I think toll free bridging is done on numbers, strings, etc. for performance reasons ---------------------------------------------------------------------------------------------------- [00:12:28] Forrest Chang(@fkchang):rather than wrapping those ---------------------------------------------------------------------------------------------------- [00:13:29] meh.(@meh):those are not for performance reasons ---------------------------------------------------------------------------------------------------- [00:13:31] meh.(@meh):but for usability reasons ---------------------------------------------------------------------------------------------------- [00:13:40] meh.(@meh):you'd have to call #to_n on all of them otherwise ---------------------------------------------------------------------------------------------------- [00:13:47] meh.(@meh):which would make it a pain in the ass even within the corelib ---------------------------------------------------------------------------------------------------- [00:14:16] meh.(@meh):to stay on the safe side you should still call #to_n on those tho ---------------------------------------------------------------------------------------------------- [00:14:27] meh.(@meh):because they call valueOf() on self or other things ---------------------------------------------------------------------------------------------------- [00:14:29] Forrest Chang(@fkchang):@meh so then, there is some sort of benefit to toll free bridging, but what would it be? ---------------------------------------------------------------------------------------------------- [00:15:13] meh.(@meh):for things that aren't in the corelib? none ---------------------------------------------------------------------------------------------------- [00:16:10] Forrest Chang(@fkchang):that's a start. I'll note that opal-jquery does toll free bridging on element. @elia said he took advantage of the js object being extended, I'd be curious as to what circumstances ---------------------------------------------------------------------------------------------------- [00:16:24] Forrest Chang(@fkchang):@meh does opal-browser do any toll free bridging? ---------------------------------------------------------------------------------------------------- [00:16:45] meh.(@meh):nope ---------------------------------------------------------------------------------------------------- [00:17:24] Forrest Chang(@fkchang):so then general advice would be to favor include Native then ---------------------------------------------------------------------------------------------------- [00:17:37] meh.(@meh):yep ---------------------------------------------------------------------------------------------------- [00:18:01] Forrest Chang(@fkchang):thx ---------------------------------------------------------------------------------------------------- [00:18:15] Forrest Chang(@fkchang):@meh btw, working on anything cool lately? ---------------------------------------------------------------------------------------------------- [00:18:24] meh.(@meh):working on a game in Rust ---------------------------------------------------------------------------------------------------- [00:18:44] Forrest Chang(@fkchang):ironically, my 13 yr old son just wrote a tic tac toe game in Rust ---------------------------------------------------------------------------------------------------- [00:18:55] meh.(@meh):noice ---------------------------------------------------------------------------------------------------- [00:19:13] meh.(@meh):send him towards glium and 3d stuff :^) ---------------------------------------------------------------------------------------------------- [00:20:14] Forrest Chang(@fkchang):yeah, he impresses me, taught himself java to write an adventure game, then ruby for another text based game, started SICP, but when stalled redirected to Rust. I explained to him virtualbox and he's been running different distro's to do his develpoment on ---------------------------------------------------------------------------------------------------- [01:33:30] Torsten Rüger(@dancinglightning):@meh i was trying to follow the native discussion and looked at browser source. A lot of include Native there, but not much alias_native. I wonder is it even possible to use alias_naive when wrapping a larger api (for me pixi). I seems that "ruby" objects would make it back into the js framework and boom ---------------------------------------------------------------------------------------------------- [01:35:02] Torsten Rüger(@dancinglightning):Maybe just for simple attribute readers ? ---------------------------------------------------------------------------------------------------- [02:04:36] Jikku Jose(@JikkuJose):@jgaskins Thanks! I will look into it! Infact I prefer Haml better, I didn't expect to see it. ---------------------------------------------------------------------------------------------------- ############################## [2015-07-09] ############################## [08:23:42] Christian Käser(@dfyx):@fkchang yeah, Raphael works great with opal ---------------------------------------------------------------------------------------------------- [08:23:53] Christian Käser(@dfyx):I use it in my project to generate some pie charts ---------------------------------------------------------------------------------------------------- [16:39:56] Forrest Chang(@fkchang):@meh @elia @adambeynon I'm thinking perhaps the time to use toll free bridging is when you are passing back your objects to js. W/toll free bridging, you extend the js prototype, so the object you actually pass around is the js one. W/ include Native, you wrap the object and it's @native that is the actual js object, so passing the wrapper back to the original js isn't as seemless ---------------------------------------------------------------------------------------------------- [17:09:07] Forrest Chang(@fkchang):In my mucking w/Raphael and opal, I haven't needed to pass my object back to raphael, so it seems fine to just wrap it w/native, but I can imagine other js libs where you have objects, and you have to pass them back to the js libs a lot more in normal, where toll free bridging allows the actual js object get passed back vs. an opal wrapper obj that you have to expose the @native object back to js ---------------------------------------------------------------------------------------------------- [17:42:28] Forrest Chang(@fkchang):@all, wanted to pimp out the rspec part of opal-playground (which @adambeynon wrote). I've been using it w/a coworker to debate over how a spec should work ---------------------------------------------------------------------------------------------------- [17:43:00] Forrest Chang(@fkchang):http://git.io/vqMDa ---------------------------------------------------------------------------------------------------- [17:47:31] Forrest Chang(@fkchang):Pretty damn handy for real life dev ---------------------------------------------------------------------------------------------------- [19:09:35] Torsten Rüger(@dancinglightning):@fkchang i homed in on pixi, which i find the more complete package while still small-ish. ---------------------------------------------------------------------------------------------------- [19:09:36] Torsten Rüger(@dancinglightning):It just got a makeover with native, which i took to the extreme (just trying around) as you can see eg https://github.com/orbitalimpact/opal-pixi/blob/master/lib/opal/pixi/sprite.rb ---------------------------------------------------------------------------------------------------- [19:10:29] Torsten Rüger(@dancinglightning):It seems to unrap "ruby" objects and there is a possibility with the :as option to wrap the result. It's very smooth i think ---------------------------------------------------------------------------------------------------- [19:11:37] Torsten Rüger(@dancinglightning):The "on" method even knows how to handle a block (and i assume pass it as a js function). ---------------------------------------------------------------------------------------------------- [19:12:26] Torsten Rüger(@dancinglightning):The only js left is in the constructor and any code to make the library "smarter" ---------------------------------------------------------------------------------------------------- [21:29:06] Forrest Chang(@fkchang):@dancinglightning cool, I've been thinking that a reason to use toll free bridging is when you need to pass your objects back to the original js a lot. I haven't hit it in Raphael (not that I've worked that much), so I don't see it needed there, but I have 0 experience w/pixi to know if that makes sense. I think it makes sense in opal-jquery that Element is toll free bridged, coz you pass your elements to other jquery functions often. ---------------------------------------------------------------------------------------------------- [22:12:27] Gabriel Rios(@gabrielrios):@fkchang Yes, so I think that while using the library you won't have much need to pass the original JS back (if the library is completely wrapped), it would only make sense for interacting with JS libraries that don't have an Opal counterpart, so yes opal-jquery Element makes a lot of sense as there's tons of jquery plugins out there. ---------------------------------------------------------------------------------------------------- ############################## [2015-07-10] ############################## [19:57:56] Stephen Russett(@StephenOTT):Hey, any performance comparisons between Opal and gopherjs? ---------------------------------------------------------------------------------------------------- [19:58:05] Stephen Russett(@StephenOTT):or any pro/con list? ---------------------------------------------------------------------------------------------------- [21:17:22] Forrest Chang(@fkchang):@StephenOTT interesting question, I'd be surprised if anyone has looked at both. I've only worked w/Go a little -- a websockets proxy, where I needed the speed and concurrency. With Go being a simpler, non dynamic language, I imagine gopherjs ought to be faster performing, if that actually makes a difference in your app. That being said, Ruby is higher level and more flexible, so I imagine coding a complex app in Opal could go faster. That gopherjs supports a form of goroutine on top of js is cool, we should consider imitating that in Opal, since there's no Ruby example to draw from. I volunteer @meh to work that magic ---------------------------------------------------------------------------------------------------- [21:17:58] meh.(@meh):fkchang, not compatible with Opal's design ---------------------------------------------------------------------------------------------------- ############################## [2015-07-12] ############################## [21:46:42] Ángel M(@Angelmmiguel):Hi @elia ---------------------------------------------------------------------------------------------------- [21:47:11] Ángel M(@Angelmmiguel):Opal.compile method (javascript) ---------------------------------------------------------------------------------------------------- [21:48:07] Ángel M(@Angelmmiguel):I loaded current version from opalrb.org (cdn) and used in my website ---------------------------------------------------------------------------------------------------- [21:52:20] Elia Schito(@elia):Be sure to load opal-parser.js too ---------------------------------------------------------------------------------------------------- [21:58:21] Ángel M(@Angelmmiguel):yes, the two libraries was loaded ---------------------------------------------------------------------------------------------------- [21:59:46] Ángel M(@Angelmmiguel):When I change url to use 0.7.1 version, it works well :) ---------------------------------------------------------------------------------------------------- [11:25:10] Ángel M(@Angelmmiguel):Hello! ---------------------------------------------------------------------------------------------------- [11:26:42] Ángel M(@Angelmmiguel):Do you delete the compile method on javascript library? ---------------------------------------------------------------------------------------------------- [11:26:53] Ángel M(@Angelmmiguel):I get an error when I try to use it ---------------------------------------------------------------------------------------------------- [14:39:31] Ángel M(@Angelmmiguel):I downgrade the version of the library from current to 0.7.1 and it's ok :) ---------------------------------------------------------------------------------------------------- [21:45:49] Elia Schito(@elia):@Angelmmiguel which method exactly? ---------------------------------------------------------------------------------------------------- ############################## [2015-07-13] ############################## [07:48:36] Elia Schito(@elia):@Angelmmiguel can you post the urls for which it doesn't work? ---------------------------------------------------------------------------------------------------- [08:12:34] Ángel M(@Angelmmiguel):@elia http://cdn.opalrb.org/opal/current/opal.min.js and http://cdn.opalrb.org/opal/current/opal-parser.min.js ---------------------------------------------------------------------------------------------------- [08:15:39] Elia Schito(@elia):@Angelmmiguel Ok, the solution is to `require "opal-parser"` from a ruby/opal script ---------------------------------------------------------------------------------------------------- [08:15:55] Elia Schito(@elia):or `Opal.require('opal-parser')` in JS land ---------------------------------------------------------------------------------------------------- [08:16:45] Elia Schito(@elia):eg. ``` ``` ---------------------------------------------------------------------------------------------------- [08:18:06] Ángel M(@Angelmmiguel):Ah! ok @elia, thanks for the reply. I will change it on opalbox-jquery :) ---------------------------------------------------------------------------------------------------- [08:19:07] Elia Schito(@elia):@Angelmmiguel would be great if you can send a PR to update documentation for this :sparkles: ---------------------------------------------------------------------------------------------------- [08:25:56] Ángel M(@Angelmmiguel):Of course @elia. When I arrive to home, I will create it ;) ---------------------------------------------------------------------------------------------------- [08:26:21] Elia Schito(@elia):awesome thanks! ---------------------------------------------------------------------------------------------------- [08:29:29] Elia Schito(@elia):Great new stuff coming to the Safari 9 web inspector: https://developer.apple.com/videos/wwdc/2015/?id=505 ---------------------------------------------------------------------------------------------------- [12:13:58] Torsten Rüger(@dancinglightning):About great stuff @elia . I just threw 10000 lines of ruby code at opal (with small hopes) and it WORKS. That’s great stuff, so thanks guys, also @meh and @adambeynon and everyone else. ---------------------------------------------------------------------------------------------------- [15:44:11] Ángel M(@Angelmmiguel):@elia I test your solution on opalbox-jquery and it works fine ---------------------------------------------------------------------------------------------------- [15:44:29] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [15:45:02] Elia Schito(@elia):also thanks @dancinglightning! this is great feedback :smile_cat: ---------------------------------------------------------------------------------------------------- [16:19:52] Forrest Chang(@fkchang):@dancinglightning so what's the 10000 line project? ---------------------------------------------------------------------------------------------------- [16:22:32] Torsten Rüger(@dancinglightning):@fkchang I started writing a vm in ruby last year. Now i can produce executables, but i don’t want to use gdb anymore. So i am writing a debugger/interpreter for the vm. All of the vm but the parser works in opal. ---------------------------------------------------------------------------------------------------- [16:24:55] Forrest Chang(@fkchang):@dancinglightning very interesting ---------------------------------------------------------------------------------------------------- [16:26:20] Elia Schito(@elia):@dancinglightning from what I can understand these might be of your interest https://github.com/opal/opal/issues?q=is%3Aopen+is%3Aissue+label%3Aparser 🍰 ---------------------------------------------------------------------------------------------------- [16:26:39] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [16:27:18] Torsten Rüger(@dancinglightning):@fkchang thanks, it does seem to be a ittle further out here than fashionable :-) http://salama-vm.org/ ---------------------------------------------------------------------------------------------------- [16:28:42] Torsten Rüger(@dancinglightning):@elia not sure, that is about your parser right ? i started my own, it’s peg based. I just don’t understand those yacc ones. ---------------------------------------------------------------------------------------------------- [16:29:05] Elia Schito(@elia)::( hoped for a moment ---------------------------------------------------------------------------------------------------- [16:30:47] Torsten Rüger(@dancinglightning):@elia i understand. Mad undertaking. i was wondering why you didn’t use the whitequark one https://github.com/whitequark/parser ---------------------------------------------------------------------------------------------------- [16:32:06] Elia Schito(@elia):I don't think it was ready when @adambeynon started, but we planned to switch to it by first migrating to a compatible ast and then switching the parser ---------------------------------------------------------------------------------------------------- [16:32:34] Elia Schito(@elia):but that's not easy :) ---------------------------------------------------------------------------------------------------- [16:34:05] Torsten Rüger(@dancinglightning):@elia sounds good. and i’m sure it’s not. It’s a shame mine is’t further along, it would be a good idea to share. ---------------------------------------------------------------------------------------------------- [18:18:35] Forrest Chang(@fkchang):hmm, looks like whitequark parse would be able to provide a number of things I've been hoping @adambeynon could provide for me parse_with_comments, source, etc. ---------------------------------------------------------------------------------------------------- [20:32:41] Elia Schito(@elia):@/all https://twitter.com/rubygems/status/620691078245679104 ---------------------------------------------------------------------------------------------------- [20:32:56] Elia Schito(@elia):this should be final ---------------------------------------------------------------------------------------------------- [20:36:33] George Plymale II(@ylluminarious)::clap: ---------------------------------------------------------------------------------------------------- [20:36:38] Ryan Stout(@ryanstout):nice work! ---------------------------------------------------------------------------------------------------- [20:38:03] Elia Schito(@elia):props to @vais for the constant stream of PRs (which are a pleasure to merge btw)! ---------------------------------------------------------------------------------------------------- [20:38:36] Elia Schito(@elia):after 0.8 is out, plan is to go straight to 0.9 ---------------------------------------------------------------------------------------------------- [20:45:32] Ángel M(@Angelmmiguel):nice! :D ---------------------------------------------------------------------------------------------------- [20:55:37] Jared White(@jaredcwhite):Eeeeeexcellent! :) ---------------------------------------------------------------------------------------------------- [21:16:24] CJ Lazell(@cj):nice! ---------------------------------------------------------------------------------------------------- [21:16:44] CJ Lazell(@cj):is there any way to set headers on the opal server? ---------------------------------------------------------------------------------------------------- [21:38:37] Elia Schito(@elia):@cj what kind of headers? for which type of file? ---------------------------------------------------------------------------------------------------- [21:50:09] CJ Lazell(@cj):@elia cache control, age, connection transport etc…. ---------------------------------------------------------------------------------------------------- [21:59:18] Elia Schito(@elia):I'm open to update Opal::Server to either include that stuff by default or allow the use of middlewares (I think there's an issue already open but don't remember) ---------------------------------------------------------------------------------------------------- [21:59:24] Elia Schito(@elia):@cj ^ ---------------------------------------------------------------------------------------------------- [21:59:47] CJ Lazell(@cj):yee, we talked about opening it up before/allowing the use of middleware ---------------------------------------------------------------------------------------------------- [22:01:00] CJ Lazell(@cj):I think it’s definietly something that needs to be added. headers I think should be an options that just merges in the users hash, where the users hash takes priority ---------------------------------------------------------------------------------------------------- [23:08:43] Elia Schito(@elia):@cj was checking the source to add a hook, but actually I (re)discovered that after all Opal::Server is already a rack app, hence you can use whatever middleware you want with it, am I missing something? (sorry if you already explained the other time) ---------------------------------------------------------------------------------------------------- [23:23:23] CJ Lazell(@cj):@elia you’re talking about https://github.com/wedgeio/wedge/blob/master/lib/wedge/middleware.rb#L129, right? how would you go about changing the response headers? similar to this https://github.com/jeremyevans/roda/blob/master/lib/roda/plugins/assets.rb#L216? ---------------------------------------------------------------------------------------------------- [23:25:09] CJ Lazell(@cj):@elia I also thought there is no way to call #use on the Opal::Server to add your own middleware to it ---------------------------------------------------------------------------------------------------- [23:25:20] CJ Lazell(@cj):which is what we were talking about before I think ---------------------------------------------------------------------------------------------------- [23:30:26] CJ Lazell(@cj):in the block that is* ---------------------------------------------------------------------------------------------------- [23:44:28] Elia Schito(@elia):basically the rack app that is opal server boils down to these lines ---------------------------------------------------------------------------------------------------- [23:44:28] Elia Schito(@elia):https://github.com/opal/opal/blob/master/lib/opal/sprockets/server.rb#L75-L91 ---------------------------------------------------------------------------------------------------- [23:45:03] Elia Schito(@elia):any place you see where it would make sense to add the hook? ---------------------------------------------------------------------------------------------------- ############################## [2015-07-14] ############################## [14:15:38] CJ Lazell(@cj):@elia I would add :headers to that, create a class under Index called Headers and then use that middleware to set the headers based on what the user passed in ---------------------------------------------------------------------------------------------------- [15:16:09] CJ Lazell(@cj):by that I mean the attr_accessor at the top :) ---------------------------------------------------------------------------------------------------- [17:40:26] Elia Schito(@elia):@meh is it expected that a Promise#fail block swallows exceptions? ---------------------------------------------------------------------------------------------------- [17:40:37] meh.(@meh):elia, define swallow ---------------------------------------------------------------------------------------------------- [17:40:53] Elia Schito(@elia):rescue nil ---------------------------------------------------------------------------------------------------- [17:41:47] Elia Schito(@elia):I wasn't seeing anything where I expected to see an exception in the console ---------------------------------------------------------------------------------------------------- [17:42:04] Elia Schito(@elia):(i'm on 0.8 rc3) ---------------------------------------------------------------------------------------------------- [17:52:20] meh.(@meh):elia, in theory it's normal ---------------------------------------------------------------------------------------------------- [17:52:20] meh.(@meh):you should add another fail if the fail fails, in theory ---------------------------------------------------------------------------------------------------- [17:52:21] meh.(@meh):we don't have Thread.raise ---------------------------------------------------------------------------------------------------- [17:52:21] meh.(@meh):so they must be swallowed ---------------------------------------------------------------------------------------------------- [17:52:21] meh.(@meh):for debugging ---------------------------------------------------------------------------------------------------- [17:52:21] meh.(@meh):just add an always at the end ---------------------------------------------------------------------------------------------------- [17:52:21] meh.(@meh):and print the parameter to console ---------------------------------------------------------------------------------------------------- [22:31:19] Rick Carlino(@RickCarlino):Anyone know if fiddle salad allows `require`ing of outside libs like `opal-jquery`? ---------------------------------------------------------------------------------------------------- ############################## [2015-07-15] ############################## [00:32:07] Forrest Chang(@fkchang):@RickCarlino not that I know of. I put in require_js into opal-irb that allows you to include js libs on the fly that also works on opal-playground by way of including the opal-irb gem ---------------------------------------------------------------------------------------------------- [17:22:29] Ryan Stout(@ryanstout):does anyone remember a conversation about opal adding preprocessor hooks for things like custom if RUBY_PLATFORM == 'opal' checks? ---------------------------------------------------------------------------------------------------- [17:27:57] Elia Schito(@elia):Yes ---------------------------------------------------------------------------------------------------- [17:29:49] Torsten Rüger(@dancinglightning):just from reading the code/specs (if_node) one can check positive or negative for PLATFORM or ENGINE and that seems to be that ---------------------------------------------------------------------------------------------------- [17:32:50] Elia Schito(@elia):Some custom additions are in place for mspec too ---------------------------------------------------------------------------------------------------- [17:52:29] Ryan Stout(@ryanstout):@elia is it possible to make something like Volt.client? work like if RUBY_PLATFORM == 'opal' ---------------------------------------------------------------------------------------------------- [18:41:23] Elia Schito(@elia):@ryanstout sure, search for not_supported_on in opal codebase ---------------------------------------------------------------------------------------------------- [18:51:20] Torsten Rüger(@dancinglightning):@ryanstout actually if we just did .client do … end and do the check inside the method before yielding we would hide the implementation ---------------------------------------------------------------------------------------------------- [18:53:21] Ryan Stout(@ryanstout):@elia thanks, checking it out ---------------------------------------------------------------------------------------------------- [21:31:55] Ryan Stout(@ryanstout):why is it Fixnum.inspect returns "Numeric"? ---------------------------------------------------------------------------------------------------- [21:32:24] Elia Schito(@elia):they're all the same class ---------------------------------------------------------------------------------------------------- [21:32:31] Ryan Stout(@ryanstout):ok, they are aliased? ---------------------------------------------------------------------------------------------------- [21:32:40] Elia Schito(@elia):ie. js Number ---------------------------------------------------------------------------------------------------- [21:32:48] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:32:48] Elia Schito(@elia):y ---------------------------------------------------------------------------------------------------- [22:20:54] Elia Schito(@elia):How proper module support would have worked if only `__proto__` were supported by all browsers: https://gist.github.com/elia/a076c2cbe69f30229cba ---------------------------------------------------------------------------------------------------- ############################## [2015-07-16] ############################## [20:13:06] Forrest Chang(@fkchang):what's your other subject ---------------------------------------------------------------------------------------------------- [20:16:37] Mitch VanDuyn(@catmando):@fkchang - I got very stuck a few months back with react.rb getting the testing working. The problem was I had ruby code running in 3 places (server, server opal on v8, and opal on client). I was just beating my head on the wall getting any kind of tests to work. I am wondering if with your experience we could chat for an hour next week sometime, look at some code, and get a few basic tests going. I am really suffering not having any way to automate testing of all this code I am writing! ---------------------------------------------------------------------------------------------------- [20:18:09] Mitch VanDuyn(@catmando):@fkchang - if you don't have time or its not up your alley I understand of course ---------------------------------------------------------------------------------------------------- [20:28:51] Forrest Chang(@fkchang):@catmando I'm up for it, hopefully I'll have something useful to share on that ---------------------------------------------------------------------------------------------------- [20:29:27] Forrest Chang(@fkchang):we were going to do some sort of what u r doing and react.rb walkthrough too ---------------------------------------------------------------------------------------------------- [20:30:32] Mitch VanDuyn(@catmando):@fkchange okay that's good too. Does a week from today at 1:00 PM work? ---------------------------------------------------------------------------------------------------- [20:30:53] Mitch VanDuyn(@catmando):we can do it on gitter on the react.rb room, I'll set up some thing to share code etc. ---------------------------------------------------------------------------------------------------- [20:33:53] Forrest Chang(@fkchang):@catmando thurs is generally my busiest day ---------------------------------------------------------------------------------------------------- [20:34:47] Mitch VanDuyn(@catmando):@fkchang, np wednesday is also good for me, but really anytime works, and I can rearrange things. ---------------------------------------------------------------------------------------------------- [20:43:12] Forrest Chang(@fkchang):@catmando how's fridays, my schedule often clears up 1pm PT on fridays ---------------------------------------------------------------------------------------------------- [20:45:17] Mitch VanDuyn(@catmando):@fkchang, I am good at 1:00 PM PT next friday - actually would work very well for me. ---------------------------------------------------------------------------------------------------- [20:48:53] Forrest Chang(@fkchang):@catmando ok, let's shoot for that ---------------------------------------------------------------------------------------------------- [16:54:33] Ryan Stout(@ryanstout):congrats! ---------------------------------------------------------------------------------------------------- [17:28:34] ylluminate(@ylluminate):anything we can help out with to get .8 to volt? i know you'd mentioned you had been working on it @ryanstout ---------------------------------------------------------------------------------------------------- [17:29:11] Ryan Stout(@ryanstout):@ylluminate (fyi, this is the opal room). I'm really close, if things go well, I might have it out today. ---------------------------------------------------------------------------------------------------- [17:30:21] ylluminate(@ylluminate)::clap: ---------------------------------------------------------------------------------------------------- [17:56:44] Andrew Kalek(@anlek):Hello everyone, Just wondering if Opal is production ready? I haven't done much research into it yet but figured I could ask here. ---------------------------------------------------------------------------------------------------- [18:05:05] Mitch VanDuyn(@catmando):@anlek, I have a small team and we redoing our website front end in Opal, its going very well. We have had basically no problems. ---------------------------------------------------------------------------------------------------- [18:05:58] Andrew Kalek(@anlek):Interesting. I find that Opal website doesn't do a good job showing the rendered JS (like let's say CoffeeScript website) which makes me a bit uncomfortable. ---------------------------------------------------------------------------------------------------- [18:08:27] Mitch VanDuyn(@catmando):@anlek coffeescript was designed as more a syntax sugar on top of javascript, so that there is pretty much a 1:1 mapping between the two. Opal is true compiler that generates efficient javascript code, so while the code is readable if you really want to do that, you basically don't have to. ---------------------------------------------------------------------------------------------------- [18:09:04] Mitch VanDuyn(@catmando):@anlek but if you want to see what opal is doing try this: http://opalrb.org/try/ ---------------------------------------------------------------------------------------------------- [18:09:19] Andrew Kalek(@anlek):Wow, that's a good point that I didn't know about. ---------------------------------------------------------------------------------------------------- [18:09:47] Mitch VanDuyn(@catmando):What kind of project were you thinking of using opal for? ---------------------------------------------------------------------------------------------------- [18:10:23] Andrew Kalek(@anlek):No project in mind yet, I just read about Opal (and heard a podcast a few weeks back) and thought I'd look into it. ---------------------------------------------------------------------------------------------------- [18:10:33] Andrew Kalek(@anlek):Any idea how Opal works with things like Ember.js? ---------------------------------------------------------------------------------------------------- [18:11:20] Mitch VanDuyn(@catmando):@anlek - you could make it work I think easily enough. However... ---------------------------------------------------------------------------------------------------- [18:11:42] Andrew Kalek(@anlek):oh boy, here it comes... ;) ---------------------------------------------------------------------------------------------------- [18:12:07] Mitch VanDuyn(@catmando):we started using ember and got quite a few of our pages in ember, but it found the learning curve too steep. ---------------------------------------------------------------------------------------------------- [18:12:25] Andrew Kalek(@anlek):For Ember itself or using Ember with Opal? ---------------------------------------------------------------------------------------------------- [18:13:07] Mitch VanDuyn(@catmando):For ember itself... ---------------------------------------------------------------------------------------------------- [18:13:28] Gabriel Rios(@gabrielrios):@anlek would probably require a wrapper, there’s one for React.js (https://github.com/zetachang/react.rb), but there’s some Opal Frameworks too ---------------------------------------------------------------------------------------------------- [18:13:30] Andrew Kalek(@anlek):Oh, ok. I can deal with that. ---------------------------------------------------------------------------------------------------- [18:13:31] Mitch VanDuyn(@catmando):what we are doing in my shop is using Facebooks React + a set of gems that let you do everything in ruby. ---------------------------------------------------------------------------------------------------- [18:13:32] George Plymale II(@ylluminarious):@anlek there are a number of frameworks and libraries for opal, e.g., [voltrb](https://github.com/voltrb/volt), [vienna](https://github.com/opal/vienna) ---------------------------------------------------------------------------------------------------- [18:14:36] Mitch VanDuyn(@catmando):@anlek at this point with about 3 months experience I have become an absolute opal-react fanatic. ---------------------------------------------------------------------------------------------------- [18:16:53] Mitch VanDuyn(@catmando):But there is no technical reason why you can't put a wrapper on Ember. If you do want to chat about react + opal head over to the zetachang/react.rb gitter room for specific discussion there. ---------------------------------------------------------------------------------------------------- [18:17:23] Andrew Kalek(@anlek):@catmando Thanks, I'll look into it when the time comes ;) ---------------------------------------------------------------------------------------------------- [18:17:49] Andrew Kalek(@anlek):@ylluminarious Thanks, I have seen Vienna somewhere on the Opal site but didn't look into it. I'll check those out. ---------------------------------------------------------------------------------------------------- [18:17:55] Mitch VanDuyn(@catmando):@anlek - have fun! ---------------------------------------------------------------------------------------------------- [18:18:18] Andrew Kalek(@anlek):It's also nice to know there is a channel with so many nice people willing to help if I have any problems ;) ---------------------------------------------------------------------------------------------------- [18:20:07] George Plymale II(@ylluminarious):@anlek no problem ---------------------------------------------------------------------------------------------------- [18:33:53] Andrew Kalek(@anlek):Has anyone used Volt? ---------------------------------------------------------------------------------------------------- [18:34:52] George Plymale II(@ylluminarious):@anlek fyi, there's a volt room for discussion: https://gitter.im/voltrb/volt ---------------------------------------------------------------------------------------------------- [18:35:08] Andrew Kalek(@anlek):Wow, awesome, thanks! ---------------------------------------------------------------------------------------------------- [18:48:33] Forrest Chang(@fkchang):@anlek there are 2 other places to mess around with opal in the browser http://fkchang.github.io/opal-irb/index-embeddable.html#code:alert%20%22Hi%20anlek!%22 ---------------------------------------------------------------------------------------------------- [18:49:12] Forrest Chang(@fkchang):and http://git.io/vm2vM ---------------------------------------------------------------------------------------------------- [18:49:43] Andrew Kalek(@anlek):@fkchang first link doesn't seem to do anything for me (I see H1 and H2 content but can't click `show lrb`) ---------------------------------------------------------------------------------------------------- [18:49:52] Forrest Chang(@fkchang):u can see the compiled code in both, though more easily in the playground ---------------------------------------------------------------------------------------------------- [18:50:07] Andrew Kalek(@anlek):Second link looks great! ---------------------------------------------------------------------------------------------------- [18:50:30] Forrest Chang(@fkchang):For opal frameworks, I would also look at clearwater and lissio ---------------------------------------------------------------------------------------------------- [18:51:00] Forrest Chang(@fkchang):@anlek do you have an error in the javascript console for the 1st link? ---------------------------------------------------------------------------------------------------- [18:52:06] Andrew Kalek(@anlek):@fkchang https://www.evernote.com/l/ACR7qYRX5VtOzpvcWJkDvTwg4w1dUVjwESwB/image.png ---------------------------------------------------------------------------------------------------- [18:54:01] Forrest Chang(@fkchang):change your url to not have https in the header, are you using "always https" or similar plugin? ---------------------------------------------------------------------------------------------------- [18:54:19] Andrew Kalek(@anlek):Yeah, I think I do ---------------------------------------------------------------------------------------------------- [18:54:47] Forrest Chang(@fkchang):I'll fix it to not specifically http the dependency js at some point and it'll still work on https, but not certain when I'll get to it ---------------------------------------------------------------------------------------------------- [18:55:21] Forrest Chang(@fkchang):@anlek when it works it would come up like this ---------------------------------------------------------------------------------------------------- [18:55:45] Andrew Kalek(@anlek):@fkchang I turned of the https force, and now I can see it. very nice. ---------------------------------------------------------------------------------------------------- [18:56:13] Forrest Chang(@fkchang):[![Screenshot_7_16_15__11_55_AM.png](https://files.gitter.im/opal/opal/OiCj/thumb/Screenshot_7_16_15__11_55_AM.png)](https://files.gitter.im/opal/opal/OiCj/Screenshot_7_16_15__11_55_AM.png) ---------------------------------------------------------------------------------------------------- [18:56:24] Andrew Kalek(@anlek)::) ---------------------------------------------------------------------------------------------------- [18:56:47] Forrest Chang(@fkchang):@anlek sign up for the opalist.co newsletter too ---------------------------------------------------------------------------------------------------- [18:57:03] Forrest Chang(@fkchang):and more discussion at metaruby.com ---------------------------------------------------------------------------------------------------- [18:57:22] Andrew Kalek(@anlek):@fkchang Thanks, I'll look into it :) ---------------------------------------------------------------------------------------------------- [19:00:10] Mitch VanDuyn(@catmando):@fkchang - i've been meaning to ask you this: Why can't I type CRs into IRB? ---------------------------------------------------------------------------------------------------- [19:01:25] Mitch VanDuyn(@catmando):Like if I type ```ruby class Foo puts "I'm a class" end ``` I get ============ SyntaxError: An error occurred while compiling: (file) unexpected 'false' Source: (file):1:9 class Foo ---------------------------------------------------------------------------------------------------- [19:21:52] Forrest Chang(@fkchang):@catmando hit ctrl-M and use the multi line editor ---------------------------------------------------------------------------------------------------- [19:22:32] Forrest Chang(@fkchang):u should watch some of the online demos, it seems most ppl have no idea of 90% of the features there ---------------------------------------------------------------------------------------------------- [19:25:24] Forrest Chang(@fkchang):and if you want the link to anything in your history, navigate to it, and hit ctrl-L (l for link), and it gives you the link for that ---------------------------------------------------------------------------------------------------- [19:25:55] Forrest Chang(@fkchang):I do some things different than irb, but actually give more capability, and make it easier once u realize how it can work. Like irb, you can go up and down command history and edit anything, but multi line edit in irb sucks, so, you just hit ctrl-M (m for multiline) and get a syntax highlighted editor (that I'm adding code completion to). Edit, reformat to your hearts content, then evaluate ---------------------------------------------------------------------------------------------------- [19:28:31] Forrest Chang(@fkchang):I started to go down the road of if what you type on one line doesn't parse, to keep it open. I implemented some of that but it's not as robust as irb, but then I realized multi line editing in irb sucks, esp. if you made a mistake, it'd be easier and more productive to invoke an editor on your statement than to spend a lot of work making the "don't blow up if the statement goes past 1 line" way ---------------------------------------------------------------------------------------------------- [19:35:03] Mitch VanDuyn(@catmando):yeah that's much better... I agree, I would rather have the multi line edit option anyway. BTW anyway to steal this nice gitter interface with their multiline / single line capability? That would be so sweet. ---------------------------------------------------------------------------------------------------- [19:36:55] Mitch VanDuyn(@catmando):@fkchange... its very cool... I really want to get react.rb integrated so you can sit there and build a ui on the fly! ---------------------------------------------------------------------------------------------------- [19:38:14] Forrest Chang(@fkchang):@catmando that's an interesting idea, since I'm using jconsole for the terminal emulation, I suspect that would be more work that I'd hope, esp. the way gitter does inline change of the content. I imagine I need to make it more clear you can do multiline edit, aside from putting it in the help ---------------------------------------------------------------------------------------------------- [19:38:50] Forrest Chang(@fkchang):@catmando yeah, I need to carve out some time to checkout react.rb one of these days, it wouldn't be too hard to make a react.rb based editor ---------------------------------------------------------------------------------------------------- [19:39:05] Forrest Chang(@fkchang):I had planned to make one for lissio for a while now ---------------------------------------------------------------------------------------------------- [19:39:13] Mitch VanDuyn(@catmando):@fkchang... yeah I wouldn't want to work on it unless I could just steal it. (the gitter text editor) ---------------------------------------------------------------------------------------------------- [19:41:34] Mitch VanDuyn(@catmando):@fkchang - I am imagining you could have some kind of TDD playground where you built each component and a set of test scripts with it at the same time. ---------------------------------------------------------------------------------------------------- [19:50:14] Mitch VanDuyn(@catmando):General Question is it there any way to in opal with sprockets to conditionally compile stuff? If not how hard would it be to add? For example if you type `if PRODUCTION ...end` and PRODUCTION were false, the code would not even get generated? ---------------------------------------------------------------------------------------------------- [19:50:49] Forrest Chang(@fkchang):@catmando Compose mode just makes it multi line, codemirror gives me so much more capability (including the qualified autocomplete I working on) ---------------------------------------------------------------------------------------------------- [19:51:23] Mitch VanDuyn(@catmando):@fkchang is codemirror in there? or something you are working ---------------------------------------------------------------------------------------------------- [19:51:55] Forrest Chang(@fkchang):@catmando opal-inspector would do that and much more, but hindered w/o the ability to look up code by name, I've been thinking of some workarounds so I can get started and show some really neat things to get some momentum behind it ---------------------------------------------------------------------------------------------------- [19:52:23] Forrest Chang(@fkchang):@catmando I'm using codemirror as the editor ---------------------------------------------------------------------------------------------------- [19:53:36] Mitch VanDuyn(@catmando):gotcha... lookup code by name meaning getting the source code back? ---------------------------------------------------------------------------------------------------- [19:53:39] Forrest Chang(@fkchang):here's my pre qualified code complete (qualified meaning I tell you what it is) ---------------------------------------------------------------------------------------------------- [19:53:50] Forrest Chang(@fkchang):[![Screenshot_7_16_15__12_53_PM.png](https://files.gitter.im/opal/opal/Gm17/thumb/Screenshot_7_16_15__12_53_PM.png)](https://files.gitter.im/opal/opal/Gm17/Screenshot_7_16_15__12_53_PM.png) ---------------------------------------------------------------------------------------------------- [19:54:31] Mitch VanDuyn(@catmando):sweet ---------------------------------------------------------------------------------------------------- [19:55:00] Forrest Chang(@fkchang):@catmando yes, it's on @adambeynon 's list of todo's, but it's critical to simulation of smalltalk's object browser way of editing code that I demoed a prototype of a few years back ---------------------------------------------------------------------------------------------------- [19:56:52] Mitch VanDuyn(@catmando):@fkchang I assume its not a technical issue, just time right? Its just a matter of the parser keep track of stuff and storing it away right? I can see why its not done, just thinking what it will take to get it done :-) ---------------------------------------------------------------------------------------------------- [19:57:32] Forrest Chang(@fkchang):@catmando yeah, it' s a matter of storing it. Also to figure out some sort of api that could serve it up from both the server or in the client ---------------------------------------------------------------------------------------------------- [19:57:49] Forrest Chang(@fkchang):it's like 70% similar to what's done for source maps ---------------------------------------------------------------------------------------------------- [19:58:23] Mitch VanDuyn(@catmando):@fkchang, why not just store it in the javascript on the client (switchable for production mode of course) ---------------------------------------------------------------------------------------------------- [19:59:38] Mitch VanDuyn(@catmando):@fkchang can you do this in mrb today? ---------------------------------------------------------------------------------------------------- [19:59:39] Forrest Chang(@fkchang):@catmando that might be a first step, I have some grandiose plans about being able to start an app, develop it in the browser, and when the code is what I want, sending it back to the server, so there are some subtleties to work out. That being said, I have some lower hanging fruit ---------------------------------------------------------------------------------------------------- [20:00:48] Forrest Chang(@fkchang):@catmando irb doesn't do it but pry does it, and I planned on basically using the same interface they do, i.e. ```edit Class#method``` ---------------------------------------------------------------------------------------------------- [20:01:05] Forrest Chang(@fkchang):from opal-irb. I'd also make the class browser ala smalltalk ---------------------------------------------------------------------------------------------------- [20:01:21] Mitch VanDuyn(@catmando):@fkchang I am with you all the way on that. The only thing I would consider is what is the purpose of "sending it back to the server". I am thinking you want to send it to a git repo. ---------------------------------------------------------------------------------------------------- [20:01:59] Forrest Chang(@fkchang):sometimes the cmd line is where u want it, sometimes the gui, I'll do both ---------------------------------------------------------------------------------------------------- [20:02:54] Forrest Chang(@fkchang):@catmando sending it back to the server is a dev thing. Take this case, I develop in safari, get it working, then I send the stuff back to the server so I can test in FF or mobile ---------------------------------------------------------------------------------------------------- [20:03:25] Forrest Chang(@fkchang):I sort of envision some sort of PR's so I can figure which changes I want to actually commit to the repo. ---------------------------------------------------------------------------------------------------- [20:03:47] Forrest Chang(@fkchang):That said, the low hanging fruit is to just push it back to the server, and I can use git itself to decide whether or not to commit ---------------------------------------------------------------------------------------------------- [20:04:51] Forrest Chang(@fkchang):that might be the better way to do it, but I need to be able to pull up code by name and know where to put it back, etc. ---------------------------------------------------------------------------------------------------- [20:06:28] Mitch VanDuyn(@catmando):@fkchang well not very smalltalk'ish but if you basically were always editing a "file" then wouldn't it all work? ---------------------------------------------------------------------------------------------------- [20:07:52] Mitch VanDuyn(@catmando):@fkchang there is some advantage in the redundancy of having the file directory structure layed on top of the code structure (at least I find it so.) ---------------------------------------------------------------------------------------------------- [20:08:15] Forrest Chang(@fkchang):@catmando I was going to try something like that as one of my workaround steps\ ---------------------------------------------------------------------------------------------------- [20:08:39] Forrest Chang(@fkchang):there is no way of getting around file structure, because that's how it is stored ---------------------------------------------------------------------------------------------------- [20:08:46] Forrest Chang(@fkchang):on the server ---------------------------------------------------------------------------------------------------- [20:08:54] Forrest Chang(@fkchang):and I don't plan on making images like small talk ---------------------------------------------------------------------------------------------------- [20:09:36] Forrest Chang(@fkchang):opal-playground has been getting me to find smaller chunks of some of my ideas to implement, but I appreciate hearing your ideas. Small features can work me towards my loftier goals ---------------------------------------------------------------------------------------------------- [20:10:31] Mitch VanDuyn(@catmando):@fkchang, well actually I think with not too much work we could be using it in anger. ---------------------------------------------------------------------------------------------------- [20:10:52] Mitch VanDuyn(@catmando):@fkchang - on a different subject... ---------------------------------------------------------------------------------------------------- [20:11:00] Mitch VanDuyn(@catmando):if you have a few minutes... ---------------------------------------------------------------------------------------------------- [20:11:12] Forrest Chang(@fkchang):@catmando that'd be cool, having actual users outside of myself and my team could really help w/shaping it. Though I'd hope it's not in anger ---------------------------------------------------------------------------------------------------- [20:11:42] Mitch VanDuyn(@catmando):old guys expression perhaps (as opposed to playing) ---------------------------------------------------------------------------------------------------- [15:13:36] Elia Schito(@elia):@vais @meh @adambeynon might be a good time to release 0.8 wdyt? ---------------------------------------------------------------------------------------------------- [15:13:46] meh.(@meh):fine by me ---------------------------------------------------------------------------------------------------- [15:42:36] Vais Salikhov(@vais):I think it's time for 0.9 already :) so, yes. ---------------------------------------------------------------------------------------------------- [15:43:14] Elia Schito(@elia):2/3 is enough, releasing! ---------------------------------------------------------------------------------------------------- [15:44:15] Vais Salikhov(@vais)::tada: :sparkles: ---------------------------------------------------------------------------------------------------- [16:10:18] Gabriel Rios(@gabrielrios)::shipit: ---------------------------------------------------------------------------------------------------- [16:10:43] Elia Schito(@elia):https://twitter.com/rubygems/status/621713416126861313 ---------------------------------------------------------------------------------------------------- [16:12:13] Elia Schito(@elia):@/all finally v0.8 is out! 😄 Let's celebrate, update out apps and get ready for 0.9! ---------------------------------------------------------------------------------------------------- [16:13:38] George Plymale II(@ylluminarious)::D ---------------------------------------------------------------------------------------------------- [16:14:27] CJ Lazell(@cj):w00t! :D ---------------------------------------------------------------------------------------------------- [16:15:31] Torsten Rüger(@dancinglightning):well done ! ---------------------------------------------------------------------------------------------------- [16:49:01] ylluminate(@ylluminate):and almost to the 5,000th commit! ---------------------------------------------------------------------------------------------------- ############################## [2015-07-17] ############################## [23:02:21] Elia Schito(@elia):in dev only of course ---------------------------------------------------------------------------------------------------- [23:02:36] Elia Schito(@elia):https://twitter.com/rubygems/status/622177344002916352 ---------------------------------------------------------------------------------------------------- [23:06:12] Elia Schito(@elia):@ryanstout bedtime, keep me posted, would be definitely good to improve perf ---------------------------------------------------------------------------------------------------- [23:06:26] Ryan Stout(@ryanstout):@elia thanks for the help. I'll see what I can figure out. ---------------------------------------------------------------------------------------------------- [10:45:49] Christian Käser(@dfyx):@meh, @adambeynon, @elia Now that opal 0.8 is out, when will opal-rails follow? ---------------------------------------------------------------------------------------------------- [10:46:15] Elia Schito(@elia):@dfyx will take care of that shortly ---------------------------------------------------------------------------------------------------- [10:50:13] Christian Käser(@dfyx):@elia Great ---------------------------------------------------------------------------------------------------- [10:51:30] Christian Käser(@dfyx):I have an in-house rails app that currently runs on opal 0.7 ---------------------------------------------------------------------------------------------------- [14:36:47] Rick Carlino(@RickCarlino):Does opal have `SimpleDelegator`? ---------------------------------------------------------------------------------------------------- [14:39:17] Gabriel Rios(@gabrielrios):Yes ---------------------------------------------------------------------------------------------------- [17:58:46] Forrest Chang(@fkchang):anyone on? ---------------------------------------------------------------------------------------------------- [18:16:13] Elia Schito(@elia):Sup ---------------------------------------------------------------------------------------------------- [18:19:39] Torsten Rüger(@dancinglightning):quiet here, @fkchang i’ve been meaning to say: That new hope talk was excellent. One of the best ever, both in content and presentation. It’s what got me to pick it up, thanks! ---------------------------------------------------------------------------------------------------- [18:50:08] Mitch VanDuyn(@catmando):@fkchang, am now... ---------------------------------------------------------------------------------------------------- [19:03:48] Forrest Chang(@fkchang):@dancinglightning thanks, I put a lot of work into that talk ---------------------------------------------------------------------------------------------------- [19:05:18] Torsten Rüger(@dancinglightning):@fkchang well it was great. btw wasn’t there some class browser ? ---------------------------------------------------------------------------------------------------- [19:07:37] Forrest Chang(@fkchang):Anyways, I was thinking about some form of web_require for opal. In opal-irb (and by proxy opal-playground) I implemented a require_js - demoed here where I require_js raphael.js to mess w/it http://git.io/vmGmQ. I was figuring if we had some sort of cdn where we compile all the opal libs, that could be useful for real time experimentation, I don't think I'd do that in a production app. Related, we could do a web_require on opal code itself if we setup the right type of repo, a rubygems for opal, per se, where we could resolve dependencies because we know where the code would live ---------------------------------------------------------------------------------------------------- [19:07:38] Forrest Chang(@fkchang):thoughts? ---------------------------------------------------------------------------------------------------- [19:09:17] Forrest Chang(@fkchang):@dancinglightning I demo'ed my "opal-inspector" prototype -- if you saw @catmando and my conversation here yesterday, I talked a bit about it. Long story short, I plan to borrow smalltalk and lisp machine stuff to make really cool opal tools, I'm kind of blocked on that feature I want @adambeynon but I'm looking to some workarounds to get something to show ---------------------------------------------------------------------------------------------------- [19:13:21] Mitch VanDuyn(@catmando):@fkchang so if you do a web_require 'my-opal-lib' it would just work? Neat idea. Could it be somehow integrated with sprockets so that in a production environment it grabs all the stuff while it builds the assets? ---------------------------------------------------------------------------------------------------- [19:14:16] Mitch VanDuyn(@catmando):The problem would be preventing unwanted config changes when new version of a gem were released. For that you are back to some kind of gemfile / gemfile.lock structure right? ---------------------------------------------------------------------------------------------------- [19:16:38] Forrest Chang(@fkchang):@catmando that's the idea. It's thought from the perspective of adding code at runtime. My initial thought is I'm in opal-irb (or playground, or the future opal-inspector) and I just want to pull something in that I didn't already have required on the server side (which is currently not possible -- you have gem install, require, etc... and restart app). So for experimenting or development that's useful, but I see that once I've figured out what I want to use, that I'd do it the normal way. That said, @ryanstout made some mention of wanting to be able to load something like opal-irb on demand, but not always, where something like this would be useful ---------------------------------------------------------------------------------------------------- [19:17:15] Mitch VanDuyn(@catmando):@fkchang, but perhaps it could all be implicit... so you web_require a file, it checks (server side) to see if that file has been required before. if not it gets it and adds it the assets. If its already there you have the one then you stay with that version, until you do some explicit action to remove. ---------------------------------------------------------------------------------------------------- [19:17:34] Forrest Chang(@fkchang):If we setup some sort of opalgems server, web_require could hit that, it'd know how to traverse the directories and compile to js in the browser. Dependencies on other opalgems could be resolved by convention ---------------------------------------------------------------------------------------------------- [19:18:03] Forrest Chang(@fkchang):etc. But an reasonable low fruit would be to have compiled versions of all the opal libs, and just use require_js (I think that should work) ---------------------------------------------------------------------------------------------------- [19:18:26] Forrest Chang(@fkchang):then I could require_js opal-react, for instance on opal-playground right now and mess w/it ---------------------------------------------------------------------------------------------------- [19:18:49] Forrest Chang(@fkchang):But if I'm the only one who wants this feature, I wouldn't spend much effort on it ---------------------------------------------------------------------------------------------------- [19:19:27] Forrest Chang(@fkchang):@catmando ur web_require is something to think of ---------------------------------------------------------------------------------------------------- [19:20:28] Forrest Chang(@fkchang):Maybe we don't need a repo, we could crawl source on github as long as we can figure out conventions ---------------------------------------------------------------------------------------------------- [19:20:38] Forrest Chang(@fkchang):for web_require that is ---------------------------------------------------------------------------------------------------- [19:21:26] Torsten Rüger(@dancinglightning):@fkchang maybe i misunderstand, but could this not be a opal.server feature, or a sinatra app that you write. ---------------------------------------------------------------------------------------------------- [19:23:08] Forrest Chang(@fkchang):@dancinglightning to serve as the "opalgems" server? ---------------------------------------------------------------------------------------------------- [19:25:08] Forrest Chang(@fkchang):I would've imagined that @adambeynon @elia and @adambeynon must've have thought about something like web_require/opalgems before ---------------------------------------------------------------------------------------------------- [19:25:29] Mitch VanDuyn(@catmando):however... all that said, how much does this really buy over simply releasing a gem? ---------------------------------------------------------------------------------------------------- [19:26:26] Forrest Chang(@fkchang):maybe there's some insights ---------------------------------------------------------------------------------------------------- [19:26:44] Forrest Chang(@fkchang):@catmando the whole point is to be able require things at run time ---------------------------------------------------------------------------------------------------- [19:27:03] Forrest Chang(@fkchang):the analogy is real irb, where anything I've installed, I can simply require it and then use it ---------------------------------------------------------------------------------------------------- [19:27:23] Forrest Chang(@fkchang):Now if you haven't installed, you still have gem install it, but everything is available at run time ---------------------------------------------------------------------------------------------------- [19:27:49] Forrest Chang(@fkchang):Gems are fine when you already know you want it, then u install, require it in your app etc. ---------------------------------------------------------------------------------------------------- [19:28:28] Mitch VanDuyn(@catmando):I see, well in that case, I think you can still use all the existing gem infrastructure. ---------------------------------------------------------------------------------------------------- [19:29:20] Forrest Chang(@fkchang):Again, if no one finds it useful, not something I'll spend a lot of time, but low hanging fruit is if opal-react or opal-pixi is compiled to js somewhere, I can just require_js them right now in anything that has opal-irb included and mess w/it, and I could do that right now -- that meets the need of "adding functionality at run time" ---------------------------------------------------------------------------------------------------- [19:31:56] Torsten Rüger(@dancinglightning):@fkchang I went through playing with 4 different opal libraries in 2 days. Never saw it as a problem to stop my server, change the gemfile, bundle and restart. It was the reading up and getting to know the libraries that took more time. ---------------------------------------------------------------------------------------------------- [19:31:59] Mitch VanDuyn(@catmando):Hmmm... I sort of see what you mean. Certainly some way to add more to opal-irb at run time is good, but not really sure ---------------------------------------------------------------------------------------------------- [19:32:31] Torsten Rüger(@dancinglightning):I do think that an irb on a running app (in dev mode) would be useful though ---------------------------------------------------------------------------------------------------- [19:33:04] Torsten Rüger(@dancinglightning):or a class / object inspector. a debugger as it were ---------------------------------------------------------------------------------------------------- [19:33:28] Mitch VanDuyn(@catmando):I'm with @dancinglightning. And beyond understanding the library, lets say you did automagically pull in opal-react, well that's nice but to make it useful there are going to have to be other stuff added. ---------------------------------------------------------------------------------------------------- [19:34:52] Gabriel Rios(@gabrielrios):@fkchang This might be useful, mostly for opal-irb indeed (and maybe opal-repl). But what I find really interesting about `require_js` is that we might want to use it on wrappers, right now everytime someone is going to use opal-pixi, opal-react and other libraries there’s the need to add the script tag, which someone might not be expecting ---------------------------------------------------------------------------------------------------- [19:35:01] Torsten Rüger(@dancinglightning):@fkchang didn’t mean to take the wind out there. I do think it’s good that you are thinking of how to improve development. It’s been the same for too many decades ---------------------------------------------------------------------------------------------------- [19:35:20] Mitch VanDuyn(@catmando):I think its a good feature, but I think there are bigger fish to fry that will get generate opal excitement. ---------------------------------------------------------------------------------------------------- [19:35:23] Forrest Chang(@fkchang):@dancinglightning running opal-irb on apps is really handy. I've used the "live gist" to even help a coworker debug by setting up the situation that went wrong ---------------------------------------------------------------------------------------------------- [19:35:28] Gabriel Rios(@gabrielrios):Anyway there was a opal-cdn thing, that looks down right now (https://github.com/opal/opal-cdn), and I remember @ylluminate talking about having a central cdn for all opal gems ---------------------------------------------------------------------------------------------------- [19:35:48] Forrest Chang(@fkchang):W/o opal-irb, it'd be so hard to get the situation over to him ---------------------------------------------------------------------------------------------------- [19:38:45] Mitch VanDuyn(@catmando):I am just thinking if we want to do this then just make it work with standard gem structure. Have opal-irb redefine require, so that it "knows" how to go the gem server find the gem extract the needed opal code, and pull it down. It might be easier to set up a rails / sinatra server that does the donkey work and caches the results. ---------------------------------------------------------------------------------------------------- [19:39:29] Forrest Chang(@fkchang):@dancinglightning no worries, a bunch of the stuff I have in mind, most people won't be able to appreciate until they use it. Some folks in the Ruby world are familiar w/the smalltalk dev env (see avdi's recent gushing on smalltalk for someone who has recently discovered it - or rediscovered it). I believe I am the only person I know in the Ruby community who has ever used a lisp machine, so there's somethings I'll borrow, that pretty much no one in the ruby community has seen. ---------------------------------------------------------------------------------------------------- [19:42:12] Forrest Chang(@fkchang):@gabrielrios my quickie require_js implementation was to insert a ` in the html, but what is source in this case? (Note this is straight opal code, no lissio, but I assume that was just an example) Right now the page looks like this: ```html Hello React >----- does this go here???? ----<
``` ---------------------------------------------------------------------------------------------------- [15:27:49] meh.(@meh):catmando, yes, that should work ---------------------------------------------------------------------------------------------------- [15:37:15] Mitch VanDuyn(@catmando):@meh gee sorry but source is of course not defined... in this context what is "source" going to be??? ---------------------------------------------------------------------------------------------------- [15:42:15] meh.(@meh):catmando, right ---------------------------------------------------------------------------------------------------- [15:42:19] meh.(@meh):catmando, let me check ---------------------------------------------------------------------------------------------------- [15:42:29] Mitch VanDuyn(@catmando):I'm getting it I think ---------------------------------------------------------------------------------------------------- [15:42:53] Mitch VanDuyn(@catmando):looked at load_asset_code, source is the source file name right? and then I need to grab the opal processor ---------------------------------------------------------------------------------------------------- [15:43:28] Mitch VanDuyn(@catmando):@meh GOT IT! Thanks... ---------------------------------------------------------------------------------------------------- [15:43:34] meh.(@meh):catmando, yeah, source is the file name ---------------------------------------------------------------------------------------------------- [15:43:53] meh.(@meh):catmando, so it knows what the main file to load from the module list is ---------------------------------------------------------------------------------------------------- [15:44:13] Mitch VanDuyn(@catmando):Should this be documented anywhere? I will update the docs, but I am a little unsure where it should go. ---------------------------------------------------------------------------------------------------- [15:44:30] meh.(@meh):catmando, no idea, I had elia work on that stuff because I didn't follow the changes through ---------------------------------------------------------------------------------------------------- [15:44:42] meh.(@meh):as in, to make lissio compatible with 0.8 ---------------------------------------------------------------------------------------------------- [15:46:28] Mitch VanDuyn(@catmando):Yeah well that is what happened here too... @elia I would like to update the docs to explain that if you are rolling your own loading function then you need to include a call to Opal::Processor.load_asset_code... its just not clear in the docs where this should go? ---------------------------------------------------------------------------------------------------- [16:42:53] Elia Schito(@elia):good question! I have no idea either, I think I mentioned it in the changelog tho ---------------------------------------------------------------------------------------------------- [17:21:59] Mitch VanDuyn(@catmando):@elia I think perhaps very briefly upfront under install / getting started with a link to a section towards the end with the details. How does that sound? ---------------------------------------------------------------------------------------------------- [17:23:17] Elia Schito(@elia):good, can you draft something for that, super busy for some hours ---------------------------------------------------------------------------------------------------- [18:26:42] Ryan Stout(@ryanstout):@elia you around? ---------------------------------------------------------------------------------------------------- [20:49:26] Mitch VanDuyn(@catmando):arghhh... why is including every, and after so darn hard. Every time I try to use those methods I beat my head on the wall for hours... right now I am including opal-browser in the gem file, but when I require opal-browser it breaks the Opal::Processor.load_asset_code! ---------------------------------------------------------------------------------------------------- [20:50:37] Mitch VanDuyn(@catmando):THERE!!! the gem file is called opal-browser, but you require browser. Maybe if I said that to myself 37 more times I will remember! ---------------------------------------------------------------------------------------------------- ############################## [2015-07-21] ############################## [19:09:31] Brayden Banks(@bb010g):(There's GNU Smalltalk, but it seems really meh to me.) ---------------------------------------------------------------------------------------------------- [19:25:27] Forrest Chang(@fkchang):@bb010g it's where it is in that video, waiting for the code/comments lookup feature that I was hoping @vais would be able to implement in @adambeynon 's place given all the commits he's been making . I've been getting some low hanging fruit ideas working on opal-playground and from @catmando so I'll probably revive them. I'm adding auto completion w/context to the editor in opal-irb, that I'll bring to opal-playground, then after a "say detour", I'll probably get back to doing something opal-inspector -y. I also can implement a couple of things that avdi gushed about in small talk on his blog lately, I might detour and do that so I can say, "but that already exists in opal..." ---------------------------------------------------------------------------------------------------- [19:27:43] Forrest Chang(@fkchang):on a related note, the opal inspector demo site will need to be server based, I think, any ideas now that heroku doesn't do free 24/7 dynos anymore? ---------------------------------------------------------------------------------------------------- [19:28:43] Brayden Banks(@bb010g):App Engine? ---------------------------------------------------------------------------------------------------- [21:43:13] Mitch VanDuyn(@catmando):@fkchang You can host it on one of our servers if you like, or easier yet we can sponsor the demo site on our heroku account. ---------------------------------------------------------------------------------------------------- [22:33:24] Forrest Chang(@fkchang):@catmando thanks, I might take u up on it when it actually happens ---------------------------------------------------------------------------------------------------- [22:35:31] Mitch VanDuyn(@catmando):No drama, just let me know and I'll set you up with a box ---------------------------------------------------------------------------------------------------- [00:11:56] Vais Salikhov(@vais):https://news.ycombinator.com/item?id=9918343 ---------------------------------------------------------------------------------------------------- [01:41:19] Vais Salikhov(@vais):@/all https://news.ycombinator.com/item?id=9918343 is at number 16 on the HN front page. This one could really use your comments/upvotes - it's a great opportunity to get some visibility for Opal and its ecosystem. Thanks! ---------------------------------------------------------------------------------------------------- [01:56:55] Rick Carlino(@RickCarlino):@vais What's amazing is the lack of "Snarky" comments that a lot of new libraries get. Seems like people are really excited. ---------------------------------------------------------------------------------------------------- [11:20:15] Vais Salikhov(@vais):@RickCarlino indeed! It stayed up on the front page for a while, and it was pretty quiet - not a single negative comment until almost the end. Very interesting reaction :smile: Also, if you want something to make it to the front page of HN these days, remember to include the word "react" in the title :wink: ---------------------------------------------------------------------------------------------------- [14:22:56] Mitch VanDuyn(@catmando):@rickcarlino r u referring to " ruby has an incredible amount of cruft, gotchas, and a massive stdlib". If so individual should stick with pure lisp. ---------------------------------------------------------------------------------------------------- [14:43:35] Bozhidar Batsov(@bbatsov):well, to some extent this is the truth ---------------------------------------------------------------------------------------------------- [14:43:46] Bozhidar Batsov(@bbatsov):the language has accumulated a lot of cruft ---------------------------------------------------------------------------------------------------- [14:43:51] Bozhidar Batsov(@bbatsov):and the stdlib even more ---------------------------------------------------------------------------------------------------- [14:44:11] Bozhidar Batsov(@bbatsov):I’m guessing there’s be a massive cleanup in Ruby 3.0 ---------------------------------------------------------------------------------------------------- [14:44:17] Bozhidar Batsov(@bbatsov):when it happens ---------------------------------------------------------------------------------------------------- [14:44:53] Bozhidar Batsov(@bbatsov):I’m pretty sure 2/3 of Ruby devs haven’t used even 1/4 of the stdlib ---------------------------------------------------------------------------------------------------- [14:45:21] Bozhidar Batsov(@bbatsov):plenty of outdated and esoteric stuff in there ---------------------------------------------------------------------------------------------------- [14:45:43] Bozhidar Batsov(@bbatsov):implementing a port for another platfrom would obviously be simpler if there were less of those ---------------------------------------------------------------------------------------------------- [14:45:57] Bozhidar Batsov(@bbatsov):same goes for exotic language features ---------------------------------------------------------------------------------------------------- [14:46:03] Bozhidar Batsov(@bbatsov):often less is more :-) ---------------------------------------------------------------------------------------------------- [14:55:00] Vais Salikhov(@vais):@bbatsov watched your talk in Kiev about this, you make a lot of good points :) ---------------------------------------------------------------------------------------------------- [14:55:47] Bozhidar Batsov(@bbatsov):10x ---------------------------------------------------------------------------------------------------- [14:56:07] Bozhidar Batsov(@bbatsov):not my finest execution, but I definitely believe in everything I said ---------------------------------------------------------------------------------------------------- [14:57:08] Bozhidar Batsov(@bbatsov):I’m hoping to do this talk a few more times, so I can raise the awareness of such problems a bit more ---------------------------------------------------------------------------------------------------- [14:57:16] Bozhidar Batsov(@bbatsov):btw, my next talk will be about Opal :-) ---------------------------------------------------------------------------------------------------- [14:59:59] Vais Salikhov(@vais):LOL ---------------------------------------------------------------------------------------------------- [15:00:35] Vais Salikhov(@vais):Hope it's good things ;) ---------------------------------------------------------------------------------------------------- [15:00:40] Bozhidar Batsov(@bbatsov):http://2015.eurucamp.org/speakers/ ---------------------------------------------------------------------------------------------------- [15:01:19] Bozhidar Batsov(@bbatsov):mostly, yes ---------------------------------------------------------------------------------------------------- [15:01:34] Bozhidar Batsov(@bbatsov):although I definitely dislike some of the design choices ---------------------------------------------------------------------------------------------------- [15:01:46] Bozhidar Batsov(@bbatsov):e.g. the use of backticks for dropping down to JS ---------------------------------------------------------------------------------------------------- [15:02:23] Bozhidar Batsov(@bbatsov):I hate string evaluation so much - it becomes really easy to make silly mistakes ---------------------------------------------------------------------------------------------------- [15:02:55] Bozhidar Batsov(@bbatsov):and there’s also the question how do you execute external commands if you’re running in node.js or io.js ---------------------------------------------------------------------------------------------------- [15:04:31] Bozhidar Batsov(@bbatsov):aliasing TrueClass and FalseClass to boolean is kind of odd ---------------------------------------------------------------------------------------------------- [15:05:08] Bozhidar Batsov(@bbatsov):and the getting started instructions can certainly be extended :-) ---------------------------------------------------------------------------------------------------- [15:05:25] Bozhidar Batsov(@bbatsov):but overall I feel the project has a ton of potential ---------------------------------------------------------------------------------------------------- [15:05:31] Bozhidar Batsov(@bbatsov):especially outside Rails ---------------------------------------------------------------------------------------------------- [15:05:40] Bozhidar Batsov(@bbatsov):and this will be the core of my talk ---------------------------------------------------------------------------------------------------- [15:15:46] Vais Salikhov(@vais):@bbatsov sweet. You may find this interesting: https://github.com/jeremyevans/opalrb.org/blob/recv.js.meth/source/docs/compiled_ruby.html.md#calling-javascript-methods ---------------------------------------------------------------------------------------------------- [15:16:07] AstonJ(@AstonJ):Upvoted the link @vais :) ---------------------------------------------------------------------------------------------------- [15:17:00] AstonJ(@AstonJ):Love how Matz is behind the Opal movement ;-) he just tweeted @RickCarlino’s blog post (and has tweeted other Opal stuff too) check it out, RT and comment :p https://twitter.com/yukihiro_matz/status/623507116830031872 ---------------------------------------------------------------------------------------------------- [15:17:45] Bozhidar Batsov(@bbatsov):@vais this was from unmerged PR, right? ---------------------------------------------------------------------------------------------------- [15:18:13] Bozhidar Batsov(@bbatsov):yeah, Matz definitely wants to see Ruby used in as many ways as possible ---------------------------------------------------------------------------------------------------- [15:18:32] Bozhidar Batsov(@bbatsov):last year’s Ruby survey’s results were epic ---------------------------------------------------------------------------------------------------- [15:18:44] Bozhidar Batsov(@bbatsov):96% of Ruby devs were web devs ---------------------------------------------------------------------------------------------------- [15:18:51] Bozhidar Batsov(@bbatsov):90% of them used Rails ---------------------------------------------------------------------------------------------------- [15:18:57] Bozhidar Batsov(@bbatsov):obviously we have some issues :-) ---------------------------------------------------------------------------------------------------- [15:19:25] Vais Salikhov(@vais):@bbatsov @jeremyevans did a ton of work to address the using-back-ticks-to-drop-down-to-javascript issue (https://github.com/opal/opal/pull/879, https://github.com/opal/opal/pull/912/files) Both have been merged into master, they just did not make it into the 0.8 release. The updated documentation has not been merged cause it would confuse people until the changes are officially released with the next version of Opal. ---------------------------------------------------------------------------------------------------- [15:19:54] Bozhidar Batsov(@bbatsov):ah, that’s great ---------------------------------------------------------------------------------------------------- [15:20:10] Bozhidar Batsov(@bbatsov):I’ll add a note about this in my presentation then ---------------------------------------------------------------------------------------------------- [15:20:21] Bozhidar Batsov(@bbatsov):this will be in 0.9, right? ---------------------------------------------------------------------------------------------------- [15:20:33] Bozhidar Batsov(@bbatsov):btw, any timeline for 0.8 and 0.9 ---------------------------------------------------------------------------------------------------- [15:20:40] Bozhidar Batsov(@bbatsov):and overall roadmap ---------------------------------------------------------------------------------------------------- [15:20:50] Bozhidar Batsov(@bbatsov):it’d be nice to mention something along those lines in my talk ---------------------------------------------------------------------------------------------------- [15:21:46] Vais Salikhov(@vais):Ooh... that'd be a question for @elia :wink2: ---------------------------------------------------------------------------------------------------- [15:23:18] Vais Salikhov(@vais):@AstonJ nice! @RickCarlino congrats on Matz tweeting about your screencasts! :clap: ---------------------------------------------------------------------------------------------------- [15:23:29] Rick Carlino(@RickCarlino):OMG HE KNOWS WHO I AM ---------------------------------------------------------------------------------------------------- [15:23:32] Rick Carlino(@RickCarlino):IM NOT WORTHY ---------------------------------------------------------------------------------------------------- [15:24:29] Vais Salikhov(@vais):https://stjamesclergy.files.wordpress.com/2013/10/2-wayne-and-garth-not-worthy.jpg ---------------------------------------------------------------------------------------------------- [15:32:28] Jason Goldberger(@elbow-jason):I wish you guys could've seen @RickCarlino just now on Hangouts. He was dancing like he was reinventing disco. ---------------------------------------------------------------------------------------------------- [16:32:12] Forrest Chang(@fkchang):I'm never worthy... ---------------------------------------------------------------------------------------------------- [16:43:48] Rick Carlino(@RickCarlino):@fkchang Tottally [dropped your name](https://www.youtube.com/watch?v=x1yPgUUG0Js&feature=youtu.be&t=46) in that last one ;-). ---------------------------------------------------------------------------------------------------- [16:55:12] Forrest Chang(@fkchang):@RickCarlino awesome, I may be worthy at some point! ---------------------------------------------------------------------------------------------------- [17:00:18] Jared White(@jaredcwhite)::+1: on the HN discussion! ---------------------------------------------------------------------------------------------------- [17:00:22] Jared White(@jaredcwhite):just put in my 2c ---------------------------------------------------------------------------------------------------- [17:02:08] AstonJ(@AstonJ):Haha @RickCarlino I loved it when @fkchang dropped my name/put me on stage with DHH - I could finally say I’ve been on stage with DHH at a Ruby Conf! https://youtu.be/GH9FAfKG-qY?t=11m42s THANK YOU FORREST, HAHA! ---------------------------------------------------------------------------------------------------- [17:03:15] Forrest Chang(@fkchang):@AstonJ no prob ---------------------------------------------------------------------------------------------------- [17:04:26] AstonJ(@AstonJ):<3 ---------------------------------------------------------------------------------------------------- [17:07:11] Forrest Chang(@fkchang):@jaredcwhite good comment on HN. I've been trying to express that thought, via Joy Driven Development, but I think your comment does it more clearly ---------------------------------------------------------------------------------------------------- [17:08:36] Forrest Chang(@fkchang):So tell me what you think about the embedded opal-playground rspecs in http://funkworks.blogspot.com/2015/07/sharing-executable-test-code-with-opal.html ---------------------------------------------------------------------------------------------------- [17:09:31] Forrest Chang(@fkchang):I'm hoping to get a post up w/embedded opal-irb's in it, and hopefully an accompanying screencast, though I dunno if that'll happen before the opalist deadline ---------------------------------------------------------------------------------------------------- [18:01:40] Rick Carlino(@RickCarlino):lmao @ "wop wop waaaahh" sound clip in that vid. ---------------------------------------------------------------------------------------------------- [18:55:01] Forrest Chang(@fkchang):@RickCarlino yeah, I worked hard for all the audio/video in that talk ---------------------------------------------------------------------------------------------------- [18:55:17] Forrest Chang(@fkchang):still ticked that youtube forced a mute of the starwars music ---------------------------------------------------------------------------------------------------- [18:55:31] Forrest Chang(@fkchang):maybe it was the 20th century fox music, whatever ---------------------------------------------------------------------------------------------------- [19:00:55] Brayden Banks(@bb010g):@fkchang Whatever happened to opal-inspector? ---------------------------------------------------------------------------------------------------- [19:04:51] Rick Carlino(@RickCarlino):Yeah, opal-inspector blew my mind. ---------------------------------------------------------------------------------------------------- [19:08:38] Brayden Banks(@bb010g):I like the idea of Smalltalk and their inspector, but it's nice to be able to sanely use version control. Also, Ruby is a lot more friendly than Smalltalk IMHO. ---------------------------------------------------------------------------------------------------- ############################## [2015-07-22] ############################## [00:01:37] Elia Schito(@elia):> ah, that’s great I’ll add a note about this in my presentation then this will be in 0.9, right? btw, any timeline for 0.8 and 0.9 and overall roadmap it’d be nice to mention something along those lines in my talk @bbatsov @vais That'd be awesome, basically 0.8 is out, and just needs some blog post to line out how things work now and what's new, I'd be happy to post it on the opal's blog no matter who writes it, tho it'd be cool if it was by @vais ;) For 0.8 I think I still have to check some of the libs in the opal org and ensure they're gemspec allows for it wrt 0.9 I'll set a milestone on GH soonish and see if there's anything we absolutely want to be part of it before shipping, otherwise –given the general feedback– the only feature left is to ensure all docs are updated (see the PR from @jeremyevans). Again I'll support anyone who volunteers. As @fkchang said once “four kids and demanding job” take a lot of time, doing my best with the time I (don't) have left.* _* not to complain of course! …just to explain why I don't push things harder (as I would like)_ cc @meh ---------------------------------------------------------------------------------------------------- [00:02:28] meh.(@meh):sounds good to me ---------------------------------------------------------------------------------------------------- [00:06:14] Elia Schito(@elia)::star2: ---------------------------------------------------------------------------------------------------- [02:14:32] Rick Carlino(@RickCarlino):Have any tutorials yet been written on the topic of creating Opal libs for public consumtion / sharing? ---------------------------------------------------------------------------------------------------- [02:25:33] Gustavo(@goddamnhippie):Hi, sorry if this has been asked before I haven’t found anything related to this: the opal-browser and opal-jquery have some overlap in functionality, can I use both at the same time? Should I prefer one over the other? ---------------------------------------------------------------------------------------------------- [02:31:00] meh.(@meh):goddamnhippie, there are very high chances shit will break ---------------------------------------------------------------------------------------------------- [02:31:12] meh.(@meh):goddamnhippie, especially with the DOM stuff ---------------------------------------------------------------------------------------------------- [02:34:37] Gustavo(@goddamnhippie):so opal-jquery would be more stable but opal-browser is simpler/modern? ---------------------------------------------------------------------------------------------------- [02:56:06] Jared White(@jaredcwhite):I'm running behind this week, so Opalist issue will probably be released Thursday. cc @fkchang ---------------------------------------------------------------------------------------------------- [05:00:36] Forrest Chang(@fkchang):@jaredcwhite cool for me, then I'll have a second entry then, maybe with @RickCarlino 's (local screencast god) blessing, a screencast ---------------------------------------------------------------------------------------------------- [05:03:42] Forrest Chang(@fkchang):@goddamnhippie there are some collisions w/opal-jquery, but they can be used together, I have them together in 1 app load order matters, and knowing which is which (I will try to dig up the details, I should've written it down), but if I'm doing opal-rails, I tend to go the path of least resistance and just use opal-jquery since rails comes w/jquery. At some point I will both figure out what the collisions are exactly and figure out how to do opal-rails w/o jquery ---------------------------------------------------------------------------------------------------- [13:00:36] Gustavo(@goddamnhippie):thanks @fkchang ---------------------------------------------------------------------------------------------------- [13:01:04] Rick Carlino(@RickCarlino):haha go for it @fkchang ---------------------------------------------------------------------------------------------------- [15:24:27] Jared White(@jaredcwhite):@fkchang Damn! I totally forgot I'd said it will go out Thursday, and I ended up with enough time to put it all together this morning and send it out. Sorry about that -- at least now you'll have plenty of time before the next issue! ---------------------------------------------------------------------------------------------------- [19:29:53] Mitch VanDuyn(@catmando):Is there way to turn off source maps for gem code (I am just doing something wrong...) React.rb gem for example is pulling all the source jobs in ---------------------------------------------------------------------------------------------------- ############################## [2015-07-23] ############################## [00:58:13] meh.(@meh):catmando, is the new Array still an Array? ---------------------------------------------------------------------------------------------------- [00:58:18] meh.(@meh):catmando, it may be a double inclusion of the runtime somewhere ---------------------------------------------------------------------------------------------------- [01:21:06] meh.(@meh):@catmando ^ ---------------------------------------------------------------------------------------------------- [01:22:53] Mitch VanDuyn(@catmando):Yeah in debugger original array is like object 16 new array is 150 ---------------------------------------------------------------------------------------------------- [01:23:32] Mitch VanDuyn(@catmando):I am not getting any double inclusion warnings ---------------------------------------------------------------------------------------------------- [01:37:05] Mitch VanDuyn(@catmando):```ruby array_class = Array an_array = [1, 2, 3] another_array = array_class.new(3) # <- works fine puts "[#{another_array}]" include React::Component array_class = Array an_array = [1, 2, 3] another_array = array_class.new(3) # <- fails! says 3 is not native!!! puts "[#{another_array}]" ``` ---------------------------------------------------------------------------------------------------- [01:50:56] Mitch VanDuyn(@catmando):FYI same problem back in opal 0.7 and ---------------------------------------------------------------------------------------------------- [02:29:40] Mitch VanDuyn(@catmando):Found it: Not sure why but the gem is including Native from within a module. That seems to be causing the problem (makes sense) ---------------------------------------------------------------------------------------------------- [13:23:26] Christian Käser(@dfyx):@meh I'd like to +1 catmando's question about source maps. ---------------------------------------------------------------------------------------------------- [13:24:02] Christian Käser(@dfyx):It would be great if the source maps were split by their original file location (assets/vendor/gems) ---------------------------------------------------------------------------------------------------- [13:24:45] meh.(@meh):dfyx, elia is the sourcemaps guy ---------------------------------------------------------------------------------------------------- [13:25:15] Christian Käser(@dfyx):@elia see above ;) ---------------------------------------------------------------------------------------------------- [13:25:17] meh.(@meh):dfyx, I don't even use sourcemaps because I'm used to the compiled output :P ---------------------------------------------------------------------------------------------------- [13:25:46] Elia Schito(@elia):yeh ---------------------------------------------------------------------------------------------------- [13:26:38] Elia Schito(@elia):I was thinking of adding a black box kind of feature, where you can specify certain file paths that will be compiled to single file and not splitted and will be without sourcemaps ---------------------------------------------------------------------------------------------------- [13:27:24] Elia Schito(@elia):@dfyx @catmando that way the sourcemap is there only for the local app, I'm using a setup like this in rails and it's great ---------------------------------------------------------------------------------------------------- [13:27:41] Elia Schito(@elia):would that solve the problem? ---------------------------------------------------------------------------------------------------- [13:29:15] Christian Käser(@dfyx):@elia I think having the source maps in a logical directory structure would be a great way to start ---------------------------------------------------------------------------------------------------- [13:29:53] Mitch VanDuyn(@catmando):@elia - great idea ---------------------------------------------------------------------------------------------------- [13:29:55] Elia Schito(@elia):@dfyx can you give me an example of what it should look like? ---------------------------------------------------------------------------------------------------- [13:30:04] Christian Käser(@dfyx):Currently my own files and for example opal's `math.rb` are placed in the same directory ---------------------------------------------------------------------------------------------------- [13:32:00] Mitch VanDuyn(@catmando):it would be nice if it could be automagic. so if the gem was local you got the source maps, but if remote you didn't. Not sure how we could tell, but perhaps it could be just based on the the directory that the gem was in? ---------------------------------------------------------------------------------------------------- [13:32:30] Christian Käser(@dfyx):Now: ``` __OPAL_SOURCE_MAPS__ * application.rb * myfile.rb * native.rb * ... other opal stuff ``` Better: ``` app/assets * application.rb * myfile.rb gems * ... opal * native.rb * ... vendor/assets * ... ``` ---------------------------------------------------------------------------------------------------- [13:32:39] Christian Käser(@dfyx):Something like that ---------------------------------------------------------------------------------------------------- [13:38:17] Elia Schito(@elia):@dfyx not easy given the current architecture ---------------------------------------------------------------------------------------------------- [13:38:53] Elia Schito(@elia):@catmando actually that's a good idea, chime in here https://github.com/opal/opal-rails/issues/51 if you want ---------------------------------------------------------------------------------------------------- [13:39:12] Elia Schito(@elia):hoped to have some feedback before rolling that out for everyone ---------------------------------------------------------------------------------------------------- [14:00:02] Vais Salikhov(@vais):@meh https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/The.Matrix.glmatrix.2.png/220px-The.Matrix.glmatrix.2.png ---------------------------------------------------------------------------------------------------- [14:00:13] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [14:00:36] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [14:00:42] Vais Salikhov(@vais):At some point you just don't need sourcemaps anymore :wink2: ---------------------------------------------------------------------------------------------------- [14:01:32] Elia Schito(@elia):you see the woman in red? ---------------------------------------------------------------------------------------------------- [16:13:14] Andrew Kalek(@anlek):Hey, Is it possible to use Opal in a something like phone gap? ---------------------------------------------------------------------------------------------------- [16:13:58] Elia Schito(@elia):I know @adambeynon used it in all sorts of configurations with mobile phones (phonegap/webview/etc.) ---------------------------------------------------------------------------------------------------- [16:14:51] Andrew Kalek(@anlek):Nice! ---------------------------------------------------------------------------------------------------- [21:12:37] Forrest Chang(@fkchang):@adambeynon @elia @meh or anyone else, any idea why ```javascript function require_js_sync(url) { var r = new XMLHttpRequest(); r.open("GET", url, false); r.send(''); eval(r.responseText); } require_js(sync 'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js') ``` works fine in the js console (only tried chrome) yet ```ruby def require_js_sync(url) %x| var r = new XMLHttpRequest(); r.open("GET", url, false); r.send(''); eval(r.responseText) | nil end require_js_sync 'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js' ``` fails with 'TypeError: b.on is not a function' ? ---------------------------------------------------------------------------------------------------- [22:14:30] Elia Schito(@elia):@fkchang maybe it has to do with the context of eval ---------------------------------------------------------------------------------------------------- [22:15:04] Elia Schito(@elia):but a check with the debugger about what `b` is should help more :) ---------------------------------------------------------------------------------------------------- ############################## [2015-07-24] ############################## [18:50:10] Ryan Stout(@ryanstout):if someone has time, it would be great to get tryopal updated to 0.8 ---------------------------------------------------------------------------------------------------- [18:50:13] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- [18:50:31] Ryan Stout(@ryanstout):(I use it all of the time) ---------------------------------------------------------------------------------------------------- [20:37:27] Ryan Stout(@ryanstout):@elia you around by chance? ---------------------------------------------------------------------------------------------------- [23:26:51] Elia Schito(@elia):@ryanstout sup? ---------------------------------------------------------------------------------------------------- [23:27:10] Ryan Stout(@ryanstout):@elia nevermind, was going to ask about the opal-rspec stuff. Thanks ---------------------------------------------------------------------------------------------------- [23:27:24] Elia Schito(@elia):k np ---------------------------------------------------------------------------------------------------- [23:27:37] Ryan Stout(@ryanstout):btw, my performance issues were sprockets related ---------------------------------------------------------------------------------------------------- [23:28:11] Ryan Stout(@ryanstout):its funny it was actually slower serving cached compiled opal than it was to recompile it. (not sure how thats possible, but it is, hehe) ---------------------------------------------------------------------------------------------------- [00:41:36] Rick Carlino(@RickCarlino):@elia Any idea why this would break? ```ruby def initialize(dom_element) @callback = -> { |a, b| fullfil_or_reject(a, b) } @promise = Promise.new end ``` ---------------------------------------------------------------------------------------------------- [00:43:58] Rick Carlino(@RickCarlino):works with `lambda {| . . . .` ---------------------------------------------------------------------------------------------------- [00:44:11] Rick Carlino(@RickCarlino):is that a legit bug? Should I report? ---------------------------------------------------------------------------------------------------- [01:20:55] Forrest Chang(@fkchang):@elia dunno how I can stop it in the debugger, b is referenced in the actual js file ---------------------------------------------------------------------------------------------------- [02:33:05] Jamie Gaskins(@jgaskins):@fkchang Try `window.eval` instead of just `eval`. Seems to work for me. ---------------------------------------------------------------------------------------------------- [02:33:25] Jamie Gaskins(@jgaskins):Might just be a namespace issue. ---------------------------------------------------------------------------------------------------- [07:45:54] Elia Schito(@elia):@RickCarlino the arrow syntax has the arguments outside of the curly braces: `-> a, b {…}` ---------------------------------------------------------------------------------------------------- [07:46:13] Elia Schito(@elia):or also `-> (a,b) {…}` ---------------------------------------------------------------------------------------------------- [07:54:39] Elia Schito(@elia):@fkchang @jgaskins also creating a script tag may help ---------------------------------------------------------------------------------------------------- [12:31:01] Rick Carlino(@RickCarlino):@elia D'oh! That's right. I was definitely working too late last night. ---------------------------------------------------------------------------------------------------- [13:43:28] Torsten Rüger(@dancinglightning):When i get erros, eg mistyping a variable name, i get ---------------------------------------------------------------------------------------------------- [13:44:16] Torsten Rüger(@dancinglightning):Uncaught NoMethodError: undefined method `i' for # kernel.self.js:1144 ---------------------------------------------------------------------------------------------------- [13:44:31] Torsten Rüger(@dancinglightning):This is with source_map = true ---------------------------------------------------------------------------------------------------- [13:44:55] Torsten Rüger(@dancinglightning):What i am missing is the source line in Interpreter ---------------------------------------------------------------------------------------------------- [13:45:09] Elia Schito(@elia):it's probably back down in the stacktrace ---------------------------------------------------------------------------------------------------- [13:45:53] Elia Schito(@elia):unless you mark kernel.js as blackbox (Chrome only), that way it should skip backtrace lines in it ---------------------------------------------------------------------------------------------------- [13:47:27] Torsten Rüger(@dancinglightning):Interpreter is nowhere in the stack, some Opal, some anonymous, but none of my code ---------------------------------------------------------------------------------------------------- [13:48:07] Torsten Rüger(@dancinglightning):If i turn debug=true, the error is on min.’s:3607 , strange ---------------------------------------------------------------------------------------------------- [13:48:14] Torsten Rüger(@dancinglightning):main.jj ---------------------------------------------------------------------------------------------------- [13:48:16] Torsten Rüger(@dancinglightning):js ---------------------------------------------------------------------------------------------------- [13:48:48] Elia Schito(@elia):try posting the full backtrace, maybe there's some hint in it ---------------------------------------------------------------------------------------------------- [13:49:01] Torsten Rüger(@dancinglightning):with or without debug on? ---------------------------------------------------------------------------------------------------- [13:49:13] Elia Schito(@elia):with it on should be better ---------------------------------------------------------------------------------------------------- [13:51:06] Torsten Rüger(@dancinglightning):or, maybe sprockets thing, cleared out the tmp/ and now it is there in the bottom . Thanks ---------------------------------------------------------------------------------------------------- [13:53:43] Torsten Rüger(@dancinglightning):might have been looking left too much too, when files are on the right. ---------------------------------------------------------------------------------------------------- [13:54:04] Torsten Rüger(@dancinglightning):VERY cool btw that it pulls the ruby source in there. ---------------------------------------------------------------------------------------------------- [13:54:40] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [13:55:35] Torsten Rüger(@dancinglightning):btw, is there a good way to switch between app and chrome inspector. i mean is there a key binding? ---------------------------------------------------------------------------------------------------- [13:56:14] Elia Schito(@elia):what you mean by app? ---------------------------------------------------------------------------------------------------- [13:57:49] Torsten Rüger(@dancinglightning):the chrome tab i am running my application in (that’s an application, right? not a web page) ---------------------------------------------------------------------------------------------------- [13:58:30] Elia Schito(@elia):yeah, :D ---------------------------------------------------------------------------------------------------- [13:59:20] Elia Schito(@elia):I think on osx the key combo is `⌥⌘I` ---------------------------------------------------------------------------------------------------- [14:08:08] Torsten Rüger(@dancinglightning):Thanks. ---------------------------------------------------------------------------------------------------- [14:08:28] Torsten Rüger(@dancinglightning):In opal, isn’t “string”.is_a? Symbol == true ---------------------------------------------------------------------------------------------------- [14:08:46] Elia Schito(@elia):yes it should ---------------------------------------------------------------------------------------------------- [14:09:51] Elia Schito(@elia):watch out for parentheses tho ---------------------------------------------------------------------------------------------------- [14:10:04] Elia Schito(@elia):`"".is_a?(Symbol) == true` ---------------------------------------------------------------------------------------------------- [14:12:25] Torsten Rüger(@dancinglightning):still checking ---------------------------------------------------------------------------------------------------- [14:13:32] Torsten Rüger(@dancinglightning):my bug, < instead of <= ---------------------------------------------------------------------------------------------------- [17:29:19] Forrest Chang(@fkchang):@jgaskins window.eval did the trick, thanks! ---------------------------------------------------------------------------------------------------- ############################## [2015-07-25] ############################## [07:41:04] Elia Schito(@elia):It probably loses all the time checking the dependency tree for modification which means doing a lot of io, there's the same problem in rails with template digests. In production the manifest is frozen and should be faster ---------------------------------------------------------------------------------------------------- [07:45:24] Elia Schito(@elia):@ryanstout ^ ---------------------------------------------------------------------------------------------------- [17:17:16] Ryan Stout(@ryanstout):@elia humm. Interesting. I'm more concerned about dev time actually, hehe. (2 sec reload atm) ---------------------------------------------------------------------------------------------------- [17:17:38] Ryan Stout(@ryanstout):it would be great if sprockets could use the listen gem or something to not need to stat every file ---------------------------------------------------------------------------------------------------- [17:21:50] Elia Schito(@elia):That's what I bought too, would be cool to have that in rails too ---------------------------------------------------------------------------------------------------- [17:59:54] Torsten Rüger(@dancinglightning):hey, i’m for that too. i have 3-5 seconds reload time. too much imho. ---------------------------------------------------------------------------------------------------- ############################## [2015-07-26] ############################## [08:32:21] Bozhidar Batsov(@bbatsov):does anyone have a vector version of the logo lying around? ---------------------------------------------------------------------------------------------------- [08:54:49] Keith(@ktec):Great news, I have finally got this working: http://ktec.github.io/opal-pixi-examples/ ---------------------------------------------------------------------------------------------------- [08:56:21] Elia Schito(@elia):@bbatsov I built the logo but alas is just a raster pixelmator image ---------------------------------------------------------------------------------------------------- [08:56:42] Bozhidar Batsov(@bbatsov):roger that ---------------------------------------------------------------------------------------------------- [08:56:59] Bozhidar Batsov(@bbatsov):guess I’ll make do with it ---------------------------------------------------------------------------------------------------- [14:04:09] Keith(@ktec):Has anyone created one of these for Opal yet? http://veelenga.github.io/awesome-crystal/ ---------------------------------------------------------------------------------------------------- [14:04:42] Keith(@ktec):Seems to be a "thing" these days, there's one for Elixir, and some other languages ---------------------------------------------------------------------------------------------------- [14:05:14] Keith(@ktec):would be better than my gist, because then people can submit pull requests to make additions ---------------------------------------------------------------------------------------------------- [16:02:57] Bozhidar Batsov(@bbatsov):I’d rather have such a section in the docs ---------------------------------------------------------------------------------------------------- [16:03:01] Bozhidar Batsov(@bbatsov):than something separate ---------------------------------------------------------------------------------------------------- [16:03:19] Bozhidar Batsov(@bbatsov):“Extra resources” or something like this ---------------------------------------------------------------------------------------------------- [16:03:39] Bozhidar Batsov(@bbatsov):I find naming everything “awesome” a bit distasteful ---------------------------------------------------------------------------------------------------- [19:02:20] AstonJ(@AstonJ):That’s really cool @ktec a write up would be awesome :+1: ---------------------------------------------------------------------------------------------------- [19:02:45] AstonJ(@AstonJ):The closest thing atm is this wiki on MetaRuby http://metaruby.com/t/opal-resources/201 (anyone with Trust level one or higher can edit it) ---------------------------------------------------------------------------------------------------- ############################## [2015-07-27] ############################## [06:35:08] Keith Salisbury(@globalkeith):@bbatsov being english, I fully agree with you regarding the american abuse of the word "awesome" however, if we consider trying to encourage people to discover the joys of Opal, turning our noses up at a free and seemingly popular marketing channel, would be foolish, no? The point is more about having a curated repository with links to everything available in the opal world. Perhaps "everything-opal" would be a more suitable name? ---------------------------------------------------------------------------------------------------- [06:35:46] Keith Salisbury(@globalkeith):btw, did anyone here go to Brighton Ruby? ---------------------------------------------------------------------------------------------------- [07:07:56] Forrest Chang(@fkchang):I did some playing around w/crystal, pretty impressed that the cases I was playing around were faster than golang, w/smaller binaries (I'll blog about it shortly to include benchmarks). I think a crystal backend makes for a good pairing w/opal, ruby end to end, and rocket fast w/good memory utilization ---------------------------------------------------------------------------------------------------- [16:26:46] Bozhidar Batsov(@bbatsov):the way things are going in 5 years nobody will be using MRI :-) ---------------------------------------------------------------------------------------------------- [16:28:23] Forrest Chang(@fkchang):@bbatsov there's some truth to that, looking at the ideas I have for rubyconf proposals, that is an implication, though until the other ruby derivatives have comparable amounts of gems, I think MRI still has longevity ---------------------------------------------------------------------------------------------------- [16:33:10] Bozhidar Batsov(@bbatsov):sure, that’s why I said 5 years :-) ---------------------------------------------------------------------------------------------------- [16:33:29] Bozhidar Batsov(@bbatsov):it’s interesting why there’s so little interested in Opal so far ---------------------------------------------------------------------------------------------------- [16:33:37] Bozhidar Batsov(@bbatsov):only around 80k downloads ---------------------------------------------------------------------------------------------------- [16:33:45] Bozhidar Batsov(@bbatsov):and 2.7k stars ---------------------------------------------------------------------------------------------------- [16:33:58] Bozhidar Batsov(@bbatsov):in Clojure-world, ClojureScript seems to be as popular as Clojure ---------------------------------------------------------------------------------------------------- [16:34:11] Bozhidar Batsov(@bbatsov):and probably will become more popular than Clojure pretty soon ---------------------------------------------------------------------------------------------------- [16:34:44] Bozhidar Batsov(@bbatsov):one would imagine people would be pretty happy to drop CoffeeScript for Ruby ---------------------------------------------------------------------------------------------------- [16:38:06] George Plymale II(@ylluminarious):@bbatsov i think that some people are actually attached to javascript and prefer CS over plain ruby because of its similarity to js. it's very strange, but it just seems like some people like javascript (which really just seems like masochism to me :P) ---------------------------------------------------------------------------------------------------- [16:48:08] Torsten Rüger(@dancinglightning):@bbatsov another reason why opal is not adopted may also be that the ruby community is rails heavy, and rails is server. The drive to client side app left the community and started ember. Not surprisingly because dhh is on record for a document based approach. And for small things coffee really is quite fine, you know where you’re at (no runtime, very stable..) ---------------------------------------------------------------------------------------------------- [16:50:28] George Plymale II(@ylluminarious):@dancinglightning i concur ---------------------------------------------------------------------------------------------------- [16:57:21] Torsten Rüger(@dancinglightning):and opal is great, a bit like ruby before rails. It needs it’s killer app, and on the app framework side there has been more dabbling, only now with volt is there is serious contendent. ---------------------------------------------------------------------------------------------------- [17:15:08] Bozhidar Batsov(@bbatsov):yep, guess that’s right ---------------------------------------------------------------------------------------------------- [17:15:16] Bozhidar Batsov(@bbatsov):Volt lead me to Opal ---------------------------------------------------------------------------------------------------- [18:04:45] Forrest Chang(@fkchang):@bbatsov as someone who's been evangelizing for a few years, I'm pretty surprised at the lack of uptake from the Ruby community. I suppose it's because people either think it's a toy (not mature enough, or not enough documentation/examples) and/or they are happy w/whatever JS based investment they already have. I read DHH's response to @AstonJ 's queries as "happy w/coffescript, and not on list of things to learn at this point". Opal has to be much more compelling to get people in that camp to switch, IMO. I think the route to popularity is to make it such a no brainer for Rails, that all those people w/substantial investment in Rails will start to adopt ---------------------------------------------------------------------------------------------------- [20:21:46] Elia Schito(@elia):@fkchang :+1: also agree with @dancinglightning, I see many many people that are rails programmers and wouldn't touch frontend with a ten-foot pole, no matter the language, to the point that I had a colleague (very skilled rubyist) that preferred to use backticks and plain JS ---------------------------------------------------------------------------------------------------- [20:26:09] Ryan Stout(@ryanstout):anyone know why doing: Time.now.usec displays: "Microseconds are not supported" I can't find where that is in the opal code. ---------------------------------------------------------------------------------------------------- [20:26:46] Elia Schito(@elia):stdlib/time i think ---------------------------------------------------------------------------------------------------- [20:29:02] Ryan Stout(@ryanstout):@elia I'm really confused on this one: http://opalrb.org/try/?code:puts%20Time.now.usec ---------------------------------------------------------------------------------------------------- [20:29:10] Ryan Stout(@ryanstout):https://github.com/opal/opal/blob/master/opal/corelib/time.rb#L377 ---------------------------------------------------------------------------------------------------- [20:31:05] Ryan Stout(@ryanstout):ok, nevermind, found where it was: https://github.com/opal/opal/commit/d4a3f94fc13cb979e80e6440ef099563df242815 ---------------------------------------------------------------------------------------------------- [20:31:18] Elia Schito(@elia):yeah: https://github.com/opal/opal/blob/0-8-stable/opal/corelib/time.rb#L258-L261 ---------------------------------------------------------------------------------------------------- [20:32:49] Ryan Stout(@ryanstout):thanks! ---------------------------------------------------------------------------------------------------- ############################## [2015-07-28] ############################## [03:56:24] Bozhidar Batsov(@bbatsov):@fkchang Opal certainly needs more promotion. These days every second Ruby conf I visit has a talk on Crystal, but I’ve yet to see anyone besides you and @ryanstout talk about Opal. I aslo found a talk by @elia, but it was in Italian. :-) ---------------------------------------------------------------------------------------------------- [04:23:32] Jared White(@jaredcwhite):Part of the problem may be brain-drain at this point -- many people that are keenly interested in heavy frontend dev have long jumped on the JS bandwagon, and people that are still really super into Ruby (and likely Rails) tend to be more backend focused. It's challenging to find folks in the client-side frame of mind that are gung-ho about coding in Ruby rather than something else. ---------------------------------------------------------------------------------------------------- [04:34:24] Ryan Stout(@ryanstout):@bbatsov I think its that the tools aren't there yet. Since most of the front-end tools are (currently) written in JS, they don't see the advantage of using opal. I think once we get more idiomatic ruby tools for the client side, people will see the benefit. That said, Volt seems to be getting lots of adoption. I think once its more feature complete it will ramp up pretty quickly. ---------------------------------------------------------------------------------------------------- [05:30:33] Forrest Chang(@fkchang):@bbatsov I keep submitting proposals for opal, but only one has been accepted. I keep trying though ---------------------------------------------------------------------------------------------------- [05:32:24] Forrest Chang(@fkchang):@jaredcwhite I think if we can show that browser based ruby is just ruby, more rubyist will adopt. I proposed a few talks where I basically tried to paint how when I code Ruby in the browser it's so much better than when I do JS, one thing I do instinctively is quickly abstract away browser specific code, so that 95% of the coding I do is "just Ruby" ---------------------------------------------------------------------------------------------------- [05:33:53] Forrest Chang(@fkchang):I suspect I need to find a better way to say it, or maybe I should just rewrite and submit again, maybe before wasn't the right time. I've also submitted a talk on how "all ruby web components was a good thing". In the post React days, this talk topic might make more sense. ---------------------------------------------------------------------------------------------------- [05:34:40] Forrest Chang(@fkchang):@ryanstout I should look into helping w/some volt tools ---------------------------------------------------------------------------------------------------- [05:35:29] Ryan Stout(@ryanstout):@fkchang hit me up if you have time, I would love to integrate some of your stuff into volt ---------------------------------------------------------------------------------------------------- [05:35:57] Ryan Stout(@ryanstout):also, yea, I keep getting talks rejected also. I'm not really a conspiracy theorist, but a lot of the people running conferences have a vested interest in just keeping things the same. ---------------------------------------------------------------------------------------------------- [05:36:40] Ryan Stout(@ryanstout):but I think once opal (and maybe volt) get popular enough, they will need to accept some talks about it :-) ---------------------------------------------------------------------------------------------------- [10:23:42] Bozhidar Batsov(@bbatsov):guess so :-) ---------------------------------------------------------------------------------------------------- [10:24:51] Bozhidar Batsov(@bbatsov):well, if it’s any consolation after my upcoming eurucamp talk on Opal, I’ll be doing another talk about Volt at RailsClub.ru ---------------------------------------------------------------------------------------------------- [10:25:05] Bozhidar Batsov(@bbatsov):at both conferences I had submitted other proposals as well ---------------------------------------------------------------------------------------------------- [10:25:07] Bozhidar Batsov(@bbatsov)::-) ---------------------------------------------------------------------------------------------------- [12:37:56] Elia Schito(@elia):Yeah, Volt's a great thing for Opal, also good that we get some retweets from both matz and Brendan Eich from time to time :) ---------------------------------------------------------------------------------------------------- [13:36:41] Bozhidar Batsov(@bbatsov):btw, are source maps working for anyone with the example sinatra app https://github.com/opal/opal/tree/master/examples/sinatra ---------------------------------------------------------------------------------------------------- [13:36:59] Bozhidar Batsov(@bbatsov):the sourcemaps work for me in the example rack app, but not in the sinatra app ---------------------------------------------------------------------------------------------------- [13:37:14] Elia Schito(@elia):they were last time I checked, but was a while ago ---------------------------------------------------------------------------------------------------- [14:14:39] Michał Kalbarczyk(@fazibear):Hi, trying to use storage support from opal-browser, but get the error on reload ---------------------------------------------------------------------------------------------------- [14:14:56] Michał Kalbarczyk(@fazibear):`TypeError: Opal.cget is not a function. (In 'Opal.cget(klass)', 'Opal.cget' is undefined)` ---------------------------------------------------------------------------------------------------- [14:16:47] Michał Kalbarczyk(@fazibear):Any clues ? ---------------------------------------------------------------------------------------------------- [14:17:12] Michał Kalbarczyk(@fazibear):`store = $window.storage('todos') ` ---------------------------------------------------------------------------------------------------- [14:17:49] Elia Schito(@elia):@fazibear it's now `Opal.get`, opal-browser should be updated cc @meh ---------------------------------------------------------------------------------------------------- [14:37:12] Michał Kalbarczyk(@fazibear):@elia found it, its in opal. https://github.com/opal/opal/pull/1030 ---------------------------------------------------------------------------------------------------- [15:02:59] Jared White(@jaredcwhite):So... @fkchang @ryanstout is it time for our own OpalConf? :) ---------------------------------------------------------------------------------------------------- [16:01:17] Forrest Chang(@fkchang):@ryanstout should I hit you up on the volt gitter? ---------------------------------------------------------------------------------------------------- [16:02:28] Forrest Chang(@fkchang):@jaredcwhite it's worth entertaining, should it be a virtual conf (they seem popular these days), I'd be surprised that we'd have enough bodies to fill an actual for pay venue. At least some of my opal proposals will get accepted ;) ---------------------------------------------------------------------------------------------------- [16:11:52] Forrest Chang(@fkchang):I have an idea to try and use reverse psychology in conference proposal for opal ---------------------------------------------------------------------------------------------------- [16:42:07] Forrest Chang(@fkchang):@bbatsov (love prelude btw) have you seen this? https://www.youtube.com/watch?v=Cvz2tiT12-I ---------------------------------------------------------------------------------------------------- [17:41:20] Ryan Stout(@ryanstout):@jaredcwhite we should do a small after hours mini conference at rubyconf or something ---------------------------------------------------------------------------------------------------- [17:54:51] Elia Schito(@elia):@fkchang wrt reverse psychology, you mean titling like "what Opal can't do for you"? :D ---------------------------------------------------------------------------------------------------- [17:57:06] Elia Schito(@elia):@bbatsov can you open an issue for the Sinatra example? (of course a PR would be great too) ---------------------------------------------------------------------------------------------------- [18:21:20] Forrest Chang(@fkchang):@elia close, my tentative title is "Reasons to NOT use Ruby in the browser", where the items are pretty silly, i.e. "I love never knowing what this refers to", "I love rewriting complex business logic and tests in a different language than the server" ---------------------------------------------------------------------------------------------------- ############################## [2015-07-29] ############################## [08:09:05] Elia Schito(@elia):@fkchang new talks idea: piggybacking on crystal could work, maybe people interested in crystal are more likely to be more open-minded toward Opal and combining them could help gaining supporters ---------------------------------------------------------------------------------------------------- [09:34:09] Bozhidar Batsov(@bbatsov):@elia Nice! ---------------------------------------------------------------------------------------------------- [11:46:11] Bozhidar Batsov(@bbatsov):btw, does someone have some ready-made Opal benchmarks I can use for my eurucamp presentation? ---------------------------------------------------------------------------------------------------- [11:46:22] Bozhidar Batsov(@bbatsov):I’m a bit short on time and I won’t be able to do tests myself ---------------------------------------------------------------------------------------------------- [11:46:39] Bozhidar Batsov(@bbatsov):but it’d probably be good to have something on the topic in the slides ---------------------------------------------------------------------------------------------------- [12:04:05] Elia Schito(@elia):@bbatsov there's a benchmark folder in the opal repo, was curated by @vais ---------------------------------------------------------------------------------------------------- [13:05:10] Vais Salikhov(@vais):@bbatsov currently there are no benchmarks comparing JavaScript and Opal. The challenge is that it's a little like comparing apples and oranges. If you have any ideas on how to do that, lmk. You could compare Opal to MRI Ruby, but that's not very useful. I *do* use benchmarks to compare Opal to Opal when making changes to the corelib to make sure there are no performance regressions. And for that I *do* use MRI numbers as a baseline (but mostly for giggles). Here is an example: I am working on a large change to `Hash` to make it completely match Ruby semantics and pass the remaining RubySpecs, but sacrificing performance is not an option, so benchmarking is a big part of the work: ``` $ bundle exec rake bench:report Benchmark Opal1 Opal2 Opal3 Opal4 Ruby1 /Users/vais/Desktop/benchmark/bm_hash_assoc_object.rb 0.675 0.915 0.822 0.836 0.016 /Users/vais/Desktop/benchmark/bm_hash_assoc_string.rb 2.866 2.741 2.840 2.786 0.015 /Users/vais/Desktop/benchmark/bm_hash_clone_object.rb 1.710 2.070 1.849 1.846 0.690 /Users/vais/Desktop/benchmark/bm_hash_clone_string.rb 0.165 0.350 0.352 0.277 0.725 /Users/vais/Desktop/benchmark/bm_hash_delete_object.rb 0.746 0.179 0.208 0.121 0.016 /Users/vais/Desktop/benchmark/bm_hash_delete_string.rb 2.936 0.030 0.029 0.030 0.008 /Users/vais/Desktop/benchmark/bm_hash_each_key_object.rb 0.159 0.218 0.225 0.195 1.316 /Users/vais/Desktop/benchmark/bm_hash_each_key_string.rb 0.131 0.175 0.162 0.168 0.876 /Users/vais/Desktop/benchmark/bm_hash_each_object.rb 7.846 0.814 0.816 0.834 1.173 /Users/vais/Desktop/benchmark/bm_hash_each_string.rb 0.799 0.838 0.813 0.857 0.913 /Users/vais/Desktop/benchmark/bm_hash_each_value_object.rb 6.721 0.268 0.268 0.261 1.085 /Users/vais/Desktop/benchmark/bm_hash_each_value_string.rb 0.199 0.194 0.203 0.200 0.866 /Users/vais/Desktop/benchmark/bm_hash_element_reference_object.rb 0.126 0.214 0.208 0.179 0.014 /Users/vais/Desktop/benchmark/bm_hash_element_reference_string.rb 0.017 0.018 0.021 0.019 0.011 /Users/vais/Desktop/benchmark/bm_hash_element_set_object.rb 0.406 0.837 0.645 0.728 0.102 /Users/vais/Desktop/benchmark/bm_hash_element_set_string.rb 0.130 0.141 0.127 0.146 0.068 /Users/vais/Desktop/benchmark/bm_hash_equal_value_object.rb 11.988 10.678 9.553 9.771 2.980 /Users/vais/Desktop/benchmark/bm_hash_equal_value_string.rb 2.387 0.214 0.231 0.223 1.227 /Users/vais/Desktop/benchmark/bm_hash_fetch_object.rb 0.098 0.115 0.107 0.110 0.008 /Users/vais/Desktop/benchmark/bm_hash_fetch_string.rb 0.014 0.014 0.019 0.014 0.013 /Users/vais/Desktop/benchmark/bm_hash_flatten_object.rb 6.994 0.233 0.212 0.228 0.780 /Users/vais/Desktop/benchmark/bm_hash_flatten_string.rb 0.252 0.262 0.251 0.252 0.677 /Users/vais/Desktop/benchmark/bm_hash_has_key_object.rb 11.334 0.125 0.115 0.110 0.012 /Users/vais/Desktop/benchmark/bm_hash_has_key_string.rb 14.081 0.020 0.021 0.018 0.007 /Users/vais/Desktop/benchmark/bm_hash_has_value_object.rb 0.800 0.228 0.226 0.226 0.095 /Users/vais/Desktop/benchmark/bm_hash_has_value_string.rb 0.173 0.120 0.125 0.125 0.044 /Users/vais/Desktop/benchmark/bm_hash_hash_object.rb 2.293 2.080 2.086 2.122 0.039 /Users/vais/Desktop/benchmark/bm_hash_hash_string.rb 1.902 1.810 1.836 1.862 0.042 /Users/vais/Desktop/benchmark/bm_hash_inspect_object.rb 2.946 1.794 1.459 1.611 4.441 /Users/vais/Desktop/benchmark/bm_hash_inspect_string.rb 1.417 1.208 1.245 1.440 0.940 ... ``` ---------------------------------------------------------------------------------------------------- [13:06:55] Vais Salikhov(@vais):`Ruby1` column on the far right is MRI. These changes and benchmarks are in my `hash` branch on my Opal fork https://github.com/vais/opal/tree/hash I have not pushed them yet, it's a WIP. ---------------------------------------------------------------------------------------------------- [13:08:35] Vais Salikhov(@vais):More about how benchmarking works here: https://github.com/opal/opal/blob/master/CONTRIBUTING.md#benchmarking This area of the project could use a lot of improvement, feedback and ideas very welcome :wink: ---------------------------------------------------------------------------------------------------- [15:53:31] Bozhidar Batsov(@bbatsov):yeah, I totally get what you mean ---------------------------------------------------------------------------------------------------- [15:53:56] Bozhidar Batsov(@bbatsov):but people like numbers that look good, when they’re considering some technology ---------------------------------------------------------------------------------------------------- [15:54:29] Bozhidar Batsov(@bbatsov):I remember @ryanstout had cooked exactly a comparison between Opal and JS for his RubyConf talk ---------------------------------------------------------------------------------------------------- [15:55:36] Bozhidar Batsov(@bbatsov):anyways, my current idea is too simply say that a lot of decisions have been made to ensure the speed is as fast as possible (compiler handling of method missing, mapping of strings and numbers, etc) ---------------------------------------------------------------------------------------------------- [15:55:40] Bozhidar Batsov(@bbatsov):guess this should be enough ---------------------------------------------------------------------------------------------------- [17:04:28] Elia Schito(@elia):@bbatsov yes, all that stuff has been developed constantly measuring alternatives on jsperf when it was still usable ---------------------------------------------------------------------------------------------------- [17:05:03] meh.(@meh):bbatsov, for the record, most of the performance hit comes from operators, since they're forced to be method calls ---------------------------------------------------------------------------------------------------- [17:16:53] Bozhidar Batsov(@bbatsov):good to know ---------------------------------------------------------------------------------------------------- [17:56:17] Mitch VanDuyn(@catmando):Man does any body have any ideas for adding a feature to opal-rspec so that you could rerun an example! During async running it would be great to keep retrying the example until it passes. Anybody got any ideas how this might be done? ---------------------------------------------------------------------------------------------------- [18:02:33] Jamie Gaskins(@jgaskins):@elia I think it'd be a good idea to add some info about upgrading. I didn't see anything in `opal-rails` or `opal-rspec` mentioning explicitly requiring in the spec files (or a `spec_helper` or something) — should it be `require 'opal-rspec'` in my Opal code or just `require 'rspec'`? ---------------------------------------------------------------------------------------------------- [18:56:26] Elia Schito(@elia):@jgaskins it's both opal and opal-rspec ---------------------------------------------------------------------------------------------------- [22:57:34] Forrest Chang(@fkchang):@elia already been thinking about the "crystopal" stack, though I dunno if I will pitch that one for RubyConf (CFP ends Aug 31 - I wanna make sure I can demo something if I were to pitch that) ---------------------------------------------------------------------------------------------------- [22:58:08] Forrest Chang(@fkchang):I think the 1st hurdle might be to implement some sort of asset pipeline for crystal, no one else has ---------------------------------------------------------------------------------------------------- [22:58:28] Forrest Chang(@fkchang):but then I think I should do some opal-inspector stuff instead ---------------------------------------------------------------------------------------------------- [22:59:12] Rick Carlino(@RickCarlino):@fkchang Is registration closed for attendees already? ---------------------------------------------------------------------------------------------------- [23:18:18] Elia Schito(@elia):@fkchang Not sure crystal needs an asset pipeline thingy, you can do most with the sprockets command or a rakefile (if I understood wat you meant…) ---------------------------------------------------------------------------------------------------- [23:49:25] Forrest Chang(@fkchang):@RickCarlino registration hasn't opened yet, I think it usually opens after CFP is over (coz they want to tease the good talks, IMO) ---------------------------------------------------------------------------------------------------- [23:52:45] Forrest Chang(@fkchang):@elia I'm game for a workaround, but I do like how sprockets auto compiles my opal so I just edit and refresh the page ---------------------------------------------------------------------------------------------------- [02:07:18] Jamie Gaskins(@jgaskins):I upgraded to Opal 0.8 on Rails 4.2.3, and `opal-rspec`0.4.3, and I can't run specs anymore inside the browser. I moved my spec files to `/spec-opal` but when I try to run them, it gives me `NoMethodError: undefined method 'describe' for main`. Anyone else seen this? @elia ---------------------------------------------------------------------------------------------------- [04:45:18] Bozhidar Batsov(@bbatsov):@fkchang no, I haven't ---------------------------------------------------------------------------------------------------- [04:45:39] Bozhidar Batsov(@bbatsov):@fkchang btw, I think that focusing only on the browser is the wrong way to go about Opal ---------------------------------------------------------------------------------------------------- [04:46:15] Bozhidar Batsov(@bbatsov):in the ClojureScript community they’re focusing a lot on node, React Native, desktop apps ---------------------------------------------------------------------------------------------------- [04:46:36] Bozhidar Batsov(@bbatsov):obivously the browser is the simplest pitch, but these days you can do a lot more with JS ---------------------------------------------------------------------------------------------------- [04:47:08] Bozhidar Batsov(@bbatsov):@elia will do ---------------------------------------------------------------------------------------------------- [06:24:43] Elia Schito(@elia):@jgaskins you need to require opal-rspec explicitly ---------------------------------------------------------------------------------------------------- [06:25:21] Elia Schito(@elia): that's to allow people to use eg. minitest instead ---------------------------------------------------------------------------------------------------- [06:26:54] Elia Schito(@elia):@jgaskins Maybe we should add an upgrading.md to all repos wdyt? ---------------------------------------------------------------------------------------------------- [06:44:27] Bozhidar Batsov(@bbatsov):or this should be just a part of the readme ---------------------------------------------------------------------------------------------------- [08:03:07] Elia Schito(@elia):@bbatsov :tulip: https://github.com/opal/opal-rails/commit/79a23dad63a8501209072d40a9948331611d2065 ---------------------------------------------------------------------------------------------------- ############################## [2015-07-30] ############################## [01:30:53] Vais Salikhov(@vais):@elia http://eregon.github.io/rubyspec/2015/07/29/rubyspec-is-reborn.html ---------------------------------------------------------------------------------------------------- [01:31:52] Vais Salikhov(@vais):@bbatsov ^ regarding the rumors of RubySpecs death being greatly exaggerated :wink: ---------------------------------------------------------------------------------------------------- [04:04:51] Vais Salikhov(@vais):[![Clipboard01.gif](https://files.gitter.im/opal/opal/sXb7/thumb/Clipboard01.gif)](https://files.gitter.im/opal/opal/sXb7/Clipboard01.gif) ---------------------------------------------------------------------------------------------------- [04:05:23] Vais Salikhov(@vais):A little more publicity for Opal :wink2: ---------------------------------------------------------------------------------------------------- [04:49:47] Vais Salikhov(@vais):Thanks to @chrisseaton (and @eregon obviously) :smile: ---------------------------------------------------------------------------------------------------- [15:07:02] Jared White(@jaredcwhite):@fkchang @elia My understanding of Crystal is that it has no visibility into the world of Rubygems -- it could maybe execute a system command and get the return of it...but I'm not sure how well that would work with Sprockets. You might need a Crystal server and a separate "asset" server that's still Ruby. ---------------------------------------------------------------------------------------------------- [15:45:53] ylluminate(@ylluminate):on the topic of crystal, i'm curious as to what you guys see as the real appeal at the moment for the language as far as using opal with it. wouldn't this be more akin to a ruby + coffeescript scenario (where crystal is the coffeescript, but is more ruby-like obviously)? from what i've understood, it's not syntactically a one-to-one relationship with ruby; while it has obvious (serious) performance advantages, it does introduce a quirky relationship where we can't just run gems out of the box, etc... ---------------------------------------------------------------------------------------------------- [15:56:32] Jared White(@jaredcwhite):@ylluminate The way I see it, the #1 reason people ditch Ruby on Rails as a web stack is performance. First you ditch it in client-world by using frontend frameworks in a single page app (SPA). Then you ditch it in server-world by building APIs in some other language (JS/Node, Go, etc.) But if you are building SPAs in Javascript, Go, etc., well that's no fun! What if we could use Ruby/Ruby-like languages for both frontend and backend dev with great performance? Seems like a win/win scenario. (Of course, there are valid arguments to be made that Rails really isn't that big of a performance problem for most webapps...Improvements to MRI in 2.2+, or switching to JRuby, using the latest app servers like Passenger 5, etc...and there are even arguments to be made that a more backend-focused approach with things like Turbolinks for frontend responsiveness are also decent solutions.) ---------------------------------------------------------------------------------------------------- [15:57:19] Jared White(@jaredcwhite):But, y'know, NEW HOTNESS! :) ---------------------------------------------------------------------------------------------------- [16:20:01] ylluminate(@ylluminate):well that is my concern. raptor (passenger 5) has been amazing for us and i don't see the practicality of a loss of producitivity shifting to crystal, but i can see the "new hotness" argument, sure. ---------------------------------------------------------------------------------------------------- [16:21:13] ylluminate(@ylluminate):i could see a volt-like framework called "crystal-meth" that evokes the power of opal for the client side... ;) ---------------------------------------------------------------------------------------------------- [16:21:58] Forrest Chang(@fkchang):@ylluminate in my playing w/crystal thus far, I see it as a "subset of ruby" that ends up faster and w/smaller binaries than go. So my 1st thought is that I want to evangelize crystal as something rubyist can and should use in lieu of those times you would switch to golang or node -- which is generally performance based. That crystal makes binaries, and thus shippable w/o installing anything is an orthogonal perk. That being said, depending on the ruby you write, crystal will compile it directly, I grabbed some ruby mandelbrot code and it ran w/o modification - so I think constraining to a certain subset of ruby could work w/crystal in the backend. Since w/opal there are also things you have to do that don't work the same on the backend w/MRI or JRuby, I don't know if it would be that much of a change. That being said, crystal is still pretty early. I tried to get a simple websocket example working (that I want to hit on the front end from opal), and it turns out there's a fix or 2 that needs to get in for that to work. But, Crystal is also the only static language I can think of that has open classes, so I was able to monkey patch in the fixes w/o having clone, change and recompile crystal. We also spiked another application that uses JSON, which we encountered some issues. That might have some hinderances wrt to using crystal for webwork given the ubiquity of JSON, though hopefullly our issue on crystal will get some changes ---------------------------------------------------------------------------------------------------- [16:22:24] Forrest Chang(@fkchang):Ultimately, if I can basically write Ruby and have it run as fast as golang, I'm pretty happy. ---------------------------------------------------------------------------------------------------- [16:24:00] Forrest Chang(@fkchang):@jaredcwhite I suppose what @elia is suggesting is that that I use opal/sprockets rake task to do the compilation (possibly running under guard -- this is basically how people use grunt to do the equivalent of asset pipeline, set up the rules for grunt and then have it watch the source files) ---------------------------------------------------------------------------------------------------- [16:24:27] Forrest Chang(@fkchang):That's probably a good 1st step in lieu of trying to implement asset pipeline directly in crystal ---------------------------------------------------------------------------------------------------- [16:29:46] Forrest Chang(@fkchang):@ylluminate good name crystal-meth, if only we could get some sort of opal reference into it too ---------------------------------------------------------------------------------------------------- [16:33:03] ylluminate(@ylluminate):there's no doubt that that name is memorable and would certainly catch eyes ---------------------------------------------------------------------------------------------------- [16:34:42] ylluminate(@ylluminate):it sounds like a fork of volt to use crystal that would mutually contribute would perhaps be beneficial and act as a healthy boon to the effort of volt. volt would be the pure ruby stack, meth would be the crystal stack version with the same opal effort going on ---------------------------------------------------------------------------------------------------- [16:36:06] ylluminate(@ylluminate):the idea of "hotness" is indeed accurate in that it's getting attention for the reasons noted, even though the practicality may be in question ---------------------------------------------------------------------------------------------------- [17:41:05] Elia Schito(@elia):As fun as it is the crystal-meth name I can see how it can raise issues like the cocaine gem did etc. Just a heads up ;) ---------------------------------------------------------------------------------------------------- [17:43:18] Elia Schito(@elia):For me crystal is being the solution to ship the agent for timesampler.com which so far was a gem nearly impossible to install for any non-ruby-developer. For I also tried a nw.js / atom-shell approach reusing nearly 100% of the code with Opal (which is a really cool project if you didn't know) but that too didn't end well, because you know… Node.js. ---------------------------------------------------------------------------------------------------- [17:44:38] Elia Schito(@elia):With crystal I almost finished porting the code with just its stdlib (+ the external fswatch) and I think that by tonight I can have a two executables shippable that I can easily wrap in an osx package and make people install it quite easily. ---------------------------------------------------------------------------------------------------- [17:55:59] ylluminate(@ylluminate):lol @elia the interesting point of crystal-meth is that it's not as confusing as something like `cocaine`. a gem named cociaine is kind of hard to grok and what's worse is that their description on rubygems is even worse: "A small library for doing (command) lines"... o.o Kinda odd and crazy, but meth is more akin to volt - well what does it mean? it doesn't matter per se because it's a framework and it's more about name recognition than describing what it is in the name for these framework cases. eg, rails doesn't necessarily make sense. you have to think about it quite a bit to pull in meaning, but the same could be said of methamphetamines as well - they, according to a quick google, release dopamine rapidly and thus create "reward, motivation, the experience of pleasure, and motor function" obviously it will be criticized, but it will definitely catch some positive attention as well in that perhaps it will shift the negatively connoted drug towards something more positive. lol... anywayzzz ;) ---------------------------------------------------------------------------------------------------- [18:13:14] Gabriel Rios(@gabrielrios):after seeing github remove a project for having word *retard* on it, It’s always good to have that in mind ---------------------------------------------------------------------------------------------------- [18:19:56] Elia Schito(@elia):@gabrielrios any link to the full story? I missed the drama this time… ---------------------------------------------------------------------------------------------------- [18:20:24] ylluminate(@ylluminate):just move to gitlab if needed... :D ---------------------------------------------------------------------------------------------------- [18:20:55] ylluminate(@ylluminate):this drama is getting disgustingly old ---------------------------------------------------------------------------------------------------- [18:21:20] ylluminate(@ylluminate):people are not "real" anymore unfortunately. too worried about things that absolutely shouldn't be made into mountains ---------------------------------------------------------------------------------------------------- [18:22:34] ylluminate(@ylluminate):i guess the next logical step for folks like this would be to make kids wear full body armor when playing soccer or perhaps just shutting down any and all social interaction for risk of being offended or dealing with potentially being offended ---------------------------------------------------------------------------------------------------- [18:22:53] Elia Schito(@elia):@gabrielrios nvm found it ---------------------------------------------------------------------------------------------------- [18:24:05] Gabriel Rios(@gabrielrios):@elia :+1: ---------------------------------------------------------------------------------------------------- [18:28:34] Forrest Chang(@fkchang):@elia cool beans on the installer. About how much work was it to port? ---------------------------------------------------------------------------------------------------- [18:29:04] Forrest Chang(@fkchang):The big drawback for crystal performance wise, is that we're in nearly the same boat as node was before npm took off, that we'd have to port all these gems ---------------------------------------------------------------------------------------------------- [18:29:10] Forrest Chang(@fkchang):or the functional equivalent ---------------------------------------------------------------------------------------------------- [18:38:38] ylluminate(@ylluminate):so what i'm gathering, there's no pkg mgmt tool for crystal yet, right? ---------------------------------------------------------------------------------------------------- [18:38:57] ylluminate(@ylluminate):that is a pretty big negative and not considering somehow tying in gems in any fashion is a huge loss ---------------------------------------------------------------------------------------------------- [18:40:03] ylluminate(@ylluminate):it might be smart if someone were to take rubygems and extend it with a crystal validator that would check projects to see if they're usable in crystal. it could be a simply badge on rubygems.org and could help project owners who are interested to be aware of that ---------------------------------------------------------------------------------------------------- [19:02:28] Elia Schito(@elia):Given Crystal is 95% ruby syntax I don't think it's that easy to port entire gems, probably more difficult than porting to Opal as a bunch of semantics change as well ---------------------------------------------------------------------------------------------------- [19:03:27] ylluminate(@ylluminate):well, i guess i'm saying that it would make sense to have a way to test and then perhaps have a mechanism in place to make gems both std ruby and crystal compliant; perhaps having some .cr.diff files or something. brainstorming obviously. ---------------------------------------------------------------------------------------------------- [19:04:37] Elia Schito(@elia):Sure would be cool to use crystal instead of c for ruby extensions ---------------------------------------------------------------------------------------------------- [19:07:12] Elia Schito(@elia):@fkchang I think around 3hrs so far ---------------------------------------------------------------------------------------------------- [19:21:09] Forrest Chang(@fkchang):@ylluminate I haven't figured out the shards thing yet, but it seems that you setup the equivalent of a Gemfile with links right to repos (which I have to guess is in the shard format), and it will include those -- sort of a built in bundler. No central repository outside of github ATM, from what I can tell ---------------------------------------------------------------------------------------------------- [20:05:56] Mitch VanDuyn(@catmando): Folks - Anyway "reinitialize" opal? Am working on some server side rendering with RubyRacer, and want to avoid recreating the RubyRacer context if at all possible. This would require (I think) some how reinitializing Opal... any ideas? ---------------------------------------------------------------------------------------------------- [22:01:51] Forrest Chang(@fkchang):I think one think I like about asset pipeline in the app is that you get compile errors in the app. I think I should hope to understand that better, because I'd like to catch opal-rspec compile errors in the app, but what happens is that opal-rspec just doesn't run the spec that has compile errors, and you get fooled unless you watch the spec count. @elia have u or @adambeynon given thought to that? ---------------------------------------------------------------------------------------------------- [22:03:42] Elia Schito(@elia):@catmando that depends on what get's "dirty", anyway Opal it's enough similar to Ruby to make it quite difficult I think ---------------------------------------------------------------------------------------------------- [22:04:48] Elia Schito(@elia):@fkchang that's probably just related to the server running in a thread (or fork) and thus swalloing errors without feedback, try opening an issue for that ---------------------------------------------------------------------------------------------------- [22:25:12] Rick Carlino(@RickCarlino):Many opal gems call `.untaint` when adding themselves to the file path. Why is that? ---------------------------------------------------------------------------------------------------- [22:26:05] Elia Schito(@elia):Because some people used tainting features in their setup, like $SAFE = some number ---------------------------------------------------------------------------------------------------- [22:26:24] Rick Carlino(@RickCarlino):Ah ---------------------------------------------------------------------------------------------------- [22:44:30] Forrest Chang(@fkchang):@elia it happens when you hit spec page in the rails app too, I'm pretty certain. When I get a chance to verify, I'll write an issue. On a note, has any of that changed in opal-rails for 0.7 -> 0.8, maybe it's better, I haven't upgraded ---------------------------------------------------------------------------------------------------- ############################## [2015-07-31] ############################## [17:31:35] Elia Schito(@elia):@fkchang a bunch of stuff changed on that side but not sure if the issue is still there ---------------------------------------------------------------------------------------------------- [23:06:46] Forrest Chang(@fkchang):I just learned that opal-irb works in 0.8.0 (I've had to change code w/previous changes) cuz sophie wrote a blog and built an quick app w/it http://www.thegreatcodeadventure.com/repl-ilze-building-an-in-browser-ruby-repl-with-opal/ ---------------------------------------------------------------------------------------------------- ############################## [2015-08-01] ############################## [15:20:48] meh.(@meh):ident lolwut ---------------------------------------------------------------------------------------------------- [15:20:53] meh.(@meh):wat ---------------------------------------------------------------------------------------------------- [15:21:02] meh.(@meh):that was for bitlbee :D ---------------------------------------------------------------------------------------------------- ############################## [2015-08-03] ############################## [15:56:19] CJ Lazell(@cj):morning…. anyone know how to set the headers on sprockets? ---------------------------------------------------------------------------------------------------- [15:59:44] CJ Lazell(@cj):@elia I know we’ve talked about this before, I’m just trying to put a hack together so that you can set the headers in the opal server ---------------------------------------------------------------------------------------------------- [16:41:32] Mitch VanDuyn(@catmando):fyi - if anybody is interested I just posted a progress report about our work with react + opal + rails + active record: http://metaruby.com/t/opal-react-isomorphic-ruby-that-plays-well-with-rails/56/11?u=catmando ---------------------------------------------------------------------------------------------------- [17:14:24] CJ Lazell(@cj):so according to this I can just add -323f23f (some random number) and it will add a long expires header. that works fine in debug mode naming the file wedge.self-0aa2105d29558f3eb790d411d7d8fb66.js but when you remove self and just have wedge-0aa2105d29558f3eb790d411d7d8fb66.js when debug mode is off, it gives file not found ---------------------------------------------------------------------------------------------------- [17:35:14] CJ Lazell(@cj):so I ended up doing this https://gist.github.com/87032eb6c9e2a4a35143 ---------------------------------------------------------------------------------------------------- [18:02:56] Elia Schito(@elia):@cj seems the right way, I don't think there's any official support for setting headers in sprockets ---------------------------------------------------------------------------------------------------- [19:39:58] Rick Carlino(@RickCarlino):Anyone have advice on how to better inspect elements while debugging Opal code? It seems like when I print some objects, they just return an empty line instead of debug info. Are there any strategies to deal with this? ---------------------------------------------------------------------------------------------------- [19:43:08] meh.(@meh):RickCarlino, how do you print them? ---------------------------------------------------------------------------------------------------- [21:04:16] Rick Carlino(@RickCarlino):Sometimes I do `puts`, other times I backtick and do a JS `console.log` ---------------------------------------------------------------------------------------------------- [21:04:35] Rick Carlino(@RickCarlino):I can try to find a good example and raise a legitimate issue if its just me. ---------------------------------------------------------------------------------------------------- [21:10:08] Elia Schito(@elia):@RickCarlino try with `p` or `pp` (after `require 'pp'`) ---------------------------------------------------------------------------------------------------- [21:16:01] Rick Carlino(@RickCarlino):@elia ah, had no idea they were different. Always thought `p` was just an alias for `puts`. Thanks for the help! ---------------------------------------------------------------------------------------------------- [21:18:17] Elia Schito(@elia):p its useful also bc it returns the inspected value ---------------------------------------------------------------------------------------------------- [21:18:39] Elia Schito(@elia):@RickCarlino learned while implementing it lol :) ---------------------------------------------------------------------------------------------------- [21:19:03] Elia Schito(@elia):pp sends the object to console.log (when in a browser) ---------------------------------------------------------------------------------------------------- [21:19:47] Elia Schito(@elia):@RickCarlino well, in case you didn't know what to podcast about… : ) ---------------------------------------------------------------------------------------------------- [21:20:09] Rick Carlino(@RickCarlino):Hahaha, I already put it in my "idea book". ---------------------------------------------------------------------------------------------------- ############################## [2015-08-04] ############################## [09:55:00] Vais Salikhov(@vais):@jgaskins have you tried overriding #new for your classes with a fixed set of arguments to see if that makes a difference? Or those are not your classes? In any case +1 for opening an issue because gitter is fleeting. ---------------------------------------------------------------------------------------------------- [10:32:41] Colin Gunn(@balmoral):Been living mostly in volt, but need to wrap Highcharts js in Opal. Very impressed with what you guys are doing and how you're doing it. Have opened an issue #1044 on GitHub to make life even easier: ---------------------------------------------------------------------------------------------------- [10:34:33] Colin Gunn(@balmoral):to add option to handle arrays in alias_native ---------------------------------------------------------------------------------------------------- [12:32:10] Bozhidar Batsov(@bbatsov):https://speakerdeck.com/bbatsov/opal-the-journey-from-javascript-to-ruby ---------------------------------------------------------------------------------------------------- [12:32:36] Bozhidar Batsov(@bbatsov):in case someone is interested in something like this :-) ---------------------------------------------------------------------------------------------------- [12:32:46] Elia Schito(@elia):\o/ ---------------------------------------------------------------------------------------------------- [15:07:33] Forrest Chang(@fkchang):@RickCarlino I've been thinking of making something like awesome print as the default debug print behavior for opal-irb ---------------------------------------------------------------------------------------------------- [15:07:51] Forrest Chang(@fkchang):@catmando great you wrote up your react stuff... ---------------------------------------------------------------------------------------------------- [15:14:24] Forrest Chang(@fkchang):Along the lines of my idea that "making opal a no brainer for rails will probably help opal's popularity", maybe getting @catmando 's opal/rails gem ecosystem vision, is a good path to that. It could be the right combiniation: Rails, opal and React since it is getting a lot of favorable press ---------------------------------------------------------------------------------------------------- [15:15:16] Elia Schito(@elia):@bbatsov "Used in production by 2013" actually just checked and the first time I used it was 26 june 2013 ---------------------------------------------------------------------------------------------------- [15:15:59] Elia Schito(@elia):implementing some frontend filters for an e-commerce ---------------------------------------------------------------------------------------------------- [15:16:13] Bozhidar Batsov(@bbatsov):I watched @fkchang’s presentation and he mentioned that he knew of some apps using it in prod in 2013 ---------------------------------------------------------------------------------------------------- [15:16:24] Bozhidar Batsov(@bbatsov):therefore this particular date reference ---------------------------------------------------------------------------------------------------- [15:17:23] Bozhidar Batsov(@bbatsov):btw, when I was at the conference some people were wondering how to get involved in the development ---------------------------------------------------------------------------------------------------- [15:17:38] Bozhidar Batsov(@bbatsov):it might be good to start adding “beginner-friendly” tags to some tickets ---------------------------------------------------------------------------------------------------- [15:17:46] Elia Schito(@elia):yeah, was just for info :) ---------------------------------------------------------------------------------------------------- [15:18:04] Bozhidar Batsov(@bbatsov):and perhaps link straight from the README to the list of things that have to be implemented ---------------------------------------------------------------------------------------------------- [15:18:12] Elia Schito(@elia)::+1: seems a good idea ---------------------------------------------------------------------------------------------------- [15:19:19] Elia Schito(@elia):If you happen to see any issue that can be marked as such just drop a comment and I'll add the tag ---------------------------------------------------------------------------------------------------- [15:20:05] Jared White(@jaredcwhite):hey folks - just a heads up that I'm putting the next Opalist issue off until next week - (a) I'm buried in work this week, and (b) the usual volume of news is a little less than usual by this time, but I'm sure next week there will be plenty to talk about. @catmando Hugely excited about what you shared on the React + Opal stuff your team is working on. Any chance you could put a blog post up with that stuff that I could link to? Or maybe I could just link to the forum thread? ---------------------------------------------------------------------------------------------------- [15:21:14] Forrest Chang(@fkchang):@jaredcwhite and I actually have material ready early this time.... ---------------------------------------------------------------------------------------------------- [15:21:45] Forrest Chang(@fkchang):@bbatsov I bet @adambeynon has apps earlier than that ---------------------------------------------------------------------------------------------------- [15:21:55] Jared White(@jaredcwhite):@fkchang awesome, can't wait to see it ---------------------------------------------------------------------------------------------------- [15:21:56] Elia Schito(@elia):@jaredcwhite don't miss the hash PR with benchmarks done by @vais earlier this week ---------------------------------------------------------------------------------------------------- [15:22:17] Jared White(@jaredcwhite):@elia Ah, I will look for that ---------------------------------------------------------------------------------------------------- [15:22:20] Elia Schito(@elia):> I bet @adambeynon has apps earlier than that indeed ---------------------------------------------------------------------------------------------------- [15:23:37] Forrest Chang(@fkchang):@jaredcwhite it's a fairly comprehensive overview (cuz it seems like most ppl don't know most of the fatures) of opal-irb, contemplating whether I should do a screencast, I feel I've done it before, though there are some new ones. Maybe I can outsource it to @RickCarlino aka "God of opal screencasts" (GOOS from now on) ---------------------------------------------------------------------------------------------------- [15:25:01] Forrest Chang(@fkchang):I can be Maverick to his 'Goos', but I'll have to level up my (nonexistant) screencast game ---------------------------------------------------------------------------------------------------- [15:56:39] CJ Lazell(@cj):opal uses sprockets 3 now right? ---------------------------------------------------------------------------------------------------- [16:02:17] Forrest Chang(@fkchang):@cj as of 0.8 yes ---------------------------------------------------------------------------------------------------- [16:02:39] CJ Lazell(@cj):dang, they dropped gzip support in 3 ---------------------------------------------------------------------------------------------------- [16:04:25] CJ Lazell(@cj):I guess I’ll have to patch it :) ---------------------------------------------------------------------------------------------------- [17:25:55] Forrest Chang(@fkchang):@cj yeah, can't upgrade opal-playground coz middleman doesn't support sprockets 3, which is how opal-playground is setup ---------------------------------------------------------------------------------------------------- [19:59:54] AstonJ(@AstonJ):Nice slides @bbatsov - just posted on MR http://metaruby.com/t/if-youre-not-into-opal-how-can-we-convince-you/36/6 :) ---------------------------------------------------------------------------------------------------- [20:08:12] AstonJ(@AstonJ):@catmando - that was a great post, thanks… I tweeted it too :D ---------------------------------------------------------------------------------------------------- [20:16:02] Mitch VanDuyn(@catmando):I guess I am wondering what the arguments are that we see AGAINST using opal. (thanks @fkchang and @astonj for the encouragement, and @dancinglightning for trying out the system and making some great suggestions) ---------------------------------------------------------------------------------------------------- [20:44:35] AstonJ(@AstonJ):We touched on it in this thread @catmando http://metaruby.com/t/why-are-you-using-opal/258 - I think a big part is down to lack of official documentation. (I posted some suggestions here: https://github.com/opal/docs/issues/1) ---------------------------------------------------------------------------------------------------- [21:07:20] AstonJ(@AstonJ):Argh ignore me - I missread your post sorry. ---------------------------------------------------------------------------------------------------- [23:58:42] Rick Carlino(@RickCarlino):@fkchang Just chiming in after a pretty long break from gitter. Did you say Opal IRB is in need of a tutorial? ---------------------------------------------------------------------------------------------------- [02:42:52] Jamie Gaskins(@jgaskins):I just noticed that, in Chrome/v8, instantiation of Ruby objects is unable to be optimized by the VM because it uses the `arguments` array (via `*args` in Opal): https://github.com/opal/opal/blob/247d921f43e2fcdec47405c1c2a38472fc89ca71/opal/corelib/class.rb#L42 Safari doesn't seem to have any trouble with it (it renders Clearwater apps 3x as fast as Chrome when I don't use render caching), but in rendering a pretty large virtual DOM several times in Clearwater just now, I spent 13.24% of my CPU time in `Class#new`. I haven't opened an issue yet because I don't know if there's any way around it. Anyone have any ideas? ---------------------------------------------------------------------------------------------------- ############################## [2015-08-05] ############################## [00:13:22] Rick Carlino(@RickCarlino):Lmao @ @bbatsov 's slide that says "No need for a book called 'Ruby: The Good Parts'" ---------------------------------------------------------------------------------------------------- [07:51:55] Colin Gunn(@balmoral):FYI release of opal-highcharts wrapper for Highcharts javascript library https://github.com/balmoral/opal-highcharts and https://rubygems.org/gems/opal-highcharts. Comments and contributions very welcome. ---------------------------------------------------------------------------------------------------- [09:50:43] Vais Salikhov(@vais):@jaredcwhite this one https://github.com/opal/opal/pull/1035 :blush: ---------------------------------------------------------------------------------------------------- [12:40:55] Forrest Chang(@fkchang):@RickCarlino I was thinking of making an accompanying screen cast when I release my opal-irb overview blog post. Then I think about how much better you are at doing them than I... ---------------------------------------------------------------------------------------------------- [13:11:31] Rick Carlino(@RickCarlino):@fkchang When are you releasing the blog post? ---------------------------------------------------------------------------------------------------- [13:23:50] Forrest Chang(@fkchang):@RickCarlino after it's proofread, would you like to look at the current draft? ---------------------------------------------------------------------------------------------------- [13:25:21] Forrest Chang(@fkchang):Also in general, I had a request to release opal-irb as an "on rubygems.org" gem, delayed cuz I wanted to clean it up a bit, and also wasn't sure if I should do versions to match opal versions -- all the other minor releases, I had to rewrite stuff to match, I think 0.8 is the 1st one I didn't ---------------------------------------------------------------------------------------------------- [13:47:46] Rick Carlino(@RickCarlino):@fkchang Sure. I need to get part II of the ecommerce tutorial out the door, but I didn't have anything planned thereafter. I can take a look after this week. ---------------------------------------------------------------------------------------------------- [16:27:42] cire1776(@cire1776):I am trying to use Forwardable and am getting a 'uninitialized constant User::Forwardable' in the try Opal and through Volt. Is this a known issue or am I doing something wrong. ---------------------------------------------------------------------------------------------------- [17:14:18] Gabriel Rios(@gabrielrios):@cire1776 I’m using forwardable just fine on a app, are you requiring it? (`require ‘forwardable’`) ---------------------------------------------------------------------------------------------------- [19:29:08] cire1776(@cire1776):Thanks for the reply. I had copied some third-party code that had: require 'Forwardable'. It works in ruby, but the capital F doesn't work in Opal. ---------------------------------------------------------------------------------------------------- [20:35:07] Elia Schito(@elia):@cire1776 could happen in Windows i think, where the fs is case insensitive ---------------------------------------------------------------------------------------------------- ############################## [2015-08-06] ############################## [13:20:03] Francesco 'makevoid' Canessa(@makevoid):Hi all ---------------------------------------------------------------------------------------------------- [13:20:11] Francesco 'makevoid' Canessa(@makevoid):finally had some time to play with opal ---------------------------------------------------------------------------------------------------- [13:20:31] Francesco 'makevoid' Canessa(@makevoid):I wanted to try react.rb - but I don't like sprockets at all, it's kind of slow ---------------------------------------------------------------------------------------------------- [13:20:49] Francesco 'makevoid' Canessa(@makevoid):I made this so far: https://github.com/makevoid/opal_raw ---------------------------------------------------------------------------------------------------- [13:21:00] Francesco 'makevoid' Canessa(@makevoid):it's only opal and opal-browser ---------------------------------------------------------------------------------------------------- [13:21:29] Francesco 'makevoid' Canessa(@makevoid):I vendored them both directly into js files ---------------------------------------------------------------------------------------------------- [13:22:52] Francesco 'makevoid' Canessa(@makevoid):and I'm just using the builder to recompile the js when I save my clientside rb file ---------------------------------------------------------------------------------------------------- [13:23:26] Francesco 'makevoid' Canessa(@makevoid):this way it's very fast, I don't have to wait like 2 seconds for sprockets to recompile all the assets ---------------------------------------------------------------------------------------------------- [13:24:52] Francesco 'makevoid' Canessa(@makevoid):I couldn't get an already compiled (js) version of react.rb thou, do you know an easy way to generate one? Or a sprocket rule / some code to get one bundled file of every asset of the app? ---------------------------------------------------------------------------------------------------- [13:24:54] Francesco 'makevoid' Canessa(@makevoid):thanks ---------------------------------------------------------------------------------------------------- [13:39:53] Gabriel Rios(@gabrielrios):@makevoid you can try to use the rake tasks used on opal-jquery https://github.com/opal/opal-jquery/blob/master/Rakefile#L14-L28 ---------------------------------------------------------------------------------------------------- [13:40:15] Francesco 'makevoid' Canessa(@makevoid):cool ---------------------------------------------------------------------------------------------------- [13:41:05] Francesco 'makevoid' Canessa(@makevoid):opal is really cool, I've read some bits of source code and now I want to build something with it soon :) ---------------------------------------------------------------------------------------------------- [13:44:47] Francesco 'makevoid' Canessa(@makevoid):I'll try `Opal::Builder.build` against react-rb and see if I can get a version built, thanks for the hint @gabrielrios ---------------------------------------------------------------------------------------------------- [16:25:52] meh.(@meh):@elia ping ---------------------------------------------------------------------------------------------------- [16:26:00] Elia Schito(@elia):pong ---------------------------------------------------------------------------------------------------- [16:26:08] Elia Schito(@elia):sup? ---------------------------------------------------------------------------------------------------- [16:26:49] meh.(@meh):I'm reconsidering #1044 ---------------------------------------------------------------------------------------------------- [16:27:42] Elia Schito(@elia):rationale? ---------------------------------------------------------------------------------------------------- [16:33:31] meh.(@meh):sempre bello l'internet italiano ---------------------------------------------------------------------------------------------------- [16:33:35] meh.(@meh):I was saying ---------------------------------------------------------------------------------------------------- [16:33:50] meh.(@meh):there is `Native::Array` ---------------------------------------------------------------------------------------------------- [16:33:54] meh.(@meh):so it could be the right thing to do, if it uses `Native::Array` ---------------------------------------------------------------------------------------------------- [16:34:27] meh.(@meh):but I don't remember its API so I have to check that ---------------------------------------------------------------------------------------------------- [16:36:17] meh.(@meh):yeah, I don't think it would work, there would be an inconsistency between `#alias_native` and `#native_accessor` and friends ---------------------------------------------------------------------------------------------------- [16:36:32] meh.(@meh):mmh ---------------------------------------------------------------------------------------------------- [16:37:05] meh.(@meh):in the case of alias it would look something like ---------------------------------------------------------------------------------------------------- [16:37:24] meh.(@meh):`alias_native :series do |s| Series::new(s) end` ---------------------------------------------------------------------------------------------------- [16:38:17] meh.(@meh):`alias_native :mime_types, :mimeTypes, get: :item, named: :namedItem do |m| MimeType.new(m) end` ---------------------------------------------------------------------------------------------------- [16:38:30] meh.(@meh):looks like shit ---------------------------------------------------------------------------------------------------- [16:38:33] meh.(@meh):meh ---------------------------------------------------------------------------------------------------- [16:52:52] Elia Schito(@elia):¯\_(ツ)_/¯ ---------------------------------------------------------------------------------------------------- [16:53:05] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [23:47:17] Colin Gunn(@balmoral):@meh and @elia I much appreciate you taking the time to consider #1044. My timezone is +10, so out of sync with your conversation. I understand your concern to keep the API clean and consistent, but I’ll probably keep my little patch going as it saves a lot of repetitive and comparatively untidy code. Since `#alias_native` already provides an `:as` option to provide type conversion from the native object, having the additional option `:as_array_of` seems to me semantically and functionally consistent with the intent of the method, and is very handy and concise to boot. Leave it with you. :satisfied: ---------------------------------------------------------------------------------------------------- ############################## [2015-08-08] ############################## [10:06:19] David Boardman(@djboardman):Hi I'm trying to do some date arithmetic e.g. `Date.new + 1` but getting `lhs.$+ is not a function` in 0.9.0-dev. I've seen a lot of changes going on in 0.9.0-dev for dates and time so should was wondering if that's something that is coming? ---------------------------------------------------------------------------------------------------- [11:19:04] Vais Salikhov(@vais):@djboardman hmm, it looks like calling `Date.new` without arguments is broken (it does not default to today as Ruby does). Here's what I'm getting: ``` $ bundle exec opal -ve "require 'date'; p Date.new" Opal v0.9.0.dev NaN-NaN-NaN ``` But: ``` $ bundle exec opal -ve "require 'date'; d = Date.new(2015, 1, 1); p d; p d + 1" Opal v0.9.0.dev 2015-01-01 2015-01-02 ``` So, call it with args or use `Date.today`: ``` $ bundle exec opal -ve "require 'date'; d = Date.today; p d; p d + 1" Opal v0.9.0.dev 2015-08-08 2015-08-09 ``` I'll see if I can fix this today though, thanks for bringing it up! ---------------------------------------------------------------------------------------------------- [11:26:03] Vais Salikhov(@vais):Actually, I just learned that`Date.new` is supposed to default to `-4712-01-01` :wink2: ---------------------------------------------------------------------------------------------------- [11:36:00] Benny Bach(@bebac):If anyone is interested, I just got the the vienna specs running with opal-browser. The repository can be found here https://github.com/bebac/vienna.git it is on a branch called opal-browser. I have only made a very basic application, so there might be some issues that haven't surfaced yet. ---------------------------------------------------------------------------------------------------- [11:59:23] Elia Schito(@elia):@vais 😳 TMYK ---------------------------------------------------------------------------------------------------- [11:59:42] Elia Schito(@elia):@bebac cool stuff! ---------------------------------------------------------------------------------------------------- ############################## [2015-08-09] ############################## [22:20:24] meh.(@meh):@vais welp, I just had an old jshint version ◕ ◡ ◔ ---------------------------------------------------------------------------------------------------- [05:47:05] Jikku Jose(@JikkuJose):@bbatsov do you have a video of that presentation you gave as slides? ---------------------------------------------------------------------------------------------------- [05:51:14] Bozhidar Batsov(@bbatsov):the presentation was recorded, but I have no idea when will it be uploaded ---------------------------------------------------------------------------------------------------- [05:51:22] Bozhidar Batsov(@bbatsov):confreaks did the recording ---------------------------------------------------------------------------------------------------- [06:05:44] Jikku Jose(@JikkuJose):@bbatsov sure, I will look after a while. Please do post it in case you get the link. ---------------------------------------------------------------------------------------------------- [07:10:28] Elia Schito(@elia):@bbatsov btw I noticed you mention opalrb as the github org, so I created it and put a link to github.com/opal :) ---------------------------------------------------------------------------------------------------- [07:11:21] Bozhidar Batsov(@bbatsov):ops ---------------------------------------------------------------------------------------------------- [07:11:31] Bozhidar Batsov(@bbatsov):sorry about this ---------------------------------------------------------------------------------------------------- [18:50:44] supriyantomaftuh(@supriyantomaftuh):Free ---------------------------------------------------------------------------------------------------- [22:07:47] meh.(@meh):@vais how the hell do you skip jshint from erroring out the build? ---------------------------------------------------------------------------------------------------- ############################## [2015-08-10] ############################## [01:33:43] Vais Salikhov(@vais):@meh I usually comment out the jshint line in testing.rake while iterating in development, then enable it again before committing or as needed. On Travis I don't think there should be any way to skip jshint as it would defeat the whole purpose of it :wink: ---------------------------------------------------------------------------------------------------- [14:01:57] Elia Schito(@elia):@RickCarlino video request: volt without bootstrap tutorial :) ---------------------------------------------------------------------------------------------------- [14:38:53] Jikku Jose(@JikkuJose):Is there any Google Maps API related wrappers in Opal? ---------------------------------------------------------------------------------------------------- [15:29:49] Forrest Chang(@fkchang):@JikkuJose no, I might release some down the road though ---------------------------------------------------------------------------------------------------- [15:31:03] Rick Carlino(@RickCarlino):@elia I will be using bootstrap for life! ---------------------------------------------------------------------------------------------------- [15:32:59] Elia Schito(@elia):ahahha ---------------------------------------------------------------------------------------------------- [18:08:12] Torsten Rüger(@dancinglightning):@RickCarlino one can never e to sure. Semantic naming for css is nice and just around the corner, coming our way. ---------------------------------------------------------------------------------------------------- [18:08:55] Torsten Rüger(@dancinglightning):@elia bootstrap was quite easy to remove, just remove the gems, dependencies and done. ---------------------------------------------------------------------------------------------------- [18:11:40] Torsten Rüger(@dancinglightning):btw , mongo can also be removed if one does not use store ---------------------------------------------------------------------------------------------------- [22:47:00] Christian Käser(@dfyx):@ylluminarious (maybe @elia and @meh): I have some weird problems with opal-phaser ---------------------------------------------------------------------------------------------------- [22:47:30] Christian Käser(@dfyx):I'm trying to write a wrapper for the "Phaser Isometric plug-in" ---------------------------------------------------------------------------------------------------- [22:47:40] Christian Käser(@dfyx):Beginning with the following: ---------------------------------------------------------------------------------------------------- [22:47:57] Christian Käser(@dfyx):```ruby module Phaser module Plugin class Isometric def initialize(game) @native = %x{ new Phaser.Plugin.Isometric(#{game.to_n}) } end end end end ``` ---------------------------------------------------------------------------------------------------- [22:48:52] Christian Käser(@dfyx):For some reason I get `Uncaught NoMethodError: undefined method `Isometric' for Plugin` even though the debugger confirms that the method exists on the native object ---------------------------------------------------------------------------------------------------- [22:50:00] meh.(@meh):how are you calling it? ---------------------------------------------------------------------------------------------------- [22:51:18] meh.(@meh):also you should `include Native` in `Isometric` and call `super(\`new whatever\`)` instead of assigning to `@native` yourself ---------------------------------------------------------------------------------------------------- [23:35:06] George Plymale II(@ylluminarious):@dfyx hey, sorry for the delayed response. yes, as @meh said, i think you're missing an `include Native` for that class to work. ---------------------------------------------------------------------------------------------------- [23:39:29] George Plymale II(@ylluminarious):i personally use `` @native = `new Foo()` `` over ``super(`new Foo()`)``, but that's just me ---------------------------------------------------------------------------------------------------- ############################## [2015-08-11] ############################## [02:27:09] Jikku Jose(@JikkuJose):@fkchang oh cool; do you have an idea to an approximate timeline? ---------------------------------------------------------------------------------------------------- [07:01:04] Elia Schito(@elia):@dfyx try with `new (window.Phaser.Plugin.Isometric)()` the problem could be that each of the modules define a closure variable with the name of the module shadowing the originals. ---------------------------------------------------------------------------------------------------- [07:03:45] Bernhard Weichel(@bwl21):Is there a simple method to serialize any object to string. I tried .to_json (does not serialize class instances by default); I also tried to_yaml which did not work at all. I get undefined method. ---------------------------------------------------------------------------------------------------- [07:05:02] Elia Schito(@elia):Unfortunately there's no serialization support to date ---------------------------------------------------------------------------------------------------- [07:24:18] Bernhard Weichel(@bwl21):to_json works somehow, at least with Array , Hash etc. I will try to implement something for me using instance_variables. But it seems that opal generates some Instance variables like `@constructor` ---------------------------------------------------------------------------------------------------- [07:25:05] Elia Schito(@elia):Those are unaviodable afaik as they come from JavaScript ---------------------------------------------------------------------------------------------------- [07:29:13] Bernhard Weichel(@bwl21):I am starting some refactorings in my application and want to compare the result of the current implementation with the result of the new implementation. In particular I am integrating a new parser for abc and need to implement a transformer to my music model which shall provide exactly the same result. Maybe there is is something on the js - level I could use for that. ---------------------------------------------------------------------------------------------------- [07:29:49] Bernhard Weichel(@bwl21):what happens if the application has an instance-variable called `@constructor`? ---------------------------------------------------------------------------------------------------- [07:30:56] Elia Schito(@elia):not sure but it migth be translated to this.constructor$ ---------------------------------------------------------------------------------------------------- [07:31:05] Elia Schito(@elia):if it's not it should :) ---------------------------------------------------------------------------------------------------- [07:32:02] Bernhard Weichel(@bwl21): ---------------------------------------------------------------------------------------------------- [07:32:04] Bernhard Weichel(@bwl21):i see ---------------------------------------------------------------------------------------------------- [07:34:05] Bernhard Weichel(@bwl21): ---------------------------------------------------------------------------------------------------- [07:36:17] Bernhard Weichel(@bwl21):``` def initialize(name) @name = name @constructor = "foo" end ``` compiles to in http://opalrb.org/try/# ``` def.$initialize = function(name) { var self = this; self.name = name; return self.constructor = "foo"; }; ``` ---------------------------------------------------------------------------------------------------- [07:38:37] Elia Schito(@elia):@bwl21 would you mind opening an issue for this? ---------------------------------------------------------------------------------------------------- [15:12:08] George Plymale II(@ylluminarious):@dfyx interestingly enough, `Phaser.Plugin.Isometric` does not seem to work out of the box even in regular js: http://jsbin.com/lafacefobu/edit?html,js,console. ---------------------------------------------------------------------------------------------------- [15:12:39] George Plymale II(@ylluminarious):btw, if you'd like, you can chat about this at http://gitter.im/orbitalimpact/opal-phaser ---------------------------------------------------------------------------------------------------- [15:12:49] Christian Käser(@dfyx):@ylluminarious I got it working. It was a problem somewhere else ---------------------------------------------------------------------------------------------------- [15:13:00] George Plymale II(@ylluminarious):ah, ok, great :) ---------------------------------------------------------------------------------------------------- [16:09:02] Forrest Chang(@fkchang):@JikkuJose not really, I wrapped rails gem that included some coffeescript frontend to google maps, I call the coffeescript, but am likely to make a more ruby-ified interface in pure opal ---------------------------------------------------------------------------------------------------- [16:18:08] Mitch VanDuyn(@catmando):Anybody know why after upgrading to rails 4, and latest opal, opal-rails, etc. Opal rspecs don't run? I can browse opal-spec and the test links are there and the code is there all mapped. But nothing happens. ---------------------------------------------------------------------------------------------------- [20:29:08] Jared White(@jaredcwhite):Any news etc. I should link to for tomorrow's Opalist issue? ---------------------------------------------------------------------------------------------------- [20:51:46] Mitch VanDuyn(@catmando):still not getting why rspec won't run... ```ruby #spec-opal/test_spec.rb require 'opal' require 'opal-rspec' describe 'a spec' do puts "defining stuff" it 'has successful examples' do puts "running the test" 'I run'.should =~ /run/ end end ``` prints "defining stuff" to the console, but never runs the tests... rails-4.2.3 opal-rails-0.8.0 opal-rspec-0.4.3 any clues anybody? ---------------------------------------------------------------------------------------------------- [21:06:10] Mitch VanDuyn(@catmando):Just tried a clean rails-4.2.3 app, added opal-rails, and the above test_spec, same result... test loads, puts defining stuff, but the test itself never runs. If I do a `bundle exec rake opal:spec` everything is fine. ---------------------------------------------------------------------------------------------------- [21:20:14] Mitch VanDuyn(@catmando):Moving back to opal-rails 7.0 and everything seems good again... is opal-rspec... seems like there might be some missing instructions in the opal-rails 8.0 instructions??? @elia any ideas? ---------------------------------------------------------------------------------------------------- [21:34:02] Mitch VanDuyn(@catmando):@elia seems like the instructions are missing the fact that you need to call autorun in your example (or more typically in your spec_helper file)... Shall I do a PR on the doc for this? ---------------------------------------------------------------------------------------------------- [22:12:02] Forrest Chang(@fkchang):@jaredcwhite will submit my article soon ---------------------------------------------------------------------------------------------------- [22:12:17] Forrest Chang(@fkchang):@catmando taking from your last post you figured it out? ---------------------------------------------------------------------------------------------------- [22:12:50] Mitch VanDuyn(@catmando):@fkchang - assuming I am correct and its a wee documentation bug ---------------------------------------------------------------------------------------------------- [23:08:20] Forrest Chang(@fkchang):@jaredcwhite submitted ---------------------------------------------------------------------------------------------------- [23:08:35] Jared White(@jaredcwhite):@fkchang Eeeeeexcellent! ---------------------------------------------------------------------------------------------------- [23:33:40] Mitch VanDuyn(@catmando):I remember a conversation about speeding up things in development mode by turning off/on something... it was in the last week or so, but I can't find it. ---------------------------------------------------------------------------------------------------- ############################## [2015-08-12] ############################## [00:34:57] Elia Schito(@elia):@catmando please do the PR, here's kinda late but I'll check stuff tomorrow ---------------------------------------------------------------------------------------------------- [00:36:14] Elia Schito(@elia):the conversation you re referring to I think is that about collapsing certain assets to a single file ---------------------------------------------------------------------------------------------------- [00:37:13] Elia Schito(@elia):to avoid the humongous number of script src tags in dev ---------------------------------------------------------------------------------------------------- [00:37:47] Elia Schito(@elia):🌝😴 ---------------------------------------------------------------------------------------------------- [02:11:31] Rick Carlino(@RickCarlino):So does Opal keep a binding object? ---------------------------------------------------------------------------------------------------- [07:34:09] Elia Schito(@elia):@RickCarlino no ---------------------------------------------------------------------------------------------------- [10:35:02] Mitch VanDuyn(@catmando):@elia @adambeynon @meh @vais I am seeing a change between 0.7 and 0.8 that I can't figure out: I am using rails-react to prerender opal. To do this rails-react looks for a components.js file that should require all the components to be loaded into V8 for prerendering. So in 0.7 I simply required 'opal' plus any other gems that I was using as well as the actual components. All worked fine. In 0.8 here is what I see (poking with the debugger and the rubyracer interface into the JS engine) : Opal seems to have been loaded fine, but the rest of the requires are simply not there. Other normal JS code in the components.js file after the requires executes just fine. I am wondering if the way loading and requires has changed somehow and I have to do something more to get all this required code to have been actually loaded into the Opal name space? Thanks in advance. ---------------------------------------------------------------------------------------------------- [10:41:35] Elia Schito(@elia):@catmando Try with `Opal.require('application')` where `application` is the name of your main file ---------------------------------------------------------------------------------------------------- [11:10:56] Mitch VanDuyn(@catmando):I tried with load and that helps. What is the difference? ---------------------------------------------------------------------------------------------------- [11:11:19] Elia Schito(@elia):same diff that require and load have in MRI ---------------------------------------------------------------------------------------------------- [11:11:28] Elia Schito(@elia):require will do it just once ---------------------------------------------------------------------------------------------------- [11:13:07] Mitch VanDuyn(@catmando):Gotcha ---------------------------------------------------------------------------------------------------- [11:13:44] Elia Schito(@elia):that's the price for having requires behave like they do in MRI (sequence, if checks, etc) ---------------------------------------------------------------------------------------------------- [11:14:01] Elia Schito(@elia):and for having sourcemaps play nicely :) ---------------------------------------------------------------------------------------------------- [12:05:52] Mitch VanDuyn(@catmando):@elia - thanks. I figured it was something like that looking at the following. My question is how does this get generated and how can I duplicate it when running in react-rails? Is there a method that will generate this block? ``` // ``` ---------------------------------------------------------------------------------------------------- [12:09:37] Mitch VanDuyn(@catmando):Or do i need to worry about it? ---------------------------------------------------------------------------------------------------- [12:18:58] Elia Schito(@elia):@catmando Yeah, sure, sorry :) The method is `Opal::Processor.load_asset_code(sprockets_env, name)` ---------------------------------------------------------------------------------------------------- [12:20:07] Elia Schito(@elia):the mark as loaded are for stubs and non-opal libraries which are marked as required before the main is required ---------------------------------------------------------------------------------------------------- [12:20:54] Elia Schito(@elia):so for example `require 'jquery'` inside of an opal file will result in a noop ---------------------------------------------------------------------------------------------------- [17:00:50] Jared White(@jaredcwhite):Opalist #9 is out! https://opalist.curated.co/issues/9 ---------------------------------------------------------------------------------------------------- [17:03:36] George Plymale II(@ylluminarious)::clap: ---------------------------------------------------------------------------------------------------- [17:32:28] Mitch VanDuyn(@catmando):@elia - thanks for the help... reactive_record and its friends upgraded to latest opal and all specs passing ---------------------------------------------------------------------------------------------------- [17:33:14] Mitch VanDuyn(@catmando):@jaredcwhite NICE! ---------------------------------------------------------------------------------------------------- [17:47:12] Elia Schito(@elia):@catmando 👍🏼 ---------------------------------------------------------------------------------------------------- [19:04:48] Rick Carlino(@RickCarlino):@jaredcwhite :clap: Awesome! ---------------------------------------------------------------------------------------------------- ############################## [2015-08-13] ############################## [10:12:41] Martin Becker(@Thermatix):umm, Hi, I'm trying to integrate sprockets and opal and well I think I got it working, sort of, the browser returns 200 for the resources. the mime types is set correctly... only nothing is returned and I don't know why and i'm still fairly new to sprockets so I was wondering if you could tell me what I'm doing wrong? Here's a [gist](https://gist.github.com/Thermatix/6c7d579a4962cc905d72) with what I've got so far. ---------------------------------------------------------------------------------------------------- [19:57:51] meh.(@meh):@vais more splat fixes, can you check if we're passing relevant specs and enable them please? ---------------------------------------------------------------------------------------------------- ############################## [2015-08-14] ############################## [13:57:07] Elia Schito(@elia):can you post the command you tried? ---------------------------------------------------------------------------------------------------- [13:57:16] Elia Schito(@elia):also there's a `--gem` option ---------------------------------------------------------------------------------------------------- [13:57:47] Samuel Gaus(@gausie):ooh ---------------------------------------------------------------------------------------------------- [13:57:53] Samuel Gaus(@gausie):well from the root folder of xcpretty I used ---------------------------------------------------------------------------------------------------- [13:57:54] Samuel Gaus(@gausie):opal -I ./lib/xcpretty/ -c ./lib/xcpretty.rb > xcpretty.js ---------------------------------------------------------------------------------------------------- [13:58:19] Elia Schito(@elia):`opal -I ./lib/ -c ./lib/xcpretty.rb > xcpretty.js` ---------------------------------------------------------------------------------------------------- [13:58:24] Elia Schito(@elia):try this ---------------------------------------------------------------------------------------------------- [13:58:37] Samuel Gaus(@gausie):same error message unfortunately ---------------------------------------------------------------------------------------------------- [13:59:05] Samuel Gaus(@gausie):wait hang on ---------------------------------------------------------------------------------------------------- [13:59:07] Samuel Gaus(@gausie):wrong copy buffer ---------------------------------------------------------------------------------------------------- [14:01:26] Samuel Gaus(@gausie):oh an improvement! ---------------------------------------------------------------------------------------------------- [14:01:36] Samuel Gaus(@gausie):but now I've got `can't find file: "shellwords" in ["/usr/local/lib/ruby/gems/2.2.0/gems/opal-0.8.0/opal", "/usr/local/lib/ruby/gems/2.2.0/gems/opal-0.8.0/stdlib", "/usr/local/lib/ruby/gems/2.2.0/gems/opal-0.8.0/lib", "/Users/gausie/Projects/xcpretty/lib"]` ---------------------------------------------------------------------------------------------------- [14:04:39] Samuel Gaus(@gausie):I assume that shellwords isnt implemented in Opal yet ---------------------------------------------------------------------------------------------------- [14:04:54] Elia Schito(@elia):yep, that's right ---------------------------------------------------------------------------------------------------- [14:05:01] Samuel Gaus(@gausie):shame! ---------------------------------------------------------------------------------------------------- [14:05:04] Elia Schito(@elia)::S ---------------------------------------------------------------------------------------------------- [14:05:07] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [14:05:11] Samuel Gaus(@gausie):so close :P ---------------------------------------------------------------------------------------------------- [14:05:36] Elia Schito(@elia):consider that a contribution opportunity! :P ---------------------------------------------------------------------------------------------------- [14:05:52] Samuel Gaus(@gausie):time to learn Ruby! ---------------------------------------------------------------------------------------------------- [14:06:37] Elia Schito(@elia):looking forward to the PR! :eyes: ---------------------------------------------------------------------------------------------------- [14:07:15] Samuel Gaus(@gausie):i’m not entirely sure how Opal works internally, but is there a contribution opportunity in writing a JS module that matches the shellwords API? ---------------------------------------------------------------------------------------------------- [14:08:19] Samuel Gaus(@gausie):ah I see how this works actually ---------------------------------------------------------------------------------------------------- [14:08:25] Samuel Gaus(@gausie):yeah i’ll give it a go ---------------------------------------------------------------------------------------------------- [14:08:27] Samuel Gaus(@gausie):next week ---------------------------------------------------------------------------------------------------- [14:09:14] Elia Schito(@elia):the internal implementation could very well be in js ---------------------------------------------------------------------------------------------------- [14:09:58] Samuel Gaus(@gausie):yeah cause I’m looking at https://github.com/opal/opal/blob/master/stdlib/time.rb for example, anad that’s clearly not a full implementation of Ruby’s Time class. Is that just unfinished or is there more code I’m missing? ---------------------------------------------------------------------------------------------------- [14:11:15] Elia Schito(@elia):there's also https://github.com/opal/opal/blob/master/opal/corelib/time.rb ---------------------------------------------------------------------------------------------------- [14:11:30] Samuel Gaus(@gausie):ok. what causes something to go in stdlib vs corelib? ---------------------------------------------------------------------------------------------------- [14:11:36] Elia Schito(@elia):but yeah, not complete: https://github.com/opal/opal/blob/master/spec/filters/unsupported/time.rb ---------------------------------------------------------------------------------------------------- [14:11:54] Elia Schito(@elia):generally we follow what Ruby does ---------------------------------------------------------------------------------------------------- [14:12:10] Elia Schito(@elia):core is stuff is already loaded when you start the interpreter ---------------------------------------------------------------------------------------------------- [14:12:18] Elia Schito(@elia):stdlib is stuff you need to require ---------------------------------------------------------------------------------------------------- [14:12:31] Samuel Gaus(@gausie):ok understood ---------------------------------------------------------------------------------------------------- [14:13:07] Elia Schito(@elia):this is stuff that waits to be fixed for time https://github.com/opal/opal/blob/master/spec/filters/bugs/time.rb ---------------------------------------------------------------------------------------------------- [14:13:53] Elia Schito(@elia):there's a really good contributing guide mainly written by @vais here: https://github.com/opal/opal/blob/master/CONTRIBUTING.md ---------------------------------------------------------------------------------------------------- [14:59:28] Martin Becker(@Thermatix):If any one wants to know, I got opal integrated with sprockets although not perfectly, nothing in my pre-compiled files actually do anything, I.e `puts 'Hello World!'` doesn't actually output to the console. ---------------------------------------------------------------------------------------------------- [16:52:30] Forrest Chang(@fkchang):@Thermatix I was never clear on what exactly you were trying to do, opal already uses sprockets to do requires and is integrated w/sprockets in various ways, opal-server, etc. ---------------------------------------------------------------------------------------------------- [18:02:14] Forrest Chang(@fkchang):So my previous idea of being able to require on demand opal stuff in the browser w/o having to install the gems and setup your app to have it, has been done for js https://gist.github.com/mathisonian/c325dbe02ea4d6880c4e ---------------------------------------------------------------------------------------------------- [18:02:35] Forrest Chang(@fkchang):With require_remote and require_js in opal-irb, we could do similar ---------------------------------------------------------------------------------------------------- [20:58:03] Qqwy / Wiebe-Marten(@Qqwy):I have a question: In a JS library I use, I'm required to pass on function objects (`x = function(){code here}`). How can I manage to do this from Opal without stepping outside of the Ruby side of things? ---------------------------------------------------------------------------------------------------- [22:09:12] Forrest Chang(@fkchang):@Qqwy I'd need more details, but know that a lambda maps to a function ---------------------------------------------------------------------------------------------------- [22:10:19] Elia Schito(@elia):@Qqwy functions are mapped directly as procs/lambdas ---------------------------------------------------------------------------------------------------- [01:19:52] Vais Salikhov(@vais):@meh :+1: I'll try to take a look this weekend ---------------------------------------------------------------------------------------------------- [11:50:15] Bozhidar Batsov(@bbatsov):https://www.youtube.com/watch?t=64&v=6Co0qmCvgq0 ---------------------------------------------------------------------------------------------------- [11:50:33] Bozhidar Batsov(@bbatsov):My Opal talk’s video is up ^^ ---------------------------------------------------------------------------------------------------- [11:50:55] Elia Schito(@elia)::clapper: :eyeglasses: ---------------------------------------------------------------------------------------------------- [12:37:42] Qqwy / Wiebe-Marten(@Qqwy):Is there a way to compile opal code from the command line? ---------------------------------------------------------------------------------------------------- [12:38:11] Elia Schito(@elia):@Qqwy sure: `opal -c myapp.rb > myapp.js` ---------------------------------------------------------------------------------------------------- [12:38:14] Qqwy / Wiebe-Marten(@Qqwy):e.g. `opal-compile ruby/input.rb javascript/output.js` ? ---------------------------------------------------------------------------------------------------- [12:38:28] Qqwy / Wiebe-Marten(@Qqwy):Oh, that was fast! :-) ---------------------------------------------------------------------------------------------------- [12:38:34] Elia Schito(@elia)::D lol ---------------------------------------------------------------------------------------------------- [12:39:05] Qqwy / Wiebe-Marten(@Qqwy):Thanks a lot! ---------------------------------------------------------------------------------------------------- [12:39:12] Elia Schito(@elia):there's also a bunch of options you might be interested in, check them out with `opal -h` ---------------------------------------------------------------------------------------------------- [12:40:23] Qqwy / Wiebe-Marten(@Qqwy):Reading through them now... Is there a way to automatically have opal compile files in a certain directory whenever they change? ---------------------------------------------------------------------------------------------------- [12:41:09] Elia Schito(@elia):I suggest using fsevent ---------------------------------------------------------------------------------------------------- [12:42:21] Elia Schito(@elia):sorry, I meant fswatch ---------------------------------------------------------------------------------------------------- [12:42:24] Elia Schito(@elia):@Qqwy https://github.com/emcrisostomo/fswatch ---------------------------------------------------------------------------------------------------- [12:45:08] Qqwy / Wiebe-Marten(@Qqwy):Thank you! ---------------------------------------------------------------------------------------------------- [13:53:13] Samuel Gaus(@gausie):Hi all. I've not got a huge amount of experience with Ruby, but am looking at compiling an existing Ruby library using Opal (https://github.com/supermarin/xcpretty). Finding it hard to know where to start - any ideas? ---------------------------------------------------------------------------------------------------- [13:55:09] Samuel Gaus(@gausie):I'm trying to use the command posting above, but all the requires are not resolving. ---------------------------------------------------------------------------------------------------- [13:56:13] Elia Schito(@elia):You can add paths to look up with the `-I` option ---------------------------------------------------------------------------------------------------- [13:56:38] Samuel Gaus(@gausie):yeah i tried that but it I still get `can't find file: "xcpretty/version"` ---------------------------------------------------------------------------------------------------- [13:56:46] Samuel Gaus(@gausie):(thanks for your quick response by the way) ---------------------------------------------------------------------------------------------------- [13:56:51] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- ############################## [2015-08-15] ############################## [05:23:10] Qqwy / Wiebe-Marten(@Qqwy):@fkchang, @elia: All right, more details. I'm trying to make Opal interface with the JS library Phaser (phaser.io) I was attempting to copy over this example to Opal code after calling `Phaser = Native(\`Phaser\`)` http://phaser.io/examples/v2/basics/02-click-on-an-image ---------------------------------------------------------------------------------------------------- [05:26:02] Qqwy / Wiebe-Marten(@Qqwy):To create a new game in Phaser, one calls the `game = new Phaser.Game()` method with some variables like screen size, but the last parameter is an JS Object containing the names of the functions that are to be called 1) `preload`: before the game is created 2) `create`: at the start of the game 3) `update`: Run once per frame (+-60x a second) afterwards. ---------------------------------------------------------------------------------------------------- [05:27:41] Qqwy / Wiebe-Marten(@Qqwy):As can be seen in the linked example, here they link to function names in the way that JS allows it, but when trying to move this code over to Opal, I get complaints that the functions cannot be executed. This is not strange as Ruby method calls don't need () behind them, whereas in JS the () are the difference between calling a function and passing a function. ---------------------------------------------------------------------------------------------------- [05:29:01] Qqwy / Wiebe-Marten(@Qqwy):I tried creating the `create` and `preload` functions (not messing with update at all yet) as procs with syntax like `create = Proc.new do ...code here... end` ---------------------------------------------------------------------------------------------------- [05:29:14] Qqwy / Wiebe-Marten(@Qqwy):but still Phaser would complain that the passed arguments could not be called as functions ---------------------------------------------------------------------------------------------------- [06:49:17] Bernhard Weichel(@bwl21):How can I get the methods / keys of a Native - object? I have the example in http://opalrb.org/try/?code:%0Aa%3D%25x%7B%0A%20%20%7B%22foo%22%3A%20%22bar%22%2C%20%22next%22%3A%20%22this%20is%20next%22%7D%0A%7D%0A%0Ab%20%3D%20Native(a)%0A%0Aputs%20b%5B%3Afoo%5D%0A%0Aputs%20b.keys%0Aputs%20b.methods%0A ```ruby a=%x{ {"foo": "bar", "next": "this is next"} } b = Native(a) puts b[:foo] puts b.keys puts b.methods ``` Background is, that I want to wrap a JS library (abc2svg) and need to clone the JS Objects. ---------------------------------------------------------------------------------------------------- [06:50:05] Vais Salikhov(@vais):@meh re your earlier request, please see https://github.com/opal/opal/pull/1060 (it's a little disappointing, but we're moving in the right direction :wink: ) ---------------------------------------------------------------------------------------------------- [07:24:08] Bernhard Weichel(@bwl21):@bbatsov thanks for the cool presentation ---------------------------------------------------------------------------------------------------- [08:32:54] Torsten Rüger(@dancinglightning):@ryanstout when trying to get the hover to work on dom nodes i ran into https://github.com/voltrb/volt/issues/266 , could you have a quick look if that is really a bug or me misunderstanding things. ---------------------------------------------------------------------------------------------------- [17:32:04] Adam Jahn(@ajjahn): ---------------------------------------------------------------------------------------------------- [17:35:00] Adam Jahn(@ajjahn):> we are still on rails 3.2 .... i think that is problematic? I am getting > ```` Bundler could not find compatible versions for gem "sprockets": In snapshot (Gemfile.lock): sprockets (2.2.3) In Gemfile: opal-rspec (>= 0) x86-mingw32 depends on opal (< 0.9, >= 0.7.0) x86-mingw32 depends on sprockets (~> 3.1) x86-mingw32 Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict. ```` Has there been any developments as far as using opal 0.8.0 with rails 3.2 due to the older version of sprockets? Or is rails 3.2 stuck with using opal 0.7.2? ---------------------------------------------------------------------------------------------------- [21:39:13] George Plymale II(@ylluminarious):@Qqwy if you're interested with working with phaser and opal, check out [opal-phaser](https://github.com/orbitalimpact/opal-phaser) ---------------------------------------------------------------------------------------------------- [21:44:32] Elia Schito(@elia):@ajjahn alas you're right and for rails 3.2 you're stuck with 0.7 ---------------------------------------------------------------------------------------------------- [21:45:42] Elia Schito(@elia):@ajjahn anything you needed in particular from 0.8? maybe we can do something either locally in your app or backporting fixes ---------------------------------------------------------------------------------------------------- [21:48:41] Adam Jahn(@ajjahn):@elia I haven't run into anything I need yet. I assume 0.7.2 will suffice. First time I've tried opal-rails on rails 3.2 app. ---------------------------------------------------------------------------------------------------- [21:51:14] Elia Schito(@elia):@ajjahn great, let me know if there's anything I can help with (the most unfortunate thing in 0.7 is that sourcemaps are kinda broken) ---------------------------------------------------------------------------------------------------- [21:53:32] Adam Jahn(@ajjahn):Yeah, I did notice that. I think I'll survive on this project without them. Thanks for you help. ---------------------------------------------------------------------------------------------------- [21:53:43] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:36:26] Qqwy / Wiebe-Marten(@Qqwy):@ylluminarious : Wow, thanks a lot for pointing me there! And there I thought for a moment that the two wouldn't play nice together. Thank you very much! :smile: ---------------------------------------------------------------------------------------------------- [23:35:11] George Plymale II(@ylluminarious):@Qqwy you're very welcome :). also, if you feel like chatting about it, you can use [our gitter room](http://gitter.im/orbitalimpact/opal-phaser). ---------------------------------------------------------------------------------------------------- ############################## [2015-08-16] ############################## [17:44:34] George Plymale II(@ylluminarious):@Qqwy try `$$.setInterval` or `$$.setTimeout` ---------------------------------------------------------------------------------------------------- [17:46:10] George Plymale II(@ylluminarious):http://opalrb.org/try/?code:action%20%3D%20Proc.new%20%7B%20%60console.log(%22test%22)%60%20%7D%0A%24%24.setInterval(action%2C%2010%20) ---------------------------------------------------------------------------------------------------- [17:49:04] Bernhard Weichel(@bwl21): @ylluminarious what is $$? why does this work? ---------------------------------------------------------------------------------------------------- [17:51:35] George Plymale II(@ylluminarious):@bwl21 i'm pretty sure it's just the `window` object, but i'll have to look at opal's source to be sure ---------------------------------------------------------------------------------------------------- [17:56:32] Qqwy / Wiebe-Marten(@Qqwy):Wow, that's amazing! Good to know that $$ points to the window object ---------------------------------------------------------------------------------------------------- [18:05:08] Bernhard Weichel(@bwl21):@Qqwy You can make it even more rubyesc http://opalrb.org/try/?code:%0Adef%20setTimeout(time%2C%20%26block)%0A%20%20%24%24.setTimeout(block%2C%20time)%0Aend%0A%0Aputs%20%22starting%22%0A%0AsetTimeout(3000)%20do%20%0A%20%20puts%20%22hugo%22%0Aend%0A I wonder if this is part of Opal ? ---------------------------------------------------------------------------------------------------- [18:05:54] Bernhard Weichel(@bwl21):``` def setTimeout(time, &block) $$.setTimeout(block, time) end puts "starting" setTimeout(3000) do puts "hugo" end ``` ---------------------------------------------------------------------------------------------------- [18:06:09] George Plymale II(@ylluminarious):@bwl21 nice ---------------------------------------------------------------------------------------------------- [18:11:43] Bernhard Weichel(@bwl21):found an answer how to get the methods / keys of a Native - object? I have the example in ``` a=%x{ {"foo": "bar", "next": "this is next"} } b = Native(a) puts %x{Object.keys(#{b.to_n})} ``` ---------------------------------------------------------------------------------------------------- [18:12:07] Bernhard Weichel(@bwl21):is there a better solution for this? ---------------------------------------------------------------------------------------------------- [18:13:19] Bernhard Weichel(@bwl21):see http://opalrb.org/try/?code:%0Aa%3D%25x%7B%0A%20%20%7B%22foo%22%3A%20%22bar%22%2C%20%22next%22%3A%20%22this%20is%20next%22%7D%0A%7D%0A%0Ab%20%3D%20Native(a)%0A%0Aputs%20b%5B%3Afoo%5D%0A%0Aputs%20b.keys%0Aputs%20b.methods%0A# ---------------------------------------------------------------------------------------------------- [18:45:36] Samuel Gaus(@gausie):hey i'm trying to write an implementation of an unimplemented stdlib for Opal. Is it acceptable for it to depend on a third-party library and if so how is it best to "require" it? ---------------------------------------------------------------------------------------------------- [18:48:43] meh.(@meh):gausie, acceptable for inclusion in Opal? ---------------------------------------------------------------------------------------------------- [18:54:44] Samuel Gaus(@gausie):yeah ---------------------------------------------------------------------------------------------------- [18:54:52] Samuel Gaus(@gausie):currently trying to implement Shellwords ---------------------------------------------------------------------------------------------------- [18:55:02] Samuel Gaus(@gausie):against the spec ---------------------------------------------------------------------------------------------------- [18:55:43] meh.(@meh):gausie, eeh, we'd rather not have third-party libs inside Opal, unless it's really really required ---------------------------------------------------------------------------------------------------- [18:56:37] Samuel Gaus(@gausie):*in regex even :P ---------------------------------------------------------------------------------------------------- [18:56:40] Samuel Gaus(@gausie):well shellwords requires some complex parser logic because javascript doesnt support lookbehinds in javascript ---------------------------------------------------------------------------------------------------- [18:57:05] Samuel Gaus(@gausie):it's probably doable without ---------------------------------------------------------------------------------------------------- [18:57:09] Samuel Gaus(@gausie):it would just be a lot harder ---------------------------------------------------------------------------------------------------- [18:57:31] meh.(@meh):how big would the dependency be? and what's its license? ---------------------------------------------------------------------------------------------------- [18:59:55] Samuel Gaus(@gausie):there are a number to choose from, and i havent started actually using one yet. i've just been meeting unit tests and hit a wall. ---------------------------------------------------------------------------------------------------- [19:01:20] meh.(@meh):gausie, the biggest concerns are license compatibility and unused code from the third party library ---------------------------------------------------------------------------------------------------- [19:02:48] Samuel Gaus(@gausie):understood ---------------------------------------------------------------------------------------------------- [19:02:53] Samuel Gaus(@gausie):i'll keep working on it anyway ---------------------------------------------------------------------------------------------------- [19:02:59] Samuel Gaus(@gausie):without a librat ---------------------------------------------------------------------------------------------------- [19:03:01] Samuel Gaus(@gausie):*library ---------------------------------------------------------------------------------------------------- [19:03:26] Samuel Gaus(@gausie):another one that i was thinking of working on that would hugely benefit from a library instead of implementation from scratch is REXML ---------------------------------------------------------------------------------------------------- [22:16:57] Forrest Chang(@fkchang):@Qqwy you can make it more rubyesque like this http://funkworks.blogspot.com/2015/04/ruby-fying-javascript-timeout.html ---------------------------------------------------------------------------------------------------- [22:17:08] Forrest Chang(@fkchang):opal browser also wraps timeout and interval ---------------------------------------------------------------------------------------------------- [22:35:43] Qqwy / Wiebe-Marten(@Qqwy):@fkchang: Thank you! ---------------------------------------------------------------------------------------------------- [08:34:38] Colin Gunn(@balmoral):@bbatsov excellent presentation :+1: ---------------------------------------------------------------------------------------------------- [09:13:43] Bernhard Weichel(@bwl21):Still could not find a solution... How can I get the methods / keys of a Native - object? I have the example in http://opalrb.org/try/?code:%0Aa%3D%25x%7B%0A%20%20%7B%22foo%22%3A%20%22bar%22%2C%20%22next%22%3A%20%22this%20is%20next%22%7D%0A%7D%0A%0Ab%20%3D%20Native(a)%0A%0Aputs%20b%5B%3Afoo%5D%0A%0Aputs%20b.keys%0Aputs%20b.methods%0A ---------------------------------------------------------------------------------------------------- [14:07:06] Dexter Tzu(@dextertzu):does anyone know of any good opal documentation/tutorials ? ---------------------------------------------------------------------------------------------------- [14:16:59] meh.(@meh):@vais @elia ping ---------------------------------------------------------------------------------------------------- [14:22:18] Elia Schito(@elia):@meh pong ---------------------------------------------------------------------------------------------------- [14:22:47] meh.(@meh):I'm getting a cannot load such file -- racc/parser.rb when running specs on my bridging-redux branch ---------------------------------------------------------------------------------------------------- [14:22:56] meh.(@meh):and why is it needed by the tests? ---------------------------------------------------------------------------------------------------- [14:22:59] meh.(@meh):what could cause that? ---------------------------------------------------------------------------------------------------- [14:23:00] Elia Schito(@elia):@danny-tang @astonj has a good list of materials ---------------------------------------------------------------------------------------------------- [14:25:31] meh.(@meh):elia, trying from opal-repl it requires it with no problem ---------------------------------------------------------------------------------------------------- [14:26:20] meh.(@meh):mh ---------------------------------------------------------------------------------------------------- [14:26:27] meh.(@meh):looks like it's requiring racc/parser.rb instead of racc/parser ---------------------------------------------------------------------------------------------------- [14:27:29] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [14:27:48] meh.(@meh):in the grammar bullcrap, let's see if fixing that fixes it in the specs ---------------------------------------------------------------------------------------------------- [14:28:10] meh.(@meh):kinda ---------------------------------------------------------------------------------------------------- [14:28:15] meh.(@meh):another error now ---------------------------------------------------------------------------------------------------- [14:31:04] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [14:31:11] meh.(@meh):right ---------------------------------------------------------------------------------------------------- [14:47:58] meh.(@meh):well, shit is running, that's something ---------------------------------------------------------------------------------------------------- [14:48:09] meh.(@meh):and now it's probably in an infinite recursion ---------------------------------------------------------------------------------------------------- [14:49:08] meh.(@meh):@elia is there a way to get the reason of failures/errors printed before finishing to run all the specs? ---------------------------------------------------------------------------------------------------- [14:49:28] meh.(@meh):or a way to figure out which spec is getting stuck so I can kill it ---------------------------------------------------------------------------------------------------- [14:49:41] meh.(@meh):or something ---------------------------------------------------------------------------------------------------- [14:49:42] meh.(@meh):or to run just a group of specs ---------------------------------------------------------------------------------------------------- [15:57:57] Elia Schito(@elia):Sorry AFK, you can pass a PATTERN env to run select specs ---------------------------------------------------------------------------------------------------- [15:59:53] meh.(@meh):yeah, I saw ---------------------------------------------------------------------------------------------------- [15:59:56] meh.(@meh):any way to run the specs in chrome? ---------------------------------------------------------------------------------------------------- [16:00:01] meh.(@meh):need a debugger ---------------------------------------------------------------------------------------------------- [16:00:47] Elia Schito(@elia):try rackup ---------------------------------------------------------------------------------------------------- [16:01:00] meh.(@meh):bundle exec rackup? ---------------------------------------------------------------------------------------------------- [16:01:21] meh.(@meh):seems to be doing something, we'll see ---------------------------------------------------------------------------------------------------- [16:01:40] meh.(@meh):yeah, noice ---------------------------------------------------------------------------------------------------- [16:01:41] meh.(@meh):thanks ---------------------------------------------------------------------------------------------------- [16:02:25] Elia Schito(@elia):or rake mspec:specs:build or something like that should build a static js ---------------------------------------------------------------------------------------------------- [16:03:00] meh.(@meh):nah, rackup is doing its job ---------------------------------------------------------------------------------------------------- [16:03:06] meh.(@meh):now the painful part ---------------------------------------------------------------------------------------------------- [17:38:46] Qqwy / Wiebe-Marten(@Qqwy):I have a question: Is there a nice way to use setTimeout and setInterval using Opal? ---------------------------------------------------------------------------------------------------- ############################## [2015-08-17] ############################## [21:12:00] Elia Schito(@elia):trying to get ancestor.$$super ---------------------------------------------------------------------------------------------------- [21:12:14] meh.(@meh):elia, basically, our alias before didn't afraid of anything ---------------------------------------------------------------------------------------------------- [21:12:33] meh.(@meh):elia, check if there is a #dump method in the first place ---------------------------------------------------------------------------------------------------- [21:12:42] Elia Schito(@elia):I see ---------------------------------------------------------------------------------------------------- [21:12:52] meh.(@meh):since we lack marshalling ---------------------------------------------------------------------------------------------------- [21:12:54] meh.(@meh):that may be the issue ---------------------------------------------------------------------------------------------------- [21:13:02] meh.(@meh):the error is dumb tho, I'll fix that ---------------------------------------------------------------------------------------------------- [21:13:10] meh.(@meh):it should just raise if it can't find it ---------------------------------------------------------------------------------------------------- [21:13:35] Elia Schito(@elia):indeed: ```NameError: undefined method `dump' for class `Class'``` ---------------------------------------------------------------------------------------------------- [21:15:22] meh.(@meh):should be as easy as adding a dummy marshal module ---------------------------------------------------------------------------------------------------- [21:15:25] meh.(@meh):if we don't have one already ---------------------------------------------------------------------------------------------------- [21:15:34] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [21:16:45] Elia Schito(@elia):meh this raises an old question ---------------------------------------------------------------------------------------------------- [21:17:17] Elia Schito(@elia):should such a module go to stdlib (being a stub) or in corelib as in MRI? ---------------------------------------------------------------------------------------------------- [21:18:40] Elia Schito(@elia):defining self.dump(*) is enough to make opal-jquery specs pass ---------------------------------------------------------------------------------------------------- [21:20:10] meh.(@meh):elia, good question ---------------------------------------------------------------------------------------------------- [21:20:17] meh.(@meh):I have no idea :D ---------------------------------------------------------------------------------------------------- [21:20:32] meh.(@meh):I think ---------------------------------------------------------------------------------------------------- [21:21:44] meh.(@meh):we should just have a nice unsupported.rb in core ---------------------------------------------------------------------------------------------------- [21:21:50] meh.(@meh):and put all the unsupported core stuff there ---------------------------------------------------------------------------------------------------- [21:21:53] meh.(@meh):including the String business ---------------------------------------------------------------------------------------------------- [21:22:18] Elia Schito(@elia):if we had a stripped down version kinda like mruby it would be a nobrainer as one can choose it and cherry pick the stuff he really needs ---------------------------------------------------------------------------------------------------- [21:22:39] meh.(@meh):elia, well, it's already possible ---------------------------------------------------------------------------------------------------- [21:22:46] meh.(@meh):most things are cherry-pickable from opal ---------------------------------------------------------------------------------------------------- [21:22:49] meh.(@meh):we just have to publicize the fact ---------------------------------------------------------------------------------------------------- [21:22:54] meh.(@meh):I'll take care of it ---------------------------------------------------------------------------------------------------- [21:23:15] meh.(@meh):after I'm done with these numeric failures ---------------------------------------------------------------------------------------------------- [21:23:26] Elia Schito(@elia):deal :) ---------------------------------------------------------------------------------------------------- [21:28:15] Elia Schito(@elia):need to add https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in#Array_iteration_and_for...in to the bookmarks ---------------------------------------------------------------------------------------------------- [21:29:17] Elia Schito(@elia):"just write vanilla JS"… of course ---------------------------------------------------------------------------------------------------- [21:31:06] Forrest Chang(@fkchang):@elia thx ---------------------------------------------------------------------------------------------------- [21:31:24] meh.(@meh):I hate these specs with all my heart ---------------------------------------------------------------------------------------------------- [21:31:32] meh.(@meh):fucking coercion ---------------------------------------------------------------------------------------------------- [21:31:35] meh.(@meh):sometimes it should raise an ArgumentError ---------------------------------------------------------------------------------------------------- [21:31:41] meh.(@meh):this is retarded ---------------------------------------------------------------------------------------------------- [21:31:42] meh.(@meh):sometimes a TypeError ---------------------------------------------------------------------------------------------------- [21:32:31] Elia Schito(@elia):@fkchang feel free to send a PR to update the README ;) ---------------------------------------------------------------------------------------------------- [21:32:47] Forrest Chang(@fkchang):@elia can do ---------------------------------------------------------------------------------------------------- [21:33:18] Elia Schito(@elia):repo is opal-rails ---------------------------------------------------------------------------------------------------- [21:52:57] meh.(@meh):elia, is there a way to just run a group of specs? ---------------------------------------------------------------------------------------------------- [21:53:03] meh.(@meh):with PATTERN I have to specify every file ---------------------------------------------------------------------------------------------------- [21:53:41] Elia Schito(@elia):I think it accepts globs ---------------------------------------------------------------------------------------------------- [21:57:00] meh.(@meh):I think I tried but it failed some fixtures ---------------------------------------------------------------------------------------------------- [21:58:25] Elia Schito(@elia):Checking ---------------------------------------------------------------------------------------------------- [21:59:55] meh.(@meh):might have been just the stuff I was trying to test tho ---------------------------------------------------------------------------------------------------- [22:01:16] Elia Schito(@elia):PATTERN is passed to `Dir.[]` in `rake mspec_node` ---------------------------------------------------------------------------------------------------- [22:01:29] meh.(@meh):PATTERN="spec/rubyspec/core/numeric/*" ---------------------------------------------------------------------------------------------------- [22:01:38] meh.(@meh):guess I need *_spec.rb ---------------------------------------------------------------------------------------------------- [22:02:00] meh.(@meh):yep ---------------------------------------------------------------------------------------------------- [22:02:01] meh.(@meh):all good ---------------------------------------------------------------------------------------------------- [22:02:22] Elia Schito(@elia):I'll update the CONTRIBUTING.md instructions and the desc ---------------------------------------------------------------------------------------------------- [23:49:29] meh.(@meh):@elia you there? ---------------------------------------------------------------------------------------------------- [23:50:16] meh.(@meh):guess not ---------------------------------------------------------------------------------------------------- [13:45:31] meh.(@meh):@vais when you have time take a look at the numeric-redux branch please ---------------------------------------------------------------------------------------------------- [15:42:15] Jared White(@jaredcwhite):@fkchang I use a similar convention in my code (aka Timeout.new(500) do). Love it :) ---------------------------------------------------------------------------------------------------- [16:53:19] Forrest Chang(@fkchang):@jaredcwhite it just makes sense to "rubyfy" it, OO is your friend ---------------------------------------------------------------------------------------------------- [19:07:25] Forrest Chang(@fkchang):@elia ping ---------------------------------------------------------------------------------------------------- [19:13:02] Elia Schito(@elia):@fkchang pong ---------------------------------------------------------------------------------------------------- [19:30:27] meh.(@meh):@elia can you check if the bridging-redux stuff works with opal-jquery? ---------------------------------------------------------------------------------------------------- [19:30:34] meh.(@meh):I think it's the only user of bridging outside core ---------------------------------------------------------------------------------------------------- [19:30:41] meh.(@meh):if that works I'm gonna merge it ---------------------------------------------------------------------------------------------------- [19:32:23] Elia Schito(@elia):Yesterday I did a quick check on opalrspec and seemed to block the execution but lacked the time to go deeper ---------------------------------------------------------------------------------------------------- [19:34:37] Elia Schito(@elia):@meh I'lol try on jq but probably not before 2hrs ---------------------------------------------------------------------------------------------------- [19:35:03] Elia Schito(@elia):lol 'twas I'll ---------------------------------------------------------------------------------------------------- [19:35:07] meh.(@meh):elia, there's time, just finished making Rational fully compliant, Complex is next ---------------------------------------------------------------------------------------------------- [19:35:58] Elia Schito(@elia):cool ---------------------------------------------------------------------------------------------------- [19:41:33] meh.(@meh):elia, but really, that bug should be unrelated in opal-rspec ---------------------------------------------------------------------------------------------------- [19:41:42] meh.(@meh):if the specs pass stuff must be working in this case ---------------------------------------------------------------------------------------------------- [19:41:53] meh.(@meh):it's something so basic and deep that it would break everything ---------------------------------------------------------------------------------------------------- [19:42:06] meh.(@meh):as in, the specs wouldn't even run in the first place ---------------------------------------------------------------------------------------------------- [19:50:23] Forrest Chang(@fkchang):@elia opal-haml question, if you use the :opal section, string interpolation uses the view/controller variables and not the opal variables. Is there a way to do opal interpolation? i.e. ---------------------------------------------------------------------------------------------------- [19:51:14] Forrest Chang(@fkchang):```haml :opal date = Date.now "The date is #{date}" # error is no date method or variable, which there is none in the view/controller ``` ---------------------------------------------------------------------------------------------------- [19:51:40] Forrest Chang(@fkchang):I can concatenate the string myself, but a surprise ---------------------------------------------------------------------------------------------------- [19:53:16] Elia Schito(@elia):Meh, yeah need to check it works on master, tbh don't remember if I tried that first ---------------------------------------------------------------------------------------------------- [20:01:02] Elia Schito(@elia):@fkchang kids bedtime, will check your question later when I actually able to understand;) ---------------------------------------------------------------------------------------------------- [20:05:09] meh.(@meh):> isNaN(undefined) ---------------------------------------------------------------------------------------------------- [20:05:13] meh.(@meh):false ---------------------------------------------------------------------------------------------------- [20:05:15] meh.(@meh):true ---------------------------------------------------------------------------------------------------- [20:05:16] meh.(@meh):for the love of god why ---------------------------------------------------------------------------------------------------- [20:05:19] meh.(@meh):> isNaN(null) ---------------------------------------------------------------------------------------------------- [20:47:40] Elia Schito(@elia):``` Number.isNaN = Number.isNaN || function(value) { return typeof value === "number" && isNaN(value); } ``` ---------------------------------------------------------------------------------------------------- [20:48:03] Elia Schito(@elia):https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN ---------------------------------------------------------------------------------------------------- [20:48:22] meh.(@meh):I know, I worked around it ---------------------------------------------------------------------------------------------------- [20:48:28] meh.(@meh):it's still pants on head retarded ---------------------------------------------------------------------------------------------------- [20:49:11] meh.(@meh):well, looks like I fixed a bunch of numeric bugs as well ---------------------------------------------------------------------------------------------------- [20:49:24] meh.(@meh):you're broken travis ---------------------------------------------------------------------------------------------------- [20:49:36] Elia Schito(@elia):@elia is laughing ---------------------------------------------------------------------------------------------------- [20:50:12] meh.(@meh):it's failing the rspec stuff ---------------------------------------------------------------------------------------------------- [20:50:16] meh.(@meh):dunno why ---------------------------------------------------------------------------------------------------- [20:50:40] Elia Schito(@elia):lemme check ---------------------------------------------------------------------------------------------------- [20:50:56] meh.(@meh):and looking at that link is killing my browser ---------------------------------------------------------------------------------------------------- [20:53:58] Elia Schito(@elia):btw opal-jquery: ``` TypeError: 'undefined' is not an object (evaluating 'ancestor.$$super') ``` ---------------------------------------------------------------------------------------------------- [20:54:47] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [20:55:17] meh.(@meh):elia, can you quickly setup a static html/js file I can feed chrome? ---------------------------------------------------------------------------------------------------- [20:55:43] meh.(@meh):also it's a weird spec that was checking for something unrelated which I just added to math.rb ---------------------------------------------------------------------------------------------------- [20:55:54] meh.(@meh):I think at least ---------------------------------------------------------------------------------------------------- [20:55:57] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [20:55:58] meh.(@meh):kek ---------------------------------------------------------------------------------------------------- [20:56:02] meh.(@meh):come on, who wrote that spec ---------------------------------------------------------------------------------------------------- [20:58:02] meh.(@meh):elia, it's all your fault ---------------------------------------------------------------------------------------------------- [20:58:35] Elia Schito(@elia)::sweat: ---------------------------------------------------------------------------------------------------- [20:59:01] Elia Schito(@elia):``` Diff: @@ -1,2 +1,33881 @@ -5\n +(function(undefined) { + if (typeof(this.Opal) !== 'undefined') { + console.warn('Opal already loaded. Loading twice can cause troubles, please fix your setup.'); + return this.Opal; + } + ``` ---------------------------------------------------------------------------------------------------- [20:59:40] meh.(@meh):I just ran the rspec specs locally and it works, why is it still broken ---------------------------------------------------------------------------------------------------- [20:59:51] meh.(@meh):ah no, it was another commit ---------------------------------------------------------------------------------------------------- [20:59:54] meh.(@meh):everything is right ---------------------------------------------------------------------------------------------------- [21:00:03] Elia Schito(@elia):somehow's outputting the contents of the script instead of "5\n" ---------------------------------------------------------------------------------------------------- [21:00:15] meh.(@meh):elia, no no, it was checking the output ---------------------------------------------------------------------------------------------------- [21:00:22] meh.(@meh):but it was testing for nowhere in the output to be a 5\n ---------------------------------------------------------------------------------------------------- [21:00:29] meh.(@meh):and I had to add some constants in Math ---------------------------------------------------------------------------------------------------- [21:00:33] meh.(@meh):and one ended with 5\n ---------------------------------------------------------------------------------------------------- [21:01:29] Elia Schito(@elia):heh, weak test ---------------------------------------------------------------------------------------------------- [21:04:29] Elia Schito(@elia):@fkchang `"asdfasdfsa \#{date} asdfdasf"` should work ---------------------------------------------------------------------------------------------------- [21:04:40] Elia Schito(@elia):notice the escape backslash ---------------------------------------------------------------------------------------------------- [21:04:58] meh.(@meh):there ---------------------------------------------------------------------------------------------------- [21:10:36] Elia Schito(@elia):this is the opal-rspec code that is broken with bridging-redux (and makes opal-jquery specs fail) ---------------------------------------------------------------------------------------------------- [21:10:42] Elia Schito(@elia):``` module Marshal class << self # Duplicates any mock objects before serialization. Otherwise, # serialization will fail because methods exist on the singleton class. def dump_with_mocks(object, *rest) if ::RSpec::Mocks.space.nil? || !::RSpec::Mocks.space.registered?(object) || NilClass === object dump_without_mocks(object, *rest) else dump_without_mocks(object.dup, *rest) end end alias_method :dump_without_mocks, :dump undef_method :dump alias_method :dump, :dump_with_mocks end end ``` ---------------------------------------------------------------------------------------------------- [21:10:55] Elia Schito(@elia):the offending line is ` alias_method :dump_without_mocks, :dump` ---------------------------------------------------------------------------------------------------- [21:11:10] meh.(@meh):and the error was? ---------------------------------------------------------------------------------------------------- [21:11:27] Elia Schito(@elia):apparently obj.$$super in `Opal.alias` is undefined ---------------------------------------------------------------------------------------------------- [21:11:46] Elia Schito(@elia):thus the subsequent while dies ---------------------------------------------------------------------------------------------------- [21:11:51] meh.(@meh):I think I know the problem ---------------------------------------------------------------------------------------------------- ############################## [2015-08-18] ############################## [22:27:43] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [22:28:02] Elia Schito(@elia):wrt metaclasses I always dream about finishing up this inception implementation: https://github.com/elia/inception.rb ---------------------------------------------------------------------------------------------------- [22:40:22] Elia Schito(@elia):@meh I'm thinking about moving guides from the site repo to the opal repo and maintain them by on *-stable branches ---------------------------------------------------------------------------------------------------- [22:40:38] meh.(@meh):why not have branches in the site repo? ---------------------------------------------------------------------------------------------------- [22:40:57] Elia Schito(@elia):because it's too far ---------------------------------------------------------------------------------------------------- [22:41:03] Elia Schito(@elia):and I'm lazy ---------------------------------------------------------------------------------------------------- [22:41:16] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [22:41:25] Elia Schito(@elia):and you can commit changelog and docs updatees along with a code change ---------------------------------------------------------------------------------------------------- [22:41:31] Elia Schito(@elia):yeh :D ---------------------------------------------------------------------------------------------------- [22:42:34] Elia Schito(@elia):And I want to do the same for docs with different sets for corelib, stdlib and opal (need a better name for this, I mean the lib/ dir) ---------------------------------------------------------------------------------------------------- [22:43:39] Elia Schito(@elia):@meh :point_up: ehm, you need to add a changelog entry with the remaining charge :battery: ---------------------------------------------------------------------------------------------------- [22:43:55] meh.(@meh):yeah, I'll do that when I'm done ---------------------------------------------------------------------------------------------------- [22:44:02] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:58:35] meh.(@meh):@elia there's a problem ---------------------------------------------------------------------------------------------------- [22:58:48] Elia Schito(@elia):ugh ---------------------------------------------------------------------------------------------------- [22:58:59] meh.(@meh):spec/rubyspec/core/module/fixtures/classes.rb spec/opal/core/module/fixtures/classes.rb ---------------------------------------------------------------------------------------------------- [22:59:07] meh.(@meh):those two files are the same and they both get compiled in ---------------------------------------------------------------------------------------------------- [22:59:08] meh.(@meh):and they collide ---------------------------------------------------------------------------------------------------- [22:59:34] meh.(@meh):or more likey, there's something broken with undef_method :P ---------------------------------------------------------------------------------------------------- [22:59:45] meh.(@meh):I mean, with the redefinition of undef'd methods ---------------------------------------------------------------------------------------------------- [22:59:55] meh.(@meh):but I'm getting two calls to undef_method for the same class and same method name ---------------------------------------------------------------------------------------------------- [22:59:58] meh.(@meh):from two different files ---------------------------------------------------------------------------------------------------- [23:00:05] meh.(@meh):I don't know which of the two should be fixed ---------------------------------------------------------------------------------------------------- [23:00:13] meh.(@meh):to have two files with the same contents ---------------------------------------------------------------------------------------------------- [23:00:20] meh.(@meh):but it sounds like a really bad idea ---------------------------------------------------------------------------------------------------- [23:03:04] Elia Schito(@elia):uhm, so the two files have the same module path? ---------------------------------------------------------------------------------------------------- [23:03:23] Elia Schito(@elia):maybe we can just run rubyspecs and our copy separately ---------------------------------------------------------------------------------------------------- [23:06:48] meh.(@meh):it's a bug in undef too ---------------------------------------------------------------------------------------------------- [23:06:51] meh.(@meh):but better fix both ---------------------------------------------------------------------------------------------------- [23:09:09] meh.(@meh):elia, nope, it's not a bug in undef_method ---------------------------------------------------------------------------------------------------- [23:09:11] meh.(@meh):it's the proper behavior ---------------------------------------------------------------------------------------------------- [23:09:17] meh.(@meh):it's a bug in how we run things ---------------------------------------------------------------------------------------------------- [23:10:15] Elia Schito(@elia):Probably some of the once cloned rubyspec dirs can go away now ---------------------------------------------------------------------------------------------------- [23:10:43] Elia Schito(@elia):But I think running rubyspecs separately is the right thing ---------------------------------------------------------------------------------------------------- [23:14:58] meh.(@meh):well, I can't even run the specs until that's fixed ---------------------------------------------------------------------------------------------------- [23:17:45] Elia Schito(@elia):comment this line (or the following alternatively) in testing.rake: ---------------------------------------------------------------------------------------------------- [23:17:49] Elia Schito(@elia):` specs = add_specs.(:shared, shared)` ---------------------------------------------------------------------------------------------------- [23:19:00] Elia Schito(@elia):does that make sense? not sure I follow completely (I'm tired) ---------------------------------------------------------------------------------------------------- [23:20:55] meh.(@meh):I don't know, I've never touched those files ---------------------------------------------------------------------------------------------------- [23:21:00] meh.(@meh):but it does weird things after I commented that lin ---------------------------------------------------------------------------------------------------- [23:21:05] meh.(@meh):the problem is the opal/ stuff ---------------------------------------------------------------------------------------------------- [23:21:22] meh.(@meh):wait actually ---------------------------------------------------------------------------------------------------- [23:21:25] meh.(@meh):yeah, shared should work ---------------------------------------------------------------------------------------------------- [23:21:36] meh.(@meh):now I'm starting to think it was even shadowing issues ---------------------------------------------------------------------------------------------------- [23:21:46] meh.(@meh):because I'm getting a bunch of unrelated failures without the shared stuff ---------------------------------------------------------------------------------------------------- [23:21:47] Elia Schito(@elia):I see to failures keeping only rubyspecs ---------------------------------------------------------------------------------------------------- [23:21:55] meh.(@meh):what are they? ---------------------------------------------------------------------------------------------------- [23:22:11] Elia Schito(@elia):``` 1. StandardError is a superclass of ThreadError NameError: uninitialized constant Object::ThreadError 2. Module#include does not override existing constants in modules and classes Expected "a" to equal "b" ``` ---------------------------------------------------------------------------------------------------- [23:22:18] meh.(@meh):yeah, I'm seeing those too ---------------------------------------------------------------------------------------------------- [23:22:30] Elia Schito(@elia):At least it's consistent :) ---------------------------------------------------------------------------------------------------- [23:28:23] meh.(@meh):on one hand, we now have opal and rubyspecs run separately ---------------------------------------------------------------------------------------------------- [23:28:38] meh.(@meh):on the other now we're down at 5903 actual rubyspecs running ---------------------------------------------------------------------------------------------------- [23:34:04] Elia Schito(@elia):well the opal/shared stuff is still valuable with its 883 passing specs ---------------------------------------------------------------------------------------------------- [23:34:20] Elia Schito(@elia):on the other hand some of them overlap with rubyspec ---------------------------------------------------------------------------------------------------- [23:34:22] meh.(@meh):yeah but we can't boast about passing 6k+ rubyspecs anymore :( ---------------------------------------------------------------------------------------------------- [23:34:33] meh.(@meh):poor vais ---------------------------------------------------------------------------------------------------- [23:34:33] Elia Schito(@elia):ha! yeah ---------------------------------------------------------------------------------------------------- [23:34:35] meh.(@meh):he'll be disappoint ---------------------------------------------------------------------------------------------------- [23:35:57] Elia Schito(@elia):yep, -114 ---------------------------------------------------------------------------------------------------- [23:36:30] Elia Schito(@elia):in the meanwhile was thinking about passing a SUITE env var to select the suite: ``` case when pattern custom = Dir[pattern] custom &= rubyspecs if whitelist_pattern specs = add_specs.(:custom, custom) when ENV['SUITE'] == 'opal' specs = add_specs.(:shared, shared) when ENV['SUITE'] == 'rubyspec' specs = add_specs.(:rubyspecs, rubyspecs) else warn 'Please provide at lease one of the following ENV vars:' warn 'PATTERN # e.g. env PATTERN="spec/rubyspec/core/numeric/**_spec.rb"' warn 'SUITE # can be either SUITE=opal or SUITE=rubyspec' exit 1 end ``` ---------------------------------------------------------------------------------------------------- [23:37:23] Elia Schito(@elia):the specs stuff is ugly and needs refactoring, but after all they're just runners ---------------------------------------------------------------------------------------------------- [23:43:07] meh.(@meh):let's see what travis thinks about it ---------------------------------------------------------------------------------------------------- [23:47:12] meh.(@meh):he didn't like it ---------------------------------------------------------------------------------------------------- [23:47:49] meh.(@meh):ah no it did ---------------------------------------------------------------------------------------------------- [23:47:53] meh.(@meh):they're the shadowed failures ---------------------------------------------------------------------------------------------------- [23:48:08] Elia Schito(@elia):that needs be ported to the mspec_phantom task too and the whole travis config re-arranged ---------------------------------------------------------------------------------------------------- [23:48:32] meh.(@meh):I removed the test run from phantom ---------------------------------------------------------------------------------------------------- [23:48:34] meh.(@meh):what was it for? ---------------------------------------------------------------------------------------------------- [23:48:59] Elia Schito(@elia):excercises a different code path ---------------------------------------------------------------------------------------------------- [23:49:08] Elia Schito(@elia):uses sprockets instead of Opal::Builder ---------------------------------------------------------------------------------------------------- [23:50:18] Elia Schito(@elia):it's valuable to get sprockets errors, also runs in a more real browser (phantom) instead of node ---------------------------------------------------------------------------------------------------- [23:51:04] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [23:51:08] meh.(@meh):I'll fix it back after I'm done with jshint ---------------------------------------------------------------------------------------------------- [23:52:32] meh.(@meh):where does the mspec_phantom one come from? ---------------------------------------------------------------------------------------------------- [23:52:41] meh.(@meh):ah, here ---------------------------------------------------------------------------------------------------- [23:52:52] meh.(@meh):eeeh ---------------------------------------------------------------------------------------------------- [23:52:54] meh.(@meh):no thanks :D ---------------------------------------------------------------------------------------------------- [23:52:57] meh.(@meh):I'll leave that to you ---------------------------------------------------------------------------------------------------- [23:54:00] Elia Schito(@elia):yeah, lol, maybe I'll do a massive cleanup, could be much simpler actually ---------------------------------------------------------------------------------------------------- [13:38:11] Elia Schito(@elia):git submodule update --init ---------------------------------------------------------------------------------------------------- [13:38:16] meh.(@meh):welp ---------------------------------------------------------------------------------------------------- [13:38:17] Elia Schito(@elia):maybe ---------------------------------------------------------------------------------------------------- [13:38:18] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [13:38:25] meh.(@meh):didn't know it had submodules ---------------------------------------------------------------------------------------------------- [13:38:27] meh.(@meh)::D ---------------------------------------------------------------------------------------------------- [13:38:36] Elia Schito(@elia):hehe ---------------------------------------------------------------------------------------------------- [13:38:41] Elia Schito(@elia):TMYK ---------------------------------------------------------------------------------------------------- [13:44:38] meh.(@meh):elia, I just tested opal-rspec on master ---------------------------------------------------------------------------------------------------- [13:44:39] meh.(@meh):it has the same issue ---------------------------------------------------------------------------------------------------- [13:44:59] meh.(@meh):it fails in `#populate_location_attributes` for the same reason ---------------------------------------------------------------------------------------------------- [13:45:38] meh.(@meh):can you verify I'm not seeing things or having cache issues please? ---------------------------------------------------------------------------------------------------- [13:46:08] meh.(@meh):and yes, I'm sure I'm on opal master ---------------------------------------------------------------------------------------------------- [13:46:13] meh.(@meh):I checked the source ---------------------------------------------------------------------------------------------------- [13:48:56] Elia Schito(@elia):u right ---------------------------------------------------------------------------------------------------- [13:49:07] Elia Schito(@elia):I think it passes on 0.8 ---------------------------------------------------------------------------------------------------- [13:50:48] Elia Schito(@elia):meh, then green light for those awesome PRs from here :traffic_light: ---------------------------------------------------------------------------------------------------- [13:51:08] Elia Schito(@elia):whatever is broken already needs fixing and doesn't depend on the PRs ---------------------------------------------------------------------------------------------------- [13:53:02] meh.(@meh):cool ---------------------------------------------------------------------------------------------------- [13:53:13] meh.(@meh):elia, I also decided it's going to be the other way around for freeze and taint ---------------------------------------------------------------------------------------------------- [13:53:18] meh.(@meh):it's opt-in ---------------------------------------------------------------------------------------------------- [13:53:23] meh.(@meh):mostly because shit will break, and warnings are ok ---------------------------------------------------------------------------------------------------- [13:53:30] meh.(@meh):but we want them to raise when running rubyspecs ---------------------------------------------------------------------------------------------------- [13:53:33] meh.(@meh):so I'm gonna add an option ---------------------------------------------------------------------------------------------------- [13:54:00] Elia Schito(@elia):fine, will check the commit once it's up ---------------------------------------------------------------------------------------------------- [13:56:26] meh.(@meh):elia, any idea where the compiler options are set up for running mspec? ---------------------------------------------------------------------------------------------------- [13:57:01] Elia Schito(@elia):we have two mspec runners ---------------------------------------------------------------------------------------------------- [13:57:10] Elia Schito(@elia):one for node and another for phantomjs ---------------------------------------------------------------------------------------------------- [13:57:19] Elia Schito(@elia):the latter integrates with sprockets ---------------------------------------------------------------------------------------------------- [13:57:41] Elia Schito(@elia):the one for node is the simpler and uses the CLI iirc ---------------------------------------------------------------------------------------------------- [13:57:46] Elia Schito(@elia):see tasks/testing.rake ---------------------------------------------------------------------------------------------------- [14:22:17] meh.(@meh):elia, check the latest cherry commit ---------------------------------------------------------------------------------------------------- [14:30:29] Elia Schito(@elia):lol, was looking at an old commit and couldn't make sense of what changed ---------------------------------------------------------------------------------------------------- [14:33:36] Elia Schito(@elia):meh, why not using a gvar, e.g. `$OPAL_OPTIONS` that can be controlled at runtime? ---------------------------------------------------------------------------------------------------- [14:34:30] Elia Schito(@elia):also warnings are noisy, if I explicitly tell opal I want the stub methods I'd rather prefer them to be silent ---------------------------------------------------------------------------------------------------- [14:40:03] meh.(@meh):elia, problem is, that's the default option ---------------------------------------------------------------------------------------------------- [14:40:05] meh.(@meh):I'll just make them warn the first time ---------------------------------------------------------------------------------------------------- [14:40:24] meh.(@meh):elia, also because the compiler options are only bound to the compilation unit ---------------------------------------------------------------------------------------------------- [14:40:29] meh.(@meh):and a gvar would get overriden ---------------------------------------------------------------------------------------------------- [14:41:29] Elia Schito(@elia):so the idea is to prepare work for per file compiler flags in the future? ---------------------------------------------------------------------------------------------------- [14:41:56] meh.(@meh):compiler flags are already per file basically ---------------------------------------------------------------------------------------------------- [14:41:59] meh.(@meh):except the config don't change with each file ---------------------------------------------------------------------------------------------------- [14:42:04] meh.(@meh):but the compilation unit is always the file ---------------------------------------------------------------------------------------------------- [14:42:05] meh.(@meh):so yeah ---------------------------------------------------------------------------------------------------- [14:43:03] Elia Schito(@elia):not sure it works as intended now ---------------------------------------------------------------------------------------------------- [14:43:11] meh.(@meh):what do you mean? ---------------------------------------------------------------------------------------------------- [14:43:41] Elia Schito(@elia):the unsupported file is a different file from rspec lib files and the check happens at runtime ---------------------------------------------------------------------------------------------------- [14:44:09] Elia Schito(@elia):also isn't the OPTIONS var bound to the closure? ---------------------------------------------------------------------------------------------------- [14:44:16] meh.(@meh):elia, it is, it is supposed to be ---------------------------------------------------------------------------------------------------- [14:44:19] meh.(@meh):it's generated for each file ---------------------------------------------------------------------------------------------------- [14:44:23] meh.(@meh):elia, also it doesn't really matter ---------------------------------------------------------------------------------------------------- [14:44:26] meh.(@meh):the default is warning ---------------------------------------------------------------------------------------------------- [14:44:35] Elia Schito(@elia):that would make the unsupported check respect the OPTIONS they've been compiled with ---------------------------------------------------------------------------------------------------- [14:44:51] meh.(@meh):elia, yeah, that's what I wanted to do ---------------------------------------------------------------------------------------------------- [14:45:00] meh.(@meh):it's a part of the runtime ---------------------------------------------------------------------------------------------------- [14:45:05] Elia Schito(@elia):compiling another file with freezing set to raise changes nothing ---------------------------------------------------------------------------------------------------- [14:45:21] meh.(@meh):elia, yeah, for now ---------------------------------------------------------------------------------------------------- [14:45:40] meh.(@meh):but I have to do it like that as things stand ---------------------------------------------------------------------------------------------------- [14:46:16] Elia Schito(@elia):ok, seemed a bit overkill to have a compile option just for that ---------------------------------------------------------------------------------------------------- [14:46:38] meh.(@meh):I couldn't find any other way to access compiler options at runtime ---------------------------------------------------------------------------------------------------- [14:46:49] meh.(@meh):for now it's gonna be like that ---------------------------------------------------------------------------------------------------- [14:46:51] Elia Schito(@elia):helpers maybe ---------------------------------------------------------------------------------------------------- [14:47:22] Elia Schito(@elia):that's fine, still don't like the OPTIONS preable in every module closure but it's internal ---------------------------------------------------------------------------------------------------- [14:47:37] Elia Schito(@elia):we can refine it with time I guess ---------------------------------------------------------------------------------------------------- [14:47:51] meh.(@meh):elia, http://sprunge.us/iCaH?js ---------------------------------------------------------------------------------------------------- [14:47:55] meh.(@meh):it's not that noisy now ---------------------------------------------------------------------------------------------------- [14:48:07] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [14:49:22] Elia Schito(@elia):`tmp/jshint.js: line 1771, col 19, Extra comma. (it breaks older versions of IE) (W070)` lol ---------------------------------------------------------------------------------------------------- [14:50:03] Elia Schito(@elia):the extra comma *is* too noisy! plz remove it :D ---------------------------------------------------------------------------------------------------- [14:50:25] meh.(@meh):it was the old version :) ---------------------------------------------------------------------------------------------------- [14:54:53] meh.(@meh):@elia ok, check now, tested nothing broke ---------------------------------------------------------------------------------------------------- [15:40:04] Elia Schito(@elia):@meh mind if I merge? ;) ---------------------------------------------------------------------------------------------------- [15:40:20] Elia Schito(@elia):I mean cherrypicking ---------------------------------------------------------------------------------------------------- [15:41:54] meh.(@meh):I'll do it ---------------------------------------------------------------------------------------------------- [15:42:13] meh.(@meh):since I have to rebase numeric-redux ---------------------------------------------------------------------------------------------------- [15:42:14] Elia Schito(@elia)::shipit: ---------------------------------------------------------------------------------------------------- [15:47:39] meh.(@meh):ok, should be good ---------------------------------------------------------------------------------------------------- [16:08:14] meh.(@meh):@elia if you can tweet about bridging-redux and cherry from the @opalrb account it could be a good idea ---------------------------------------------------------------------------------------------------- [18:03:03] Elia Schito(@elia):I removed that account a couple months ago to keep sanity but maybe it's time to give it some love : ) ---------------------------------------------------------------------------------------------------- [18:05:46] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [18:06:00] meh.(@meh):someone gotta do it ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):>> Complex(Float::NAN, 2) ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):>> Complex(Float::NAN, 2).fdiv(2) ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):=> (NaN+(1/1)*i) ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):=> (NaN+2i) ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):>> Complex(Float::NAN, 2) / 2 ---------------------------------------------------------------------------------------------------- [18:06:43] meh.(@meh):=> (NaN+1.0i) ---------------------------------------------------------------------------------------------------- [18:06:45] meh.(@meh):by the gods ---------------------------------------------------------------------------------------------------- [22:21:54] meh.(@meh):@elia ~350 more passing specs since I merged my stuff ---------------------------------------------------------------------------------------------------- [22:23:45] Elia Schito(@elia)::bouquet: ---------------------------------------------------------------------------------------------------- [22:24:14] Elia Schito(@elia):I suspected that, definitely good stuff HT :tophat: ---------------------------------------------------------------------------------------------------- [22:24:34] meh.(@meh):and almost done with the reflection bullshit ---------------------------------------------------------------------------------------------------- [22:24:50] meh.(@meh):method_added, method_removed, method_undefined, singleton_method_added, singleton_method_removed, singleton_method_undefined ---------------------------------------------------------------------------------------------------- [22:25:01] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:25:38] Elia Schito(@elia):great, need to check the status of metaclasses to see how deep they can go ---------------------------------------------------------------------------------------------------- [22:26:03] Elia Schito(@elia):and maybe we can start talking about prepend… ---------------------------------------------------------------------------------------------------- [22:26:17] meh.(@meh):hahaha ---------------------------------------------------------------------------------------------------- [22:26:22] meh.(@meh):yeah, maybe next year when I'm recharged ---------------------------------------------------------------------------------------------------- [22:27:03] Elia Schito(@elia): yeah lol ---------------------------------------------------------------------------------------------------- [22:27:38] Elia Schito(@elia):(now picturing you as the duracell :rabbit:) ---------------------------------------------------------------------------------------------------- [13:25:49] meh.(@meh):@elia ping ---------------------------------------------------------------------------------------------------- [13:26:25] Elia Schito(@elia):now I'm here :) ---------------------------------------------------------------------------------------------------- [13:26:40] meh.(@meh):elia, did you have time to test cherry with opal-jquery and opal-rspec? ---------------------------------------------------------------------------------------------------- [13:27:05] Elia Schito(@elia):yes, opal-jquery + the current opal-rspec release are ok ---------------------------------------------------------------------------------------------------- [13:27:13] meh.(@meh):cool ---------------------------------------------------------------------------------------------------- [13:27:19] Elia Schito(@elia):but ---------------------------------------------------------------------------------------------------- [13:27:24] Elia Schito(@elia):there's still an error with the updated (beta) opal-rspec ---------------------------------------------------------------------------------------------------- [13:27:37] meh.(@meh):does it work on master? ---------------------------------------------------------------------------------------------------- [13:27:37] Elia Schito(@elia):I tracked it down but had to stop ---------------------------------------------------------------------------------------------------- [13:27:42] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [13:27:47] meh.(@meh):any way I can test it myself? ---------------------------------------------------------------------------------------------------- [13:27:59] Elia Schito(@elia):sure ---------------------------------------------------------------------------------------------------- [13:28:04] Elia Schito(@elia):opal-rspec master ---------------------------------------------------------------------------------------------------- [13:28:19] Elia Schito(@elia):but don't use rake ---------------------------------------------------------------------------------------------------- [13:28:43] Elia Schito(@elia):the current suite is a bit hackish but at least expects both successes and failures ---------------------------------------------------------------------------------------------------- [13:28:52] meh.(@meh):elia, so how do I run it? ---------------------------------------------------------------------------------------------------- [13:29:15] Elia Schito(@elia):rackup is fine ---------------------------------------------------------------------------------------------------- [13:29:19] meh.(@meh):cool ---------------------------------------------------------------------------------------------------- [13:29:27] Elia Schito(@elia):@elia searching for the rake task ---------------------------------------------------------------------------------------------------- [13:29:38] meh.(@meh):by the way, I think it's a bad idea to dummy freeze and taint ---------------------------------------------------------------------------------------------------- [13:29:44] meh.(@meh):it will make people think they are working, when they are not ---------------------------------------------------------------------------------------------------- [13:30:11] Elia Schito(@elia):agree but I think a counscious opt-in is needed ---------------------------------------------------------------------------------------------------- [13:30:58] meh.(@meh):it should be opt-out if that was the case, but one can already opt-out by monkeypatching it if needed ---------------------------------------------------------------------------------------------------- [13:30:58] Elia Schito(@elia):I experimented with $OPAL_STUB_FREEZE etc. and naming apart seems easy and clear enough ---------------------------------------------------------------------------------------------------- [13:31:41] Elia Schito(@elia):yeah, I meant opting in to have them stubbed ---------------------------------------------------------------------------------------------------- [13:31:44] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [13:31:46] meh.(@meh):ok, cool ---------------------------------------------------------------------------------------------------- [13:31:50] meh.(@meh):I'll do something ---------------------------------------------------------------------------------------------------- [13:32:35] Elia Schito(@elia):oh, opal-jq passes but with the fixes above (i.e. the empty stdlib/{encoding,math}) ---------------------------------------------------------------------------------------------------- [13:33:04] Elia Schito(@elia):and stubbing the unsupported methods ---------------------------------------------------------------------------------------------------- [13:33:44] meh.(@meh):yeah I already added the deprecation stuff ---------------------------------------------------------------------------------------------------- [13:33:51] meh.(@meh):but you should find where it's requiring those ---------------------------------------------------------------------------------------------------- [13:33:59] meh.(@meh):also what methods are causing the crashes? ---------------------------------------------------------------------------------------------------- [13:34:04] meh.(@meh):freeze or dump? ---------------------------------------------------------------------------------------------------- [13:34:13] Elia Schito(@elia):freeze ---------------------------------------------------------------------------------------------------- [13:34:18] meh.(@meh):where is it using it? ---------------------------------------------------------------------------------------------------- [13:34:20] Elia Schito(@elia):meh, just a heads up, in opal-rspec the error is somewhere related to #define_example_group_method ---------------------------------------------------------------------------------------------------- [13:34:28] Elia Schito(@elia):uh dunno ---------------------------------------------------------------------------------------------------- [13:34:35] meh.(@meh):I see ---------------------------------------------------------------------------------------------------- [13:34:38] meh.(@meh):I'll check it out ---------------------------------------------------------------------------------------------------- [13:35:55] Elia Schito(@elia):heads up: the `ensure` in the above method makes the backtrace wrong (at least in safari) due to the js `finally` ---------------------------------------------------------------------------------------------------- [13:36:55] Elia Schito(@elia):and also `#populate_location_attributes` passes a nil to `Metadata.relative_path` causing it to fail ---------------------------------------------------------------------------------------------------- [13:37:11] Elia Schito(@elia):I patched it locally to ` file_path = Metadata.relative_path(file_path.to_s)` ---------------------------------------------------------------------------------------------------- [13:37:16] Elia Schito(@elia):just to keep going ---------------------------------------------------------------------------------------------------- [13:37:32] Elia Schito(@elia):hope this saves you a couple minutes :) ---------------------------------------------------------------------------------------------------- [13:37:51] meh.(@meh):with rackup I get an error ---------------------------------------------------------------------------------------------------- [13:37:54] meh.(@meh):it can't find 'rspec' ---------------------------------------------------------------------------------------------------- ############################## [2015-08-19] ############################## [13:50:32] meh.(@meh):I can't find that on github ---------------------------------------------------------------------------------------------------- [13:50:40] meh.(@meh):and blame blames you on github :P ---------------------------------------------------------------------------------------------------- [13:51:05] Elia Schito(@elia):that's because I said blame first :D ---------------------------------------------------------------------------------------------------- [13:52:13] Elia Schito(@elia):https://github.com/ruby/mspec/commit/2f0a3bc4476f576380dcf19ca4ce2f576412d1a9 ---------------------------------------------------------------------------------------------------- [13:52:13] meh.(@meh):Jannis Huebl ---------------------------------------------------------------------------------------------------- [13:52:15] meh.(@meh):no idea who that is ---------------------------------------------------------------------------------------------------- [13:52:30] Elia Schito(@elia):he was working on bignum impl ---------------------------------------------------------------------------------------------------- [13:52:57] meh.(@meh):yeah, and he fucked up everything else while trying :D ---------------------------------------------------------------------------------------------------- [13:53:23] meh.(@meh):in JS bitwise operations are 32 bit ---------------------------------------------------------------------------------------------------- [13:54:43] Elia Schito(@elia):I think you have commit access to ruby/mspec and ruby/rubyspec, otherwise just tell me what to commit or pass a patch and I'll apply ---------------------------------------------------------------------------------------------------- [13:55:23] meh.(@meh):elia, gimme a sec, I'll do some magic ---------------------------------------------------------------------------------------------------- [13:57:06] meh.(@meh):elia, ok, make our fixnum_{max, min} refer to Integer::MAX and Integer::MIN ---------------------------------------------------------------------------------------------------- [13:57:16] meh.(@meh):I doubt I have access ---------------------------------------------------------------------------------------------------- [14:01:44] Elia Schito(@elia):@meh can I give an explanation in the commit message? ---------------------------------------------------------------------------------------------------- [14:02:18] meh.(@meh):elia, "In JavaScript bitwise operations are 32 bit, and most tests that use fixnum_{max,min} are about bitwise operations." ---------------------------------------------------------------------------------------------------- [14:03:19] Elia Schito(@elia):done ---------------------------------------------------------------------------------------------------- [14:03:20] meh.(@meh):rubyspec would need a split between min/max for bitwise operations and bignum boundaries ---------------------------------------------------------------------------------------------------- [14:03:22] meh.(@meh):but that's a lot of work ---------------------------------------------------------------------------------------------------- [14:03:29] Elia Schito(@elia):ouch forgot to --author you ---------------------------------------------------------------------------------------------------- [14:03:33] meh.(@meh):nah it's fine ---------------------------------------------------------------------------------------------------- [14:03:36] meh.(@meh):I don't care about it :D ---------------------------------------------------------------------------------------------------- [14:03:37] meh.(@meh):as long as shit works ---------------------------------------------------------------------------------------------------- [14:04:13] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [15:26:11] meh.(@meh):someone forgot to enable the complex specs ◕ ◡ ◔ ---------------------------------------------------------------------------------------------------- [15:26:58] Elia Schito(@elia):: ) ---------------------------------------------------------------------------------------------------- [15:27:04] meh.(@meh):6070 :^) ---------------------------------------------------------------------------------------------------- [15:27:14] Elia Schito(@elia):there ---------------------------------------------------------------------------------------------------- [15:28:16] meh.(@meh):elia, retweet that one if you want ---------------------------------------------------------------------------------------------------- [15:28:37] Elia Schito(@elia)::smoking: :gun: did already ---------------------------------------------------------------------------------------------------- [17:31:56] meh.(@meh):man that was annoying to fix ---------------------------------------------------------------------------------------------------- [17:32:08] meh.(@meh):https://github.com/opal/opal/commit/158c71f654a56ff5e2096ad58aa647ab29665f37 ---------------------------------------------------------------------------------------------------- [17:34:21] meh.(@meh):aww shit ---------------------------------------------------------------------------------------------------- [17:35:20] meh.(@meh):>fix something ---------------------------------------------------------------------------------------------------- [17:35:21] meh.(@meh):>break something else ---------------------------------------------------------------------------------------------------- [18:36:01] meh.(@meh):that's a lie ---------------------------------------------------------------------------------------------------- [18:36:02] meh.(@meh):I fixed it ---------------------------------------------------------------------------------------------------- [18:38:18] meh.(@meh):ah, the opal specs broke ---------------------------------------------------------------------------------------------------- [18:44:19] meh.(@meh):because they're wrong ---------------------------------------------------------------------------------------------------- [21:14:26] Torsten Rüger(@dancinglightning):@elia a little bit of digging just got my load time from 14s to 400ms . Sprockets memory cache was the way s.sprockets.cache = Sprockets::Cache::MemoryStore.new(5000). should i write about that somewhere? ---------------------------------------------------------------------------------------------------- [21:51:11] Elia Schito(@elia):@dancinglightning sure! in the sprockets guide: https://github.com/opal/opalrb.org/blob/master/source/docs/using_sprockets.html.md#L1 ---------------------------------------------------------------------------------------------------- [22:27:46] Torsten Rüger(@dancinglightning):@elia ok https://github.com/opal/opalrb.org/pull/32 ---------------------------------------------------------------------------------------------------- [22:28:09] Torsten Rüger(@dancinglightning):ps noticed the getting started in the rep is much longer than online ? ---------------------------------------------------------------------------------------------------- [23:48:17] Elia Schito(@elia):Need to publish, and should probably set up Travis to build and publish at arch change (from master) ---------------------------------------------------------------------------------------------------- [03:23:31] Mitch VanDuyn(@catmando):just raised #1068 - anybody have any idea where String interpolation is implemented? I suspect its an easy fix, be happy to do it, but can't quite see where its implemented ---------------------------------------------------------------------------------------------------- [11:56:31] Elia Schito(@elia):@/all started working on better API docs, if you have comments or suggestions please let me know ---------------------------------------------------------------------------------------------------- [11:56:31] Elia Schito(@elia):http://opal.github.io/docs/ ---------------------------------------------------------------------------------------------------- [11:57:23] Elia Schito(@elia):The plan is to move guides form the opalrb.org repo and have them in the opal repo kinda like rails does ---------------------------------------------------------------------------------------------------- [12:36:11] meh.(@meh):elia, I'm done with my stuff ---------------------------------------------------------------------------------------------------- [12:36:20] meh.(@meh):we have full support for all the reflection business ---------------------------------------------------------------------------------------------------- [12:36:43] Elia Schito(@elia):great ---------------------------------------------------------------------------------------------------- [12:40:10] meh.(@meh):elia, if you want to retweet from @opalrb what I just tweeted ---------------------------------------------------------------------------------------------------- [12:46:19] Elia Schito(@elia):done ;) ---------------------------------------------------------------------------------------------------- [12:49:36] Elia Schito(@elia):-102 rubyspecs to 6k! ---------------------------------------------------------------------------------------------------- [12:50:12] Elia Schito(@elia):need to study stuff now :) ---------------------------------------------------------------------------------------------------- [13:46:54] meh.(@meh):@elia any clue where our fixnum_max is defined? ---------------------------------------------------------------------------------------------------- [13:47:24] Elia Schito(@elia):search in mspec ---------------------------------------------------------------------------------------------------- [13:47:33] meh.(@meh):I think I was looking at the wrong one ---------------------------------------------------------------------------------------------------- [13:47:56] Elia Schito(@elia):lib/mspec/helpers/numeric.rb ---------------------------------------------------------------------------------------------------- [13:48:01] meh.(@meh):our value doesn't look right at all ---------------------------------------------------------------------------------------------------- [13:48:23] Elia Schito(@elia):``` elsif guard.implementation? :opal def fixnum_max() 9007199254740991 end def fixnum_min() -9007199254740991 end ``` ---------------------------------------------------------------------------------------------------- [13:48:34] meh.(@meh):who came up with those values ---------------------------------------------------------------------------------------------------- [13:48:49] Elia Schito(@elia):need to git blame :) ---------------------------------------------------------------------------------------------------- [13:49:06] meh.(@meh):fun part is it was probably me ---------------------------------------------------------------------------------------------------- [13:49:24] Elia Schito(@elia):it's always like that with blame ---------------------------------------------------------------------------------------------------- ############################## [2015-08-20] ############################## [13:01:12] meh.(@meh):commit 51812b101b6f3675b21ab46701afee925b9c85d8 ---------------------------------------------------------------------------------------------------- [13:01:13] meh.(@meh):1 2 3 ---------------------------------------------------------------------------------------------------- [13:04:39] Torsten Rüger(@dancinglightning):@meh i got that commit, yes. The error was skip_until , not scan_until. I see the scan_until, but not the skip_until. Should be trivial though (for you :-) ---------------------------------------------------------------------------------------------------- [13:04:44] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [13:04:47] meh.(@meh):welp ---------------------------------------------------------------------------------------------------- [13:04:54] meh.(@meh):yeah, I just read _until :P ---------------------------------------------------------------------------------------------------- [13:05:20] meh.(@meh):dancinglightning, do you think you'd be able to figure out somehow what StringScanner methods parslet is using? ---------------------------------------------------------------------------------------------------- [13:05:32] meh.(@meh):so we don't do a back and forth of fixing and I just add all required methods ---------------------------------------------------------------------------------------------------- [13:05:49] Mitch VanDuyn(@catmando):@meh - so you are saying if you subclass a class in which React::Component has been included, the define_state method does not follow along? I am pretty sure that we do this all over the place. Let me check. ---------------------------------------------------------------------------------------------------- [13:06:09] meh.(@meh):catmando, I don't know, I stopped digging when you said it was a react bug :P ---------------------------------------------------------------------------------------------------- [13:06:19] Torsten Rüger(@dancinglightning):@meh i’ll have a look, but ruby being dynamic , . . ---------------------------------------------------------------------------------------------------- [13:06:24] meh.(@meh):dancinglightning, yeah, I know :P ---------------------------------------------------------------------------------------------------- [13:06:58] meh.(@meh):catmando, what I saw is that App doesn't have that method defined ---------------------------------------------------------------------------------------------------- [13:07:14] meh.(@meh):catmando, if you can give me a very small reduced testcase in just one file I can fix it, if it's an opal bug ---------------------------------------------------------------------------------------------------- [13:14:50] Martin Becker(@Thermatix):why would App not have define_sate? ---------------------------------------------------------------------------------------------------- [13:15:35] meh.(@meh):no clue ---------------------------------------------------------------------------------------------------- [13:16:22] Torsten Rüger(@dancinglightning):@meh, i see scan , rest_size, check_until , string , pos , pos= , match? , check_until , exist? , skip_until . It only instantiates scanners in 2 places, and uses surprisingly little methods actually, considering it’s a parser generator ---------------------------------------------------------------------------------------------------- [13:16:46] meh.(@meh):dancinglightning, cool, thanks ---------------------------------------------------------------------------------------------------- [13:17:37] Torsten Rüger(@dancinglightning):@meh cool would be if you could actually get parsley to work. I’d have the whole vm with interpreter in the browser. ---------------------------------------------------------------------------------------------------- [13:17:57] Martin Becker(@Thermatix):whats parsley? ---------------------------------------------------------------------------------------------------- [13:18:22] meh.(@meh):dancinglightning, well, I'm planning to replace the Ruby parser abomination we have in Opal with a parslet parser, so yeah :P ---------------------------------------------------------------------------------------------------- [13:18:42] Martin Becker(@Thermatix):question answerd ---------------------------------------------------------------------------------------------------- [13:20:14] Torsten Rüger(@dancinglightning):@meh I’ll help: you do know i have the start of a ruby parser? I mean that that is ruby i am trying to parse in my app. ---------------------------------------------------------------------------------------------------- [13:20:49] meh.(@meh):dancinglightning, I didn't know ---------------------------------------------------------------------------------------------------- [13:21:29] Torsten Rüger(@dancinglightning):https://github.com/salama/salama-reader i have kept it free off dependencies for exactly this kind of scenario ---------------------------------------------------------------------------------------------------- [13:24:04] Torsten Rüger(@dancinglightning):check out the tests, it can already do a fair bit ---------------------------------------------------------------------------------------------------- [13:29:01] Martin Becker(@Thermatix):@dancinglightning should've called it salami XD ---------------------------------------------------------------------------------------------------- [13:36:53] Torsten Rüger(@dancinglightning):@Thermatix sorry, you might have to explain that reference ---------------------------------------------------------------------------------------------------- [13:37:49] Torsten Rüger(@dancinglightning):btw parsley is misspelled parslet, a peg parser (kind of generator) ---------------------------------------------------------------------------------------------------- [13:40:18] Martin Becker(@Thermatix):no reference just salama looks like salami ---------------------------------------------------------------------------------------------------- [13:40:41] Martin Becker(@Thermatix):was a minor joke, ---------------------------------------------------------------------------------------------------- [13:40:46] Martin Becker(@Thermatix):nothing meant by it ---------------------------------------------------------------------------------------------------- [13:41:10] Torsten Rüger(@dancinglightning):ok ---------------------------------------------------------------------------------------------------- [13:41:53] meh.(@meh):dancinglightning, try with master ---------------------------------------------------------------------------------------------------- [13:41:53] Martin Becker(@Thermatix):btw, salama , i'm guessing it's used to build a VM based language like java? ---------------------------------------------------------------------------------------------------- [13:44:20] Torsten Rüger(@dancinglightning):@Thermatix close, i am building a compiling vm for ruby (in ruby) :-) ---------------------------------------------------------------------------------------------------- [13:51:35] Torsten Rüger(@dancinglightning):@meh thanks for trying, but it looks like i’s in an infinite loop. Not responding, no output, asks to kill the page after a while. The actual parse is small and works in my ruby tests. ---------------------------------------------------------------------------------------------------- [13:51:47] meh.(@meh):dancinglightning, can you break and find where the infinite loop is? ---------------------------------------------------------------------------------------------------- [13:51:52] Martin Becker(@Thermatix):lol yo dog, I heard you like ruby so I put some ruby in your ruby so you can compile some ruby XD ---------------------------------------------------------------------------------------------------- [13:52:54] Torsten Rüger(@dancinglightning):@meh, don’t know how :-( ---------------------------------------------------------------------------------------------------- [13:53:29] meh.(@meh):dancinglightning, do an opal -c file.rb and give me the output ---------------------------------------------------------------------------------------------------- [13:53:33] meh.(@meh):I'll do the debugging ---------------------------------------------------------------------------------------------------- [13:58:42] Torsten Rüger(@dancinglightning):@meh i’m using opal server (with Opal.use_gem) and pull in the whole salama gem. Opal -c says some file not found (doesn’t say which, but i guess salama) ---------------------------------------------------------------------------------------------------- [13:59:02] meh.(@meh):dancinglightning, then download the generate .js and upload it somewhere ---------------------------------------------------------------------------------------------------- [13:59:08] meh.(@meh):I just need the compile blob ---------------------------------------------------------------------------------------------------- [13:59:15] meh.(@meh):or if you're using opal server and chrome ---------------------------------------------------------------------------------------------------- [13:59:21] meh.(@meh):open the developer tools ---------------------------------------------------------------------------------------------------- [13:59:24] meh.(@meh):in the debugger there's a pause icon ---------------------------------------------------------------------------------------------------- [13:59:26] meh.(@meh):click that ---------------------------------------------------------------------------------------------------- [13:59:32] meh.(@meh):and it should stop the execution and start the debugger in there ---------------------------------------------------------------------------------------------------- [14:00:04] meh.(@meh):but since it could be a bug somewhere outside StringScanner ---------------------------------------------------------------------------------------------------- [14:00:14] meh.(@meh):giving me the blob would be a better idea, or making a repo to make it run myself ---------------------------------------------------------------------------------------------------- [14:00:27] Torsten Rüger(@dancinglightning):@meh i never get to a page to open dev tools, it just hangs. I can check in and you can clone ---------------------------------------------------------------------------------------------------- [14:00:35] meh.(@meh):fine by me ---------------------------------------------------------------------------------------------------- [14:18:08] Torsten Rüger(@dancinglightning):@meh it’s done https://github.com/salama/salama-debugger on branch diy-render . Please understand that i was in the middle of an experiment there and the app doesn’t actually do anything. But it’s pure opal (as opposed to master which is volt) and has the bug in there. Possibly creating a simple app with just salama-reader is simpler for you. Still, good luck ---------------------------------------------------------------------------------------------------- [15:07:35] meh.(@meh):dancinglightning, ok, I reduced it to a loop in Parslet::Atoms::Repetition#try ---------------------------------------------------------------------------------------------------- [15:07:53] meh.(@meh):now I just have to figure out what alignment of stars causes it to explode ---------------------------------------------------------------------------------------------------- [15:08:07] meh.(@meh):because a basic parslet parser is working ---------------------------------------------------------------------------------------------------- [15:08:11] meh.(@meh):guess that's something ---------------------------------------------------------------------------------------------------- [15:18:16] Torsten Rüger(@dancinglightning):meh can you run parslets own tests under opal? ---------------------------------------------------------------------------------------------------- [15:19:21] meh.(@meh):I think that would be hard ---------------------------------------------------------------------------------------------------- [15:20:58] Torsten Rüger(@dancinglightning):My grammar may be kind of sub optimal for testing. It has some ways of hanging that i haven't figured. Try the parslet example directory. ---------------------------------------------------------------------------------------------------- [15:22:42] meh.(@meh):yeah, looks enough ---------------------------------------------------------------------------------------------------- [15:22:50] meh.(@meh):the comments.rb thing hangs ---------------------------------------------------------------------------------------------------- [15:22:53] meh.(@meh):it's small enough ---------------------------------------------------------------------------------------------------- [15:36:42] Martin Becker(@Thermatix):umm remind me but does exec work in opal? ---------------------------------------------------------------------------------------------------- [15:36:51] Martin Becker(@Thermatix):`exec`* ---------------------------------------------------------------------------------------------------- [15:37:12] meh.(@meh):no ---------------------------------------------------------------------------------------------------- [15:37:37] meh.(@meh):maybe on node, dunno, but why would you be using node with Opal when you have MRI, Rubinius and JRuby ---------------------------------------------------------------------------------------------------- [15:40:56] Martin Becker(@Thermatix):node? ---------------------------------------------------------------------------------------------------- [15:40:59] Martin Becker(@Thermatix):i'm not using node ---------------------------------------------------------------------------------------------------- [15:41:01] Martin Becker(@Thermatix):I mean ---------------------------------------------------------------------------------------------------- [15:41:20] Martin Becker(@Thermatix):in opal you have ```` and %x{} ---------------------------------------------------------------------------------------------------- [15:41:26] Martin Becker(@Thermatix):... ---------------------------------------------------------------------------------------------------- [15:41:35] Martin Becker(@Thermatix):back ticks and `%x{}` ---------------------------------------------------------------------------------------------------- [15:42:00] Martin Becker(@Thermatix):wouldn't `exec` do the same but for a variable or normal string and convert it to raw javascript? ---------------------------------------------------------------------------------------------------- [15:43:44] meh.(@meh):Thermatix, you want eval ---------------------------------------------------------------------------------------------------- [15:44:26] meh.(@meh):just include opal-parser ---------------------------------------------------------------------------------------------------- [15:48:14] Torsten Rüger(@dancinglightning):@Thermatix maybe you want to check out native module too http://dev.mikamai.com/post/79398725537/using-native-javascript-objects-from-opal ---------------------------------------------------------------------------------------------------- [15:49:42] meh.(@meh):Thermatix, but yeah, why do you need eval? it's usually a sign you're doing something wrong ---------------------------------------------------------------------------------------------------- [16:23:13] meh.(@meh):@dancinglightning yeah, I'll drop it for now, debugging that mess is way harder than I expected ---------------------------------------------------------------------------------------------------- [16:23:39] meh.(@meh):I'll try making StringScanner as compliant as possible ---------------------------------------------------------------------------------------------------- [16:23:41] meh.(@meh):and hope for the best ---------------------------------------------------------------------------------------------------- [16:26:32] meh.(@meh):although there is probably a compilation error in there ---------------------------------------------------------------------------------------------------- [16:26:39] meh.(@meh):with a non-catched return ---------------------------------------------------------------------------------------------------- [16:39:12] Torsten Rüger(@dancinglightning):@meh ok, when you’re done i can try and go through the parslet test and have a look. I don’t think it’s far off. ---------------------------------------------------------------------------------------------------- [16:40:23] meh.(@meh):dancinglightning, it's either a compiler bug, or a bug in StringScanner ---------------------------------------------------------------------------------------------------- [16:40:28] meh.(@meh):but it's probably the former :( ---------------------------------------------------------------------------------------------------- [16:40:39] meh.(@meh):the compiler is a total mess ---------------------------------------------------------------------------------------------------- [01:27:57] meh.(@meh):@dancinglightning can you test parslet works without the blankslate removal on master please? ---------------------------------------------------------------------------------------------------- [01:28:16] meh.(@meh):unless I'm dumb and that wasn't you ---------------------------------------------------------------------------------------------------- [01:29:59] meh.(@meh):mh, nope, blocked by exist ---------------------------------------------------------------------------------------------------- [02:34:56] meh.(@meh):@dancinglightning yeah, no luck, there's another compilation issue ---------------------------------------------------------------------------------------------------- [02:35:51] meh.(@meh):@dancinglightning at least I added the missing StringScanner methods :P ---------------------------------------------------------------------------------------------------- [11:14:44] Martin Becker(@Thermatix):could I have some clarification regarding inheritance please? I have a base class: ```ruby class Base include React::Component def initialize(native) @native = native end end ``` ---------------------------------------------------------------------------------------------------- [11:15:39] Martin Becker(@Thermatix):and then an app class: ```ruby class App < Base define_state(:logged_in) {:false} end ---------------------------------------------------------------------------------------------------- [11:15:54] Martin Becker(@Thermatix):``` (whoops) ---------------------------------------------------------------------------------------------------- [11:16:40] Martin Becker(@Thermatix):it complains Uncaught NoMethodError: undefined method `define_state' for # ---------------------------------------------------------------------------------------------------- [11:17:01] Martin Becker(@Thermatix):shouldn't it have access to `define_state`? ---------------------------------------------------------------------------------------------------- [11:17:11] Elia Schito(@elia):is define_state defined in the superclass (Base)? ---------------------------------------------------------------------------------------------------- [11:17:26] Martin Becker(@Thermatix):it's included from `include React::Component` ---------------------------------------------------------------------------------------------------- [11:17:41] Elia Schito(@elia):could be a bug ---------------------------------------------------------------------------------------------------- [11:17:49] Martin Becker(@Thermatix):since I was doing it in every class, I thought it easier to do that in a base class and then just inherit form base ---------------------------------------------------------------------------------------------------- [11:19:49] Martin Becker(@Thermatix):specificly I have `define_state(:logged_in) {:false}` inside of ```ruby before_mount do define_state(:logged_in) {:false} end ``` ---------------------------------------------------------------------------------------------------- [11:20:00] Martin Becker(@Thermatix):which is where the error is happening ---------------------------------------------------------------------------------------------------- [11:20:17] Elia Schito(@elia):which opal version? ---------------------------------------------------------------------------------------------------- [11:20:35] Martin Becker(@Thermatix):"~> 0.8" ---------------------------------------------------------------------------------------------------- [11:20:45] Elia Schito(@elia):also, does it work outside of the block? ---------------------------------------------------------------------------------------------------- [11:22:42] Martin Becker(@Thermatix):one moment, having weird issue, need to reset-server ---------------------------------------------------------------------------------------------------- [11:25:09] Martin Becker(@Thermatix):huh ---------------------------------------------------------------------------------------------------- [11:25:39] Martin Becker(@Thermatix):ok so I moved them out of the before_mount block and now it's sorta working? I mean the error's differant and just as oodd but the "undefined method" has gone away ---------------------------------------------------------------------------------------------------- [11:25:44] Martin Becker(@Thermatix):I guess it's a bug with react.rb ---------------------------------------------------------------------------------------------------- [11:32:23] Martin Becker(@Thermatix):so yeah, moving the `define_state` out of the `before_mount` block makes the problem go away, the current problem is a validation issue, something unrelated. ---------------------------------------------------------------------------------------------------- [11:32:51] Martin Becker(@Thermatix):guess I'll go bug them then, thanks ---------------------------------------------------------------------------------------------------- [11:33:19] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [11:46:52] Martin Becker(@Thermatix):Actually, I take it back, It has to be in a `before_mount block` the problem is weird though, It says that it's undefined for `App` but the actual code that causes the problem is in a separate class called `Spinner`. It's very odd ---------------------------------------------------------------------------------------------------- [11:52:24] meh.(@meh):Thermatix, can you try on master? ---------------------------------------------------------------------------------------------------- [11:55:03] Martin Becker(@Thermatix):which version is master? ---------------------------------------------------------------------------------------------------- [11:55:58] Martin Becker(@Thermatix):nvm I'll clone and install it ---------------------------------------------------------------------------------------------------- [12:01:33] Martin Becker(@Thermatix):Ok, just updated to v0.9.0-dev ---------------------------------------------------------------------------------------------------- [12:01:38] Martin Becker(@Thermatix):and it's still complaining ---------------------------------------------------------------------------------------------------- [12:02:18] Martin Becker(@Thermatix):huh, is it me or is the backtrace in the JS console more human readable? ---------------------------------------------------------------------------------------------------- [12:05:21] Martin Becker(@Thermatix):no wait, it is just me, I've been using the .min version >_< ---------------------------------------------------------------------------------------------------- [12:06:05] meh.(@meh):Thermatix, can you make a simple repo that showcases the problem? ---------------------------------------------------------------------------------------------------- [12:06:19] meh.(@meh):so I can try and see if it's an Opal issue or not ---------------------------------------------------------------------------------------------------- [12:09:34] Martin Becker(@Thermatix):ok, give me a moment ---------------------------------------------------------------------------------------------------- [12:29:06] Martin Becker(@Thermatix):https://github.com/Thermatix/sprockets_problem and then switch to branch "undefined_method_define_state" ---------------------------------------------------------------------------------------------------- [12:29:31] Martin Becker(@Thermatix):follow the notes ---------------------------------------------------------------------------------------------------- [12:29:39] Martin Becker(@Thermatix):and then just run ./executable ---------------------------------------------------------------------------------------------------- [12:29:51] Martin Becker(@Thermatix):afk, need foooods ---------------------------------------------------------------------------------------------------- [12:43:37] Martin Becker(@Thermatix):back ---------------------------------------------------------------------------------------------------- [12:57:54] Mitch VanDuyn(@catmando):@thermatix - pretty sure this is a react.rb issue - lets move it over there... ---------------------------------------------------------------------------------------------------- [12:58:28] meh.(@meh):catmando, yeah ---------------------------------------------------------------------------------------------------- [12:58:30] meh.(@meh):I've been digging ---------------------------------------------------------------------------------------------------- [12:58:33] meh.(@meh):App does not have define_state ---------------------------------------------------------------------------------------------------- [12:58:36] Torsten Rüger(@dancinglightning):@meh nice, that scanner method got me a step closer. But now i get the next missing one, skip_until ---------------------------------------------------------------------------------------------------- [12:58:38] Torsten Rüger(@dancinglightning):NoMethodError: undefined method `skip_until' for # ---------------------------------------------------------------------------------------------------- [12:58:45] meh.(@meh):dancinglightning, update again ---------------------------------------------------------------------------------------------------- [12:58:49] meh.(@meh):I implemented all the missing methods ---------------------------------------------------------------------------------------------------- [12:58:56] meh.(@meh):now it's barfing over a compilation issue ---------------------------------------------------------------------------------------------------- [12:59:11] Torsten Rüger(@dancinglightning):did update 5 minutes ago ---------------------------------------------------------------------------------------------------- [12:59:19] meh.(@meh):dancinglightning, sometimes the stdlib stuff is broken, no clue why ---------------------------------------------------------------------------------------------------- [12:59:25] meh.(@meh):reinstall the gem ---------------------------------------------------------------------------------------------------- [12:59:35] meh.(@meh):it's probably caching some stuff it shouldn't ---------------------------------------------------------------------------------------------------- [12:59:53] Torsten Rüger(@dancinglightning):working off the cloned opal rep ---------------------------------------------------------------------------------------------------- [13:00:59] Torsten Rüger(@dancinglightning):and there doesn’t seem to be a skip_until in there ---------------------------------------------------------------------------------------------------- ############################## [2015-08-21] ############################## [19:46:14] Forrest Chang(@fkchang):@all what are the general 0.8 upgrade tips? ---------------------------------------------------------------------------------------------------- [19:47:17] Forrest Chang(@fkchang):@elia seeing ```Sprockets::FileNotFound - couldn't find file 'boolean_editor.html' with type 'application/javascript':``` for the opal haml templates that worked fine on 0.7 in 0.8 for opal and opal-rails ---------------------------------------------------------------------------------------------------- [19:48:10] Elia Schito(@elia):If using sprockets and not opal-Rails you need to manually bootstrap the app with Opal.load("application") ---------------------------------------------------------------------------------------------------- [19:48:31] Elia Schito(@elia):@fkchang ^ ---------------------------------------------------------------------------------------------------- [19:50:42] Elia Schito(@elia):Here's an helper that does just that taking care of everything http://opal.github.io/docs/v0.8.0/lib/classes/Opal/Processor.html#method-c-load_asset_code ---------------------------------------------------------------------------------------------------- [19:53:09] Forrest Chang(@fkchang):@elia so in an opal-rails app, what do we need to do? ---------------------------------------------------------------------------------------------------- [19:56:06] Forrest Chang(@fkchang):is a cache clear needed? I backed off to 0.7 and I had to do that to get it to work ---------------------------------------------------------------------------------------------------- [20:00:29] Forrest Chang(@fkchang):oh, but it it didn't work, I'll try again after lunch ---------------------------------------------------------------------------------------------------- [20:05:54] Mitch VanDuyn(@catmando):is it possible to load a js file from within an Opal gems main file? For example I have ```ruby #my_fat_gem.rb if RUBY_ENGINE == 'opal' require 'foo' require 'react.js' ... else ... end ``` everything works, but unless I require react out in the application.rb it doesn't seem to load... I think the problem is something to do with the way opal require actually works... For prerendering to work I need that 'react.js' file to be loaded just like a normal js asset file? Is that possible? ---------------------------------------------------------------------------------------------------- [20:35:16] Ryan Stout(@ryanstout):@elia you around by chance? ---------------------------------------------------------------------------------------------------- [20:44:32] Elia Schito(@elia):@ryanstout kinda, but I'll try to reply ---------------------------------------------------------------------------------------------------- [20:44:50] Ryan Stout(@ryanstout):@elia actually, I figured out a solution. ---------------------------------------------------------------------------------------------------- [20:44:52] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- [21:51:00] Adam Jahn(@ajjahn):@elia or @meh (or anyone else) -- Can you offer any insight on using Browser::Event in opal-browser? Basically, I want to add a 'progress' event listener to a Browser::HTTP::Request (XMLHttpRequest) object. Maybe I'm not even barking up the right tree. ---------------------------------------------------------------------------------------------------- [21:51:52] meh.(@meh):ajjahn, I don't even know how that's done in JS :D ---------------------------------------------------------------------------------------------------- [21:52:19] Adam Jahn(@ajjahn):``` $.ajax({ xhr: function() { var xhr = new window.XMLHttpRequest(); //Upload progress xhr.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; //Do something with upload progress console.log(percentComplete); } }, false); //Download progress xhr.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; //Do something with download progress console.log(percentComplete); } }, false); return xhr; }, type: 'POST', url: "/", data: {}, success: function(data){ //Do something success-ish } }); ``` ---------------------------------------------------------------------------------------------------- [21:52:47] Adam Jahn(@ajjahn):Something like that I suppose. ---------------------------------------------------------------------------------------------------- [21:53:04] meh.(@meh):what is xhr.upload? ---------------------------------------------------------------------------------------------------- [21:53:26] meh.(@meh):ah, it's a field ---------------------------------------------------------------------------------------------------- [21:53:44] meh.(@meh):ajjahn, yeah, the upload part isn't done yet, I didn't even know it existed ---------------------------------------------------------------------------------------------------- [21:54:07] meh.(@meh):and I can't do anything until sunday 5 pm, or when I'm done getting to 400 achievements points in D3 season, it's very important :P ---------------------------------------------------------------------------------------------------- [21:54:22] Adam Jahn(@ajjahn):I don't need the upload part at this point, I haven't worked out how to hook into the download progress. ---------------------------------------------------------------------------------------------------- [21:54:43] meh.(@meh):then just pass a block to the HTTP.post ---------------------------------------------------------------------------------------------------- [21:54:52] meh.(@meh):then use #on :progress ---------------------------------------------------------------------------------------------------- [21:56:00] Adam Jahn(@ajjahn):I tried that with no luck. As far as I can tell browsing the source, progress isn't one of the callbacks being listened for. ---------------------------------------------------------------------------------------------------- [21:56:15] meh.(@meh):isn't it just a dom event? ---------------------------------------------------------------------------------------------------- [21:57:29] meh.(@meh):ah I see it ---------------------------------------------------------------------------------------------------- [21:57:34] Adam Jahn(@ajjahn):https://github.com/opal/opal-browser/blob/master/opal/browser/http/request.rb#L317 ---------------------------------------------------------------------------------------------------- [22:00:16] meh.(@meh):right, gimme a sec ---------------------------------------------------------------------------------------------------- [22:00:57] Adam Jahn(@ajjahn):Thanks. Yeah so no luck with the Request object led me here: https://github.com/opal/opal-browser/blob/master/opal/browser/event/progress.rb , but like I said, no idea if I'm on the right track. ---------------------------------------------------------------------------------------------------- [22:01:06] meh.(@meh):you are, kind of ---------------------------------------------------------------------------------------------------- [22:08:55] meh.(@meh):ajjahn, can you test the progress branch please? ---------------------------------------------------------------------------------------------------- [22:11:30] Adam Jahn(@ajjahn):Yes... ---------------------------------------------------------------------------------------------------- [22:12:45] meh.(@meh):@elia when you have time can you update opal-browser to the latest rspec/opal? ---------------------------------------------------------------------------------------------------- [22:12:51] meh.(@meh):getting some errors I have no clue about ---------------------------------------------------------------------------------------------------- [22:18:27] Adam Jahn(@ajjahn):Works! ---------------------------------------------------------------------------------------------------- [22:24:01] Adam Jahn(@ajjahn):Except, now the other events (i.e. here: https://github.com/opal/opal-browser/blob/master/opal/browser/http/request.rb#L317) aren't firing. Not even 'complete'. ---------------------------------------------------------------------------------------------------- [22:26:55] meh.(@meh):weird ---------------------------------------------------------------------------------------------------- [22:28:19] meh.(@meh):ah found the problem ---------------------------------------------------------------------------------------------------- [22:28:38] Adam Jahn(@ajjahn):The good news is I see what's going on with Event now. ---------------------------------------------------------------------------------------------------- [22:29:10] meh.(@meh):no wait I don't ---------------------------------------------------------------------------------------------------- [22:29:13] meh.(@meh):no wait I do ---------------------------------------------------------------------------------------------------- [22:29:16] meh.(@meh):ffff ---------------------------------------------------------------------------------------------------- [22:29:19] meh.(@meh):stupid Ruby ---------------------------------------------------------------------------------------------------- [22:29:26] meh.(@meh):no wait I don't :D ---------------------------------------------------------------------------------------------------- [22:30:14] meh.(@meh):ajjahn, it must be a weird interaction between Event::Target and Request ---------------------------------------------------------------------------------------------------- [22:30:34] meh.(@meh):like a method collision or something ---------------------------------------------------------------------------------------------------- [22:30:46] meh.(@meh):or super not working properly ---------------------------------------------------------------------------------------------------- [22:30:58] meh.(@meh):which I seriously hope isn't the case ---------------------------------------------------------------------------------------------------- [22:41:06] Adam Jahn(@ajjahn):Hmm, I'll keep tinkering... ---------------------------------------------------------------------------------------------------- [00:08:38] meh.(@meh):I hate you travis ---------------------------------------------------------------------------------------------------- [00:09:17] Mitch VanDuyn(@catmando):I am getting this error: ```ruby gems/sprockets-3.3.2/lib/sprockets/resolve.rb:64:in `resolve!': couldn't find file 'opal-react' with type 'application/javascript' (Sprockets::FileNotFound) from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/sprockets-3.3.2/lib/sprockets/context.rb:88:in `resolve' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/sprockets-3.3.2/lib/sprockets/legacy.rb:259:in `resolve_with_compat' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/sprockets-3.3.2/lib/sprockets/context.rb:142:in `require_asset' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:68:in `block in process_requires' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:66:in `each' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:66:in `process_requires' from /Users/mitch/.rvm/gems/ruby-2.2.2/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:45:in `evaluate' ``` The only problem is there is no `opal-react` anywhere. Not in the rails app, no in any of the gems. I did a text search and its just does not exist. I WAS referencing the gem, but removed it. I have tried doing an rm -rf tmp/cache I have blown away Gemfile.lock and reloaded. Any other ideas? ---------------------------------------------------------------------------------------------------- [00:11:26] meh.(@meh):maybe something cached by sprockets? ---------------------------------------------------------------------------------------------------- [00:11:34] meh.(@meh):or was that tmp/cache? ---------------------------------------------------------------------------------------------------- [00:11:50] meh.(@meh):try a bundle install --path foo ---------------------------------------------------------------------------------------------------- [00:41:47] Mitch VanDuyn(@catmando):@meh found it... it was my textmate being goofy... for whatever reason it missed two files, but when I just did a grep they were there! ---------------------------------------------------------------------------------------------------- [00:41:57] meh.(@meh):heh ---------------------------------------------------------------------------------------------------- [09:01:15] Can Edremitoglu(@cantonic):hey guys. Can somebody tell me what the opal-jquery equivalent of `$(document).ajaxStart()` is? ---------------------------------------------------------------------------------------------------- [09:09:39] Martin Becker(@Thermatix):I don't know about that but you can use `HTTP.post` or `HTTP.get` ---------------------------------------------------------------------------------------------------- [09:53:44] Martin Becker(@Thermatix):whats the class type of {}? ---------------------------------------------------------------------------------------------------- [09:57:32] Martin Becker(@Thermatix):wait, nvm ---------------------------------------------------------------------------------------------------- ############################## [2015-08-22] ############################## [03:37:23] Adam Jahn(@ajjahn):@meh https://github.com/opal/opal-browser/pull/39 ---------------------------------------------------------------------------------------------------- [03:38:03] meh.(@meh):ajjahn, doesn't sound right ---------------------------------------------------------------------------------------------------- [03:38:40] meh.(@meh):ajjahn, this way you're only forwarding those ---------------------------------------------------------------------------------------------------- [03:38:51] meh.(@meh):my intention was to add to @callbacks only the internal stuff ---------------------------------------------------------------------------------------------------- [03:38:56] meh.(@meh):namely the stuff in STATES ---------------------------------------------------------------------------------------------------- [03:38:59] meh.(@meh):and whatever else is handled ---------------------------------------------------------------------------------------------------- [03:39:13] meh.(@meh):the code number should be Integer ---------------------------------------------------------------------------------------------------- [03:39:17] meh.(@meh):so it should just be ---------------------------------------------------------------------------------------------------- [03:39:27] meh.(@meh):`STATES.include?(what) || Integer === what` ---------------------------------------------------------------------------------------------------- [03:39:53] meh.(@meh):also :success and :failure ---------------------------------------------------------------------------------------------------- [03:39:57] Adam Jahn(@ajjahn):That still won't work because you would need 'success' and 'failure' ---------------------------------------------------------------------------------------------------- [03:39:58] meh.(@meh):so yeah ---------------------------------------------------------------------------------------------------- [03:40:16] meh.(@meh):`STATES.include?(what) || %w[success failure].include?(what) || Integer === :what` ---------------------------------------------------------------------------------------------------- [03:40:23] meh.(@meh):erm ---------------------------------------------------------------------------------------------------- [03:40:25] meh.(@meh):`STATES.include?(what) || %w[success failure].include?(what) || Integer === what` ---------------------------------------------------------------------------------------------------- [03:40:25] meh.(@meh):there ---------------------------------------------------------------------------------------------------- [03:41:28] Adam Jahn(@ajjahn):Okay, I'll give that a go. Just a sec. ---------------------------------------------------------------------------------------------------- [03:47:09] Adam Jahn(@ajjahn):Done. ---------------------------------------------------------------------------------------------------- [03:55:40] meh.(@meh):ajjahn, do you confirm it works? ---------------------------------------------------------------------------------------------------- [04:01:32] Adam Jahn(@ajjahn):Yeah, every thing is back to normal in my code + progress events. I can look into adding some legitimate specs sometime this weekend. ---------------------------------------------------------------------------------------------------- [04:01:46] meh.(@meh):ajjahn, nah don't worry about it ---------------------------------------------------------------------------------------------------- [04:01:51] meh.(@meh):the spec running is completely broken ---------------------------------------------------------------------------------------------------- [04:01:53] meh.(@meh):has been for a long time ---------------------------------------------------------------------------------------------------- [04:02:01] meh.(@meh):browserstack must have removed our account or something ---------------------------------------------------------------------------------------------------- [04:02:04] meh.(@meh):and rspec needs updating ---------------------------------------------------------------------------------------------------- [04:05:00] Adam Jahn(@ajjahn):Gotcha. Well I feel good about it. ---------------------------------------------------------------------------------------------------- [04:05:21] meh.(@meh):thanks for looking into it ---------------------------------------------------------------------------------------------------- [12:59:21] Elia Schito(@elia):@catmando you can totally require js files but it's probably better to do that without the .js suffix ---------------------------------------------------------------------------------------------------- [13:08:18] Elia Schito(@elia):@meh will be on vacation for a couple of weeks, don't yet know if that means more Opal or not :D in the meantime can you open an issue for the opal-rspec update so I don't forget? ---------------------------------------------------------------------------------------------------- [13:55:36] Mitch VanDuyn(@catmando):@elia yeah I got it. The problem is that I want to require opaljquery but only on the client, not during prerendering. Jquery breaks Ruby racer in weird ways. Just had to move the requires out of the gem and into document ation ---------------------------------------------------------------------------------------------------- [22:29:01] Qqwy / Wiebe-Marten(@Qqwy):I am wondering how to make Opal work with http://nwjs.io/ (which enables you to build computer applications using Node, HTML, CSS and JS running in a Webkit browser shim.) ---------------------------------------------------------------------------------------------------- [22:29:57] Qqwy / Wiebe-Marten(@Qqwy):When exactly is the opal runtime neccesary? Only when I want to compile .rb code on-the-fly, or also after precompiling code to javascript? ---------------------------------------------------------------------------------------------------- [22:36:40] Elia Schito(@elia):You need the runtime when you precompile too ---------------------------------------------------------------------------------------------------- [22:49:13] meh.(@meh):Qqwy, you always need the runtime/corelib to run Opal code, you only need opal-parser if you also want `#eval` ---------------------------------------------------------------------------------------------------- [22:54:45] Torsten Rüger(@dancinglightning):@Qqwy good direction, can you make a post or something if you get that going ---------------------------------------------------------------------------------------------------- [23:22:42] George Plymale II(@ylluminarious):@Qqwy there's currently an empty opal project for nw [here](https://github.com/orbitalimpact/opal-nw) ---------------------------------------------------------------------------------------------------- [23:22:55] George Plymale II(@ylluminarious):contributions are welcome ---------------------------------------------------------------------------------------------------- ############################## [2015-08-23] ############################## [23:49:37] Qqwy / Wiebe-Marten(@Qqwy):I'm experimenting with Guard right now ---------------------------------------------------------------------------------------------------- [23:49:59] Qqwy / Wiebe-Marten(@Qqwy):(https://github.com/guard/guard) ---------------------------------------------------------------------------------------------------- [23:50:44] Qqwy / Wiebe-Marten(@Qqwy):It seems like a great idea to create an Opal guard, because that would allow for auto-rebuilding Opal applications. ---------------------------------------------------------------------------------------------------- [23:51:07] Qqwy / Wiebe-Marten(@Qqwy):(guard basically does configurable build tasks on file change) ---------------------------------------------------------------------------------------------------- [09:12:02] Elia Schito(@elia):I think putting together an "awesome Opal" site would be a good idea cc @AstonJ @ylluminarious @dancinglightning @fkchang ---------------------------------------------------------------------------------------------------- [09:37:05] Bernhard Weichel(@bwl21):@ylluminarious @Qqwy it seems to be pretty empty. I have created an NW application. But as a pity, I cannot extract an example. You could try to investigate https://github.com/bwl21/zupfnoter/blob/master/30_sources/SRC_Zupfnoter/src/controller-nw.rb This is all I did to integrate. You can see the Rakefile https://github.com/bwl21/zupfnoter/blob/master/30_sources/SRC_Zupfnoter/src/Rakefile line 86 ff is the rake task to build the apps. ---------------------------------------------------------------------------------------------------- [10:21:05] Torsten Rüger(@dancinglightning):@elia i think documentation improvements are good, but opalrb.org is where people are most likely to land, i would start by improving that ---------------------------------------------------------------------------------------------------- [21:38:04] Qqwy / Wiebe-Marten(@Qqwy):@bwl21 : That looks great. ---------------------------------------------------------------------------------------------------- [21:38:07] Qqwy / Wiebe-Marten(@Qqwy):I will try to get it to run ---------------------------------------------------------------------------------------------------- [21:38:30] Qqwy / Wiebe-Marten(@Qqwy):I myself am not that far yet; Right now I'm attempting to include opal-jquery to no avail ---------------------------------------------------------------------------------------------------- [21:40:21] Qqwy / Wiebe-Marten(@Qqwy):In the task file where I call Opal.compile() I have `require 'opal'` and `require 'opal-jquery'`. I have also tried adding `require 'opal-jquery'` to my main application.js (which right now only has a call to `alert "hello world"` that ought to work as soon as the library is included successfully) ---------------------------------------------------------------------------------------------------- [21:40:26] Qqwy / Wiebe-Marten(@Qqwy):What am I missing? ---------------------------------------------------------------------------------------------------- [22:09:58] George Plymale II(@ylluminarious):@bwl21 yeah, it is pretty empty right now. me and some other folks who own the project were planning on doing more with it, but haven't really had the time due to other projects and things getting in the way. ---------------------------------------------------------------------------------------------------- [22:11:53] George Plymale II(@ylluminarious):@elia by "awesome Opal", do you mean a site with opal documentation and tutorials or projects showcasing opal or both? ---------------------------------------------------------------------------------------------------- [22:13:04] George Plymale II(@ylluminarious):either of those things sounds good to me, as opal definitely needs some unified, good learning resources ---------------------------------------------------------------------------------------------------- [23:04:18] Qqwy / Wiebe-Marten(@Qqwy):I figured it out using https://www.youtube.com/watch?v=5NHU0865tj0 ---------------------------------------------------------------------------------------------------- [23:04:34] Qqwy / Wiebe-Marten(@Qqwy):Turns out to make the compilation system working properly, I had to set up a Gemfile, run Bundle and use Rake ---------------------------------------------------------------------------------------------------- ############################## [2015-08-24] ############################## [06:35:37] Stephen Scott(@suchipi):Does anyone know of some good documentation on Opal.modules ? ---------------------------------------------------------------------------------------------------- [06:36:03] Stephen Scott(@suchipi):I'm not sure if I need to keep track of if things have already been loaded or if I can leave that to Opal ---------------------------------------------------------------------------------------------------- [17:17:21] Forrest Chang(@fkchang):@Qqwy maybe my guard for opal-rails might be handy for some ideas/examples http://funkworks.blogspot.com/2015/03/guard-opal-rails-gems-released.html?q=guard ---------------------------------------------------------------------------------------------------- [17:18:00] Forrest Chang(@fkchang):@elia I'm up for an awesome opal, it seems like the meta ruby resources that @AstonJ setup is basically the start of such ---------------------------------------------------------------------------------------------------- [20:19:40] Qqwy / Wiebe-Marten(@Qqwy):Thanks a lot, @fkchang ! ---------------------------------------------------------------------------------------------------- [20:19:59] Qqwy / Wiebe-Marten(@Qqwy):I'm having steady progress with my attempt to integrate Opal with nwjs ---------------------------------------------------------------------------------------------------- [20:20:57] Qqwy / Wiebe-Marten(@Qqwy):What I am getting stumped at a little right now however, is the fact that I am trying to use opal-haml. However, it seems that the inner workings of the Opal `require` function has recently changed, since it does not recognize any non-.rb file anymore, when passed without an explicit extension ---------------------------------------------------------------------------------------------------- [20:21:10] Qqwy / Wiebe-Marten(@Qqwy):e.g. `require 'app/views/test.html.haml'` works ---------------------------------------------------------------------------------------------------- [20:21:22] Qqwy / Wiebe-Marten(@Qqwy):but `require 'app/views/test'` does not ---------------------------------------------------------------------------------------------------- [20:22:18] Qqwy / Wiebe-Marten(@Qqwy):As a result, `require_tree 'app/views'` doesn't work either, and that mass-require behavior is actually what I want to use to include the user-generated views in Opal. ---------------------------------------------------------------------------------------------------- [20:22:51] meh.(@meh):Qqwy, looks like a bug caused by my recent changes ---------------------------------------------------------------------------------------------------- [20:25:38] Qqwy / Wiebe-Marten(@Qqwy):Is there a way to easily revert this behaviour? ---------------------------------------------------------------------------------------------------- [20:25:42] meh.(@meh):Qqwy, no ---------------------------------------------------------------------------------------------------- [20:25:43] Qqwy / Wiebe-Marten(@Qqwy):And should I create an issue on GitHub for it? ---------------------------------------------------------------------------------------------------- [20:25:46] meh.(@meh):Qqwy, probably ---------------------------------------------------------------------------------------------------- [20:25:56] meh.(@meh):I'm not sure it's a bug, or caused by my changes, but do open an issue ---------------------------------------------------------------------------------------------------- [20:26:11] meh.(@meh):if it worked before it's likely a regression ---------------------------------------------------------------------------------------------------- [20:31:32] Qqwy / Wiebe-Marten(@Qqwy):It at least goes against what is stated here: https://github.com/opal/opal-haml ---------------------------------------------------------------------------------------------------- [20:34:15] Qqwy / Wiebe-Marten(@Qqwy):I think this is where it happens ---------------------------------------------------------------------------------------------------- [20:34:16] Qqwy / Wiebe-Marten(@Qqwy):https://github.com/opal/opal/blob/master/opal/corelib/runtime.js#L1686 ---------------------------------------------------------------------------------------------------- [20:35:40] meh.(@meh):Qqwy, I didn't change the regex used there ---------------------------------------------------------------------------------------------------- [20:35:46] meh.(@meh):so it's either a regression or a documentation bug :P ---------------------------------------------------------------------------------------------------- [20:35:56] meh.(@meh):never touched opal-haml so dunno ---------------------------------------------------------------------------------------------------- [20:36:18] Qqwy / Wiebe-Marten(@Qqwy):;-) ---------------------------------------------------------------------------------------------------- [20:36:23] Qqwy / Wiebe-Marten(@Qqwy):No problem! Thank you for your help ---------------------------------------------------------------------------------------------------- [21:34:27] Qqwy / Wiebe-Marten(@Qqwy):I have another question: I'm trying to pass an Opal block as callback of a JS function. ---------------------------------------------------------------------------------------------------- [21:35:37] Qqwy / Wiebe-Marten(@Qqwy):In this case, using the Node `request` library, I'm trying: `var request = require("request")` `request(#{url}, ` yield `)` Obviously this is not working. But I am looking to do something similar ---------------------------------------------------------------------------------------------------- [21:36:52] meh.(@meh):I'm not sure I understand what you want to do from that code ---------------------------------------------------------------------------------------------------- [21:38:05] Qqwy / Wiebe-Marten(@Qqwy):Ah, let me explain. The npm request package allows you to get content from a remote URL (without relying on AJAX). It is usually used as follows: ---------------------------------------------------------------------------------------------------- [21:38:35] Qqwy / Wiebe-Marten(@Qqwy):request('http://example.com', function(error, response, body){ /* Do something with the result here */}) ---------------------------------------------------------------------------------------------------- [21:39:18] Qqwy / Wiebe-Marten(@Qqwy):Where `body` will contain the body of the HTTP response, `response` contains the headers and other metadata and `error` is empty unless there was a problem, in which case it is an array, iirc. ---------------------------------------------------------------------------------------------------- [21:40:21] Qqwy / Wiebe-Marten(@Qqwy):Basically I want to grab the results (that are gathered asynchroniously as everything is -for better or worse- in Node, and call a Ruby block with it ---------------------------------------------------------------------------------------------------- [21:43:30] meh.(@meh):well ---------------------------------------------------------------------------------------------------- [21:43:34] meh.(@meh):a Ruby block is just a JS function ---------------------------------------------------------------------------------------------------- [21:44:51] Qqwy / Wiebe-Marten(@Qqwy):Wait, so I can just pass it's name inside a #{} ? ---------------------------------------------------------------------------------------------------- [21:45:05] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [21:45:16] Qqwy / Wiebe-Marten(@Qqwy):like `do_something_with_passed_function(#{ruby_block_name})` ? ---------------------------------------------------------------------------------------------------- [21:45:21] Qqwy / Wiebe-Marten(@Qqwy):Wow, awesome! ---------------------------------------------------------------------------------------------------- [21:45:23] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [21:45:24] Qqwy / Wiebe-Marten(@Qqwy):It works! :D ---------------------------------------------------------------------------------------------------- [21:45:29] meh.(@meh):if you want the parameters to be wrapped in a native ---------------------------------------------------------------------------------------------------- [21:45:41] meh.(@meh):you can use `Native.proc { }` instead of `proc { }` ---------------------------------------------------------------------------------------------------- [21:52:52] Qqwy / Wiebe-Marten(@Qqwy):Is there documentation on the proper use of Native somewhere? ---------------------------------------------------------------------------------------------------- [21:53:28] meh.(@meh):I don't think so ---------------------------------------------------------------------------------------------------- [21:53:35] meh.(@meh):but the code is really small and self-contained ---------------------------------------------------------------------------------------------------- [22:09:07] Qqwy / Wiebe-Marten(@Qqwy):Where can I find the source code for Native? ---------------------------------------------------------------------------------------------------- [22:11:35] meh.(@meh):Qqwy, stdlib ---------------------------------------------------------------------------------------------------- ############################## [2015-08-25] ############################## [08:39:20] Martin Becker(@Thermatix):how do I use set_timeout or set_interval with opal? ---------------------------------------------------------------------------------------------------- [08:40:40] Martin Becker(@Thermatix):nvm , found it ---------------------------------------------------------------------------------------------------- [09:34:17] Bernhard Weichel(@bwl21):@Qqwy sorry, have been afk for a day. I have no clue, what is missing. My application does the same includes as you do. ---------------------------------------------------------------------------------------------------- [09:46:13] Bernhard Weichel(@bwl21):I need some help with object_id. I try to integrate a third party JS library which uses chained lists. I want to convert the same and there fore need unique object Ids. But if I call Native on the same JS-object twice, object_id does not yield the same result. ``` a = `{"foo": "hugo"}` puts Native(a).__id__ puts Native(a).__id__ puts Native(a).__id__ ``` yields 14522 14528 14532 I know there is no object id in JS. But is there any way that the code above always yields the same id? ---------------------------------------------------------------------------------------------------- [10:00:46] Martin Becker(@Thermatix):your going to have to store the results of `Native(a)` into a variable, it's generate new Ids because it's generate new objects each time you call Native(a). ---------------------------------------------------------------------------------------------------- [10:01:03] Martin Becker(@Thermatix):it's generating* ---------------------------------------------------------------------------------------------------- [10:01:28] Martin Becker(@Thermatix):They're not the same object hence differing ID's ---------------------------------------------------------------------------------------------------- [10:46:24] Bernhard Weichel(@bwl21):@Qqwy for a nw app, you still need to have a html landing page which embeds your script. Do you have that? ---------------------------------------------------------------------------------------------------- [10:49:33] Bernhard Weichel(@bwl21):@Thermatix this does not really help. I want to keep the JS-Objects in a hash and reference the same by the object id. So the only way I see is that the very first call to Native adds a unique Id to the underlying JS object. My question here is, if someone has already implemented such an approach. ---------------------------------------------------------------------------------------------------- [10:49:57] Martin Becker(@Thermatix):I mean like this ---------------------------------------------------------------------------------------------------- [10:50:54] Martin Becker(@Thermatix):```ruby a = `{"foo": "hugo"}` natives = {} natives[:a] = Native(a) puts natives[:a].__id__ ``` ---------------------------------------------------------------------------------------------------- [10:56:55] Bernhard Weichel(@bwl21):Yes but now I would like to see if natives already contains object a ---------------------------------------------------------------------------------------------------- [11:08:50] Martin Becker(@Thermatix):```ruby class Natives @natives = {} def add key,value @natives[key] = value unless not_allowed? value end def get key @natives[key] end def not_allowed? value get(key).__id__ == value.__id__ end end ---------------------------------------------------------------------------------------------------- [11:09:05] Martin Becker(@Thermatix):ug ---------------------------------------------------------------------------------------------------- [11:09:07] Martin Becker(@Thermatix):```ruby class Natives @natives = {} def add key,value @natives[key] = value unless not_allowed? value end def get key @natives[key] end def not_allowed? value get(key).__id__ == value.__id__ end end ``` ---------------------------------------------------------------------------------------------------- [11:09:33] Martin Becker(@Thermatix):oops, wrong class name but that might be the closest your gonnah get ---------------------------------------------------------------------------------------------------- [11:09:39] Martin Becker(@Thermatix):the problem is that ---------------------------------------------------------------------------------------------------- [11:10:48] Martin Becker(@Thermatix):`Natives(a)` generates a different object with the same keys each time, so you need to check if a key exists not an id (ofcourse not what i've done) ---------------------------------------------------------------------------------------------------- [11:36:00] Bernhard Weichel(@bwl21):Tried here: http://opalrb.org/try/?code:%20%20%20%20class%20Native%0A%20%20%20%20%20%20%20%20%40natives%20%3D%20%7B%7D%0A%20%20%20%20%20%20%20%20def%20add%20key%2Cvalue%0A%20%20%20%20%20%20%20%20%20%20%20%20%40natives%5Bkey%5D%20%3D%20value%20unless%20not_allowed%3F%20value%0A%20%20%20%20%20%20%20%20end%0A%0A%20%20%20%20%20%20%20%20def%20get%20key%0A%20%20%20%20%20%20%20%20%20%20%20%20%40natives%5Bkey%5D%0A%20%20%20%20%20%20%20%20end%0A%0A%20%20%20%20%20%20%20%20def%20not_allowed%3F%20value%0A%20%20%20%20%20%20%20%20%20%20%20%20get(key).__id__%20%3D%3D%20value.__id__%20%0A%20%20%20%20%20%20%20%20end%0A%20%20%20%20end%0A%0Aa%20%3D%20%60%7B%22foo%22%3A%20%22hugo%22%7D%60%0Ab%20%3D%20%60%7B%22foo%22%3A%20%22hugo%22%7D%60%0A%0A%0A%0Ax%20%3D%20Native(a)%0Ay%20%3D%20Native(a)%0Az%20%3D%20Native(b)%0A%0A%0Aputs%20x.get_key%0Aputs%20y.get_key%0Aputs%20z.get_key%0A%0A%20%20 ---------------------------------------------------------------------------------------------------- [11:36:35] Bernhard Weichel(@bwl21):But I wonder where the __id__ is added to the JS object. ---------------------------------------------------------------------------------------------------- [11:38:26] Bernhard Weichel(@bwl21):I guess your appraoch is to add an id to the JS object on the very first invocation of Native(a) right? ---------------------------------------------------------------------------------------------------- [11:44:58] Martin Becker(@Thermatix):I made a few mistakes, just touching it up >_< ---------------------------------------------------------------------------------------------------- [11:50:38] Colin Gunn(@balmoral):@bwl21 Don’t know if this is what you need but have you tried wrapping the JS objects in a Ruby class with Native mixin: ``` class SomeClass include Native alias_native :id, :__id__ …. end def some_method ruby_object = SomeClass.new(js_native) puts ruby_object.id end ``` ---------------------------------------------------------------------------------------------------- [11:52:00] Colin Gunn(@balmoral):that way you’re not creating a new Native instance every time ---------------------------------------------------------------------------------------------------- [12:02:34] Bernhard Weichel(@bwl21):To summarize my issue: I have a bunch of linked JS objects. They are linked such that they have a prev and a next reference. If I want to serialize such an object to JSON, I get an endless loop. Therefore I want to replace prev and next by object ids and a hash which resolves these ids. In oder to do this I need to find out, if a given JS object is already in my hash. ---------------------------------------------------------------------------------------------------- [12:06:56] Martin Becker(@Thermatix):hmm ok i've tried a few ways to do it, but it won't work, as said, every time you do `Native(a)` it generates a new object, so doing that twice in row will generate a native object with a separate id each time because there not the same object even if the object used to generate the native is the same, the only way your going to store a native is to store the created native into a hash with a key and then use that key as a unique reference no other way I can see, that or try what @balmoral suggested ---------------------------------------------------------------------------------------------------- [12:08:31] Martin Becker(@Thermatix):btw how in react do I pass a value to component that isn't a prop,? I want to push something to a component but not as a prop, how would I do this? ---------------------------------------------------------------------------------------------------- [12:27:53] Bernhard Weichel(@bwl21):I need to take a break and be afk for a few hours. Maybe I get an entirely new idea ... The best would be if Native yields the same object for the same JS object. In other words, if Native generates the wrapper, it could place the __id__ property in the JS object. By this it could yield the same Native instance whenever an object of the same __id__ occurs. Of course this might cause problems with the garbage collector. The other option for me is to solve it not in the most generic way but utilizing the application knowledge and solve it on the application level. thanks so far for the discussion. ---------------------------------------------------------------------------------------------------- [12:45:14] Martin Becker(@Thermatix):sorry I wasn't much help ---------------------------------------------------------------------------------------------------- [15:01:35] Jamie Gaskins(@jgaskins):I started working last night on an idea for server-rendered components in Clearwater. It's as simple as this in an initializer: ``` Opal.append_paths(shared_components_path) ``` … where `shared_components_path` is where your isomorphic code lives, like `"app/shared"`. Then you can just put `<%= MyComponent.new %>` in your server-side view. I still need to add the ability to use the router on the server to handle routing targets (which will likely change how you put the component in your Rails views), but it works pretty well. The branch is here: https://github.com/clearwater-rb/clearwater/tree/server-render ---------------------------------------------------------------------------------------------------- [15:10:47] Adam Jahn(@ajjahn):@jgaskins, Yes! I love the idea of components that render on both sides of the wire. I recently played with @catmando's branch of react.rb that works with react-rails, and things just felt right. ---------------------------------------------------------------------------------------------------- [15:26:12] Bernhard Weichel(@bwl21):@Thermatix : what do you think about this: http://opalrb.org/try/?code:module%20Kernel%0A%20%20%20%20def%20Native(obj)%0A%20%20%20%20if%20%60%23%7Bobj%7D%20%3D%3D%20null%60%0A%20%20%20%20%20%20nil%0A%20%20%20%20elsif%20native%3F(obj)%0A%20%20%20%20%20%20result%20%3D%20%20Native%3A%3AObject.new(obj)%0A%20%20%20%20%20%20if%20%60typeof(%23%7Bobj%7D.__id__)%20!%3D%3D%20%27undefined%27%60%20%20%23%7Bobj%7D.__id__%20%7C%7C%200%60%20%3E%200%0A%20%20%20%20%20%20%20%20puts%20%22reusing%20object%20%23%7B%60%23%7Bobj%7D.__id__%60%7D%22%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%60%23%7Bobj%7D.__id__%20%3D%20%23%7Bresult.__id__%7D%60%0A%20%20%20%20%20%20end%0A%20%20%20%20%20%20result%0A%20%20%20%20else%0A%20%20%20%20%20%20obj%0A%20%20%20%20end%0A%20%20end%0Aend%0A%0Aa%20%3D%20%60%7B%22foo%22%3A%20%22hugo%22%2C%20%22bar%22%3A%20%7B%22foobar%22%3A%20b%7D%7D%60%0Ab%20%3D%20%60%7B%22foo%22%3A%20a%7D%60%0A%0A%0A%0A%0Ax%20%3D%20Native(a)%0Ay%20%3D%20Native(a)%0Az%20%3D%20Native(b)%0Aw%20%3D%20z%0A%0A%0Aputs%20x%5B%3A__id__%5D%0Aputs%20y%5B%3A__id__%5D%0Aputs%20z%5B%3A__id__%5D%0Aputs%20z%5B%3Afoo%5D%5B%3A__id__%5D%0Aputs%20w%5B%3Afoo%5D%5B%3A__id__%5D%0A%0A%0A%20%20 @elia: could you also please have a look on this. Would it be worth to make this part of Native? ---------------------------------------------------------------------------------------------------- [15:27:32] Martin Becker(@Thermatix):thats nice ---------------------------------------------------------------------------------------------------- [15:27:41] Martin Becker(@Thermatix):and fixed the problem I was thinking of ---------------------------------------------------------------------------------------------------- [15:28:13] Bernhard Weichel(@bwl21):This approach adds a property __id__ to JS objects wrapped in Native which is the object id of the very first Native ... This property is the same for all Native instances of that object. ---------------------------------------------------------------------------------------------------- [15:28:46] Martin Becker(@Thermatix):I like it, ensures that the id is the same across any potential version of an object ---------------------------------------------------------------------------------------------------- [15:29:37] meh.(@meh):bwl21, that's not feasible ---------------------------------------------------------------------------------------------------- [15:30:08] meh.(@meh):bwl21, you'd be changing every object you feed it, which would crash in some cases on IE, and you'd add a property that may be already present on the raw object, and iterating over its keys would break other users of the object ---------------------------------------------------------------------------------------------------- [16:10:12] Bernhard Weichel(@bwl21):@meh I see. Is there any other option to achieve this? ---------------------------------------------------------------------------------------------------- [16:10:21] meh.(@meh):bwl21, I don't know ---------------------------------------------------------------------------------------------------- [16:10:31] meh.(@meh):Native(`a`) will always be == Native(`a`) ---------------------------------------------------------------------------------------------------- [16:10:41] meh.(@meh):but there's no way to store the hash/id if it's not inside the object ---------------------------------------------------------------------------------------------------- [16:10:43] meh.(@meh):and we can't do that ---------------------------------------------------------------------------------------------------- [16:11:16] meh.(@meh):instead of using Native you could write a wrapper yourself ---------------------------------------------------------------------------------------------------- [16:11:31] meh.(@meh):that way you can add the hash to the object, since it's yours and you can verify it won't break anything ---------------------------------------------------------------------------------------------------- [16:16:05] Bernhard Weichel(@bwl21):I tried this, but I did not manage to handle ids for "inner objects". Therefore I redefined Native(). But I also feel this to be somehow fragile. ---------------------------------------------------------------------------------------------------- ############################## [2015-08-26] ############################## [15:46:56] Qqwy / Wiebe-Marten(@Qqwy):also see https://github.com/opal/opal/issues/1073 ---------------------------------------------------------------------------------------------------- [15:47:05] Qqwy / Wiebe-Marten(@Qqwy):Nobody has responded to that issue yet ---------------------------------------------------------------------------------------------------- [15:48:26] Qqwy / Wiebe-Marten(@Qqwy):I hope someone will ---------------------------------------------------------------------------------------------------- [20:52:17] Qqwy / Wiebe-Marten(@Qqwy):All right! ---------------------------------------------------------------------------------------------------- [20:52:29] Qqwy / Wiebe-Marten(@Qqwy):I've released the simple boilerplate code I've made so far ---------------------------------------------------------------------------------------------------- [20:52:43] Qqwy / Wiebe-Marten(@Qqwy):it *works*, but it can still greatly be improved of course ---------------------------------------------------------------------------------------------------- [20:52:43] Qqwy / Wiebe-Marten(@Qqwy):https://github.com/Qqwy/opalnw-boilerplate ---------------------------------------------------------------------------------------------------- [20:54:21] Qqwy / Wiebe-Marten(@Qqwy):any help, issues and questions are very welcome :-) ---------------------------------------------------------------------------------------------------- [22:57:56] Qqwy / Wiebe-Marten(@Qqwy):______________--- ---------------------------------------------------------------------------------------------------- [22:58:54] Qqwy / Wiebe-Marten(@Qqwy):I'm having a very interesting problem with Node, by the way. There's an object that Node makes that extends Node's EventEmitter. But I cannot figure out how to properly make the callbacks work with that ---------------------------------------------------------------------------------------------------- [22:59:52] Qqwy / Wiebe-Marten(@Qqwy):Is there a way to call methods on the native object directly? ---------------------------------------------------------------------------------------------------- [23:05:03] Qqwy / Wiebe-Marten(@Qqwy):A very simple example: ---------------------------------------------------------------------------------------------------- [23:05:18] Qqwy / Wiebe-Marten(@Qqwy):This is how EventEmitters work in Node: var EventEmitter = require('events').EventEmitter; var radium = new EventEmitter(); radium.on('radiation', function(ray) { console.log(ray); }); setInterval(function() { radium.emit('radiation', 'GAMMA'); }, 1000); ---------------------------------------------------------------------------------------------------- [23:06:09] Qqwy / Wiebe-Marten(@Qqwy):This is what I tried with Opal: `var EventEmitter = require('events').EventEmitter;` radium = Native(`new EventEmitter()`); radium.on('radiation')do |ray| console.log(ray); end `setInterval(function() {` radium.emit('radiation', 'GAMMA'); `}, 1000);` ---------------------------------------------------------------------------------------------------- [23:07:34] Qqwy / Wiebe-Marten(@Qqwy):The Opal code will never output anything on the console. ---------------------------------------------------------------------------------------------------- [15:37:43] Qqwy / Wiebe-Marten(@Qqwy):@bwl21 : Yes. I have a main page which has two script tags in its `head`: the latest jquery version and application.js, which is the compiled result of the Opal Builder. ---------------------------------------------------------------------------------------------------- [15:42:03] Qqwy / Wiebe-Marten(@Qqwy):The problem I have right now still is that Opal's `require` does not work for non-(.rb, .opal or .js) files ---------------------------------------------------------------------------------------------------- [15:43:31] Qqwy / Wiebe-Marten(@Qqwy):`require_tree 'app/views'` throws errors, as it can *see* files like `view.haml`, `item.haml` but then tries to load files called `view` and `item` (without any extension) ---------------------------------------------------------------------------------------------------- ############################## [2015-08-27] ############################## [02:26:56] Rick Carlino(@RickCarlino):Just bought my RubyConf tickets. Hope to see you there! ---------------------------------------------------------------------------------------------------- [02:58:20] Jamie Gaskins(@jgaskins):@Qqwy Try replacing `console.log` with `pp` (also `require 'pp'`). ---------------------------------------------------------------------------------------------------- [06:13:28] Qqwy / Wiebe-Marten(@Qqwy):@jgaskins: Good catch, although in my environment (nwjs), console.log is set up properly, also as an Opal function. Replacing it with prettyprint does not solve the problem. Nor does something like Native.call(radium, 'on', 'radiation') do |ray| pp ray end change the outcome. ---------------------------------------------------------------------------------------------------- [12:54:08] Elia Schito(@elia):> @elia i think documentation improvements are good, but opalrb.org is where people are most likely to land, i would start by improving that ---------------------------------------------------------------------------------------------------- [12:55:26] Elia Schito(@elia):@dancinglightning the plan is to embed/link all docs guides into it, the difference would be they'd be available for different versions (similarly to what happens for rails) ---------------------------------------------------------------------------------------------------- [14:19:49] Bernhard Weichel(@bwl21):@Qqwy in my APP i use a Static compilation of the opal code. I guess it is possible to include and run an Opal Server which resolves the requires. But i do not know. ---------------------------------------------------------------------------------------------------- [14:57:04] ingemar(@ingemar):Hello! I would deeply appreciate if someone could give me some pointer on how to use Browser::DOM::MutationObserver. I thought this would work: ``` begin puts "supported? #{Browser::DOM::MutationObserver.supported?}" options = { children: true, tree: true, attributes: true } observer = Browser::DOM::MutationObserver.new do |*args| puts args.inspect puts " ==> change was observed <==" end element = Element['ul'] observer.observe element, options element.add_class('foo') rescue => error puts error end ``` Output: ``` # supported? true # Failed to execute 'observe' on 'MutationObserver': The provided node was null. ``` ---------------------------------------------------------------------------------------------------- [15:00:33] meh.(@meh):where is Element coming from? ---------------------------------------------------------------------------------------------------- [15:11:06] ingemar(@ingemar):meh: I'm picking ut up from the page DOM. It's there if I do a `puts` on `element` ---------------------------------------------------------------------------------------------------- [15:11:24] meh.(@meh):ingemar, no I mean, is it coming from opal-jquery or what? ---------------------------------------------------------------------------------------------------- [15:11:59] ingemar(@ingemar):yes, opal-jquery ---------------------------------------------------------------------------------------------------- [15:12:05] meh.(@meh):yeah, that's not gonna work ---------------------------------------------------------------------------------------------------- [15:12:15] meh.(@meh):you have to get element with opal-browser as well ---------------------------------------------------------------------------------------------------- [15:12:20] ingemar(@ingemar):aha ---------------------------------------------------------------------------------------------------- [15:12:49] meh.(@meh):it will work if you give it the native DOM element ---------------------------------------------------------------------------------------------------- [15:12:53] meh.(@meh):but you're giving it a jquery object ---------------------------------------------------------------------------------------------------- [15:16:43] ingemar(@ingemar):meh: Alright, I'll try that! ---------------------------------------------------------------------------------------------------- [15:20:13] ingemar(@ingemar):meh: Hmm.. how do I do that? `#to_n`? ---------------------------------------------------------------------------------------------------- [15:20:24] meh.(@meh):ingemar, I don't know, never used opal-jquery ---------------------------------------------------------------------------------------------------- [15:25:09] ingemar(@ingemar):meh: haha, OK. thanks. ---------------------------------------------------------------------------------------------------- [15:28:03] ingemar(@ingemar):This works: ``` element = Element['ul'] observer.observe element.get(0), options element.add_class('foo') ``` ---------------------------------------------------------------------------------------------------- [15:28:10] ingemar(@ingemar):meh: Thanks for holding my hand. ---------------------------------------------------------------------------------------------------- [15:28:49] meh.(@meh)::) ---------------------------------------------------------------------------------------------------- [15:30:08] meh.(@meh):ingemar, but yeah, using opal-jquery and opal-browser at the same time is kind of pointless :P ---------------------------------------------------------------------------------------------------- [15:30:23] meh.(@meh):they do the same thing ---------------------------------------------------------------------------------------------------- [15:31:00] ingemar(@ingemar):JLMRMA ---------------------------------------------------------------------------------------------------- [15:31:27] ingemar(@ingemar):Just Let Me Refactor My App ---------------------------------------------------------------------------------------------------- [15:31:50] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [15:49:28] Qqwy / Wiebe-Marten(@Qqwy):I will remember the JLMRMA acronym. Seems like a nice 'hangman' word to bug my colleagues with. ---------------------------------------------------------------------------------------------------- [17:14:51] Ryan Stout(@ryanstout):hey, how is everyone? Just curious how 0.9 is going and expected release time. (No rush, just trying to plan for the future) ---------------------------------------------------------------------------------------------------- [20:59:52] Joiey Seeley(@bigtunacan):@dfyx Is your opal-electron stuff available to try out anywhere? ---------------------------------------------------------------------------------------------------- [21:45:19] meh.(@meh):ryanstout, no clue, it's pretty much just @elia doing release stuff ---------------------------------------------------------------------------------------------------- [21:45:25] meh.(@meh):ryanstout, but, lots of fixes and additions by me :^) ---------------------------------------------------------------------------------------------------- [21:45:41] meh.(@meh):ryanstout, now Numeric, Rational and Complex are mostly fully compliant with Ruby ---------------------------------------------------------------------------------------------------- [21:45:44] meh.(@meh):although nobody will care ---------------------------------------------------------------------------------------------------- [21:46:25] meh.(@meh):ryanstout, also fixed a bunch of Module/Class/Object/Kernel stuff ---------------------------------------------------------------------------------------------------- [21:46:46] meh.(@meh):ryanstout, oh, also /(singleton_)?method_(added|removed|undefined)/ now work ---------------------------------------------------------------------------------------------------- [21:54:31] meh.(@meh):so yeah, there will be a lot of stuff nobody will ever use :D ---------------------------------------------------------------------------------------------------- [22:59:42] Ryan Stout(@ryanstout):@meh I'll probably use singleton_added/removed :-) And the bug fixes. Thanks for the hard work. Also, I was pretty excited about the opal/mini :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-08-28] ############################## [10:24:15] Christian Käser(@dfyx):@bigtunacan sadly not. I didn't even have the time to update it to opal 0.8 and it's really unfinished. I'll post it here as soon as you can do a little more than open a window ---------------------------------------------------------------------------------------------------- [10:25:44] ingemar(@ingemar):@dfyx Could you elaborate a bit on this opal-electron? Sounds very interesting since we’re building an app with electron + opal ---------------------------------------------------------------------------------------------------- [21:54:36] Elia Schito(@elia):@ryanstout @meh the idea is to start the release cycle when the docs become usable, would also be cool to get a post about the 0.8 release out before 0.9 is ready :) ---------------------------------------------------------------------------------------------------- [21:54:46] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [21:54:53] meh.(@meh):we can skip 0.8 ---------------------------------------------------------------------------------------------------- [21:54:59] meh.(@meh):microsoft skipped 9 ---------------------------------------------------------------------------------------------------- [21:56:02] Elia Schito(@elia):good point ---------------------------------------------------------------------------------------------------- [21:57:43] Elia Schito(@elia):Going straight to 10 is pretty common these days, both ms and rake did that ---------------------------------------------------------------------------------------------------- [21:57:54] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [21:58:08] Ryan Stout(@ryanstout):0.9 is the big time :-) ---------------------------------------------------------------------------------------------------- [21:58:21] Elia Schito(@elia):and OS X has been 10 for 10 years at least ---------------------------------------------------------------------------------------------------- [21:58:23] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:00:10] Elia Schito(@elia):the only people that liked "9" are the jRuby team, but you know, Java… ---------------------------------------------------------------------------------------------------- [22:00:17] Elia Schito(@elia):😹 ---------------------------------------------------------------------------------------------------- [22:00:30] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- ############################## [2015-08-29] ############################## [03:23:30] Jamie Gaskins(@jgaskins):@elia Well, Java … Script. ;-) ---------------------------------------------------------------------------------------------------- ############################## [2015-08-30] ############################## [03:47:34] Gregory Clark(@gregc):The big question is.... Can Opal compile *itself* into JavaScript? ---------------------------------------------------------------------------------------------------- [07:19:01] Bernhard Weichel(@bwl21):@Qqwy wrt to event emitter: best is to implement a wrapper class for EventEmitter. ---------------------------------------------------------------------------------------------------- [07:19:56] Adam Beynon(@adambeynon):@gregc of course! We provide opal/parser.js which is the gem compiled by itself ---------------------------------------------------------------------------------------------------- [07:54:19] Bernhard Weichel(@bwl21):@Qqwy It is similar to this (did not test it): ``` class EventEmitter def initialize() %x{ var EventEmitter = require('events').EventEmitter; var #{@radium} = new EventEmitter(); } end def on(event, &block) Native(@radium).on(event, block) end def start %x{ setInterval(function() { #{@radium}.emit('radiation', 'GAMMA'); }, 1000); } end end e = EventEmitter.new e.on(:radiation) do |ray| puts ray end e.start ``` ---------------------------------------------------------------------------------------------------- [09:53:31] Forrest Chang(@fkchang):@meh what's the right way to do this in paggio? ```ruby Paggio.html! do |_| _.label({for: name}) {label} _.input.nbb({name: name, id: name, value: source, readonly: true}) end ``` I'm getting ``` {"name"=>"number-editor-1526", "id"=>"number-editor-1526", "value"=>"a", "readonly"=>true} ``` ---------------------------------------------------------------------------------------------------- [19:14:05] Qqwy / Wiebe-Marten(@Qqwy):@bwl21 Thank you very much for your help! Indeed it would be nice to build a wrapper around it. ---------------------------------------------------------------------------------------------------- [19:15:05] Qqwy / Wiebe-Marten(@Qqwy):As for the code you've posted above: The `Native(@radium).on(event, block)` construction ought to work, but sadly it does not. The only way I managed to make it work was: ---------------------------------------------------------------------------------------------------- [19:15:21] Qqwy / Wiebe-Marten(@Qqwy): def event_emitter_register_event(object, eventname, &block) `#{object}.on(#{eventname}, block)` end ---------------------------------------------------------------------------------------------------- [19:16:11] Qqwy / Wiebe-Marten(@Qqwy):This calls &block on the emission of the the 'eventname' event on the object. I would have expected the Native() element to work the same way, but alas, it did not ---------------------------------------------------------------------------------------------------- [19:17:05] Qqwy / Wiebe-Marten(@Qqwy):For now, when I need to listen to native Node events, I use this function. When creating my own, I use the ruby gem `events` which follows the Node EventEmitter syntax quite closely. ---------------------------------------------------------------------------------------------------- [20:01:20] Bernhard Weichel(@bwl21):@Qqwy AS i am in my table at the moment, it is too hard to enger code. But you could also add your JS code to the method, i proposed. Tomorrow i will do a closer look if i can extract something from my application. ---------------------------------------------------------------------------------------------------- ############################## [2015-09-01] ############################## [22:35:14] Forrest Chang(@fkchang):where would I put that? i.e the old way for static file is an html file that loads the script created by Opal::Builder, which in mycase becomes #{app_basename}.js ---------------------------------------------------------------------------------------------------- [22:36:12] meh.(@meh):fkchang, on top of loading the script, you need to require the top ---------------------------------------------------------------------------------------------------- [22:36:13] meh.(@meh):anywhere is fine ---------------------------------------------------------------------------------------------------- [22:36:44] meh.(@meh):even just `Opal::Builder.build(app_basename.to_s).to_s + "Opal.require('#{app_basename}')" ---------------------------------------------------------------------------------------------------- [22:38:56] Forrest Chang(@fkchang):@meh sorry for being dense, I'm not clear where that would go, at the beginning of the #{app_basename}.js.rb? ---------------------------------------------------------------------------------------------------- [22:39:04] meh.(@meh):fkchang, at the end ---------------------------------------------------------------------------------------------------- [22:39:25] meh.(@meh):when you build a file, it just compiles and splits the files in loadable modules ---------------------------------------------------------------------------------------------------- [22:39:36] meh.(@meh):you still have to load the module you want ---------------------------------------------------------------------------------------------------- [22:44:07] Forrest Chang(@fkchang):meh I tried this: ```ruby require 'opal_irb_jqconsole' require 'browser' # include opal browser so we have access to it require 'browser/dom' Document.ready? do OpalIrbJqconsole.create_bottom_panel OpalIrbJqconsole.add_open_panel_behavior("show-irb") end Opal.require 'app-embeddable' ``` but it didn't work. So I've clearly mistunderstood your directions ---------------------------------------------------------------------------------------------------- [22:44:37] meh.(@meh):fkchang, the Opal.require has to be JS, outside of the compiled stuff ---------------------------------------------------------------------------------------------------- [22:44:45] meh.(@meh):either in your HTML, or appended to the compiled output from the builder ---------------------------------------------------------------------------------------------------- [22:44:48] Forrest Chang(@fkchang):Ah ---------------------------------------------------------------------------------------------------- [22:44:54] meh.(@meh):both ways work ---------------------------------------------------------------------------------------------------- [22:57:07] Forrest Chang(@fkchang):thanks, that works, we need to update the docs, and it's kind of awkward ---------------------------------------------------------------------------------------------------- [23:12:56] Forrest Chang(@fkchang):@elia @meh, ok so static works now, now my to solve sprockets, I put the load_asset_code somewhere in the html? You can' t just add document ready code to an opal file and have it work because it's now in a module? ---------------------------------------------------------------------------------------------------- [23:13:25] meh.(@meh):fkchang, you can, just add the Opal.require right after ---------------------------------------------------------------------------------------------------- [23:13:52] meh.(@meh):just append it to the compiled string ---------------------------------------------------------------------------------------------------- [23:13:55] meh.(@meh):so it's in the same ---------------------------------------------------------------------------------------------------- [13:37:08] Joiey Seeley(@bigtunacan):It doesn't get any errors, but nothing happens. ---------------------------------------------------------------------------------------------------- [13:37:17] Joiey Seeley(@bigtunacan):Shouldn't that give me an alert popup? ---------------------------------------------------------------------------------------------------- [13:51:54] Gabriel Rios(@gabrielrios):@bigtunacan missing one step, you need to load the parser ``` ``` ---------------------------------------------------------------------------------------------------- [13:56:46] Joiey Seeley(@bigtunacan):Ok; now I'm in business ---------------------------------------------------------------------------------------------------- [13:56:50] Joiey Seeley(@bigtunacan):Thank you! ---------------------------------------------------------------------------------------------------- [13:56:57] Gabriel Rios(@gabrielrios)::+1: ---------------------------------------------------------------------------------------------------- [13:57:46] Joiey Seeley(@bigtunacan):We have a local Ruby meetup today and we are going to have everyone hacking around in Opal. ---------------------------------------------------------------------------------------------------- [13:57:58] Joiey Seeley(@bigtunacan):Didn't want to spend the whole time just getting it working :) ---------------------------------------------------------------------------------------------------- [16:05:46] Forrest Chang(@fkchang):@bigtunacan this might be handy for your meetup, as far as "no time getting it working" http://fkchang.github.io/opal-playground/ ---------------------------------------------------------------------------------------------------- [16:54:32] Jamie Gaskins(@jgaskins):Wasn't there a way to convert a JS object into a Hash? I thought `Hash.new(obj)` did that, but it's not working. ---------------------------------------------------------------------------------------------------- [17:17:20] meh.(@meh):@fkchang just tried opal-irb, I still hate that eye sore of red background, but it looks like it's gotten breddy good ---------------------------------------------------------------------------------------------------- [17:18:17] meh.(@meh):the error reporting with the compiled output is godly as well ---------------------------------------------------------------------------------------------------- [17:22:36] Forrest Chang(@fkchang):@meh thanks, I have some really cool stuff in the works, might split it out and revisit trying to do opal-inspector, even w/o that feature I asked for years ago. I'll consider removing the ruby red background ---------------------------------------------------------------------------------------------------- [17:43:34] Joiey Seeley(@bigtunacan):@fkchang I'm sitting next to Ben Oakes right now ---------------------------------------------------------------------------------------------------- [17:43:38] Joiey Seeley(@bigtunacan):He says hello ---------------------------------------------------------------------------------------------------- [17:44:29] Ben Oakes(@benjaminoakes):hello :) ---------------------------------------------------------------------------------------------------- [17:44:39] Ben Oakes(@benjaminoakes):Small world, eh? ---------------------------------------------------------------------------------------------------- [17:45:19] Ben Oakes(@benjaminoakes):local meetup = ICRuby ---------------------------------------------------------------------------------------------------- [17:45:45] Forrest Chang(@fkchang):@benjaminoakes hey! Long time... How goes it ---------------------------------------------------------------------------------------------------- [17:46:02] Forrest Chang(@fkchang):but in the Ruby community, the whole world is a small world ---------------------------------------------------------------------------------------------------- [17:46:17] Ben Oakes(@benjaminoakes):One of the nice things about it, in many ways. ---------------------------------------------------------------------------------------------------- [17:46:26] Joiey Seeley(@bigtunacan):Seems these days like it's only getting smaller :( ---------------------------------------------------------------------------------------------------- [17:46:38] Ben Oakes(@benjaminoakes):Things are pretty good. Still playing with Opal on occasion. ---------------------------------------------------------------------------------------------------- [17:46:59] Ben Oakes(@benjaminoakes):Still a lot of promise, but it's a hard sell whenever I've brought it up. ---------------------------------------------------------------------------------------------------- [17:47:26] Forrest Chang(@fkchang):@benjaminoakes my personal experiences, bias noted, is SO MUCH BETTER than JS ---------------------------------------------------------------------------------------------------- [17:48:00] Ben Oakes(@benjaminoakes):You're preaching to the choir, but not my decision. And JS is... livable. ---------------------------------------------------------------------------------------------------- [17:48:14] Forrest Chang(@fkchang):I've pitched a number of conference talks on why, maybe one will get in this year, which is sort of good, cuz putting my finger on why it's so much more productive in a way that people can grok it in a short time has been challenging ---------------------------------------------------------------------------------------------------- [17:48:17] George Plymale II(@ylluminarious):@fkchang ditto ---------------------------------------------------------------------------------------------------- [17:48:35] Ben Oakes(@benjaminoakes):Yeah, I saw some video with you on YouTube... haven't watched it yet. ---------------------------------------------------------------------------------------------------- [17:48:55] Ben Oakes(@benjaminoakes):btw, did you review Practices of an Agile Software Developer (the prag prog book)? I was re-reading it and saw your name ---------------------------------------------------------------------------------------------------- [17:49:04] Forrest Chang(@fkchang):watch the new hope one, the Star Wars fan in you will be proud ---------------------------------------------------------------------------------------------------- [17:49:12] Ben Oakes(@benjaminoakes):link? ---------------------------------------------------------------------------------------------------- [17:49:37] Forrest Chang(@fkchang):I did review that. When I gave Andy Hunt my review, he replied along the lines of "I'm so going to your ur review quote" ---------------------------------------------------------------------------------------------------- [17:50:07] Ben Oakes(@benjaminoakes):Funny. That's a few times I've run into your name in just a few weeks. ---------------------------------------------------------------------------------------------------- [17:52:01] Forrest Chang(@fkchang):@benjaminoakes all the resources for that talk all in one place. As a Star Wars fan, you'll want to start w/the vimeo link w/sound (coz youtube copy censor killed it ) mentioned in the 2nd paragraph, http://funkworks.blogspot.com/2014/01/opal-new-hope-for-ruby-programmers.html?q=a+new+hope ---------------------------------------------------------------------------------------------------- [17:55:26] Forrest Chang(@fkchang):@benjaminoakes so do you have a consistent set of reasoning for folks not adopting opal? We've discussed in the on what we should do to help w/adoption. Real life rejections make for good data ---------------------------------------------------------------------------------------------------- [17:57:24] George Plymale II(@ylluminarious):@fkchang @benjaminoakes i think that @bbatsov's talk on opal was pretty good wrt to offering reasoning for using opal instead of js: https://www.youtube.com/watch?v=6Co0qmCvgq0 ---------------------------------------------------------------------------------------------------- [17:57:36] Ben Oakes(@benjaminoakes):Well, I've personally found the getting started docs to be a little lacking. Easy to get stuck. The other things I've heard are about browser compatibility and the size of the generated code, especially if you are starting small. ---------------------------------------------------------------------------------------------------- [17:58:05] Joiey Seeley(@bigtunacan):Trying to get opal-browser compiling right now ---------------------------------------------------------------------------------------------------- [17:58:07] Ben Oakes(@benjaminoakes):Hard to get the thin-end of the wedge into your codebase. ---------------------------------------------------------------------------------------------------- [17:58:07] Joiey Seeley(@bigtunacan):opal --gem paggio --compile opal/browser.rb > browser.js ---------------------------------------------------------------------------------------------------- [17:58:43] Joiey Seeley(@bigtunacan):/Users/jseeley/.rvm/gems/ruby-1.9.3-p547@ob/gems/opal-0.8.0/lib/opal/builder.rb:118:in `read': A file required by "opal/browser.rb" wasn't found. (Opal::Builder::MissingRequire) can't find file: "browser/version" in ["/Users/jseeley/.rvm/gems/ruby-1.9.3-p547@ob/gems/opal-0.8.0/opal", "/Users/jseeley/.rvm/gems/ruby-1.9.3-p547@ob/gems/opal-0.8.0/stdlib", "/Users/jseeley/.rvm/gems/rub y-1.9.3-p547@ob/gems/opal-0.8.0/lib", "/Users/jseeley/.rvm/gems/ruby-1.9.3-p547@ob/bundler/gems/paggio-59ac18e4dfb3/lib"] ---------------------------------------------------------------------------------------------------- [17:59:34] meh.(@meh):bigtunacan, try adding a -I opal ---------------------------------------------------------------------------------------------------- [17:59:44] meh.(@meh):I've never compiled stuff statically like that ---------------------------------------------------------------------------------------------------- [18:00:25] meh.(@meh):and -I lib, it's just a matter of giving it the paths to look into ---------------------------------------------------------------------------------------------------- [18:00:33] meh.(@meh):it tells you the paths it's using already, so go from there ---------------------------------------------------------------------------------------------------- [18:05:23] Forrest Chang(@fkchang):@benjaminoakes generated code size could be something, though in @ryanstout 's volt talk he compares it favorably to ember, certainly for a few lines here and there, might not be worth it. Opal itself will work with IE6 (thanks to @meh's superpowers - opal-browser too), though some of the libs have dependencies that don't play well (for example, IE8 doesnt opal-irb cuz I use jquery-ui for some weird combo) ---------------------------------------------------------------------------------------------------- [18:06:14] Forrest Chang(@fkchang):wrt docs: I agree ---------------------------------------------------------------------------------------------------- [18:35:55] Joiey Seeley(@bigtunacan):@meh, Ok; got it working now. Sent a PR to update the README for the next person that comes along :) ---------------------------------------------------------------------------------------------------- [22:38:20] Ben Oakes(@benjaminoakes):Anyone here used html-pipeline in Opal? https://github.com/jch/html-pipeline ---------------------------------------------------------------------------------------------------- [22:38:52] Ben Oakes(@benjaminoakes):I'd love to get this example working... ```ruby require 'html/pipeline' filter = HTML::Pipeline::MarkdownFilter.new("Hi **world**!") filter.call ``` ---------------------------------------------------------------------------------------------------- [22:39:25] meh.(@meh):benjaminoakes, what are the errors if any? ---------------------------------------------------------------------------------------------------- [22:39:31] Ryan Stout(@ryanstout):@benjaminoakes I would be ---------------------------------------------------------------------------------------------------- [22:40:20] Ben Oakes(@benjaminoakes):(Just to be clear, I haven't done much with Opal) ---------------------------------------------------------------------------------------------------- ############################## [2015-09-04] ############################## [01:16:06] Jamie Gaskins(@jgaskins):@ryanstout Doesn't look like that would work, either: > To achieve better performance Oga uses a small, native extension (C for MRI/Rubinius, Java for JRuby). ---------------------------------------------------------------------------------------------------- [02:18:20] Ryan Stout(@ryanstout):@jgaskins for some reason I thought the c extensions were optional and it has a pure Ruby fallback. ---------------------------------------------------------------------------------------------------- [08:57:46] Bernhard Weichel(@bwl21):To be honest, I am afraid that the power of nokogiri cannot be easily brought to pure ruby or javascript. Even in pure ruby I guess it would be pretty slow when compiled to JS. In other words, Gems requiring Nokogiri cannot really be used in Opal. ---------------------------------------------------------------------------------------------------- [11:51:29] Jamie Gaskins(@jgaskins):I'd actually be pretty interested in seeing if it could be fast. It probably wouldn't be as fast as C, but JS is pretty easy for the VM to optimize if you do things a certain way (or rather, _don't_ do things a certain way). Some of the biggest performance issues in Opal are caused by the Ruby language itself allowing (and sometimes depending on) behavior that can't be optimized inside the VM. ---------------------------------------------------------------------------------------------------- [11:52:17] Jamie Gaskins(@jgaskins):If someone wrote a Nokogiri-like gem mostly in JS and put a Ruby wrapper around it, it could probably perform pretty well. ---------------------------------------------------------------------------------------------------- [12:51:07] Elia Schito(@elia):@jgaskins require native first ---------------------------------------------------------------------------------------------------- [12:51:33] Elia Schito(@elia):(re hash.new) ---------------------------------------------------------------------------------------------------- [12:54:36] Elia Schito(@elia):@bigtunacan the opal CLI requires a file or -e eval code, but that shouldn't probably a requirement when using --compile, I can fix that for 0.9 ---------------------------------------------------------------------------------------------------- [12:59:59] Elia Schito(@elia):@jgaskins @ryanstout about Oga, I'm pretty sure we can provide our _small, native extension (JavaScript fo Opal)_ :smirk: ---------------------------------------------------------------------------------------------------- [15:26:59] Ilya Bylich(@iliabylich):Hi there. Does anyone know how to disable web notifications from forks running on CI? There are a lot of noisy messages (and in irc too) that are coming from my fork. ---------------------------------------------------------------------------------------------------- [15:42:03] Rick Carlino(@RickCarlino): ---------------------------------------------------------------------------------------------------- [15:43:20] Rick Carlino(@RickCarlino):Nvm, looks like it does, according to the docs ---------------------------------------------------------------------------------------------------- [16:22:56] Forrest Chang(@fkchang):@jgaskins indeed it works http://fkchang.github.io/opal-irb/index-jq.html#code:Hash.new(%60%7B%20a%3A%201%2C%20b%3A%202%7D%60) ---------------------------------------------------------------------------------------------------- [16:30:33] Elia Schito(@elia):@iliabylich check the fork's .travis.yml & hooks config on github ---------------------------------------------------------------------------------------------------- [16:32:31] Ilya Bylich(@iliabylich):@elia I can remove the section about notifications from travis.yml in my repo, but I (and other people that have forks with CI) have to do the same job every time. Is there a way to make it through the main repo's travis.yml? ---------------------------------------------------------------------------------------------------- [16:34:23] Elia Schito(@elia):I see, checking if I can remove it from the yml ---------------------------------------------------------------------------------------------------- [16:55:48] Elia Schito(@elia):@iliabylich didn't found anything to prevent that in the docs :\ ---------------------------------------------------------------------------------------------------- [16:59:56] Ilya Bylich(@iliabylich):@elia thanks anyway ---------------------------------------------------------------------------------------------------- [17:01:24] Torsten Rüger(@dancinglightning):@meh you talked about opal parser, about redoing it. Are you aware of https://github.com/whitequark/parser ? ---------------------------------------------------------------------------------------------------- [17:31:37] meh.(@meh):dancinglightning, yeah ---------------------------------------------------------------------------------------------------- [17:31:43] meh.(@meh):but it's RACC or C ---------------------------------------------------------------------------------------------------- [17:31:46] meh.(@meh):or both ---------------------------------------------------------------------------------------------------- [17:41:49] Torsten Rüger(@dancinglightning):@meh no, it is pure ruby. It only uses a c tool to construct the ruby code. The c tool is ragel, and that is pretty clever stuff. performance is good too they say. ---------------------------------------------------------------------------------------------------- [23:44:42] Jamie Gaskins(@jgaskins):@fkchang @elia: Looks like it's caused by there being arrays as values. Try this one: http://opalrb.org/try/?code:p%20Hash.new(%60%7B%20a%3A%20%5B%7B%20a%3A%201%20%7D%5D%20%7D%60) ---------------------------------------------------------------------------------------------------- [23:53:13] Elia Schito(@elia):@jgaskins looks like a bug, can you open an issue? ---------------------------------------------------------------------------------------------------- [23:56:09] Jamie Gaskins(@jgaskins):@elia Absolutely, I just wanted to be sure I was actually expecting the right thing to happen. :-) ---------------------------------------------------------------------------------------------------- ############################## [2015-09-05] ############################## [19:34:48] Bráulio Bhavamitra(@brauliobo):hello all, was trying opal-rails and got the question: is it possible to rails's routes and helpers (like url_for) with opal? ---------------------------------------------------------------------------------------------------- ############################## [2015-09-06] ############################## [07:11:58] Elia Schito(@elia):@brauliobo currently no, but you can search for similar projects done in JS and the add an opal wrapper ---------------------------------------------------------------------------------------------------- [07:53:14] Elia Schito(@elia):@jgaskins you around? ---------------------------------------------------------------------------------------------------- [07:53:49] Jamie Gaskins(@jgaskins):@elia: yep. What's up? ---------------------------------------------------------------------------------------------------- [07:54:11] Elia Schito(@elia):was trying clearwater with opal server ---------------------------------------------------------------------------------------------------- [07:54:22] Elia Schito(@elia):got the hello world working ---------------------------------------------------------------------------------------------------- [07:54:40] Elia Schito(@elia):but couldn't access the /articles path (it's a 404) ---------------------------------------------------------------------------------------------------- [07:55:07] Elia Schito(@elia):@jgaskins was wondering if you had a ready made solution without going full-blown rails ---------------------------------------------------------------------------------------------------- [07:55:11] Jamie Gaskins(@jgaskins):I tried the `Opal::Server` thing a while back. I remember I had a lot of trouble with it, but I can't remember why. ---------------------------------------------------------------------------------------------------- [07:55:36] Jamie Gaskins(@jgaskins):At the time, I figured it was just my own misunderstanding of it. ---------------------------------------------------------------------------------------------------- [07:55:56] Jamie Gaskins(@jgaskins):@elia It works really well with Roda. Lemme get you a link ---------------------------------------------------------------------------------------------------- [07:56:05] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [07:56:44] Jamie Gaskins(@jgaskins):https://github.com/jgaskins/clearwater-roda-example/blob/e9d2b611f33f5b7f35da06c514a92c052262d094/app.rb#L11-L30 ---------------------------------------------------------------------------------------------------- [07:57:28] Elia Schito(@elia):thanks! cloning… ---------------------------------------------------------------------------------------------------- [07:57:36] Jamie Gaskins(@jgaskins):The `plugin :assets` line can actually just be `plugin :assets, js: ['application.rb'], js_opts: Opal::Builder.new` ---------------------------------------------------------------------------------------------------- [07:58:08] Jamie Gaskins(@jgaskins):I put multiple front-end apps in that Roda app, so I had to specify each one. ---------------------------------------------------------------------------------------------------- [07:59:05] Elia Schito(@elia):my final goal is to inject the clearwater app in a spree admin… so it'll be a lot of fun :D ---------------------------------------------------------------------------------------------------- [08:00:04] Jamie Gaskins(@jgaskins):A minimal Roda app to serve a Clearwater app would be something like this: ```ruby class MyClearwaterApp < Roda plugin :render, engine: 'slim' plugin :assets, js: ['app.rb'], js_opts: { builder: Opal::Builder.new } compile_assets route do |r| r.assets view 'index' end end ``` ---------------------------------------------------------------------------------------------------- [08:00:18] Jamie Gaskins(@jgaskins):@elia: Nice! ---------------------------------------------------------------------------------------------------- [08:02:16] Jamie Gaskins(@jgaskins):That way, all routes would serve up the Clearwater app. You would want to put your API routes above the `view 'index'` line. ---------------------------------------------------------------------------------------------------- [08:02:59] Elia Schito(@elia):thanks! ---------------------------------------------------------------------------------------------------- [08:03:02] Jamie Gaskins(@jgaskins):```ruby class MyClearwaterApp < Roda plugin :render, engine: 'slim' plugin :assets, js: ['app.rb'], js_opts: { builder: Opal::Builder.new } compile_assets route do |r| r.assets r.on 'api' do r.on 'todos' do # Handle todos in here end end view 'index' end end ``` ---------------------------------------------------------------------------------------------------- [08:03:11] Jamie Gaskins(@jgaskins):^^ example ---------------------------------------------------------------------------------------------------- [08:04:38] Jamie Gaskins(@jgaskins):@elia: I've gotta get some sleep, but I'd love to hear about your experience with it. :-) ---------------------------------------------------------------------------------------------------- [08:05:01] Elia Schito(@elia):@jgaskins sleep tight, will report back for sure! :) ---------------------------------------------------------------------------------------------------- [16:29:09] Bernhard Weichel(@bwl21):I am facing a problem with Opal and Array. I try to use a third party JS library. As soon as I combine it with Opal, it fails. I boiled it down to the fact that Opal extends the JS Array. The third party lib uses the `for (x in y)`to iterate over the array. Even if it is not a good practice, it is a problem. I can verify this with the following opal-Script ``` %x{ var a=[1,2,3]; for(x in a){ #{puts( `a[x]`)}; } } ``` This yields the array values together with the opal methods ... http://opalrb.org/try/?code:%25x%7B%0A%20%20%20var%20a%3D%5B1%2C2%2C3%5D%3B%0A%20%20%20for(x%20in%20a)%7B%0A%20%20%20%20%20%23%7Bputs(%20%60a%5Bx%5D%60)%7D%3B%0A%20%20%20%7D%0A%7D%0A%0A Any Idea how to overcome this issue without changing the third party lib. ---------------------------------------------------------------------------------------------------- [17:11:26] Gabriel Rios(@gabrielrios):@bwl21 no, this is a recurring issue, only way to solve this is change the third party lib, send them a PR ;) ---------------------------------------------------------------------------------------------------- [17:11:55] Gabriel Rios(@gabrielrios):#1024 #680 ---------------------------------------------------------------------------------------------------- [18:51:19] Mitch VanDuyn(@catmando):does anybody know if the opal compiler will remove lines surrounded in `if RUBY_ENGINE != 'opal'` for example: ---------------------------------------------------------------------------------------------------- [18:52:43] Mitch VanDuyn(@catmando):```ruby if RUBY_ENGINE != 'opal' # piles and piles of server side only code # can always do a conditional require, but is it necessary or does opal just # toss out the code inside the failed if? Clearly it is doing some optimization # at compile time otherwise requires would not work... end ``` ---------------------------------------------------------------------------------------------------- [19:18:34] Bernhard Weichel(@bwl21):@catmando I am afraid, it will still compile these lines, even if they will not be executed. But you will see compiler errors there if there are some. ---------------------------------------------------------------------------------------------------- [21:12:39] Jamie Gaskins(@jgaskins):@bwl21 @catmando: Well, kinda. It compiles the conditional, but doesn't put the code within it into the compiled output. ```ruby if RUBY_ENGINE != 'opal' puts 'DID OPAL COMPILE THIS?' end ``` ```javascript if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && (!$a.$$is_boolean || $a == true))) {}; ``` ---------------------------------------------------------------------------------------------------- [21:15:04] Mitch VanDuyn(@catmando):@bw21 @jgaskins - not worried about compiler errors, just worried about dumping a load of code down to the browser that will never get executed. Looks like from @jgaskins example, no actual code is generated, which is very very cool. Will allow server and client side code to exist in one file, without impacting the client load time. (Correct???) ---------------------------------------------------------------------------------------------------- [21:28:06] Jamie Gaskins(@jgaskins):@catmando Bingo. I'm pretty sure that was the idea behind it. I remembered @elia talking about adding it a couple months or so ago, but I just wanted to confirm it with real code before I responded in case it was an idea and not something that actually existed. :-) ---------------------------------------------------------------------------------------------------- [21:31:27] Mitch VanDuyn(@catmando):@jgaskins well that is most cool. Thanks for having a look for me (feeling a bit dull that I didn't just go into try opal myself!) ---------------------------------------------------------------------------------------------------- [21:32:42] Elia Schito(@elia):Just for the record the skipped code trick is from adam, so HT to him 🎩 :bowtie: ---------------------------------------------------------------------------------------------------- ############################## [2015-09-07] ############################## [12:38:45] Elia Schito(@elia):@catmando it's @adambeynon ---------------------------------------------------------------------------------------------------- [12:39:05] Mitch VanDuyn(@catmando):man life is tough without my morning coffee :-) ---------------------------------------------------------------------------------------------------- [12:39:09] Elia Schito(@elia):same as GH, not sure if it will be useful tho ---------------------------------------------------------------------------------------------------- [12:39:16] Elia Schito(@elia):ha! same here :D ---------------------------------------------------------------------------------------------------- [12:54:06] Mitch VanDuyn(@catmando):shout out to @adambeynon for the if RUBY_ENGINE != 'opal' optimization.... this is going to be very very useful for isomorphic code! Thanks! ---------------------------------------------------------------------------------------------------- [12:54:39] Elia Schito(@elia)::clap: ---------------------------------------------------------------------------------------------------- [15:16:09] ingemar(@ingemar):Why is `string[regexp]` much faster than `string =~ regexp` ? ---------------------------------------------------------------------------------------------------- [15:44:45] Vais Salikhov(@vais):@ingemar `string[regexp]` and `string =~ regexp` are both implemented in terms of `regexp.match` in the end, so, good question :smile: Do you have a benchmark or anything more specific than *much faster*? ---------------------------------------------------------------------------------------------------- [15:45:48] ingemar(@ingemar):@vais just this: http://opalrb.org/try/?code:foo%20%3D%20%22There%20was%20a%20might%20power%20in%20the%20unleashed%20source%22%0Ar%20%3D%20Regexp.new%20%27leash%27%2C%20%27i%27%0A%0Ats%20%3D%20Time.now%0A1_000_000.times%20do%0A%20%20foo%5Br%5D%0Aend%0Ate%3D%20Time.now%0A%0Ats2%20%3D%20Time.now%0A1_000_000.times%20do%0A%20%20foo%20%3D~%20r%0Aend%0Ate2%20%3D%20Time.now%0A%0Aputs%20%22%5B%5D%3A%20%23%7Bte%20-%20ts%7D%22%0Aputs%20%22%3D~%3A%20%23%7Bte2%20-%20ts2%7D%22%0A# (link will run 2x1_000_000 iterations in your browser, will take a few seconds) ---------------------------------------------------------------------------------------------------- [15:46:29] ingemar(@ingemar):“much faster”, about 1 s on my machine ---------------------------------------------------------------------------------------------------- [15:47:46] Elia Schito(@elia):could it be related to special gvars like `$~` & friends? ---------------------------------------------------------------------------------------------------- [15:48:10] ingemar(@ingemar):I’m clueless ---------------------------------------------------------------------------------------------------- [15:49:07] ingemar(@ingemar):Joining an array of strings with #* seem to be 4 times faster than #join ---------------------------------------------------------------------------------------------------- [15:50:36] Elia Schito(@elia):https://github.com/opal/opal/blob/master/opal/corelib/string.rb#L119 https://github.com/opal/opal/blob/master/opal/corelib/string.rb#L129 ---------------------------------------------------------------------------------------------------- [15:51:20] Elia Schito(@elia):`=~` is implemented with `Regexp#=~` cc @vais ---------------------------------------------------------------------------------------------------- [16:01:08] Vais Salikhov(@vais):@ingemar also see https://github.com/opal/opal/blob/master/opal/corelib/regexp.rb#L108 and https://github.com/opal/opal/blob/master/opal/corelib/regexp.rb#L118 Interestingly, the same code running on MRI `=~`is faster than `[]`by exactly 1 second for over 10 million iterations :wink2: ``` $ ruby -v test.rb ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] []: 7.264012 =~: 6.290699 ``` Go figure. ---------------------------------------------------------------------------------------------------- [16:04:28] ingemar(@ingemar):@vais Yes, I noticed that too! ;P ---------------------------------------------------------------------------------------------------- [19:26:23] Jamie Gaskins(@jgaskins):I love how people are benchmarking and profiling stuff now, trying to get Opal to go as fast as possible. It hasn't been slow at all for me, but an app loading/calculating/rendering _even faster_ is always a win. ---------------------------------------------------------------------------------------------------- [19:27:08] Rick Carlino(@RickCarlino):@gabrielrios How mature is that `opal-firebase` gem? ---------------------------------------------------------------------------------------------------- [19:31:21] Rick Carlino(@RickCarlino):Eg: You think it's ready for a screencast? Some folks in the volt gitter were asking about it. ---------------------------------------------------------------------------------------------------- [19:33:34] Ryan Stout(@ryanstout):@jgaskins yea, great work everyone on performance stuff. The big bottleneck for me is code loading. I've spent a little time profiling, but haven't gotten anywhere. One I was thinking is maybe there's a way to detect that a class doesn't call any class methods (except for def's), and then basically lazy load the whole class in a function that gets called on the scope const lookup. I read that most of the browsers won't compile functions until they are first used, so using that, we could basically lazily compile all classes. (I think) ---------------------------------------------------------------------------------------------------- [19:40:28] Jamie Gaskins(@jgaskins):@ryanstout That sounds interesting. So something like this? ```javascript const_lookups = { "MyConst": function() { # Opal-compiled Ruby class definition goes here } } ``` And then `Kernel#const_missing` just pulls from that? ---------------------------------------------------------------------------------------------------- [19:42:04] Ryan Stout(@ryanstout):yea, basically. Opal has a $scope.get function (that calls const_missing if a class isn't defined, I think) ---------------------------------------------------------------------------------------------------- [19:42:41] Ryan Stout(@ryanstout):the compile time for opal is my biggest performance issue right now, and I'm thinking that its partly because too much code is being run at compile time. ---------------------------------------------------------------------------------------------------- [19:42:53] Ryan Stout(@ryanstout):(though take that with a grain of salt, I've only profiled a bit) ---------------------------------------------------------------------------------------------------- [19:45:52] Ryan Stout(@ryanstout):@jgaskins have you looked much at compile time for your stuff? (volt probably has more code, though its not a crazy amount or anything) ---------------------------------------------------------------------------------------------------- [19:50:29] Ryan Stout(@ryanstout):And by compile time, I mean time for the browser to "evaluate script" ---------------------------------------------------------------------------------------------------- [20:15:33] Jamie Gaskins(@jgaskins):@ryanstout About 2/3 of the Clearwater codebase is the [`virtual-dom`](https://github.com/Matt-Esch/virtual-dom) library (vendored for various reasons), which is a fair bit of code. I think it's about 500kb unminified in a Hello World app, but I would need to verify that since I usually look at minified/gzipped sizes. :-) ---------------------------------------------------------------------------------------------------- [20:16:42] Ryan Stout(@ryanstout):@jgaskins ok, cool. Yea, most of volt is opal stuff, except for jquery. So its probably more of an issue for me. Though the time right now is fine, I would just like it to be faster, hehe. ---------------------------------------------------------------------------------------------------- [20:29:12] Jamie Gaskins(@jgaskins):Dev load time in 0.8 on Rails is a little weird because it sends 200 or so requests, one for each Ruby file. And that's okay because it makes source maps work, but it is a little awkward to wait 2-3 seconds on every change. ---------------------------------------------------------------------------------------------------- [20:32:09] Jamie Gaskins(@jgaskins):I still have some work to do to figure out how to get things working right on Roda. It compiles just fine, but Roda (or Sprockets?) concatenates the files and that seems to break source maps. Also, if you view source on [my Clearwater/Roda demo app](https://clearwater-roda-example.herokuapp.com), the script it includes ends in `.rb` instead of `.js`, so I don't know what's going on there. :-) ---------------------------------------------------------------------------------------------------- [20:59:18] Elia Schito(@elia):@jgaskins @ryanstout if you find a way to concatenate sourcemaps reliably (as e.g. discourse does) I'm most intrested ---------------------------------------------------------------------------------------------------- [20:59:41] Ryan Stout(@ryanstout):@elia you still seeing sourcemap concat issues? ---------------------------------------------------------------------------------------------------- [21:00:07] Ryan Stout(@ryanstout):or you mean into one file? ---------------------------------------------------------------------------------------------------- [21:00:18] Elia Schito(@elia):@jgaskins @ryanstout about the lazy loading I suggest trying with autoload which should work pretty well, and since we're not in a threaded env we're much more free to use it than in say CRuby ---------------------------------------------------------------------------------------------------- [21:00:43] Ryan Stout(@ryanstout):@elia yea, but then I'm autoloading when running in cruby :-) ---------------------------------------------------------------------------------------------------- [21:00:45] Jamie Gaskins(@jgaskins):@elia It's actually not a much longer pause than 0.7, tbh. ---------------------------------------------------------------------------------------------------- [21:00:46] Ryan Stout(@ryanstout):(since i share code) ---------------------------------------------------------------------------------------------------- [21:01:02] Elia Schito(@elia):@ryanstout yeah 0.7 was delivering a single file for code and a single file for 0.7 ---------------------------------------------------------------------------------------------------- [21:01:12] Elia Schito(@elia):@ryanstout gotcha :D ---------------------------------------------------------------------------------------------------- [21:01:51] Elia Schito(@elia):errr, you can use an if RUBY_ENGINE switch! ---------------------------------------------------------------------------------------------------- [21:02:05] Ryan Stout(@ryanstout):@elia I think a good chunk of the time is corelib classes ---------------------------------------------------------------------------------------------------- [21:02:12] Ryan Stout(@ryanstout):or stdlib classes that get included by not used ---------------------------------------------------------------------------------------------------- [21:02:18] Ryan Stout(@ryanstout):again though, I need to profile more ---------------------------------------------------------------------------------------------------- [21:02:19] Elia Schito(@elia):> (since i share code) btw, who cool is that ---------------------------------------------------------------------------------------------------- [21:03:30] Elia Schito(@elia):@ryanstout once I feel docs are decently accessible and are available by version I'll release 0.9 ---------------------------------------------------------------------------------------------------- [21:03:50] Ryan Stout(@ryanstout):@elia cool, keep up the good work on everything ---------------------------------------------------------------------------------------------------- [21:04:01] Elia Schito(@elia):there's already a ton of stuff on master ---------------------------------------------------------------------------------------------------- [21:04:04] Ryan Stout(@ryanstout):does autoload put the class loading into a JS function? ---------------------------------------------------------------------------------------------------- [21:04:36] Elia Schito(@elia):each file (in JS) is registered in a func inside `Opal.modules = {};` ---------------------------------------------------------------------------------------------------- [21:05:04] Elia Schito(@elia):and require is the moment that actually evaluates the "module" ---------------------------------------------------------------------------------------------------- [21:05:29] Elia Schito(@elia):thus autoload defers the require at the first use of the constant ---------------------------------------------------------------------------------------------------- [21:05:47] Jamie Gaskins(@jgaskins):That sounds like it'd solve the problem, @ryanstout ---------------------------------------------------------------------------------------------------- [21:05:55] Jamie Gaskins(@jgaskins):… at least on the Opal side :-) ---------------------------------------------------------------------------------------------------- [21:05:58] Elia Schito(@elia):_sorry if I stated obvious stuff :)_ ---------------------------------------------------------------------------------------------------- [21:07:12] Elia Schito(@elia):@jgaskins yeah, a couple times I dreamed about porting the static compilation of Opal to CRuby to sort of package entire apps that way, but would need another life as usual :) ---------------------------------------------------------------------------------------------------- [21:07:33] Ryan Stout(@ryanstout):@elia actually, I may not be understanding. So when $scope.get is called, does that call the modules func if it hasn't been run yet? or thats on require? ---------------------------------------------------------------------------------------------------- [21:08:27] Elia Schito(@elia):autoload hooks into const_missing and performs a require automatically ---------------------------------------------------------------------------------------------------- [21:08:56] Elia Schito(@elia):this behavior should be the same in both Opal/CRuby ---------------------------------------------------------------------------------------------------- [21:09:34] Ryan Stout(@ryanstout):ok, but require calls the Opal.modules func when you require right? ---------------------------------------------------------------------------------------------------- [21:09:46] Ryan Stout(@ryanstout):(not using autoload ---------------------------------------------------------------------------------------------------- [21:09:47] Ryan Stout(@ryanstout):) ---------------------------------------------------------------------------------------------------- [21:10:27] Elia Schito(@elia):yes ---------------------------------------------------------------------------------------------------- [21:11:07] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:11:18] Elia Schito(@elia):https://github.com/opal/opal/blob/master/opal/corelib/runtime.js#L1711-L1734 ---------------------------------------------------------------------------------------------------- [21:11:53] Elia Schito(@elia):`Kernel#requires` calls `Opal.require();` which calls `Opal.load();` ---------------------------------------------------------------------------------------------------- [21:11:55] Ryan Stout(@ryanstout):would it make since to make require delay and $scope.get load for classes that only have def's? ---------------------------------------------------------------------------------------------------- [21:12:03] Ryan Stout(@ryanstout):or am I missing something? ---------------------------------------------------------------------------------------------------- [21:13:16] Elia Schito(@elia):can you give me an example of how would that work? (not clear what you mean by classes with def's) ---------------------------------------------------------------------------------------------------- [21:16:57] Ryan Stout(@ryanstout):sure, so if I have a class like this: ```ruby class Blue def one 1 end end ``` The Blue class only has def's in it (no side effects). My goal would be to not compile the def's on the client if the Blue class never gets used. So for cases like above where the class only has methods in it (something fairly common in my code), you could flag the class somehow, then have the require not actually load the class yet. Then when opal does $scope.get, that function could see that the class isn't loaded yet and load it. Looking over the generated code from opal, corelib, and volt, there's probably 50% of classes that would fall into this category, and I think (though I could be wrong) that it would really speed up compile time. (Since again, a lot of classes in volt and corelib never get used) Since there's no way to do deadcode elimination, it would be another way to save some compile time in the browser. ---------------------------------------------------------------------------------------------------- [21:17:06] Ryan Stout(@ryanstout):let me know if that makes any since. ---------------------------------------------------------------------------------------------------- [21:19:25] Elia Schito(@elia):so you mean like some implicit autload that checks side effects? ---------------------------------------------------------------------------------------------------- [21:20:58] Elia Schito(@elia):For what I understand would still be better to use autoload explicitly as you can have eg. some `self.inherited` hooks that would count as side effects and are kinda hard to check statically ---------------------------------------------------------------------------------------------------- [21:21:30] Ryan Stout(@ryanstout):@elia cool, I didn't think about inherited ---------------------------------------------------------------------------------------------------- [21:21:50] Ryan Stout(@ryanstout):yea, I'm just hesitant to use autoload on the server.. I'll read up some more on it though. ---------------------------------------------------------------------------------------------------- [21:22:03] Elia Schito(@elia):@ryanstout anyway in theory is possible, but would require inspecting the AST and similar stuff… ---------------------------------------------------------------------------------------------------- [21:22:10] Ryan Stout(@ryanstout):@elia yea ---------------------------------------------------------------------------------------------------- [21:22:26] Ryan Stout(@ryanstout):well, maybe if I get some time, I'll try and throw something together and do some benchmarks ---------------------------------------------------------------------------------------------------- [21:22:33] Ryan Stout(@ryanstout):I'll check out autoload first though ---------------------------------------------------------------------------------------------------- [21:22:42] Ryan Stout(@ryanstout):maybe autoloading only on the client makes since ---------------------------------------------------------------------------------------------------- [21:22:52] Elia Schito(@elia):@ryanstout what about something like: ``` if RUBY_ENGINE == 'opal' autoload :Foo, 'foo' else require 'foo' end ``` ---------------------------------------------------------------------------------------------------- [21:23:03] Ryan Stout(@ryanstout):though I guess I was hoping to be able to have it work for users classes also ---------------------------------------------------------------------------------------------------- [21:23:28] Ryan Stout(@ryanstout):but yea, most of the requires in volt are managed by volt ---------------------------------------------------------------------------------------------------- [21:24:06] Ryan Stout(@ryanstout):@elia can you do an autoload of a class that has autoloads? ---------------------------------------------------------------------------------------------------- [21:24:26] Elia Schito(@elia):I guess it wouldn't be a problem ---------------------------------------------------------------------------------------------------- [21:24:45] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:24:59] Ryan Stout(@ryanstout):googling says autoloading is threadsafe as of 2.0.0 ---------------------------------------------------------------------------------------------------- [21:25:25] Elia Schito(@elia):lol, outdated knowledge is the best :D ---------------------------------------------------------------------------------------------------- [08:07:10] Elia Schito(@elia):> @bwl21 no, this is a recurring issue, only way to solve this is change the third party lib, send them a PR ;) ---------------------------------------------------------------------------------------------------- [08:07:40] Elia Schito(@elia):@gabrielrios maybe we'll have a docs page explaining all the things about that :) ---------------------------------------------------------------------------------------------------- [12:38:19] Mitch VanDuyn(@catmando):@elia What is Adam's gitter handle? ---------------------------------------------------------------------------------------------------- ############################## [2015-09-08] ############################## [00:04:25] Gabriel Rios(@gabrielrios):@RickCarlino I think its pretty complete, but I have only one app using it for chat might not have hit all the corners of firebase as its was not that complex use case ---------------------------------------------------------------------------------------------------- [00:51:45] Jamie Gaskins(@jgaskins):@elia @ryanstout I knew it'd been threadsafe in Rubinius and JRuby for years, but TBH I didn't know it was in MRI yet. That's pretty interesting. I guess it would have to be, though, if you're not using eager-loading in Rails and you're using Puma. ---------------------------------------------------------------------------------------------------- [00:53:47] Ryan Stout(@ryanstout):@jgaskins yea, I read in a few places its been thread safe in mri since 2.0: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/33078 ---------------------------------------------------------------------------------------------------- [00:53:48] Ryan Stout(@ryanstout):https://github.com/ruby/ruby/commit/cfe8ed5cbc763a3abcfc19ce10619836aeff7682 ---------------------------------------------------------------------------------------------------- [00:53:56] Jamie Gaskins(@jgaskins):Nice ---------------------------------------------------------------------------------------------------- [12:40:28] ingemar(@ingemar):uhm… http://opalrb.org/try/?code:Element.parse(%27div%27).tap%20do%20%7Cdiv%7C%0A%20%20div%20%3C%3C%20Element.new(%3Ah1).tap%20do%20%7Ch1%7C%0A%20%20%20%20h1.text%20%3D%20%27hello%27%0A%20%20end%0Aend ---------------------------------------------------------------------------------------------------- [12:46:44] Elia Schito(@elia):helLOL ---------------------------------------------------------------------------------------------------- [21:58:42] Jamie Gaskins(@jgaskins)::slow_clap: ---------------------------------------------------------------------------------------------------- [21:59:09] Rick Carlino(@RickCarlino):blooper! ---------------------------------------------------------------------------------------------------- ############################## [2015-09-09] ############################## [16:14:00] mzdunek93(@mzdunek93):right now it chooses rubyprocessor even if the filename ends in .js ---------------------------------------------------------------------------------------------------- [16:22:26] ingemar(@ingemar):@mzdunek93 Sorry, don’t know. Maybe someonelse knows. ---------------------------------------------------------------------------------------------------- [16:22:53] mzdunek93(@mzdunek93):it just seems like a weird behavior from the CLI to me ---------------------------------------------------------------------------------------------------- [16:23:20] Elia Schito(@elia):the `opal` CLI resembles the ruby command and doesn't support js files directly ---------------------------------------------------------------------------------------------------- [16:23:22] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [16:25:16] mzdunek93(@mzdunek93):now that I think about it, you're probably right ---------------------------------------------------------------------------------------------------- [16:26:05] mzdunek93(@mzdunek93):it just was weird to me when i saw that opal processes required files differently based on their extensions, but not the files from command line ---------------------------------------------------------------------------------------------------- [16:31:57] Elia Schito(@elia):Most of that behaviour comes from sprockets, some of it has been ported to `Opal::Builder` which isn't based on sprockets and is behing the CLI ---------------------------------------------------------------------------------------------------- [20:16:11] Jamie Gaskins(@jgaskins):Apparently, tvOS works with JS, so who's gonna build the first Opal app on Apple TV? ---------------------------------------------------------------------------------------------------- [20:16:28] Jamie Gaskins(@jgaskins):Source: https://developer.apple.com/tvos/ ---------------------------------------------------------------------------------------------------- [16:12:55] mzdunek93(@mzdunek93):hi ---------------------------------------------------------------------------------------------------- [16:13:03] ingemar(@ingemar):Hello ---------------------------------------------------------------------------------------------------- [16:13:44] mzdunek93(@mzdunek93):shouldn't I be able to run commands like "opal file.js" through the jsprocessor? ---------------------------------------------------------------------------------------------------- ############################## [2015-09-10] ############################## [03:55:08] Jamie Gaskins(@jgaskins):@fazibear You mentioned on Twitter that you ran Inesita through todomvc-perf-comparison. Any tips on how to do that? I haven't checked that out yet, but I'd really like to try the same with Clearwater. :-) ---------------------------------------------------------------------------------------------------- [15:36:52] Elia Schito(@elia):@meh you see anything wrong with this usage of Promise? ``` def self.for_country_id(country_id) @cache ||= {} @cache[country_id] = Promise.value( HTTP.get(STATES_API_PATH, data: { country_id: country_id }) .then(&:json) .fail { |response| warn [:fail, response.json].inspect } ) Promise.value(@cache[country_id]) end ``` ---------------------------------------------------------------------------------------------------- [15:37:21] meh.(@meh):yes, Promise.value generates a promise that's already been resolved ---------------------------------------------------------------------------------------------------- [15:37:35] meh.(@meh):you should store the result of HTTP.get ---------------------------------------------------------------------------------------------------- [15:41:07] Elia Schito(@elia):@meh What I wanted is to memoize the original promise and return a fresh promise on which I can still call `.then` ---------------------------------------------------------------------------------------------------- [15:42:05] Elia Schito(@elia):seemed (when I wrote the code) that passing a promise to `Promise.value`would give a promise that resloves along with the passed promise ---------------------------------------------------------------------------------------------------- [15:42:26] meh.(@meh):elia, shouldn't be the case ---------------------------------------------------------------------------------------------------- [15:42:37] meh.(@meh):Promise.value is used to create a Promise out of a non-Promise value ---------------------------------------------------------------------------------------------------- [15:42:59] meh.(@meh):I'm not sure how you'd do what you want to do ---------------------------------------------------------------------------------------------------- [15:43:28] meh.(@meh):there would need to be support for promises to resolve multiple then blocks at once ---------------------------------------------------------------------------------------------------- [15:43:49] Elia Schito(@elia):I'd like to always call `.then` even on a resolved promise (in which case it would execute immediately) ---------------------------------------------------------------------------------------------------- [15:44:05] Elia Schito(@elia):yeah that would help, calling multiple `.then`s ---------------------------------------------------------------------------------------------------- [15:49:02] Elia Schito(@elia):@meh seems to be already working that way ``` >> Promise => Promise >> p1 = Promise.new => # >> p2 = Promise.value(p1) => # >> p2.resolved? => false >> p1.resolve(123) => #> #: 123> >> p2.resolved? => true >> ``` ---------------------------------------------------------------------------------------------------- [15:54:39] meh.(@meh):yeah but p1 isn't then'd ---------------------------------------------------------------------------------------------------- [15:54:41] meh.(@meh):or reused ---------------------------------------------------------------------------------------------------- [16:07:22] ylluminate(@ylluminate):wanna raise some eyebrows for opal? this project got ~5,600 stars in roughly one month: https://github.com/gloomyson/StarCraft - i think we might convert this to opal-phaser ---------------------------------------------------------------------------------------------------- [16:09:42] George Plymale II(@ylluminarious):@ylluminate that definitely would get some attention ---------------------------------------------------------------------------------------------------- [16:12:13] ylluminate(@ylluminate):well i forked it, anyone wanting to pitch in is welcome: https://github.com/orbitalimpact/opal-StarCraft ---------------------------------------------------------------------------------------------------- [16:12:30] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [16:12:34] ylluminate(@ylluminate):i certainly think that it could be leveraged to raise some opal awareness ---------------------------------------------------------------------------------------------------- [16:13:19] ylluminate(@ylluminate):LOL, pretty neat ---------------------------------------------------------------------------------------------------- [16:14:15] Elia Schito(@elia):@meh tried to look into it but couldn't find a way to make it work with the actual code, and looking at the source I'm too confused by all those << ^ >> <:^D ---------------------------------------------------------------------------------------------------- [16:24:27] meh.(@meh):it's easier than it looks ---------------------------------------------------------------------------------------------------- [16:24:51] meh.(@meh):a << b links b as previous for a ---------------------------------------------------------------------------------------------------- [16:24:57] meh.(@meh):a >> b links b as next for a ---------------------------------------------------------------------------------------------------- [16:25:11] meh.(@meh):a ^ b links the two together as prev and next ---------------------------------------------------------------------------------------------------- [20:56:21] Mitch VanDuyn(@catmando):very obscure question: I need a way to return a block bound to a different value of this. normally I could do this: ```ruby def bind_this_block(some_self, &block) some_self.instance_eval { lambda { |*args| block.call(*args) } end ``` this would work fine, except the block is being used in a DSL to generate a function that is being passed to a JS function (from the reactive-router api) that changes its behavior depending on the number of arguments. SO the above lambda { |*args| ... } will only look like there is one arg. So just curious how I could somehow hack at the JS level to do do something like this: ```javascript block.bind(#{some_self}) ``` I tried that and it doesn't seem to work btw: ```ruby class Foo def self.do_it(instance, &block) `block.bind(instance)`.call end def initialize(y) @x = y end def baz @x end end foo = Foo.new(12) puts Foo.do_it(foo) { baz } ``` (says `NoMethodError: undefined method `baz' for main` so its not applying the binding... ) ---------------------------------------------------------------------------------------------------- [20:57:53] Elia Schito(@elia):@catmando it's internal api, but there's a .$$self on procs that should work ---------------------------------------------------------------------------------------------------- [20:58:25] Mitch VanDuyn(@catmando):.$$self does what? ---------------------------------------------------------------------------------------------------- [20:59:05] Elia Schito(@elia):holds the self value, the block iirc will fallback on `this` if `$$self` is empty ---------------------------------------------------------------------------------------------------- [21:00:00] Mitch VanDuyn(@catmando):so do something like this `block.$$self = instance` ? ---------------------------------------------------------------------------------------------------- [21:00:07] Elia Schito(@elia):``` ($a = ($b = self).$lambda, $a.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this; if (a == null) a = nil; return self.$p(a)}, TMP_1.$$s = self, TMP_1), $a).call($b) ``` ---------------------------------------------------------------------------------------------------- [21:00:17] Elia Schito(@elia):I was wrong, it's `$$s` ---------------------------------------------------------------------------------------------------- [21:00:35] Elia Schito(@elia):the above code comes from `opal -Oce '-> a { p a }'` ---------------------------------------------------------------------------------------------------- [21:01:05] Elia Schito(@elia):but be warned that's internal api ;) ---------------------------------------------------------------------------------------------------- [21:02:31] Mitch VanDuyn(@catmando):hey it works !!! thanks @elia ---------------------------------------------------------------------------------------------------- [21:02:45] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [21:03:08] Mitch VanDuyn(@catmando):the things people have to do in javascript due to the lack of any meta programming capability. ---------------------------------------------------------------------------------------------------- [21:04:01] Mitch VanDuyn(@catmando):the dsl in javascript has this sort of optional last parameter call back. If it is provided YOU must execute the call back. if its not there it is done for you. ---------------------------------------------------------------------------------------------------- [21:04:46] Mitch VanDuyn(@catmando):ugh... ---------------------------------------------------------------------------------------------------- [21:39:54] meh.(@meh):catmando, can you try with Native.proc? ---------------------------------------------------------------------------------------------------- [21:39:57] meh.(@meh):I already forgot how it works ---------------------------------------------------------------------------------------------------- [21:40:01] meh.(@meh):but it might already do what you want ---------------------------------------------------------------------------------------------------- [21:40:51] meh.(@meh):it's a fairly recent addition ---------------------------------------------------------------------------------------------------- [21:45:46] Mitch VanDuyn(@catmando):@meh... will do, as the $$s does not really work (it works, but it permantely changes the method, and there is no way that I can find to copy it.) ---------------------------------------------------------------------------------------------------- [21:52:35] Mitch VanDuyn(@catmando):@meh, no joy its not clear what native proc is doing but its not building a new instance of the function, and javascript .bind works no better on it than on the original ---------------------------------------------------------------------------------------------------- [21:56:00] meh.(@meh):catmando, where is the bind coming from? ---------------------------------------------------------------------------------------------------- [22:27:33] Elia Schito(@elia):@meh getting an infinite loop for Number#bit_length: `fixnum_max.bit_length` any clue? ---------------------------------------------------------------------------------------------------- [22:27:47] Elia Schito(@elia):the while cycle looks suspect ---------------------------------------------------------------------------------------------------- [22:34:40] meh.(@meh):elia, what's the number? ---------------------------------------------------------------------------------------------------- [22:35:15] meh.(@meh):is it a NaN? ---------------------------------------------------------------------------------------------------- [22:35:28] meh.(@meh):or Infinity? ---------------------------------------------------------------------------------------------------- [22:35:32] Elia Schito(@elia):checking ---------------------------------------------------------------------------------------------------- [22:35:36] meh.(@meh):no, those shouldn't pass the Integer check ---------------------------------------------------------------------------------------------------- [22:35:49] meh.(@meh):it's not possible, any number will get down to 0 ---------------------------------------------------------------------------------------------------- [22:35:59] Elia Schito(@elia):isn't Fixnum::MAX or something similar? ---------------------------------------------------------------------------------------------------- [22:36:12] meh.(@meh):irrelevant, >> will get any number to 0 ---------------------------------------------------------------------------------------------------- [22:37:56] Elia Schito(@elia):9007199254740991 ---------------------------------------------------------------------------------------------------- [22:38:46] meh.(@meh):wat ---------------------------------------------------------------------------------------------------- [22:38:50] meh.(@meh):how is it returning -1 ---------------------------------------------------------------------------------------------------- [22:38:59] Elia Schito(@elia):overflow? ---------------------------------------------------------------------------------------------------- [22:39:26] meh.(@meh):I don't even ---------------------------------------------------------------------------------------------------- [22:39:32] meh.(@meh):> 9007199254740991 >> 1 ---------------------------------------------------------------------------------------------------- [22:39:32] meh.(@meh):> 9007199254740991 << 1 ---------------------------------------------------------------------------------------------------- [22:39:32] meh.(@meh):-1 ---------------------------------------------------------------------------------------------------- [22:39:33] meh.(@meh):-2 ---------------------------------------------------------------------------------------------------- [22:39:52] Rick Carlino(@RickCarlino):lol ^ ---------------------------------------------------------------------------------------------------- [22:40:02] meh.(@meh):> 9007199254740992 >> 1 ---------------------------------------------------------------------------------------------------- [22:40:02] meh.(@meh):0 ---------------------------------------------------------------------------------------------------- [22:40:02] meh.(@meh):-1 ---------------------------------------------------------------------------------------------------- [22:40:02] meh.(@meh):> 9007199254740990 >> 1 ---------------------------------------------------------------------------------------------------- [22:40:02] meh.(@meh):> 9007199254740989 >> 1 ---------------------------------------------------------------------------------------------------- [22:40:03] meh.(@meh):-2 ---------------------------------------------------------------------------------------------------- [22:43:21] Elia Schito(@elia):yay js ---------------------------------------------------------------------------------------------------- [22:43:29] meh.(@meh):wait ---------------------------------------------------------------------------------------------------- [22:43:29] meh.(@meh):WAIT ---------------------------------------------------------------------------------------------------- [22:43:33] meh.(@meh):http://stackoverflow.com/questions/14061999/why-does-0x80000000-1-in-javascript-produce-a-negative-value ---------------------------------------------------------------------------------------------------- [22:43:39] meh.(@meh):I didn't even know there was a >>> operator ---------------------------------------------------------------------------------------------------- [22:44:48] meh.(@meh):fuck, now I have to audit all of numeric usage of bitwise operators ---------------------------------------------------------------------------------------------------- [23:08:12] Jamie Gaskins(@jgaskins):Is it using the sign bit as the padding instead of 0 when right-shifting? ---------------------------------------------------------------------------------------------------- ############################## [2015-09-11] ############################## [08:46:01] Elia Schito(@elia):thanks for reporting tho :) ---------------------------------------------------------------------------------------------------- [10:47:03] Elia Schito(@elia):@bwl21 should be fixed now ---------------------------------------------------------------------------------------------------- [11:00:28] Ilya Bylich(@iliabylich):How can I update rubyspec submodule to the latest master? I've tried to change .gitmodules to explicitly use master branch, but after `git submodule update --init` it still uses outdated version ---------------------------------------------------------------------------------------------------- [11:01:02] Elia Schito(@elia):cd into the directory and checkout the ref you want ---------------------------------------------------------------------------------------------------- [11:01:14] Elia Schito(@elia):then you can commit the change on the main repo ---------------------------------------------------------------------------------------------------- [11:01:50] Ilya Bylich(@iliabylich):Alright, will CI fetch these changes during PR testing? ---------------------------------------------------------------------------------------------------- [11:02:00] Elia Schito(@elia):sure ---------------------------------------------------------------------------------------------------- [11:02:11] Ilya Bylich(@iliabylich):@elia Thanks! ---------------------------------------------------------------------------------------------------- [11:03:04] Elia Schito(@elia):np :+1: ---------------------------------------------------------------------------------------------------- [00:06:01] meh.(@meh):@elia you just added mspec_node twice ---------------------------------------------------------------------------------------------------- [00:06:18] Elia Schito(@elia):lemme check ---------------------------------------------------------------------------------------------------- [00:06:29] meh.(@meh):https://github.com/opal/opal/pull/1103/files ---------------------------------------------------------------------------------------------------- [00:07:03] Elia Schito(@elia):😖 ---------------------------------------------------------------------------------------------------- [00:09:55] Elia Schito(@elia):@meh now we'll see if it passes ---------------------------------------------------------------------------------------------------- [00:10:45] Elia Schito(@elia):there ---------------------------------------------------------------------------------------------------- [00:10:48] Elia Schito(@elia):broken ---------------------------------------------------------------------------------------------------- [07:55:15] Elia Schito(@elia):@/all heads up: going to rename the opalrb.org repo to opal.github.io to make it the main GH-pages site. GH automatically setups redirects for both web and git so it should be fine for forks ---------------------------------------------------------------------------------------------------- [08:36:21] Bernhard Weichel(@bwl21):@elia the link to documentation on opalrb.org is broken ---------------------------------------------------------------------------------------------------- [08:45:38] Elia Schito(@elia):it is, that's why I need to perform the change above ---------------------------------------------------------------------------------------------------- ############################## [2015-09-12] ############################## [01:28:53] Francesco 'makevoid' Canessa(@makevoid):Idea: ES6toOpal ---------------------------------------------------------------------------------------------------- [01:28:56] Francesco 'makevoid' Canessa(@makevoid):like html2haml ---------------------------------------------------------------------------------------------------- [01:30:36] Francesco 'makevoid' Canessa(@makevoid):can be called JS2Opal or ES something maybe ---------------------------------------------------------------------------------------------------- [01:33:45] Francesco 'makevoid' Canessa(@makevoid):but I think it a lot of s-expressions will be needed to parse and rewrite that ---------------------------------------------------------------------------------------------------- [01:33:54] Kyle Mallette(@kemallette):Quick question: I'm using opal, opal-jquery, opal-rails, etc. I'm having the hardest time trying to figure out how to `bind` to my form's `ajax:*` events. I didn't find `bind` in opal-jquery, but I've tried using `#on` with no luck. ---------------------------------------------------------------------------------------------------- [01:35:40] Kyle Mallette(@kemallette):my goal is to do the following in wonderful ruby: ``` $($.livesearch.settings.searchFormId).bind('ajax:success', function(evt, xhr, status){ $.livesearch.stop(); });``` ---------------------------------------------------------------------------------------------------- [01:43:31] Kyle Mallette(@kemallette):Oh, @zetachang opal-irb is the shit! Much thanks. Also, many thanks to all the contributors present. Opal has been wonderful so far. Feels like I'm rediscovering ruby again.. ---------------------------------------------------------------------------------------------------- [02:52:43] Kyle Mallette(@kemallette):@kemallette is a dumbass ---------------------------------------------------------------------------------------------------- [02:53:26] Kyle Mallette(@kemallette):This works just fine: :) ``` @form.on "ajax:success", nil do |evt, xhr, status | puts "evt: #{evt}, \n xhr: #{xhr}, \n status: #{status}" end ``` ---------------------------------------------------------------------------------------------------- [03:54:15] Mitch VanDuyn(@catmando):@ ---------------------------------------------------------------------------------------------------- [18:02:09] Jamie Gaskins(@jgaskins):@kemallette I think you've got the wrong Chang. opal-irb was done by @fkchang. :-) ---------------------------------------------------------------------------------------------------- [18:17:02] meh.(@meh):jgaskins, do the specs actually expect negative results? ---------------------------------------------------------------------------------------------------- [18:47:37] Jamie Gaskins(@jgaskins):@meh You mean for the bit_length stuff I'm playing with? ---------------------------------------------------------------------------------------------------- [18:48:32] meh.(@meh):jgaskins, yes ---------------------------------------------------------------------------------------------------- [18:48:49] Jamie Gaskins(@jgaskins):Yeah, there's at least one failing spec for it: https://travis-ci.org/jgaskins/opal/jobs/79781606 ---------------------------------------------------------------------------------------------------- [18:50:17] meh.(@meh):jgaskins, there's `Math.log2` on the Ruby side if you need it ---------------------------------------------------------------------------------------------------- [18:50:43] Jamie Gaskins(@jgaskins):I'm not sure what I'm doing is even worth it. I just saw your commit for it and wanted to see if there's a simpler way. :-) I've done this before in other languages, but I didn't realize the Rubyspecs had so many test cases that I hadn't considered. ---------------------------------------------------------------------------------------------------- [18:50:44] meh.(@meh):and there's a `Math.log2` on the JS side as well with a polyfill ---------------------------------------------------------------------------------------------------- [18:50:57] Jamie Gaskins(@jgaskins):Huh, nice. I didn't know about that. :-) ---------------------------------------------------------------------------------------------------- [18:52:25] Jamie Gaskins(@jgaskins):Also, I can't get all the specs to run in my local environment for some reason, so I decided letting them go to CI would be easier. Then I can squash and do a PR. I didn't realize the gitter channel got notifications of commits to forks. ---------------------------------------------------------------------------------------------------- [18:52:58] meh.(@meh):jgaskins, what's the issue with getting them to run locally? ---------------------------------------------------------------------------------------------------- [18:53:38] meh.(@meh):use PATTERN="spec/rubyspec/core/fixnum/bit_length_spec.rb" ---------------------------------------------------------------------------------------------------- [18:53:40] meh.(@meh):that should work ---------------------------------------------------------------------------------------------------- [18:53:42] Jamie Gaskins(@jgaskins):Most of the time they just get hung up in a certain spot. ---------------------------------------------------------------------------------------------------- [18:53:44] Jamie Gaskins(@jgaskins):Ah, okay ---------------------------------------------------------------------------------------------------- [18:54:55] Jamie Gaskins(@jgaskins):Nice, that works! ---------------------------------------------------------------------------------------------------- [18:55:24] Jamie Gaskins(@jgaskins):But yeah, the full RubySpec suite gets about halfway through and just sits there for a while. I don't know if there's something wrong with my local env. ---------------------------------------------------------------------------------------------------- [18:55:44] meh.(@meh):how are you running it? ---------------------------------------------------------------------------------------------------- [18:56:26] Jamie Gaskins(@jgaskins):`rake SUITE=rubyspec` ---------------------------------------------------------------------------------------------------- [18:56:41] meh.(@meh):it should be `rake mspec_node SUITE=rubyspec` ---------------------------------------------------------------------------------------------------- [18:57:21] Jamie Gaskins(@jgaskins):ahh, okay. I remember at one point I could just run `rake` and it would run all the things, but that changed somewhat recently? ---------------------------------------------------------------------------------------------------- [18:57:36] meh.(@meh):I don't know what it's going to run ---------------------------------------------------------------------------------------------------- [18:57:39] meh.(@meh):but it may be running things that hang :P ---------------------------------------------------------------------------------------------------- [18:57:46] Jamie Gaskins(@jgaskins)::-D ---------------------------------------------------------------------------------------------------- [18:57:50] meh.(@meh):like mspec_phantom ---------------------------------------------------------------------------------------------------- [18:57:52] meh.(@meh):it hangs on my machine ---------------------------------------------------------------------------------------------------- [18:58:04] Jamie Gaskins(@jgaskins):That might be it. ---------------------------------------------------------------------------------------------------- [20:28:47] Jamie Gaskins(@jgaskins):@meh Doesn't look like that simplification is worthwhile. It breaks because floating-point precision. We need to use `Math.floor(Math.log2(n)) + 1` to figure out the number of bits, but for large values of `Math.log2((2 ** i) - 1)`, that gets too close to the next highest integer and the VM treats it as that integer. ```ruby [1] pry(main)> (1..64).map {|i| (1 << i) - 1}.map { |i| p i; [i, i.bit_length, Math.log2(i).floor + 1, Math.log2(i)] } => [[1, 1, 1, 0.0], [3, 2, 2, 1.584962500721156], [7, 3, 3, 2.807354922057604], [15, 4, 4, 3.9068905956085187], [31, 5, 5, 4.954196310386875], [63, 6, 6, 5.977279923499917], ...snip... [70368744177663, 46, 46, 45.99999999999998], [140737488355327, 47, 47, 46.99999999999999], [281474976710655, 48, 48, 47.99999999999999], [562949953421311, 49, 50, 49.0], [1125899906842623, 50, 51, 50.0], [2251799813685247, 51, 52, 51.0], [4503599627370495, 52, 53, 52.0], [9007199254740991, 53, 54, 53.0], ...snip... ``` ---------------------------------------------------------------------------------------------------- [20:30:06] Jamie Gaskins(@jgaskins):We'd have to manually put that breakpoint in there and calculate it differently for numbers above it. It defeats the purpose of simplifying it. ---------------------------------------------------------------------------------------------------- [20:32:14] Jamie Gaskins(@jgaskins):It was a really interesting reason for the tests to fail. I was really struggling to figure out why it worked just fine for the usual range of numbers you see, but got borked when it tried to do it on `fixnum_max` in the spec. ---------------------------------------------------------------------------------------------------- [20:36:29] meh.(@meh):jgaskins, our bitwise operations are 32 bit bound ---------------------------------------------------------------------------------------------------- [20:36:40] meh.(@meh):anything bigger we can ignore as unsupported ---------------------------------------------------------------------------------------------------- ############################## [2015-09-13] ############################## [03:12:32] Jamie Gaskins(@jgaskins):Interesting. The only reason I stopped with it was because the RubySpec failed. ---------------------------------------------------------------------------------------------------- ############################## [2015-09-14] ############################## [23:52:10] Forrest Chang(@fkchang): @meh ping ---------------------------------------------------------------------------------------------------- [23:54:21] meh.(@meh):@fkchang pong ---------------------------------------------------------------------------------------------------- [23:55:33] Forrest Chang(@fkchang):@meh trying to use paggio w/an opal 0.7 app, and it's hanging the browser, I remember it being something like a stringIO bug, and opal-browser doesn't have it coz it doesn't use the paggio formatter. It's fixed for 0.8*, is there a monkey patch for 0.7? ---------------------------------------------------------------------------------------------------- ############################## [2015-09-15] ############################## [23:30:17] Elia Schito(@elia):Would be great (but im the worst at organizing events) ---------------------------------------------------------------------------------------------------- [23:30:26] Forrest Chang(@fkchang):actually, it should be "The future or Ruby and it's culture", and we could get all nitty gritty about, performance, scaling, browser, mobile dev while keeping the joy or Ruby --- that's basically all of my talks, so I'd have 4 talks to propose ---------------------------------------------------------------------------------------------------- [23:31:48] Forrest Chang(@fkchang):or just opalconf, volt, vienna, opal-rails, opal-browser, lissio, opal-react, opal-phaser, etc. we'd have a lot of talks actually ---------------------------------------------------------------------------------------------------- [23:32:21] Elia Schito(@elia):Indeed ---------------------------------------------------------------------------------------------------- [23:33:24] Forrest Chang(@fkchang):@meh could do his through the "blacked out face and voice changed" thing they do for federally protected witnesses on TV ---------------------------------------------------------------------------------------------------- [23:33:32] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [23:33:53] Forrest Chang(@fkchang):you should, it'd be pretty funny ---------------------------------------------------------------------------------------------------- [23:34:36] Forrest Chang(@fkchang):we could broadcast it during the mini opal conf thing that @ryanstout wants to do ---------------------------------------------------------------------------------------------------- [23:38:21] Forrest Chang(@fkchang):Anyone know how people do something similar to virtual confs on youtube/google hangouts? I think the android team does stuff like that. ---------------------------------------------------------------------------------------------------- [23:39:06] Forrest Chang(@fkchang):It could be free, we just need to host the individual talks as standlone videos, like how confreaks host them ---------------------------------------------------------------------------------------------------- [23:39:50] Elia Schito(@elia):@meh totally do it plz!!!! ---------------------------------------------------------------------------------------------------- [23:42:08] Forrest Chang(@fkchang):I believe the feature we need is Google Hangouts On Air, these guys did basically what I want to do, but for librarians http://publiclibrariesonline.org/2014/10/a-free-virtual-conference-for-librarians-its-on/ ---------------------------------------------------------------------------------------------------- [23:42:52] Forrest Chang(@fkchang):@meh should wear a suit like his icon, and the get something that erases his face ---------------------------------------------------------------------------------------------------- [23:43:37] meh.(@meh):@meh owns no suits ---------------------------------------------------------------------------------------------------- [23:44:30] Forrest Chang(@fkchang):rent ---------------------------------------------------------------------------------------------------- [23:44:39] Forrest Chang(@fkchang):or borrow ---------------------------------------------------------------------------------------------------- [23:45:42] Forrest Chang(@fkchang):I think this could really work, we could basically do what the librarians did ---------------------------------------------------------------------------------------------------- [23:48:52] Forrest Chang(@fkchang):FORAIC - future of ruby and it's culture 2015 ---------------------------------------------------------------------------------------------------- [23:49:15] Forrest Chang(@fkchang):anyone in? ---------------------------------------------------------------------------------------------------- [23:50:49] Ryan Stout(@ryanstout):@fkchang @meh @elia yea, I was thinking of trying to rent out a room near rubyconf, we could do a mix of real/virtual if everyone was interested. ---------------------------------------------------------------------------------------------------- [23:50:58] Ryan Stout(@ryanstout):(if I can find a place with decent internet) ---------------------------------------------------------------------------------------------------- [23:51:06] Ryan Stout(@ryanstout):^ a conference room that is ---------------------------------------------------------------------------------------------------- [23:51:19] Elia Schito(@elia):@fkchang I'm in for sure ---------------------------------------------------------------------------------------------------- [23:51:35] Ryan Stout(@ryanstout):@elia want to do a virtual talk? ---------------------------------------------------------------------------------------------------- [23:51:42] Ryan Stout(@ryanstout):@meh also? ---------------------------------------------------------------------------------------------------- [23:52:30] meh.(@meh):despite my writing, I can't speak English for shit :D ---------------------------------------------------------------------------------------------------- [23:52:44] Elia Schito(@elia):@ryanstout sure ---------------------------------------------------------------------------------------------------- [23:53:09] Ryan Stout(@ryanstout):@meh I'm surprised, your writing is really good. ---------------------------------------------------------------------------------------------------- [23:53:36] Elia Schito(@elia):@meh text-to-speech would fit the persona ;) ---------------------------------------------------------------------------------------------------- [23:53:39] Ryan Stout(@ryanstout):(way better than my Italian, thats for sure) ---------------------------------------------------------------------------------------------------- [23:53:42] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [23:54:48] Ryan Stout(@ryanstout):I'm waiting until rubyconf posts the schedule to figure out times/which evening. ---------------------------------------------------------------------------------------------------- [23:54:56] Ryan Stout(@ryanstout):then maybe I'll hit everyone up and try to put something up. ---------------------------------------------------------------------------------------------------- [23:57:26] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [23:57:52] George Plymale II(@ylluminarious):@elia @meh @fkchang @ryanstout all this sounds pretty exciting to me :D ---------------------------------------------------------------------------------------------------- [00:01:12] meh.(@meh):fkchang, opal/browser/dom/builder.rb ---------------------------------------------------------------------------------------------------- [00:01:23] meh.(@meh):in opal-browser ---------------------------------------------------------------------------------------------------- [00:01:26] meh.(@meh):first thing is the monkey patch ---------------------------------------------------------------------------------------------------- [00:06:56] Forrest Chang(@fkchang):@meh that did the trick, thx! ---------------------------------------------------------------------------------------------------- [17:33:20] Bernhard Weichel(@bwl21):Hi all, I am using IntelliJ IDEA with Ruby plugin also for Opal development. It would be great for users and great for the reputation of Opal if there were some support for Opal in IDEA: * Language injection * sourcemaps There is an issue in their tracker: https://youtrack.jetbrains.com/issue/RUBY-13472 It would be great if other Opal users could comment there and express their interest. ---------------------------------------------------------------------------------------------------- [21:04:00] Elia Schito(@elia):@meh ping ---------------------------------------------------------------------------------------------------- [21:04:07] meh.(@meh):@elia pong ---------------------------------------------------------------------------------------------------- [21:04:13] Elia Schito(@elia):was forcing myself on writing some api docs ---------------------------------------------------------------------------------------------------- [21:04:34] Elia Schito(@elia):and kinda liking the (narcissistic) tomdoc ---------------------------------------------------------------------------------------------------- [21:04:58] Elia Schito(@elia):but wanted to check with you before committing to it ---------------------------------------------------------------------------------------------------- [21:05:33] meh.(@meh):what's wrong with yard? ---------------------------------------------------------------------------------------------------- [21:06:03] Elia Schito(@elia):dunno, kinda remember it was a bit more formal ---------------------------------------------------------------------------------------------------- [21:06:16] Elia Schito(@elia):but never learned well any doc format ---------------------------------------------------------------------------------------------------- [21:13:45] Elia Schito(@elia):@meh yes, tomdoc is a bit more human readable while yardoc is more machine parsable ---------------------------------------------------------------------------------------------------- [21:15:12] Elia Schito(@elia):anyways was kinda unaware there was some commitment to yard in the project (~10 files) ---------------------------------------------------------------------------------------------------- [21:15:34] Elia Schito(@elia):and recently switched to sdoc ---------------------------------------------------------------------------------------------------- [21:16:21] Elia Schito(@elia):eg. http://opalrb.org/docs/api/v0.8.0/lib/index.html ---------------------------------------------------------------------------------------------------- [21:17:52] Elia Schito(@elia):I can migrate existing documentation (as time permits) if you agree ---------------------------------------------------------------------------------------------------- [21:18:29] meh.(@meh):meh ---------------------------------------------------------------------------------------------------- [22:01:02] Ryan Stout(@ryanstout):@fkchang did you submit a rubyconf talk this year? ---------------------------------------------------------------------------------------------------- [22:01:28] Ryan Stout(@ryanstout):(or anyone else) ---------------------------------------------------------------------------------------------------- [22:18:32] Forrest Chang(@fkchang): @ryanstout I submitted 4, all 4 got some kind of discussion, so I'm hopeful one gets accepted ---------------------------------------------------------------------------------------------------- [22:19:03] Ryan Stout(@ryanstout):@fkchang nice, I did 3, all rejected :-( ---------------------------------------------------------------------------------------------------- [22:19:16] Ryan Stout(@ryanstout):2 had just positive feedback :-) ---------------------------------------------------------------------------------------------------- [22:20:08] Forrest Chang(@fkchang):oh, I see that all 4 got rejected now that I checked my email ---------------------------------------------------------------------------------------------------- [22:20:17] Ryan Stout(@ryanstout):man ---------------------------------------------------------------------------------------------------- [22:20:26] Ryan Stout(@ryanstout):what does it take to get a talk accepted ---------------------------------------------------------------------------------------------------- [22:20:35] Ryan Stout(@ryanstout):@fkchang what were yours on? ---------------------------------------------------------------------------------------------------- [22:21:57] Forrest Chang(@fkchang):I have no idea, I always think of my talk as along the lines of saving Ruby and it's culture. It seems that's not so important, or I'm not good at conveying such ---------------------------------------------------------------------------------------------------- [22:23:18] Ryan Stout(@ryanstout):@fkchang yea, I'll be curious to see what the schedule looks like ---------------------------------------------------------------------------------------------------- [22:23:21] Ryan Stout(@ryanstout):@fkchang you still going? ---------------------------------------------------------------------------------------------------- [22:24:49] Forrest Chang(@fkchang):@ryanstout My talks paraphrased: * crystal a "ruby" that's faster and smaller than go * why NOT to use ruby in the browser (a reverse psychology approach) * The future of ruby is in "the family" i.e. all the MRi alternatives can address the reasons that MRI isn't appropriate * Back to the future, bring unrealized innovations of the past (small talk, lisp machines) to Ruby (opal) ---------------------------------------------------------------------------------------------------- [22:25:13] Ryan Stout(@ryanstout):interesting ---------------------------------------------------------------------------------------------------- [22:25:45] Ryan Stout(@ryanstout):you still going? ---------------------------------------------------------------------------------------------------- [22:25:46] Forrest Chang(@fkchang):@ryanstout I'm likely not to go, I hate to strand my wife w/my 4 kids during the school year ---------------------------------------------------------------------------------------------------- [22:26:04] Forrest Chang(@fkchang):I guess I have until Oct 15 to decide ---------------------------------------------------------------------------------------------------- [22:26:15] Ryan Stout(@ryanstout):understandable, I was thinking about trying to organize a volt/opal mini-conf one of the evenings. ---------------------------------------------------------------------------------------------------- [22:26:49] Forrest Chang(@fkchang):yeah, you should. Try to get a lightning talk in, but it's hard to get in coz those are so popular ---------------------------------------------------------------------------------------------------- [22:27:16] Forrest Chang(@fkchang):who knows, maybe we'll get a last minute callback like you did last year ---------------------------------------------------------------------------------------------------- [22:56:46] Ryan Stout(@ryanstout):yea, I think last year that was partly because I complained ---------------------------------------------------------------------------------------------------- [22:57:13] Ryan Stout(@ryanstout):yea, I'm going to go either way I think ---------------------------------------------------------------------------------------------------- [23:10:59] meh.(@meh):@fkchang wonder if they rejected the Opal related ones because of #941 :^) ---------------------------------------------------------------------------------------------------- [23:28:22] Forrest Chang(@fkchang):@ryanstout how did you go about complaining? ---------------------------------------------------------------------------------------------------- [23:28:32] Forrest Chang(@fkchang):@meh it's always possible ---------------------------------------------------------------------------------------------------- [23:28:46] Forrest Chang(@fkchang):@/all is it time to do an opalconf? We could make it all virtual ---------------------------------------------------------------------------------------------------- ############################## [2015-09-16] ############################## [00:00:16] Forrest Chang(@fkchang):@meh can do the "Stephen Hawkings" thing ---------------------------------------------------------------------------------------------------- [00:01:21] Forrest Chang(@fkchang):@elia @meh @ryanstout @ylluminarious so I think, we could do 2 things, the mini opal conf, which would just be a few hours and something bigger, w/the 15+ talks I can easily see filling it out. We can do like the librarians and put up a page, take registrations, and get "really nitty gritty technical" ---------------------------------------------------------------------------------------------------- [00:02:03] Ryan Stout(@ryanstout):@fkchang my original thought was maybe 5 talks over a few hours. But I'm open. ---------------------------------------------------------------------------------------------------- [00:03:02] meh.(@meh):as long as I don't have to show myself and can use text-to-speech, I'm in ---------------------------------------------------------------------------------------------------- [00:03:25] George Plymale II(@ylluminarious):lol, sounds fun ---------------------------------------------------------------------------------------------------- [00:03:25] Forrest Chang(@fkchang):@ryanstout I think that would be a good start. From what I can of the "virtual confs" (I think they are calling them "stay at home confs"), is they are like a few hours over a few consecutive days, so people can do them after work ---------------------------------------------------------------------------------------------------- [00:03:29] meh.(@meh):then I can keep the laughing man spinnan thing shown ---------------------------------------------------------------------------------------------------- [00:04:03] Forrest Chang(@fkchang):@meh can have the computer voice and Stephen Hawkings video... ---------------------------------------------------------------------------------------------------- [00:04:27] Forrest Chang(@fkchang):so I'd like for FORAIC to be like the stay at home confs, we'd have a "week of opal" ---------------------------------------------------------------------------------------------------- [00:06:32] Forrest Chang(@fkchang):who's got some design chops, or access to such ---------------------------------------------------------------------------------------------------- [00:07:40] George Plymale II(@ylluminarious)::+1: ---------------------------------------------------------------------------------------------------- [00:09:49] Forrest Chang(@fkchang):I have ideas for the foraic.org site, I should throw together a rough copy, "If you build it, they will come" -- hopefully ---------------------------------------------------------------------------------------------------- [00:12:54] Ilya Bylich(@iliabylich):@fkchang Amazing idea, don't understand why it wasn't proposed before ---------------------------------------------------------------------------------------------------- [00:13:33] Ilya Bylich(@iliabylich)::+1: for @meh 's confession ---------------------------------------------------------------------------------------------------- [00:14:48] Ilya Bylich(@iliabylich):If it's going to be a live conference, which timezone it will be? ---------------------------------------------------------------------------------------------------- [00:15:08] Forrest Chang(@fkchang):Ok, they're called remote confs, not stay at home cofn Structurally, this is the model, imo https://rubyremoteconf.com ---------------------------------------------------------------------------------------------------- [00:17:30] Forrest Chang(@fkchang):@iliabylich ah yes, time zone...I see rubyremoteconf was during the day EST, I guess it depends on whats best for the majority of the speakers, or possibly the attendees? We could make a foraic.org page and ask who would attend and what timezone is best for them... ala Lean Startup ---------------------------------------------------------------------------------------------------- [00:19:36] Forrest Chang(@fkchang):https://jsremoteconf.com has the schedule I remembered ---------------------------------------------------------------------------------------------------- [00:20:41] Forrest Chang(@fkchang):6 days, 2 talks a day, 8-10EST ---------------------------------------------------------------------------------------------------- [00:20:51] Forrest Chang(@fkchang):We don't have to do that, but something along that line would work ---------------------------------------------------------------------------------------------------- [08:47:15] Elia Schito(@elia):anyone else getting failures on rubyspec locally? https://gist.github.com/elia/43846b2332aee351a118 ---------------------------------------------------------------------------------------------------- [09:20:02] Ilya Bylich(@iliabylich):@elia I've made a fix for these specs, are you on the latest master? ---------------------------------------------------------------------------------------------------- [09:20:30] Ilya Bylich(@iliabylich):And did you pull rubyspec submodule? ---------------------------------------------------------------------------------------------------- [09:21:06] Elia Schito(@elia):re-checking everything ---------------------------------------------------------------------------------------------------- [09:21:53] Elia Schito(@elia):@iliabylich all is seemingly up-to-date ---------------------------------------------------------------------------------------------------- [09:21:58] Elia Schito(@elia):ruby spec points at e27464c ---------------------------------------------------------------------------------------------------- [09:23:49] Elia Schito(@elia):will try to re-clone later to a different location and see if anything changes… ---------------------------------------------------------------------------------------------------- [09:24:25] Ilya Bylich(@iliabylich):Rubyspec should be on 46c3fb2 ---------------------------------------------------------------------------------------------------- [09:24:56] Elia Schito(@elia):arghgh! ---------------------------------------------------------------------------------------------------- [09:25:42] Elia Schito(@elia):but now git is complaining… ` modified: spec/rubyspec (new commits)` ---------------------------------------------------------------------------------------------------- [09:26:01] Elia Schito(@elia):doesn't make much sense ---------------------------------------------------------------------------------------------------- [09:30:35] Ilya Bylich(@iliabylich):Opal's master uses this revision of rubyspec, git should be fine... ---------------------------------------------------------------------------------------------------- [09:31:24] Elia Schito(@elia):indeed, github reports it correctly, will dig deeper later, kinda refuse to believe it's git's (v2.5.2) fault ---------------------------------------------------------------------------------------------------- [21:35:56] Forrest Chang(@fkchang):@/all so http://rubyconf.org/program is up, what do u guys think? ---------------------------------------------------------------------------------------------------- [22:08:46] George Plymale II(@ylluminarious):@fkchang looks pretty cool, except for a severe lack of opal :( ---------------------------------------------------------------------------------------------------- [22:10:42] Elia Schito(@elia):Crystal is missing too ---------------------------------------------------------------------------------------------------- [22:13:15] George Plymale II(@ylluminarious):@elia indeed ---------------------------------------------------------------------------------------------------- [22:19:22] Ryan Stout(@ryanstout):a few of us tried to get opal in, and I saw tweets about a rejected crystal talk. ---------------------------------------------------------------------------------------------------- [22:19:41] Ryan Stout(@ryanstout):there's some incentive in maintaining the status quo :-) ---------------------------------------------------------------------------------------------------- [22:19:50] Ryan Stout(@ryanstout):though to be fair, they did have a lot of submissions ---------------------------------------------------------------------------------------------------- [22:20:50] George Plymale II(@ylluminarious):@ryanstout yeah, people seem to be afraid of these new ruby projects from some reason : as @meh said, it might have something to do with #941 ---------------------------------------------------------------------------------------------------- [22:21:01] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [22:21:10] Ryan Stout(@ryanstout):that doesn't explain the lack of crystal though ---------------------------------------------------------------------------------------------------- [22:21:16] Ryan Stout(@ryanstout):maybe because its not really ruby ---------------------------------------------------------------------------------------------------- [22:21:29] George Plymale II(@ylluminarious):yeah ---------------------------------------------------------------------------------------------------- [22:21:38] Ryan Stout(@ryanstout):or maybe we're just overthinking it ---------------------------------------------------------------------------------------------------- [22:21:40] George Plymale II(@ylluminarious):lol ---------------------------------------------------------------------------------------------------- [22:21:42] George Plymale II(@ylluminarious):perhaps ---------------------------------------------------------------------------------------------------- [22:21:58] Ryan Stout(@ryanstout):anyway, I'll see if I can organize an opal miniconf once the rubyconf schedule is up ---------------------------------------------------------------------------------------------------- [22:22:05] George Plymale II(@ylluminarious)::+1: ---------------------------------------------------------------------------------------------------- [22:25:17] Elia Schito(@elia):Indiana Jones and the number 7 seem to be particularly loved ---------------------------------------------------------------------------------------------------- ############################## [2015-09-17] ############################## [21:33:08] Elia Schito(@elia):please someone make an awesome list for opal! :) https://github.com/sindresorhus/awesome ---------------------------------------------------------------------------------------------------- ############################## [2015-09-18] ############################## [21:16:35] Forrest Chang(@fkchang):@elia would it go under front end development (not necessarily). I kind of think it technically belongs under ruby ---------------------------------------------------------------------------------------------------- [22:00:41] Elia Schito(@elia):@fkchang yeah, personally I don't care much where we end up in the list but rather if we have an "awesome"™ page :) ---------------------------------------------------------------------------------------------------- ############################## [2015-09-19] ############################## [11:54:27] Bernhard Weichel(@bwl21):JSON.load does not yield a hash. http://opalrb.org/try/?code:require%20%27json%27%0A%0Axx%20%3D%20JSON.load(%25q%7B%7B%22a%22%3A%22this-is-a%22%7D%7D)%0Aputs%20xx JSON.parse works. Is there an incompatiblity? ---------------------------------------------------------------------------------------------------- [14:46:15] Elia Schito(@elia):@bwl21 what's the difference between the two? ---------------------------------------------------------------------------------------------------- [16:33:18] Bernhard Weichel(@bwl21):load yields "true" while parse yields the intended hash ---------------------------------------------------------------------------------------------------- [16:34:18] Bernhard Weichel(@bwl21):Ruby doc says that load is more basic while parse is more error prone ---------------------------------------------------------------------------------------------------- ############################## [2015-09-20] ############################## [13:19:40] Jose Añasco(@merongivian): ---------------------------------------------------------------------------------------------------- [14:48:50] Jamie Gaskins(@jgaskins):@merongivian it's not in there yet. I noticed the same the other day when I wanted to add my own controls to a video. I was thinking of submitting a PR for it, but I'm at a hackathon this weekend so I haven't had time. ---------------------------------------------------------------------------------------------------- [14:51:57] Jose Añasco(@merongivian):@jgaskins are you sending it to opal directly or to some other gem (like the opal-browser)? ---------------------------------------------------------------------------------------------------- [14:52:32] Jamie Gaskins(@jgaskins):@elia Agreed. Or, maybe, since it's functionality is quite similar to `JSON.parse`, maybe have it run parse and warn "hey, we think maybe you actually want parse, so we ran that instead." ---------------------------------------------------------------------------------------------------- [14:52:50] Jamie Gaskins(@jgaskins):@merongivian Opal ---------------------------------------------------------------------------------------------------- [14:53:01] Jamie Gaskins(@jgaskins):er, opal-browser ---------------------------------------------------------------------------------------------------- [14:53:30] Jamie Gaskins(@jgaskins):running gitter on an iPad is a gross ux, in case anyone is wondering. ---------------------------------------------------------------------------------------------------- [14:55:14] Jose Añasco(@merongivian):@jgaskins cool, let me know when you push it, i want to create a wrapper for creating keyboard-like sounds, probably im going to reuse band.js library or create my own.. ---------------------------------------------------------------------------------------------------- [15:03:54] Jose Añasco(@merongivian):@jgaskins or i can give it a try if you're busy, let me now either way :smile: ---------------------------------------------------------------------------------------------------- [15:37:30] Bernhard Weichel(@bwl21):@jgaskins @elia In this case it would be good to fall back to parse and raise a warning. This leads me to the propose to have a kind of mode control to configure the messages/exceptions raised by opal at runtime. This allows to have more checks on development time but not bother the regular user at runtime with messages he cannot fix. ---------------------------------------------------------------------------------------------------- [03:55:34] Jamie Gaskins(@jgaskins):@elia @bwl21 I think `JSON.load` can load JSON as arbitrary types instead of just hashes, similar to `YAML.load`. I don't remember the details, but basically the idea is that you almost always want `parse` instead of `load` if you want a hash result. ---------------------------------------------------------------------------------------------------- [03:56:08] Jamie Gaskins(@jgaskins):I really only remember a few things about it from when the `YAML.load` vulnerability was discovered in Rails. ---------------------------------------------------------------------------------------------------- [10:51:06] David Boardman(@djboardman):I'm getting an rspec error trying to run Volt specs against opal 0.9.0.dev (this working for 0.9.0.dev until I updated this morning but I hadn't updated for a while). opal-rspec is on 0.4.3 `NoMethodError: undefined method 'delegate_to_metadata' for ` ` http://localhost:9999/assets/opal/rspec/sprockets_runner.js:4165` `...` ---------------------------------------------------------------------------------------------------- [12:58:58] Elia Schito(@elia):@jgaskins maybe then we should raise a "not implemented error" on JSON.load or remove the method entirely ---------------------------------------------------------------------------------------------------- [12:59:35] Elia Schito(@elia):@djboardman is it possible that you also have upgraded phantomjs? ---------------------------------------------------------------------------------------------------- [13:01:33] Elia Schito(@elia):otherwise would be great if you can git bisect to the exact commit that broke the spec 😊 ---------------------------------------------------------------------------------------------------- [13:17:15] Jose Añasco(@merongivian):Hey guys, have a question, is there a wrapper for the web audio api ?, i saw that you guys created a wrapper for some html5 features (opal-browser) but didn't find web audio api in the readme ---------------------------------------------------------------------------------------------------- ############################## [2015-09-21] ############################## [22:55:42] meh.(@meh):elia, where? ---------------------------------------------------------------------------------------------------- [22:55:59] Elia Schito(@elia):https://github.com/opal/opal/pulls ---------------------------------------------------------------------------------------------------- [22:56:01] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [22:56:03] meh.(@meh):ah ok ---------------------------------------------------------------------------------------------------- [06:19:18] David Boardman(@djboardman):@elia I thought you might ask me that - so far somewhere between 23 Jul and 28 Aug but I'll try and find it. Phantomjs still on 1.9.8... ---------------------------------------------------------------------------------------------------- [15:16:00] Ilya Bylich(@iliabylich):Do you plan to release opal as a standalone version of ruby so it would be possible to install it using rvm and test libraries compatibility on travis? ---------------------------------------------------------------------------------------------------- [15:16:33] Ilya Bylich(@iliabylich):Because currently we don't know which pure ruby libraries have opal support ---------------------------------------------------------------------------------------------------- [15:17:40] Ilya Bylich(@iliabylich):something like `rvm install opal-0.9.0; rvm use opal-0.9.0; rspec` which runs specs using opal through nodejs (?) ---------------------------------------------------------------------------------------------------- [15:18:07] Elia Schito(@elia):@iliabylich I started that in the past but to do that would need to reimplement rubygems in nodejs or having it live in both worlds ---------------------------------------------------------------------------------------------------- [15:19:20] Ilya Bylich(@iliabylich):@elia Is the problem only with load paths? ---------------------------------------------------------------------------------------------------- [15:19:43] Elia Schito(@elia):which is not impossible but requires time. An alternative could be to have clear instructions on how to test libs in opal too and let ppl add them to their .travis.yml ---------------------------------------------------------------------------------------------------- [15:20:31] Elia Schito(@elia):if the rvm opal is based on nodejs then it must support ruby gems to downlaod the deps of the gem under test ---------------------------------------------------------------------------------------------------- [15:21:35] Elia Schito(@elia):if we keep using MRI we need a way to expose rubygems for the same reason but keep the `ruby` executable pointing to `opal` ---------------------------------------------------------------------------------------------------- [15:22:03] Ilya Bylich(@iliabylich):But opal itself requires some native ruby for its parser, right? ---------------------------------------------------------------------------------------------------- [15:22:27] Ilya Bylich(@iliabylich):Then `ruby` can actually invoke a real ruby (which can download all deps) + opal parser ---------------------------------------------------------------------------------------------------- [15:23:35] Elia Schito(@elia):no, the nodejs version would be entirely JS based (as `opal-parser` compiles and works under JS too) ---------------------------------------------------------------------------------------------------- [15:24:45] Elia Schito(@elia):@iliabylich in fact `rvm list known` still lists opal, which is done with that technique but uses an ancient version ---------------------------------------------------------------------------------------------------- [15:29:01] Ilya Bylich(@iliabylich):Can't install it :D ---------------------------------------------------------------------------------------------------- [15:32:44] Elia Schito(@elia):yeah, it's old ---------------------------------------------------------------------------------------------------- [15:33:22] Elia Schito(@elia):but hey, if you want to give a try at alternative solutions I'll give all the support :) ---------------------------------------------------------------------------------------------------- [15:39:33] Ilya Bylich(@iliabylich):I've realized that for making a standalone `opal-ruby` stuff like bundler and rake should be implemented in the first turn, right? Then, I suppose, we should just wait :D ---------------------------------------------------------------------------------------------------- [15:40:52] Elia Schito(@elia):yes, the current `opal` CLI is very similar to the `ruby` (mri) CLI in terms of options, but as you say there's more to that ---------------------------------------------------------------------------------------------------- [17:31:07] Ilya Bylich(@iliabylich):@elia phantomjs is crashing on CI - https://travis-ci.org/opal/opal/jobs/81430315. Did you have any segfaults like this locally? ---------------------------------------------------------------------------------------------------- [17:40:30] Elia Schito(@elia):Not last time i checked, thanks for the heads up, I'll check later and if I get the time I'll update to v2 as well ---------------------------------------------------------------------------------------------------- [18:26:21] Torsten Rüger(@dancinglightning):@elia a node based opal-ruby sounds like a good idea (one i would be willing to help a little with), but i must be missing something in the discussion. Why would one not just compile bundler/rake/gems with opal and use those. Ok, some path mapping, but otherwise? ---------------------------------------------------------------------------------------------------- [18:29:55] Ilya Bylich(@iliabylich):@dancinglightning For example, check out Opal's `File` implementation - https://github.com/opal/opal/blob/master/opal/corelib/file.rb ---------------------------------------------------------------------------------------------------- [18:30:23] Ilya Bylich(@iliabylich):A lot of similar stuff should be re-implemented through node ---------------------------------------------------------------------------------------------------- [18:39:14] Torsten Rüger(@dancinglightning):@iliabylich kind of short, but maybe help me: what am i seeing there ? ---------------------------------------------------------------------------------------------------- [18:41:51] Ilya Bylich(@iliabylich):No interaction with file system. Bundler and rake both need it, so they can't be compiled with Opal, core functionality of standalone-ruby is missing ---------------------------------------------------------------------------------------------------- [18:45:12] Torsten Rüger(@dancinglightning):@iliabylich ok, so i misread. You’re basically talking about having to flesh out the missing pieces of the core (and possibly std) lib. Not as i misunderstood doing anything per se node (non-ruby) specific. ---------------------------------------------------------------------------------------------------- [18:49:27] Ilya Bylich(@iliabylich):As I know, this parts will never be implemented. Opal is for browser, you don't need files/threads/processes/ruby http/signals and other things on the client. For a standalone opal (as a package) all of these parts have to be made through some wrapper that runs it (node or phantomjs) ---------------------------------------------------------------------------------------------------- [18:54:04] Torsten Rüger(@dancinglightning):ok, i missed that part. i thought opal was ruby on js, not just ruby on the browser. No problem. But yes, then that would leave somebody else to fill that part. And then it would be a much bigger task than i imagined :-( ---------------------------------------------------------------------------------------------------- [21:01:56] Elia Schito(@elia):@iliabylich @dancinglightning actually the stdlib has some of those parts implemented from when I did a spike with nw.js / atom-shell, just `require "nodejs"` ---------------------------------------------------------------------------------------------------- [21:02:27] Elia Schito(@elia):eg. https://github.com/opal/opal/blob/master/stdlib/nodejs/file.rb ---------------------------------------------------------------------------------------------------- [21:03:15] Elia Schito(@elia):the main reason for which i made the RVM stuff back then was it was really cool installing opal that way ---------------------------------------------------------------------------------------------------- [21:03:46] Elia Schito(@elia):the other reason was to make it easy for people / show off / get some hype etc. ---------------------------------------------------------------------------------------------------- [21:04:32] Elia Schito(@elia):But having not practical usage and not enough time made me stop ---------------------------------------------------------------------------------------------------- [21:07:14] Torsten Rüger(@dancinglightning): nice bag of goodies , that nodejs folder. Did you try compiling gem or bundler, any clue to how much is missing ? Not that i have one of those practical uses things. ---------------------------------------------------------------------------------------------------- [21:33:16] Elia Schito(@elia):@dancinglightning nope, but I'm sure they'd need Net::HTTP and friends which for now are missing ---------------------------------------------------------------------------------------------------- [21:35:39] Elia Schito(@elia):@iliabylich about the crash I checked and yes, now I remember, sometimes it happens ---------------------------------------------------------------------------------------------------- [21:35:54] Elia Schito(@elia):I restarted the job, that's usually enough ---------------------------------------------------------------------------------------------------- [21:45:18] Jose Añasco(@merongivian):Hey @/all , im making a pr for opal-browser but i can't run the test suite , i did `bundle exec rake` but it says that rake isn't part of the bundle... ---------------------------------------------------------------------------------------------------- [21:45:45] Elia Schito(@elia):@meh ^ ---------------------------------------------------------------------------------------------------- [21:46:22] meh.(@meh):@merongivian opal-browser tests are borked and need a fixing, don't worry about it, just make the pull request ---------------------------------------------------------------------------------------------------- [21:46:50] Jose Añasco(@merongivian):@meh ah ok then , thanks ---------------------------------------------------------------------------------------------------- [21:47:22] meh.(@meh):@elia I recall you trying to fix them? or am I imagining things? ---------------------------------------------------------------------------------------------------- [21:47:49] Elia Schito(@elia):@meh I recall that too, but kinda in another life ---------------------------------------------------------------------------------------------------- [21:48:01] meh.(@meh):someone gotta do it sooner or later :P ---------------------------------------------------------------------------------------------------- [21:48:14] Elia Schito(@elia):yep, checking my local checkout ---------------------------------------------------------------------------------------------------- [21:52:43] Elia Schito(@elia):@meh what about a releasing guide, like stuff to check for each release? (please don't say just "meh", fake some interest… :D) ---------------------------------------------------------------------------------------------------- [21:53:21] meh.(@meh):I'm glad you asked this question, it's something that I deeply care about and I'm most likely the best person to asses such requirements ---------------------------------------------------------------------------------------------------- [21:55:31] meh.(@meh):I have no clue :D ---------------------------------------------------------------------------------------------------- [21:55:51] Elia Schito(@elia):@meh thanks, just needed to talk to someone :P ---------------------------------------------------------------------------------------------------- [21:56:41] Elia Schito(@elia):btw, on the same line I'm adding an upgrading guide for both 0.9 and 0.8 ---------------------------------------------------------------------------------------------------- [22:00:08] Elia Schito(@elia):@meh re opal-browser specs: http://docs.travis-ci.com/user/gui-and-headless-browsers/ ---------------------------------------------------------------------------------------------------- [22:00:30] meh.(@meh):elia, we had browserstack for that ---------------------------------------------------------------------------------------------------- [22:00:34] meh.(@meh):it worked ---------------------------------------------------------------------------------------------------- [22:00:36] meh.(@meh):but rspec itself broke ---------------------------------------------------------------------------------------------------- [22:00:40] meh.(@meh):you can't even run themselves locally ---------------------------------------------------------------------------------------------------- [22:01:05] Elia Schito(@elia):> Sauce Labs is free for Open Source projects and seems promoted in the docs ---------------------------------------------------------------------------------------------------- [22:01:10] Ryan Stout(@ryanstout):not sure if it helps, but I've got saucelabs working for my capybara specs on volt. ---------------------------------------------------------------------------------------------------- [22:01:59] Elia Schito(@elia):@meh > Sprockets::FileNotFound: couldn't find file 'browser/console' with type 'application/javascript' ---------------------------------------------------------------------------------------------------- [22:02:36] meh.(@meh):yeah well, that's my fault ---------------------------------------------------------------------------------------------------- [22:02:50] meh.(@meh):but I don't want to make merongivian's life harder ---------------------------------------------------------------------------------------------------- [22:02:56] meh.(@meh):elia, fix it locally in the meantime ---------------------------------------------------------------------------------------------------- [22:03:35] meh.(@meh):it's 2015 and I still have to fight against limited space on my disk ---------------------------------------------------------------------------------------------------- [22:03:42] Elia Schito(@elia):sure, just saying ---------------------------------------------------------------------------------------------------- [22:03:55] Elia Schito(@elia):that's an endless war, no matter the size ---------------------------------------------------------------------------------------------------- [22:04:02] meh.(@meh):it's servo's fault ---------------------------------------------------------------------------------------------------- [22:04:13] meh.(@meh):it's like 6G of git crap ---------------------------------------------------------------------------------------------------- [22:07:49] meh.(@meh):an rust is a 3G repo, I don't even ---------------------------------------------------------------------------------------------------- [22:08:02] meh.(@meh):it should use LZMA2 as compression ---------------------------------------------------------------------------------------------------- [22:08:18] Elia Schito(@elia):or git clone --depth 100 ---------------------------------------------------------------------------------------------------- [22:08:25] meh.(@meh):I need the history ---------------------------------------------------------------------------------------------------- [22:10:08] Elia Schito(@elia)::( ---------------------------------------------------------------------------------------------------- [22:10:39] meh.(@meh):well, I guess it's time to rm -rf ~/random ---------------------------------------------------------------------------------------------------- [22:10:45] meh.(@meh):it's 18G of stuff I never access ---------------------------------------------------------------------------------------------------- [22:11:20] Elia Schito(@elia):sounds refreshing ---------------------------------------------------------------------------------------------------- [22:13:42] Elia Schito(@elia):@iliabylich sorry, but I misread the travis failure and seems to be an MRI crash, will try updating to latest 2.0.0 version (if any) and see if it works ---------------------------------------------------------------------------------------------------- [22:14:49] Ilya Bylich(@iliabylich):@elia are you talking about phantomjs upgrade? ---------------------------------------------------------------------------------------------------- [22:15:54] Elia Schito(@elia):no, about MRI, we had occasional crashes with phantomjs as well, that's why I thought it was it ---------------------------------------------------------------------------------------------------- [22:18:47] meh.(@meh):1.2G opal ---------------------------------------------------------------------------------------------------- [22:18:51] meh.(@meh):how can those repos be so big ---------------------------------------------------------------------------------------------------- [22:19:09] Elia Schito(@elia):ugh, we don't even have images on them ---------------------------------------------------------------------------------------------------- [22:19:33] Elia Schito(@elia):but now I see why you ask to squash the commits on PRs (jk) ---------------------------------------------------------------------------------------------------- [22:20:33] meh.(@meh):http://sprunge.us/QeMT ---------------------------------------------------------------------------------------------------- [22:22:12] Elia Schito(@elia):i'd trash vienna,todos-mvc,sprockets and rspec ---------------------------------------------------------------------------------------------------- [22:22:25] Elia Schito(@elia):and reclone only when needed ---------------------------------------------------------------------------------------------------- [22:48:24] Elia Schito(@elia):ok,nuff for today ---------------------------------------------------------------------------------------------------- [22:48:56] Elia Schito(@elia):@meh `rackup` + browser showed all green specs ---------------------------------------------------------------------------------------------------- [22:49:03] Elia Schito(@elia):but `rake` fails ---------------------------------------------------------------------------------------------------- [22:49:07] meh.(@meh):sounds good ---------------------------------------------------------------------------------------------------- [22:49:44] Elia Schito(@elia):tried upgrading to the opal-rspec beta but got a `null` in a `@native` instance var ---------------------------------------------------------------------------------------------------- [22:55:07] Elia Schito(@elia):@meh if you have time/energy there's some PRs with passing specs that can perhaps be merged needing a review ---------------------------------------------------------------------------------------------------- ############################## [2015-09-22] ############################## [09:04:30] Elia Schito(@elia):@jgaskins @catmando wanna chime in this question proposing clearwater/react.rb? http://stackoverflow.com/questions/32708328/embedding-serverside-ruby-to-opal-files-in-rails ---------------------------------------------------------------------------------------------------- [10:33:35] Mitch VanDuyn(@catmando):tx for the heads up ---------------------------------------------------------------------------------------------------- [10:54:08] Elia Schito(@elia):anyone using symlinks to share views between backend and frontend? ---------------------------------------------------------------------------------------------------- [10:55:50] Elia Schito(@elia):(in rails) ---------------------------------------------------------------------------------------------------- [11:06:54] Elia Schito(@elia):found it: https://github.com/opal/opal-rails#shared-templates ---------------------------------------------------------------------------------------------------- [11:14:07] Mitch VanDuyn(@catmando):@elia we don't use sym links but we do share directories, by modifying the rails config ---------------------------------------------------------------------------------------------------- [15:25:30] Forrest Chang(@fkchang):@elia I've used symlinks to share code and views in opal-rails ---------------------------------------------------------------------------------------------------- [15:25:51] Elia Schito(@elia):@fkchang did you symlink files or folders? ---------------------------------------------------------------------------------------------------- [15:26:46] Forrest Chang(@fkchang):@elia folders, I can't remember if there was a reason I chose symlinks over adding to the assets path ---------------------------------------------------------------------------------------------------- [15:26:52] Forrest Chang(@fkchang):I may have done both depending ---------------------------------------------------------------------------------------------------- [15:29:26] Forrest Chang(@fkchang):@elia I'd be interests in what best practice patterns you and @adambeynon have come up with figuring you guys have built the most opal-rails apps ---------------------------------------------------------------------------------------------------- [15:30:48] Elia Schito(@elia):For me it's the first time I share stuff, in the past I've moved files from one to the other ---------------------------------------------------------------------------------------------------- [15:31:45] Elia Schito(@elia):this time I'm sharing a haml template that I initially render from rails and then re-render with different configuration when the window is resized ---------------------------------------------------------------------------------------------------- [15:31:57] Elia Schito(@elia):(n. of columns) ---------------------------------------------------------------------------------------------------- [16:02:01] Forrest Chang(@fkchang):@elia one thing we had to address was that opal-haml didn't take local variables like they do in Rails. I think @adambeynon added that to opal-haml since. You can get around that by passing an openstruct or similar that would have attributes that respond to the same corresponding local variables, or just change the template in general ---------------------------------------------------------------------------------------------------- [16:02:41] Forrest Chang(@fkchang):on a related issue, I'm going to change most if not all of the opal-haml stuff in my current app w/paggio ---------------------------------------------------------------------------------------------------- [16:03:23] Elia Schito(@elia):Yes, I do the openstruct thing, I think there's still an open PR from @adambeynon addressing local vars for templates, I guess I'll have to review and merge it sooner or later :) ---------------------------------------------------------------------------------------------------- [20:43:24] Mitch VanDuyn(@catmando):@/all This has nothing to do with OPAL but we are desperate, so I am posting to anybody that can help! Our site is down because we can't get authorize.net's new SSL certificates (to talk to their server) to work. If any body has any experience with this can could help. I would be most grateful ---------------------------------------------------------------------------------------------------- [20:44:55] Elia Schito(@elia):@catmando look into ciphers (not an expert tho) ---------------------------------------------------------------------------------------------------- [20:46:37] Elia Schito(@elia):recently we had issues because RC4 (cipher) was removed but that was the one we were using ---------------------------------------------------------------------------------------------------- [20:47:20] Mitch VanDuyn(@catmando):not even sure what cipher is ---------------------------------------------------------------------------------------------------- [20:48:48] Elia Schito(@elia):I think it's the type of encryption used to talk between certs ---------------------------------------------------------------------------------------------------- [20:50:06] Forrest Chang(@fkchang):@catmando what is is the error exactly. Paypal ugraded certs recently, and what it entailed for use (we have a library that wraps over active merchant), was to update the certs for OpenSSL in our boxes that talk to paypal ---------------------------------------------------------------------------------------------------- [21:43:41] Mitch VanDuyn(@catmando):@fkchange SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed /usr/lib/ruby/1.9.1/net/http.rb:799:in `connect' ---------------------------------------------------------------------------------------------------- [22:47:02] Forrest Chang(@fkchang):@catmando have you updated your OpenSSL certs? ---------------------------------------------------------------------------------------------------- [22:55:57] Mitch VanDuyn(@catmando):@fkchang yes. on the server... I am also getting the same failure on my mac which is running latest mac os. Do I need to do anything on the mac to get this to go? ---------------------------------------------------------------------------------------------------- [23:33:38] Mitch VanDuyn(@catmando):@fkchang okay fixed it... a great article here: http://mislav.uniqpath.com/2013/07/ruby-openssl/ ---------------------------------------------------------------------------------------------------- [23:37:38] Jamie Gaskins(@jgaskins):@elia I've been using the `app/shared` directory in Rails apps for sharing code between MRI and Opal. ``` # config/initializers/opal.rb Opal.append_path Rails.root.join('app', 'shared') ``` ---------------------------------------------------------------------------------------------------- [23:37:55] Jamie Gaskins(@jgaskins):Rails autoloads anything in the `app` directory. ---------------------------------------------------------------------------------------------------- [23:58:42] Forrest Chang(@fkchang):@catmando so did you end up installing certs or simply pointing to existing certs ---------------------------------------------------------------------------------------------------- ############################## [2015-09-23] ############################## [14:43:04] Jose Añasco(@merongivian):Hey @fkchang quick question , is it posible to require ruby files on opal-irb ? ---------------------------------------------------------------------------------------------------- [14:44:39] Jose Añasco(@merongivian):Or does it have to be compiled with opal first? ---------------------------------------------------------------------------------------------------- [16:12:10] Jose Añasco(@merongivian):@/all Or can this be done with sourcemaps ? ---------------------------------------------------------------------------------------------------- [19:43:46] Jamie Gaskins(@jgaskins):@merongivian No need to @ the entire channel for that. ---------------------------------------------------------------------------------------------------- [20:09:10] Forrest Chang(@fkchang):@merongivian have you read http://funkworks.blogspot.com/2015/08/an-overview-of-opal-irbs-features.html ? YOu have some ability to 'require' stuff over the web, ala http://git.io/vOmoR but if that file in turn requires stuff, your SOL ---------------------------------------------------------------------------------------------------- [20:51:42] Jose Añasco(@merongivian): @jgaskins sorry :P , @fkchang thanks haven't seen that , going to check ---------------------------------------------------------------------------------------------------- [21:55:30] George Plymale II(@ylluminarious):hey guys, saw someone shared opal-pixi on hacker news a day ago (https://news.ycombinator.com/item?id=10262073) , you might go over and push some votes towards it, etc. could definitely get some positive attention to opal :) ---------------------------------------------------------------------------------------------------- [21:56:10] George Plymale II(@ylluminarious):also, we just got our website out the door for opal-phaser (http://opalphaser.com). please feel free to offer us any suggestions or improvements you'd like to see. ---------------------------------------------------------------------------------------------------- ############################## [2015-09-24] ############################## [14:39:26] meh.(@meh):you might be looking for requestAnimationFrame ---------------------------------------------------------------------------------------------------- [14:39:58] meh.(@meh):lhz, if you're using opal-browser, just `require 'browser/animation_frame'` ---------------------------------------------------------------------------------------------------- [16:45:17] Harley Swick(@hswick):Does anyone know of any client-side routers for opal? I tried this project https://github.com/adambeynon/opal-router. But it didn't seem to intercept the routes, and the project looks abandoned. ---------------------------------------------------------------------------------------------------- [17:05:58] Lars Haugseth(@lhz):@meh: thanks for the tip, but I'm getting the exact same behaviour: http://6581.no/opal/test-2/ ---------------------------------------------------------------------------------------------------- [17:14:50] Forrest Chang(@fkchang):@hswick lissio and vienna have built in routers, probably unlikely they can be used outside of those frameworks ---------------------------------------------------------------------------------------------------- [17:14:55] Forrest Chang(@fkchang):but u never know ---------------------------------------------------------------------------------------------------- [17:15:18] meh.(@meh):I think the lissio one can ---------------------------------------------------------------------------------------------------- [17:16:46] Lars Haugseth(@lhz):@meh: got it running at 60 fps on both platforms by reducing the number of objects: http://6581.no/opal/test-3/ For some reason it looks like the redraw overhead is higher in Win7 than in Ubuntu ---------------------------------------------------------------------------------------------------- [17:39:48] meh.(@meh):@lhz if you do some profiling it could show some useful performance bottlenecks on the Opal side of things ---------------------------------------------------------------------------------------------------- [17:43:30] Lars Haugseth(@lhz):@meh: will take a closer look when I get some time for it. first I will try to port something a bit more heavy I made in JS a couple of years back. thanks again for reminding me about requestAnimationFrame(). ---------------------------------------------------------------------------------------------------- [17:47:45] meh.(@meh):np ---------------------------------------------------------------------------------------------------- [21:29:35] Elia Schito(@elia):@hswick there's https://rubygems.org/gems/reactive-router by @catmando, you can ask him about the status of the project ---------------------------------------------------------------------------------------------------- [21:31:23] Mitch VanDuyn(@catmando):@elia - :-) I sent him to this room, he is looking for pure opal examples. reactive-router is a skin on react-router. @hswick is interested in doing a pure opal router that talks to react. ---------------------------------------------------------------------------------------------------- [21:31:42] Elia Schito(@elia):ohisee ---------------------------------------------------------------------------------------------------- [21:31:54] Elia Schito(@elia)::D lol ---------------------------------------------------------------------------------------------------- [00:18:18] ylluminate(@ylluminate):@/all ^^ :clap: appreciate your work on this @ylluminarious and I'm sure everyone else does as well. ---------------------------------------------------------------------------------------------------- [00:20:06] George Plymale II(@ylluminarious):@ylluminate thanks! :D ---------------------------------------------------------------------------------------------------- [00:22:09] ylluminate(@ylluminate):and everyone don't forget to pop over to https://gitter.im/orbitalimpact/opal-phaser for chit chat for opal-phaser ---------------------------------------------------------------------------------------------------- [00:25:40] ylluminate(@ylluminate):not sure if everyone is aware, but @ylluminarious is 15 (started this project when he was 14) and is a very dedicated and hard working young man. the opal community is very fortunate to be drawing some of the talent that comprises such a wonderful bunch of folks that we have here. work like volt, opal-phaser, volt, react.rb, etc. are really great boons to us all. ---------------------------------------------------------------------------------------------------- [00:28:15] George Plymale II(@ylluminarious):@ylluminate thanks very much for the praise :sweat_smile:. also, i definitely agree in that we have a wonderful bunch of folks here with very beneficial projects. ---------------------------------------------------------------------------------------------------- [01:37:22] Jamie Gaskins(@jgaskins):@ylluminarious :+1: Keep up the good work! I saw a game based on opal-phaser a while back — something with spiders, I think? It played pretty well and the code for it looked really nice. This was before I knew how well Opal performed, so I remember being pretty amazed with the performance at the time. ---------------------------------------------------------------------------------------------------- [01:48:30] Jamie Gaskins(@jgaskins):@meh I just noticed that the `Promise` class is implemented as a linked list to pass things down the chain. Is there any reason we shouldn't let promises point to more than one other promise? For example: ```ruby request = Browser::HTTP.get('/foo') request.then { do_a_thing } request.then { do_another_thing } ``` ---------------------------------------------------------------------------------------------------- [01:49:43] Jamie Gaskins(@jgaskins):It was a little confusing when I couldn't because JS promises allow that, so I don't know if that was intentional. ---------------------------------------------------------------------------------------------------- [02:40:06] George Plymale II(@ylluminarious):@jgaskins thanks! that project sounds really interesting; don't think i've seen it before. do you have a link? ---------------------------------------------------------------------------------------------------- [03:38:05] Jamie Gaskins(@jgaskins):@ylluminarious I don't seem to be able to find it. I think it might've been a port of a Phaser-based game to Opal-Phaser. If I find it any time soon I'll let you know. :-) ---------------------------------------------------------------------------------------------------- [03:38:32] George Plymale II(@ylluminarious):@jgaskins no worries :). thanks anyway ---------------------------------------------------------------------------------------------------- [03:38:49] Jamie Gaskins(@jgaskins):@ylluminarious While I was looking for it, though, I did find this: https://github.com/tangentstorm/tankgame ---------------------------------------------------------------------------------------------------- [03:38:54] George Plymale II(@ylluminarious):yeah ---------------------------------------------------------------------------------------------------- [03:39:07] George Plymale II(@ylluminarious):someone was talking about that in our gitter room just yesterday ---------------------------------------------------------------------------------------------------- [03:39:30] George Plymale II(@ylluminarious):looks pretty neat ---------------------------------------------------------------------------------------------------- [03:40:07] Jamie Gaskins(@jgaskins):Cool, I think it's great people are getting into game dev for the web. ---------------------------------------------------------------------------------------------------- [03:40:33] George Plymale II(@ylluminarious):agreed ---------------------------------------------------------------------------------------------------- [03:40:53] George Plymale II(@ylluminarious):it's especially nice that folks seem to be using opal for it more and more ---------------------------------------------------------------------------------------------------- [03:41:41] Jamie Gaskins(@jgaskins):Even if web games aren't the same experience as native games, doing it on the web is a much more approachable step for people just getting into it who might then start getting into developing games for native platforms. ---------------------------------------------------------------------------------------------------- [03:42:15] George Plymale II(@ylluminarious):yeah ---------------------------------------------------------------------------------------------------- [03:43:28] George Plymale II(@ylluminarious):it does seem to be getting ever more popular for game dev ---------------------------------------------------------------------------------------------------- [04:52:20] ylluminate(@ylluminate):re: game dev, opal and opal-phaser have a really interesting opportunity with the api offerings on the new apple tv. i think this could be a real nice opportunity ---------------------------------------------------------------------------------------------------- [04:54:09] ylluminate(@ylluminate):we had talked before about making apple tv game dev a bit more approachable with some direct tie ins with opal-phaser that are not done in phaser proper ---------------------------------------------------------------------------------------------------- [10:50:56] Lars Haugseth(@lhz):Hi, n00b question here - I have a working setup of a simple canvas demo using opal and opal-browser. My Rakefile uses Opal::Builder.build, which works great. However, I would like to use the opal cdn for all the framework code, so I try switching to Opal.compile in my Rakefile. How do I get Ruby core and stdlib modules my app needs included in the generated javascript? Or is there some option to Opal::Builder.build I could use to exclude opal and its libraries from being included in the generated javascript? ---------------------------------------------------------------------------------------------------- [10:52:27] Elia Schito(@elia):@lhz Opal.compile is low level, so you have to do it manually, but that would mean replicating what Opal::Builder already does… ---------------------------------------------------------------------------------------------------- [10:52:48] Elia Schito(@elia):@lhz any particular reason for wanting to switch to the CDN? ---------------------------------------------------------------------------------------------------- [10:54:01] Lars Haugseth(@lhz):Not other than I plan to make many small canvas apps, and it seems wasteful to include 800KB+ of the same javascript code in each of them. ---------------------------------------------------------------------------------------------------- [10:54:23] Elia Schito(@elia):I see :) ---------------------------------------------------------------------------------------------------- [10:55:01] Elia Schito(@elia):so you just want to build without the core/std stuff right? ---------------------------------------------------------------------------------------------------- [10:55:53] Lars Haugseth(@lhz):Yeah. ---------------------------------------------------------------------------------------------------- [10:56:40] Elia Schito(@elia):This should be enough: ``` b = Opal::Builder.new b.build_str 'puts 4', '(eval)' File.write 'four.js', b.to_s ``` ---------------------------------------------------------------------------------------------------- [10:56:54] Elia Schito(@elia):unless - of course - I'm missing something :) ---------------------------------------------------------------------------------------------------- [10:59:01] Lars Haugseth(@lhz):This is what I have that works: ---------------------------------------------------------------------------------------------------- [10:59:11] Lars Haugseth(@lhz): Opal.append_path "app" File.binwrite "test.js", Opal::Builder.build("test").to_s ---------------------------------------------------------------------------------------------------- [11:00:07] Lars Haugseth(@lhz):And my app code is in app/test.rb ---------------------------------------------------------------------------------------------------- [11:00:54] Elia Schito(@elia):so, builder will search for `require` inside your code and include required files in the bundle ---------------------------------------------------------------------------------------------------- [11:02:07] Elia Schito(@elia):to avoid that you have to pass an Array as the `prerequired` option at builder initialization: eg. `Opal::Builder.new prerequired: ['set', 'ostruct']` ---------------------------------------------------------------------------------------------------- [11:02:34] Elia Schito(@elia):that should make it skip including Set and OpenStruct ---------------------------------------------------------------------------------------------------- [11:07:12] Lars Haugseth(@lhz):Ok, tried now using Opal::Builder.new(prerequired: ['opal', 'browser', 'browser/canvas', 'browser/interval']) ---------------------------------------------------------------------------------------------------- [11:07:37] Lars Haugseth(@lhz):Then I get "Uncaught NoMethodError: undefined method `every' for #" ---------------------------------------------------------------------------------------------------- [11:07:48] Lars Haugseth(@lhz):So progress at least :) ---------------------------------------------------------------------------------------------------- [11:07:59] Elia Schito(@elia):you get that in the browser or while compiling? :P ---------------------------------------------------------------------------------------------------- [11:08:09] Lars Haugseth(@lhz):In the browser console ---------------------------------------------------------------------------------------------------- [11:08:50] Elia Schito(@elia):you may want to check the versions you're getting from the CDN vs local ---------------------------------------------------------------------------------------------------- [11:10:02] Lars Haugseth(@lhz):using opal-browser-0.2.0, and that is the one I have locally as well. Browser::Interval should add #every to Kernel. ---------------------------------------------------------------------------------------------------- [11:10:36] Lars Haugseth(@lhz):and to Window as well. ---------------------------------------------------------------------------------------------------- [11:10:39] Elia Schito(@elia):also libraries in the CDN must be compiled against the same version of opal ---------------------------------------------------------------------------------------------------- [11:11:25] Elia Schito(@elia):that's why I asked about the use case, as using the CDN has some gotchas ---------------------------------------------------------------------------------------------------- [11:12:04] Elia Schito(@elia):but you can compile browser locally and source it from your server instead of the CDN ---------------------------------------------------------------------------------------------------- [11:17:00] Lars Haugseth(@lhz):Ok, got it to work by using only 'opal' and 'browser' as prerequired. ---------------------------------------------------------------------------------------------------- [11:17:28] Elia Schito(@elia):great! ---------------------------------------------------------------------------------------------------- [11:18:12] Lars Haugseth(@lhz):Which means browser/canvas and browser/interval is compiled in, but I can live with that. 60KB is still much better than 800 KB. :) Thanks a lot for the hints! ---------------------------------------------------------------------------------------------------- [11:18:55] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [13:40:09] Lars Haugseth(@lhz):Strange, the `every(1.0 / 60) { update }`block seems to run every 16.67 ms in Chrome on Ubuntu, but it runs only half as often in Chrome on Windows 7. The actual update method runs in ~13ms on both platforms, I've checked with `performance.now()`. ---------------------------------------------------------------------------------------------------- [13:45:02] Lars Haugseth(@lhz):Even on Ubuntu inside VMware Player running on Windows 7 it plays much faster than natively on the host. ---------------------------------------------------------------------------------------------------- [13:59:03] Lars Haugseth(@lhz):Example: http://6581.no/opal/test-1/ (code at https://github.com/lhz/opal-test/blob/master/test1/app/test.rb#L23-L30) ---------------------------------------------------------------------------------------------------- [14:03:24] Lars Haugseth(@lhz):Outputs ~14 ms for update on both platforms, ~22 ms per call to block on Chrome Ubuntu and ~32 ms per call to block on Chrome Win7. ---------------------------------------------------------------------------------------------------- [14:39:16] meh.(@meh):lhz, lhz setInterval and setTimeout aren't precise ---------------------------------------------------------------------------------------------------- ############################## [2015-09-25] ############################## [07:45:49] David Boardman(@djboardman):@elia from last Sunday... the error I'm getting with Volt specs on 0.9.0.dev... I think I've tracked down the commit... raised https://github.com/opal/opal/issues/1111 with the details ---------------------------------------------------------------------------------------------------- [07:59:33] Elia Schito(@elia):great! ---------------------------------------------------------------------------------------------------- [08:02:44] Elia Schito(@elia):@djboardman thanks for digging it up ---------------------------------------------------------------------------------------------------- [20:55:20] Harley Swick(@hswick):Hi, could someone help me out with getting window history? ---------------------------------------------------------------------------------------------------- [20:55:41] Harley Swick(@hswick):```ruby class Window # @!attribute [r] history # @return [History] the history for this window def history History.new(`#@native.history`) if `#@native.history` end end ``` ---------------------------------------------------------------------------------------------------- [20:56:15] Harley Swick(@hswick):I found this in the source code but can't seem to get the syntax to use Window's history method ---------------------------------------------------------------------------------------------------- [20:56:35] meh.(@meh):hswick, waht do you mean syntax to use Window's history method? ---------------------------------------------------------------------------------------------------- [20:56:40] meh.(@meh):did you require 'browser/history'? ---------------------------------------------------------------------------------------------------- [20:58:17] Harley Swick(@hswick):Nope! That did the trick thanks! I was trying all sorts of ways to call $window.history and couldn't seem to get it work ---------------------------------------------------------------------------------------------------- ############################## [2015-09-26] ############################## [00:26:06] Elia Schito(@elia):@meh if you have time: https://github.com/opal/opal/commit/f73f766b261b881e6cd3256287b8afa28af99693#commitcomment-13432151 ---------------------------------------------------------------------------------------------------- [00:30:31] meh.(@meh):elia, I need more than that ---------------------------------------------------------------------------------------------------- [00:30:37] meh.(@meh):but yeah I'm getting that error as well ---------------------------------------------------------------------------------------------------- ############################## [2015-09-27] ############################## [01:05:47] Jamie Gaskins(@jgaskins):Does anyone know why (or how) `String#gsub` wraps the function body in `try` / `catch`? I can't find where that happens. ---------------------------------------------------------------------------------------------------- [01:09:36] Jamie Gaskins(@jgaskins):`try` blocks can't be optimized, so I'm trying to figure out why it happens and see if there's a way we can work around it. For example, if the entire `try` block were contained within another function, _that_ function could be optimized and we wouldn't need to worry about it, since the amount of time spent in the `try` block (in that stack frame, anyway) would be negligible. ---------------------------------------------------------------------------------------------------- [15:51:38] Bernhard Weichel(@bwl21):I'm ---------------------------------------------------------------------------------------------------- [22:12:07] Elia Schito(@elia):@jgaskins seems inserted by this node: https://github.com/opal/opal/blob/master/lib/opal/nodes/def.rb#L89-L93 where `catch_return` is set here: https://github.com/opal/opal/blob/master/lib/opal/nodes/logic.rb#L176 which is true under these conditions: https://github.com/opal/opal/blob/master/lib/opal/nodes/logic.rb#L170-L172 ---------------------------------------------------------------------------------------------------- [22:14:04] Elia Schito(@elia):the final reason seems the presence of this `return`: https://github.com/opal/opal/blob/master/opal/corelib/string.rb#L458 ---------------------------------------------------------------------------------------------------- [22:15:41] Elia Schito(@elia):added by this commit https://github.com/opal/opal/commit/3368fee ---------------------------------------------------------------------------------------------------- [22:16:33] Elia Schito(@elia):which at first sight seems safe to replace with a JS level return, unless @vais has a different opinion ---------------------------------------------------------------------------------------------------- [22:52:48] Vais Salikhov(@vais):@elia thanks for looking into this. @jgaskins this issue is bigger than just `String#gsub`, it is about how breaking out of iterators is implemented in Opal using a try catch trick - throwing a special `$returner` value and checking for it in the catch clause. I am not aware of any better solution, sorry... ---------------------------------------------------------------------------------------------------- [22:57:09] Elia Schito(@elia):if extracting into a function and using the function inside the try/catch block works performance-wise I think it should be explored as a solution (/improvement) ---------------------------------------------------------------------------------------------------- [23:08:19] Elia Schito(@elia):@jgaskins @vais this I think is related/relevant: https://github.com/opal/opal/pull/1117 ---------------------------------------------------------------------------------------------------- ############################## [2015-09-28] ############################## [21:50:58] Forrest Chang(@fkchang):can't think of a legit method name symbol that we could always convert to dashes taht wouls look right ---------------------------------------------------------------------------------------------------- [21:52:17] Forrest Chang(@fkchang):I think there is not character that can be used ---------------------------------------------------------------------------------------------------- [21:54:13] meh.(@meh):using - would still not be valid syntax ---------------------------------------------------------------------------------------------------- [21:54:18] meh.(@meh):with the do ---------------------------------------------------------------------------------------------------- [21:54:33] meh.(@meh):there's really no other way than how it is ---------------------------------------------------------------------------------------------------- [21:54:43] meh.(@meh):Ruby doesn't have reader macros :) ---------------------------------------------------------------------------------------------------- [21:54:56] Forrest Chang(@fkchang):can I not pass additional hash params if I use [] ? ---------------------------------------------------------------------------------------------------- [21:55:14] Forrest Chang(@fkchang):i.e. ``` _.button.btn.btn[:default]({id: unique_button_id(abutton[:id])}) {abutton[:button_text]}``` ---------------------------------------------------------------------------------------------------- [21:58:09] meh.(@meh):I'm pretty sure that's not valid Ruby syntax ---------------------------------------------------------------------------------------------------- [21:58:47] meh.(@meh):just do _.button.btn.btn[:default].id(unique_button_id(abutton[:id])) ---------------------------------------------------------------------------------------------------- [21:59:57] Forrest Chang(@fkchang):ok, thx ---------------------------------------------------------------------------------------------------- [22:00:10] Forrest Chang(@fkchang):how about converting double underscores to dashes? ---------------------------------------------------------------------------------------------------- [22:02:30] Forrest Chang(@fkchang):looks like I still need to pass hash args ```_.button.btn.btn[:default]("data-dismiss" => "modal", :type => "button") { 'Close'}``` ---------------------------------------------------------------------------------------------------- [22:06:46] meh.(@meh):data has its own special stuff already ---------------------------------------------------------------------------------------------------- [22:06:52] meh.(@meh):I'm pretty sure button does too ---------------------------------------------------------------------------------------------------- [22:07:09] meh.(@meh):`_.button.btn.btn[:default].data(dismiss: :modal).type(:button)` ---------------------------------------------------------------------------------------------------- [22:08:03] Forrest Chang(@fkchang):ok, ---------------------------------------------------------------------------------------------------- [22:08:05] Forrest Chang(@fkchang):thx ---------------------------------------------------------------------------------------------------- [22:08:54] meh.(@meh):actually that's not working ---------------------------------------------------------------------------------------------------- [22:08:56] meh.(@meh):let me check why ---------------------------------------------------------------------------------------------------- [22:11:32] meh.(@meh):ah yeah, I fucked up bad the helper definitions everywhere somehow ---------------------------------------------------------------------------------------------------- [22:11:52] meh.(@meh):fkchang, http://sprunge.us/iTjM ---------------------------------------------------------------------------------------------------- [22:12:59] meh.(@meh):fkchang, pushed a new version with fixes for that ---------------------------------------------------------------------------------------------------- [22:14:00] Forrest Chang(@fkchang):thx ---------------------------------------------------------------------------------------------------- [03:40:06] Jamie Gaskins(@jgaskins):Yeah, I figured it was likely to be in the compiler because I couldn't see a rescue in the method. I'm still trying to get acquainted with the compiler, so I had NO idea where to look in there. :-) @elia @vais I commented on #1117 to check @wied03's benchmark, but I wanted to comment here, too, since the JS-function-wrapped `begin` block wasn't part of that discussion. If we can wrap that `begin` block, the performance difference can be pretty insane: https://gist.github.com/jgaskins/0a31974208a2d288b196 ---------------------------------------------------------------------------------------------------- [03:41:20] Jamie Gaskins(@jgaskins):3.4x in Chrome 45, 5.8x in Firefox, 5.9x in Safari 9. ---------------------------------------------------------------------------------------------------- [03:43:53] Jamie Gaskins(@jgaskins):Feel free to check that gist to see if I screwed up any of the code. With numbers like that, it's entirely possible. ---------------------------------------------------------------------------------------------------- [03:47:33] Jamie Gaskins(@jgaskins):@elia @vais: Ugh, never mind, I did indeed screw up. ---------------------------------------------------------------------------------------------------- [04:02:47] Jamie Gaskins(@jgaskins):Fixed the numbers in the gist. Turns out it's 49% faster in Safari 9, 90% faster in Chrome 45, but it is still indeed 5.8x as fast in Firefox. ---------------------------------------------------------------------------------------------------- [04:05:00] Jamie Gaskins(@jgaskins):It might be even faster than that if we can wrap it in a pure JS function (what I tried to do originally, but it failed too quickly because semantics). ---------------------------------------------------------------------------------------------------- [04:21:11] meh.(@meh):what's going on? ---------------------------------------------------------------------------------------------------- [05:43:13] Elia Schito(@elia):@meh yo dawg I heard u like optimization a so I put some optimizations in your optimizers ---------------------------------------------------------------------------------------------------- [07:23:44] Bozhidar Batsov(@bbatsov):btw, I did one more presentation about Opal (and Volt) ---------------------------------------------------------------------------------------------------- [07:23:57] Bozhidar Batsov(@bbatsov):here’s the slide deck for those who are into presentations https://speakerdeck.com/bbatsov/volt-ruby-web-devlopment-recharged-railsclub-2015 ---------------------------------------------------------------------------------------------------- [07:30:43] Elia Schito(@elia):RT'ed 👍🏼😄 ---------------------------------------------------------------------------------------------------- [11:47:39] Francesco 'makevoid' Canessa(@makevoid):hi, how do I convert a js hash to a ruby hash? ---------------------------------------------------------------------------------------------------- [11:48:18] Francesco 'makevoid' Canessa(@makevoid):do I have to iterate through each key/value or is there already a method in the sdlib to do the conversion? ---------------------------------------------------------------------------------------------------- [11:48:52] Elia Schito(@elia):@makevoid ``` require 'native' Hash.new(`{a: 1, b: 2}`) ``` ---------------------------------------------------------------------------------------------------- [11:49:11] Francesco 'makevoid' Canessa(@makevoid):grazie :D ---------------------------------------------------------------------------------------------------- [11:49:44] Elia Schito(@elia):;) ---------------------------------------------------------------------------------------------------- [11:51:44] Francesco 'makevoid' Canessa(@makevoid):it works! thanks! ---------------------------------------------------------------------------------------------------- [11:51:54] Francesco 'makevoid' Canessa(@makevoid):and what if the hash is already defined in a js variable? ---------------------------------------------------------------------------------------------------- [11:52:16] Francesco 'makevoid' Canessa(@makevoid):`JSON.stringify(hash)` ---------------------------------------------------------------------------------------------------- [11:52:56] Elia Schito(@elia):what do you mean? ---------------------------------------------------------------------------------------------------- [11:53:33] Elia Schito(@elia):does this help? ``` require 'native' obj = `{a: 1, b: 2}` Hash.new(obj) ``` ---------------------------------------------------------------------------------------------------- [11:55:32] Francesco 'makevoid' Canessa(@makevoid):yes sorry ---------------------------------------------------------------------------------------------------- [11:56:01] Francesco 'makevoid' Canessa(@makevoid):it works :) ---------------------------------------------------------------------------------------------------- [11:57:53] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [12:02:43] Francesco 'makevoid' Canessa(@makevoid):at the end I needed something to convert an array of hashes (that I get from a JSON response) to ruby ```rb def hashes_convert(array) Array.new(array).map do |elem| Hash.new elem end end ``` ---------------------------------------------------------------------------------------------------- [12:04:17] Elia Schito(@elia):any reason you're not parsing JSON into ruby directly? ``` require 'json' JSON.parse json_string_response ``` ---------------------------------------------------------------------------------------------------- [12:04:59] Francesco 'makevoid' Canessa(@makevoid):lol, because I didn't know :) ---------------------------------------------------------------------------------------------------- [12:05:09] Francesco 'makevoid' Canessa(@makevoid):thanks! ---------------------------------------------------------------------------------------------------- [12:06:27] Francesco 'makevoid' Canessa(@makevoid):I didn't know there was already a JSON class, I should look at opal internals more, I'm still a newb :) ---------------------------------------------------------------------------------------------------- [12:10:13] Elia Schito(@elia):this might help: http://opalrb.org/docs/api/v0.8.0/index.html ---------------------------------------------------------------------------------------------------- [12:10:36] Elia Schito(@elia):eg. http://opalrb.org/docs/api/v0.8.0/stdlib/classes/JSON.html ---------------------------------------------------------------------------------------------------- [12:12:34] Francesco 'makevoid' Canessa(@makevoid):coool! http://opalrb.org/docs/api/v0.8.0/stdlib/files/opal/stdlib/promise_rb.html ---------------------------------------------------------------------------------------------------- [12:12:37] Francesco 'makevoid' Canessa(@makevoid):thanks! ---------------------------------------------------------------------------------------------------- [12:12:44] Francesco 'makevoid' Canessa(@makevoid):there's plenty of cool stuff there :) ---------------------------------------------------------------------------------------------------- [12:13:23] Elia Schito(@elia):Also don't miss the guides! http://opalrb.org/docs/guides/0-8-stable/index.html ---------------------------------------------------------------------------------------------------- [12:13:29] Elia Schito(@elia):eg. http://opalrb.org/docs/guides/0-8-stable/promises.html ---------------------------------------------------------------------------------------------------- [12:15:52] Francesco 'makevoid' Canessa(@makevoid):good stuff ---------------------------------------------------------------------------------------------------- [12:16:16] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [21:26:54] Forrest Chang(@fkchang):@meh ping ---------------------------------------------------------------------------------------------------- [21:27:29] meh.(@meh):@fkchang png ---------------------------------------------------------------------------------------------------- [21:29:07] Forrest Chang(@fkchang):@meh since the naming convention for css classes seems to be dash-separated, how about some scheme that would allow paggio to convert to dash separated? ---------------------------------------------------------------------------------------------------- [21:29:18] Forrest Chang(@fkchang):not certain what character to use ---------------------------------------------------------------------------------------------------- [21:29:26] meh.(@meh):fkchang, you can already do it ---------------------------------------------------------------------------------------------------- [21:29:29] meh.(@meh):with magic! ---------------------------------------------------------------------------------------------------- [21:30:20] Forrest Chang(@fkchang):how so? ---------------------------------------------------------------------------------------------------- [21:30:28] meh.(@meh):maybe I'm wrong tho ---------------------------------------------------------------------------------------------------- [21:30:34] meh.(@meh):let me check, I remember adding something to that effect ---------------------------------------------------------------------------------------------------- [21:30:54] meh.(@meh):=> "\n\n\t\n\t\n\n" ---------------------------------------------------------------------------------------------------- [21:30:55] meh.(@meh):>> Paggio.html { lol.arrow[:left, :huge] } ---------------------------------------------------------------------------------------------------- [21:32:31] Forrest Chang(@fkchang):ah, now that I see that, I think I remember asking u before ---------------------------------------------------------------------------------------------------- [21:32:48] meh.(@meh):if the dashes are properly ordered it looks good ---------------------------------------------------------------------------------------------------- [21:34:52] Forrest Chang(@fkchang):u should document that ---------------------------------------------------------------------------------------------------- [21:46:26] Forrest Chang(@fkchang):@meh can I not use a blog w/that? This fails on the do ---------------------------------------------------------------------------------------------------- [21:46:52] Forrest Chang(@fkchang):```ruby Paggio.html! { |_| _.div.modal[:dialog] do 'hi' end } ``` ---------------------------------------------------------------------------------------------------- [21:47:07] meh.(@meh):fkchang, yeah, you can't :( ---------------------------------------------------------------------------------------------------- [21:47:16] meh.(@meh):fkchang, workaround is _.div.modal[:dialog].do { } ---------------------------------------------------------------------------------------------------- [21:47:51] Forrest Chang(@fkchang):that looks familiar, must've asked that too... ---------------------------------------------------------------------------------------------------- [21:48:09] meh.(@meh):heh ---------------------------------------------------------------------------------------------------- [21:48:44] Forrest Chang(@fkchang):thinking that class: 'modal-dialog' looking nicer then ---------------------------------------------------------------------------------------------------- [21:49:16] Forrest Chang(@fkchang):how about an option that maps underscores to dashes for classes ---------------------------------------------------------------------------------------------------- [21:49:37] meh.(@meh):sounds too easy to break things ---------------------------------------------------------------------------------------------------- [21:49:45] meh.(@meh):in that case using .div.class('modal-dialog') just works ---------------------------------------------------------------------------------------------------- [21:50:01] Forrest Chang(@fkchang):yeah, but I hate to lose the nice dot syntax ---------------------------------------------------------------------------------------------------- ############################## [2015-09-29] ############################## [18:39:15] Ryan Stout(@ryanstout):@wied03 you around? ---------------------------------------------------------------------------------------------------- [18:41:06] Ryan Stout(@ryanstout):@elia you around? ---------------------------------------------------------------------------------------------------- [19:17:31] Elia Schito(@elia):Kinda, mobile/ afk ---------------------------------------------------------------------------------------------------- [19:17:44] Elia Schito(@elia):@ryanstout ^ ---------------------------------------------------------------------------------------------------- [19:29:22] Ryan Stout(@ryanstout):@elia I'm debating if we should backport a few features from 0.9 to 0.8, or wait for 0.9. Any thoughts on timeframe? ---------------------------------------------------------------------------------------------------- [19:29:26] Ryan Stout(@ryanstout):no rush, just curious ---------------------------------------------------------------------------------------------------- [19:46:35] Brady Wied(@wied03):@ryanstout - I am around, but assuming you wanted to ask me that same question, I have no idea, was wondering that too for rspec purposes ---------------------------------------------------------------------------------------------------- [19:47:14] Ryan Stout(@ryanstout):@wied03 I was going to ask you how the rspec stuff was going? I know you had worked on the promise stuff, but wasn't sure where that ended up. ---------------------------------------------------------------------------------------------------- [20:37:49] Elia Schito(@elia):@ryanstout the stuff I'd like to have in 0.9 is here https://github.com/opal/opal/milestones/0.9 ---------------------------------------------------------------------------------------------------- [20:40:12] Ryan Stout(@ryanstout):@elia not too many things on that list :-) ---------------------------------------------------------------------------------------------------- [20:40:22] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [20:40:54] Elia Schito(@elia):was mostly docs, but now there are also a couple of bugs ---------------------------------------------------------------------------------------------------- [20:41:13] Elia Schito(@elia):and the phantomjs upgrade is non-mandatory ---------------------------------------------------------------------------------------------------- [20:43:01] Ryan Stout(@ryanstout):I have volt running on saucelabs if that helps ---------------------------------------------------------------------------------------------------- [20:44:59] Elia Schito(@elia):oh, I started adding that too, but never finished ---------------------------------------------------------------------------------------------------- [20:46:06] Elia Schito(@elia):a PR would be great, but pointing me in the right direction would be good too ---------------------------------------------------------------------------------------------------- [20:46:47] Ryan Stout(@ryanstout):@elia its been so long since I set it up, I'm not sure I even remember the details, let me find the code in volt that does it. ---------------------------------------------------------------------------------------------------- [20:47:04] Ryan Stout(@ryanstout):though it might not apply, it just runs the capybara specs with saucelab as the remote runner ---------------------------------------------------------------------------------------------------- [20:47:10] Ryan Stout(@ryanstout):you probably need something different? ---------------------------------------------------------------------------------------------------- [20:48:27] Elia Schito(@elia):there's been no capybara until now, but it's not a problem using it ---------------------------------------------------------------------------------------------------- [20:50:51] Ryan Stout(@ryanstout):yea, you might be able to use it to load up the minitest page ---------------------------------------------------------------------------------------------------- [20:50:55] Ryan Stout(@ryanstout):not sure how all of that would work ---------------------------------------------------------------------------------------------------- [20:51:40] Elia Schito(@elia):the mspec_phantom task already uses a rack up (in a thread) that is loaded by phantom js ---------------------------------------------------------------------------------------------------- [20:52:05] Elia Schito(@elia):should be easy enough to port that to capybara ---------------------------------------------------------------------------------------------------- [20:53:21] Ryan Stout(@ryanstout):https://github.com/voltrb/volt/blob/master/lib/volt/spec/sauce_labs.rb <- just realized I never added more browser variants :-) ---------------------------------------------------------------------------------------------------- [20:53:38] Ryan Stout(@ryanstout):there's a bug with automated testing in chrome that I can't get around ---------------------------------------------------------------------------------------------------- [20:56:58] Brady Wied(@wied03):@ryanstout - re: rspec, the promise stuff is in the 0.5 beta, but I've been improving the Rake task, working to get all of rspec's actual specs to run (and fixing things in opal and in the opal-rspec patches) in order to get that done. Then there's a more solid foundation that can hopefully keep up with RSpec versions more quickly ---------------------------------------------------------------------------------------------------- [20:57:35] Ryan Stout(@ryanstout):@wied03 cool, sounds great. Thanks for the hard work. ---------------------------------------------------------------------------------------------------- [20:57:57] Ryan Stout(@ryanstout):@wied03 have you run into this issue at all: https://github.com/opal/opal/issues/1111 ---------------------------------------------------------------------------------------------------- [22:39:54] Brady Wied(@wied03):@ryanstout - no, but I did comment on that just now, no luck for me either right now. ---------------------------------------------------------------------------------------------------- [22:43:40] Elia Schito(@elia):@wied03 I want to thank you too for both the great work and the patience! :D ---------------------------------------------------------------------------------------------------- [22:44:25] meh.(@meh):wied03, if it's indeed a runtime issue, handing me a huge .html with the JS that causes the issue bundled in is enough for me to debug ---------------------------------------------------------------------------------------------------- ############################## [2015-09-30] ############################## [02:58:45] Brady Wied(@wied03):@meh - I reproduced @djboardman 's issue with opal 0.9 and opal-rspec 0.4.3 just by running its specs. I sent you the JS via email. ---------------------------------------------------------------------------------------------------- ############################## [2015-10-01] ############################## [18:04:12] Forrest Chang(@fkchang):@elia ping ---------------------------------------------------------------------------------------------------- [18:06:22] Forrest Chang(@fkchang):or anyone who's converted an opal-rails app from 0.7 to 0.8, it can't seem to find my opal-haml template - this is the compile error: ```undefined method `=~' for # ``` ---------------------------------------------------------------------------------------------------- [18:10:41] Forrest Chang(@fkchang):I suspect I need require them differently? ---------------------------------------------------------------------------------------------------- [18:40:04] Jamie Gaskins(@jgaskins):@fkchang I remember seeing a commit from @elia that converted the `Pathname` objects to strings for this reason. ---------------------------------------------------------------------------------------------------- [18:59:39] Forrest Chang(@fkchang):@jgaskins in master? ---------------------------------------------------------------------------------------------------- [18:59:44] Forrest Chang(@fkchang): for opal-rails? ---------------------------------------------------------------------------------------------------- [19:00:30] Forrest Chang(@fkchang):I was going to convert my opal-haml to paggio at some point, this might force my hand a little earlier ---------------------------------------------------------------------------------------------------- [19:01:59] Jamie Gaskins(@jgaskins):@fkchang I think it was in `opal`, actually. ---------------------------------------------------------------------------------------------------- [19:02:33] Jamie Gaskins(@jgaskins):@fkchang https://github.com/opal/opal/commit/53c82d90c5dba0b51e8dcc3dd02299688e76990e ---------------------------------------------------------------------------------------------------- [19:54:18] Forrest Chang(@fkchang):@jgaskins hmm, then I'd have to be using 9.0.0.dev, I'd prefer to not have to target a moving target, maybe @elia can do an 0.8.1 opal release w/this in ---------------------------------------------------------------------------------------------------- [20:03:12] Jamie Gaskins(@jgaskins):@fkchang: @elia mentioned wanting to start the 0.9 release cycle ASAP, so at worst you'd be running against a beta. ---------------------------------------------------------------------------------------------------- [20:09:31] Forrest Chang(@fkchang):@jgaskins hmm, can run it against opal-rails head neither, it's asking for opal ~> 0.8.0 -- I guess it's 0.7 for the immediate future ---------------------------------------------------------------------------------------------------- [20:17:00] Elia Schito(@elia):@fkchang pong :) ---------------------------------------------------------------------------------------------------- [20:17:24] Elia Schito(@elia):saw the conversation, we can release a 0.8.1 in the meanwhile ---------------------------------------------------------------------------------------------------- [20:18:01] Elia Schito(@elia):will do a 0.8.1.rc1 in a few minutes ---------------------------------------------------------------------------------------------------- [20:18:21] Elia Schito(@elia):thanks @jgaskins for diggin up the right commit ---------------------------------------------------------------------------------------------------- [20:35:27] Elia Schito(@elia):https://twitter.com/rubygems/status/649682848203583488 ---------------------------------------------------------------------------------------------------- [20:38:00] Forrest Chang(@fkchang):@elia thanks! I'll check it out ---------------------------------------------------------------------------------------------------- [21:14:58] Elia Schito(@elia):@fkchang let me know how it goes so that I can release the final version ---------------------------------------------------------------------------------------------------- ############################## [2015-10-02] ############################## [19:23:59] Forrest Chang(@fkchang):@jgaskins maybe u've seen what I'm seeing where classes defined at the toplevel aren't seen when upgrading to 0.8 on opal-rails ---------------------------------------------------------------------------------------------------- [19:37:30] Elia Schito(@elia):@fkchang does it change anything if you require or load it ? ---------------------------------------------------------------------------------------------------- [19:38:17] Elia Schito(@elia):you use javascript_include_tag? ---------------------------------------------------------------------------------------------------- [19:39:50] Jamie Gaskins(@jgaskins):@fkchang I haven't, actually. I had plenty of other weirdness in upgrading an existing app from 0.7-0.8, but not that. :-) Can you reproduce it in an example? ---------------------------------------------------------------------------------------------------- [19:48:56] Forrest Chang(@fkchang):@elia all the files are under app/assets/javascripts and the application.js.rb has require_tree '.' ---------------------------------------------------------------------------------------------------- [19:49:57] Forrest Chang(@fkchang):the application.html.haml has the standard ```= javascript_include_tag 'application', 'data-turbolinks-track' => true``` ---------------------------------------------------------------------------------------------------- [19:52:46] Elia Schito(@elia):@fkchang application.js or application.js.rb? ---------------------------------------------------------------------------------------------------- [19:53:14] Elia Schito(@elia):does it work if you require the template directly? ---------------------------------------------------------------------------------------------------- [19:55:07] Forrest Chang(@fkchang):@elia application.js.rb ---------------------------------------------------------------------------------------------------- [19:55:23] Forrest Chang(@fkchang):template is there, now it just doesn't find my classes ---------------------------------------------------------------------------------------------------- [19:55:51] Forrest Chang(@fkchang):@jgaskins I will try to duplicate it ---------------------------------------------------------------------------------------------------- [21:56:59] Elia Schito(@elia):@fkchang don't know if you can share the code (e.g. via an example app) ---------------------------------------------------------------------------------------------------- [21:57:32] Elia Schito(@elia):could be some kind of bug (or unsupported behavior) in `require_tree '.'` ---------------------------------------------------------------------------------------------------- [22:05:11] Forrest Chang(@fkchang):@elia looks like I've got it isolated. Seems just having the opal haml class causes the problem, seems like whether or not I have require_tree '.' or not it breaks. Will push up to github shortly ---------------------------------------------------------------------------------------------------- [22:06:25] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:11:04] Forrest Chang(@fkchang):@elia https://github.com/fkchang/opal_08_test ---------------------------------------------------------------------------------------------------- [22:39:13] Elia Schito(@elia):@fkchang I see what's the problem ---------------------------------------------------------------------------------------------------- [22:39:35] Elia Schito(@elia):you have to assets with the same logical name but different extension ("test_class") ---------------------------------------------------------------------------------------------------- [22:39:47] Elia Schito(@elia):so one takes precedence over the other ---------------------------------------------------------------------------------------------------- [22:40:21] Elia Schito(@elia):The moment you rename one of the two it works as expected ---------------------------------------------------------------------------------------------------- [22:41:10] Elia Schito(@elia):@fkchang I think it's work filing an issue there on rails/sprockets and see if @schneems is willing to add a warning for name clashes ---------------------------------------------------------------------------------------------------- [22:58:21] Forrest Chang(@fkchang):@elia in 0.7.0, requiring with the extensions disambiguated it, i.e. require 'test_class.html.haml', seems like a retrograde move, IMO. Maybe a different directory would solve it, if not then if I had 2 opal files of the same names, would they conflict? say 'subdir1/klass.rb' and 'subdir2/klass.rb' ? ---------------------------------------------------------------------------------------------------- [23:00:20] Elia Schito(@elia):no the different dir definitely solves it, 0.8 relies on sprockets for the file lookup, that means you would have the same problem if the files were `foo.js.coffee` and `foo.eco` ---------------------------------------------------------------------------------------------------- [23:00:45] Forrest Chang(@fkchang):so if I were to put views in a subdir, that should work, I'll try it ---------------------------------------------------------------------------------------------------- [23:00:53] Forrest Chang(@fkchang):but good to know about the clash ---------------------------------------------------------------------------------------------------- [23:00:54] Elia Schito(@elia):I think builder is still able to differentiate between them tho ---------------------------------------------------------------------------------------------------- [23:10:32] Forrest Chang(@fkchang):@elia hmmm, what worked on 0.7 doesn't work, I put it under app/assets/javascripts/views the require seems to work (both ```require 'test_class.haml'``` and ```require 'views/test_class.haml``` but I can figure out how to reference it Tempate['test_class'] Template['test_class.haml'] and Template['views/test_class.haml'] all fail ---------------------------------------------------------------------------------------------------- [23:28:15] Forrest Chang(@fkchang):ok, it's Template['views/test_class'] ---------------------------------------------------------------------------------------------------- [23:30:05] Forrest Chang(@fkchang):updated the github so it works, if anyone needs a reference ---------------------------------------------------------------------------------------------------- [00:46:40] Forrest Chang(@fkchang):@elia I don't get that error anymore but I get this ```couldn't find file 'boolean_editor.html.haml' with type 'application/javascript' ``` ---------------------------------------------------------------------------------------------------- [00:47:20] Forrest Chang(@fkchang):do I need to require them differently? I have been doing ```require 'boolean_editor.html.haml'``` ---------------------------------------------------------------------------------------------------- [01:58:01] Jamie Gaskins(@jgaskins):@fkchang What happens when you just do `require 'boolean_editor'`? ---------------------------------------------------------------------------------------------------- [17:07:04] Forrest Chang(@fkchang):@jgaskins I'd have to rename stuff to try that I have ruby code and templates with the same root name (my convention for keeping them correlated). I might start a fresh rails project to explore what the correct template require scheme is. I ended up doing the full require 'boolean_editor.html.haml' in a previous project to disambiguate tempate vs code because of said naming scheme, which worked fine on 0.6 and 0.7 ---------------------------------------------------------------------------------------------------- [17:07:28] Mark Howard(@iheartkode):Hello Everyone ---------------------------------------------------------------------------------------------------- [17:07:40] Forrest Chang(@fkchang):@elia have any template require tips? ---------------------------------------------------------------------------------------------------- [17:07:46] Forrest Chang(@fkchang):hi @iheartkode ---------------------------------------------------------------------------------------------------- [17:07:51] Elia Schito(@elia):Hi! ---------------------------------------------------------------------------------------------------- [17:08:14] Mark Howard(@iheartkode):Ruby to JS wow I hate Js but love Ruby ---------------------------------------------------------------------------------------------------- [17:08:52] Elia Schito(@elia):@fkchang I require them without extension ---------------------------------------------------------------------------------------------------- [17:09:10] Elia Schito(@elia):are you using Opal Builder or sprockets ? ---------------------------------------------------------------------------------------------------- [17:11:26] Mark Howard(@iheartkode):So what are the common uses for Opal? ---------------------------------------------------------------------------------------------------- [17:47:56] George Plymale II(@ylluminarious):@iheartkode pretty much any common use of javascript ;) ---------------------------------------------------------------------------------------------------- [17:47:57] Forrest Chang(@fkchang):@elia it's opal-rails, so sprockets ---------------------------------------------------------------------------------------------------- [17:49:10] Forrest Chang(@fkchang):@elia is there a way to tell opal/opal-rails the difference between name.rb and name.html.haml, as both would be require 'name' ---------------------------------------------------------------------------------------------------- [17:49:53] Forrest Chang(@fkchang):@iheartkode I try to use it for any non trivial use of javascript, sometimes a few lines here and there in a vanilla rails app is all I need, but once there's complexity involved, I switch to opal ---------------------------------------------------------------------------------------------------- [17:50:13] Mark Howard(@iheartkode):Sweet ---------------------------------------------------------------------------------------------------- [18:06:36] Elia Schito(@elia):@fkchang :bulb: drop the ".html" ---------------------------------------------------------------------------------------------------- [18:30:11] Jamie Gaskins(@jgaskins):@elia Good point. It's not being compiled to HTML. It's being compiled to JS. Could Sprockets be having trouble with that discrepancy? ---------------------------------------------------------------------------------------------------- [18:58:47] Forrest Chang(@fkchang):@elia that's an improvement, compiler is happ, now I seem to have an issue with some classes that are defined and required, but opal doesn't know about them. Hopefully I can resolve them in short order. Anything sound familiar aobut that ---------------------------------------------------------------------------------------------------- [18:59:06] Forrest Chang(@fkchang):@jgaskins I followed the rails conventions, I'm not sharing templates in this app, but have in others ---------------------------------------------------------------------------------------------------- [19:00:56] Forrest Chang(@fkchang):@elia I understand that the big factor in the 0.7 -> 0.8 change had to do w/modules and ordered requires, maybe there's some general advice, background knowledge, that would make it easier to debug such ---------------------------------------------------------------------------------------------------- [19:04:32] Forrest Chang(@fkchang):@elia seems to be the scope is wrong, i.e. StringEditor is defined at the toplevel, but the error is ```Uncaught NameError: uninitialized constant Object::StringEditor``` ---------------------------------------------------------------------------------------------------- [19:08:55] Forrest Chang(@fkchang):@elia So I don't see the class off of Opal, i.e. Opal.StringEditor doesn't exist, but I see a module in Opal.modules.string_editor .. maybe @meh @vais knows something about what I'm seeing? ---------------------------------------------------------------------------------------------------- ############################## [2015-10-03] ############################## [00:34:27] Forrest Chang(@fkchang):@elia looks like I got my app updated, works as far as I can tell, will have to test more, but I needed to put views in a different directory, etc. ---------------------------------------------------------------------------------------------------- [01:21:24] Forrest Chang(@fkchang):app seems to work, think 0.8.1 is safe ---------------------------------------------------------------------------------------------------- ############################## [2015-10-04] ############################## [00:53:36] harvard1932(@harvard1932):can anyone tell me how to run complied javascript converted using ruby? it seems like it runs on the the website and gives the right output, but when I try to implement it as javascript, it doesn't do anything ---------------------------------------------------------------------------------------------------- [17:01:34] Forrest Chang(@fkchang):@harvard1932 I don't quite understand, can u provide more details? ---------------------------------------------------------------------------------------------------- [17:45:55] Jamie Gaskins(@jgaskins):@harvard1932 Do you mean you're running the compiled JS code you get from opalrb.org/try ? ---------------------------------------------------------------------------------------------------- [17:46:58] Jamie Gaskins(@jgaskins):If that's what you're trying, you'll just need to put `` before that JS code in your page. Should get it running. ---------------------------------------------------------------------------------------------------- [20:34:16] Elia Schito(@elia):@jgaskins ping ---------------------------------------------------------------------------------------------------- [21:58:27] Jamie Gaskins(@jgaskins):@elia What's up? ---------------------------------------------------------------------------------------------------- [21:59:05] Elia Schito(@elia):@jgaskins a couple of updates on #1128 ---------------------------------------------------------------------------------------------------- [21:59:28] Elia Schito(@elia):wanted to check with you before trying to write a spec for it ---------------------------------------------------------------------------------------------------- [22:02:02] Jamie Gaskins(@jgaskins):Having a look ---------------------------------------------------------------------------------------------------- ############################## [2015-10-07] ############################## [21:30:44] Ryan Stout(@ryanstout):@fkchang you around? had a question on opal-irb ---------------------------------------------------------------------------------------------------- ############################## [2015-10-08] ############################## [03:23:06] Jamie Gaskins(@jgaskins):Has anyone thought about doing something with Opal similar to JS UMD? For those who are unfamiliar with UMD, it's just like Ruby's `require`, but instead of returning `true` / `false` based on whether or not that particular call just loaded it, it can return objects or functions evaluated in that file. And successive requires return the same object instance. This way, instead of requiring files for their side effects, we could require them for their return value. Basically, I don't want to pollute the top-level namespace by assigning object instances to constants, but I also don't want to clutter up my main app file by dumping all of these objects into the one file. ---------------------------------------------------------------------------------------------------- [03:25:30] Jamie Gaskins(@jgaskins):If people are interested, I'll file an issue. It's just one thing I thought the JS community got really right that Ruby got really wrong. :-) ---------------------------------------------------------------------------------------------------- [15:27:00] ll14m4n(@ll14m4n):Hello! I'm trying to use Middleman for static Opal app. How can I enable source maps? Don't even know where to start. ---------------------------------------------------------------------------------------------------- [19:52:58] Adam Jahn(@ajjahn):@elia If you haven't seen https://github.com/opal/opal-activesupport/pull/7 yet, let me know if you need anything else from me to get it merged. Also, would love to see a release too. Building another project against it. ---------------------------------------------------------------------------------------------------- [20:18:12] Elia Schito(@elia):@ajjahn merged thanks! I didn't see it, also cutting a new release right now ---------------------------------------------------------------------------------------------------- [20:20:00] Elia Schito(@elia):@ajjahn one thing that would be cool is to somehow keep a list of implemented stuff, just to make it easier to see if a particular AS thing is there already ---------------------------------------------------------------------------------------------------- [20:20:35] Elia Schito(@elia):maybe the readme could work, or a changelog ---------------------------------------------------------------------------------------------------- [20:24:06] Adam Jahn(@ajjahn):Thanks! Yeah, I was wondering the same thing. I would like to keep implementing things, but it will get tricky keeping track of partially implemented things even with a changeling or readme. ---------------------------------------------------------------------------------------------------- [20:28:08] Elia Schito(@elia):@ajjahn maybe it can help to have a reverse list, like of stuff that are still missing, and each PR will remove relevant lines from it ---------------------------------------------------------------------------------------------------- [20:28:46] Adam Jahn(@ajjahn):I wonder if it would be worth/possible to write a little wrapper over opal-rspec that would run test unit tests without the need to manually convert them. Then we could build against the actual AS tests to see what's missing. Just thinking out loud... ---------------------------------------------------------------------------------------------------- [20:29:40] Adam Jahn(@ajjahn):But you're right, at the very least a list is a good idea to get started. ---------------------------------------------------------------------------------------------------- [20:44:32] Elia Schito(@elia):@ajjahn I used rspec in the first place just for familiarity, I have no problem with switching to unit or minitest, or even to keep them both while we transition ---------------------------------------------------------------------------------------------------- [20:44:54] Elia Schito(@elia):opal-minitest should work to run them ---------------------------------------------------------------------------------------------------- [20:45:59] Adam Jahn(@ajjahn):@elia Oh jeez, I didn't even know opal-minitest existed. Yes I will explore a bit. ---------------------------------------------------------------------------------------------------- [20:47:18] Adam Jahn(@ajjahn):I typically use rspec, but in this case it makes sense to be able to pluck tests from AS and have them run. ---------------------------------------------------------------------------------------------------- [20:57:51] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [20:59:23] Adam Jahn(@ajjahn):@elia Did you release then? ---------------------------------------------------------------------------------------------------- [21:01:48] Elia Schito(@elia):ouch ---------------------------------------------------------------------------------------------------- [21:01:56] Elia Schito(@elia):got distracted :P ---------------------------------------------------------------------------------------------------- [21:04:15] Elia Schito(@elia):@ajjahn https://twitter.com/rubygems/status/652227872699101184 ---------------------------------------------------------------------------------------------------- [21:05:29] Adam Jahn(@ajjahn):Rad! I'll try and keep adding to it as I am able. ---------------------------------------------------------------------------------------------------- [21:13:48] Elia Schito(@elia):just for the record, I'd be happy to give commit access if it becomes more convenient :smile: ---------------------------------------------------------------------------------------------------- [21:15:12] Adam Jahn(@ajjahn):Yeah, I'd be on board with that. ---------------------------------------------------------------------------------------------------- [21:40:58] Jose Añasco(@merongivian):hey, what version of rspec is rspec-opal pointing to ?, i want it to use the --bisect option but it seems that is only supported on version 3.4 or something ---------------------------------------------------------------------------------------------------- [21:46:31] Elia Schito(@elia):@merongivian opal-rspec 0.4 I think is still on 3.0 (beta-something), there's opal-rpsec 0.5 that is still in beta and uses a more recent version (3.1 I think) ---------------------------------------------------------------------------------------------------- [21:46:57] Elia Schito(@elia):But I doubt --bisect will work out of the box being it a CLI option ---------------------------------------------------------------------------------------------------- [21:47:29] Elia Schito(@elia):in the meanwhile though @wied03 is doing an awesome job to bump it to the latest version, making rspec's own specs to pass under opal ---------------------------------------------------------------------------------------------------- [21:51:19] Jose Añasco(@merongivian):@elia so opal-rspec can't use all of the rspec cli options?, don't understand that ---------------------------------------------------------------------------------------------------- [21:51:22] Forrest Chang(@fkchang):@ryanstout what's up? ---------------------------------------------------------------------------------------------------- [21:51:57] Ryan Stout(@ryanstout):@fkchang nevermind, answered it already, thanks ---------------------------------------------------------------------------------------------------- [21:55:16] Elia Schito(@elia):@merongivian opal-rspec is targeted to the browser mainly, the rake task uses phantomjs to run the specs, which implies there's no CLI :) ---------------------------------------------------------------------------------------------------- [21:56:41] Jose Añasco(@merongivian):@elia oh gotcha ---------------------------------------------------------------------------------------------------- [21:57:26] Jose Añasco(@merongivian):so maybe it have to be implemented specially for opal-rspec ---------------------------------------------------------------------------------------------------- [21:59:18] Elia Schito(@elia):yes, I can guess --bisect runs the suite multiple times with different sets of examples and different sorting in order to track down the failure cause, if I'm right it could still do most of the job in MRI and just delegate the actual running of the specs to opal ---------------------------------------------------------------------------------------------------- [22:02:28] Jose Añasco(@merongivian):@elia yea something like that, haven't try the bisect option on rspec but i want it to use it on opal-rspec, would be great to have that ---------------------------------------------------------------------------------------------------- ############################## [2015-10-12] ############################## [20:46:41] Elia Schito(@elia):@/all https://twitter.com/rubygems/status/653673095727874048 ---------------------------------------------------------------------------------------------------- [21:21:45] Elia Schito(@elia):CHANGES: https://github.com/opal/opal/releases/tag/v0.8.1 ---------------------------------------------------------------------------------------------------- [21:38:57] Ryan Stout(@ryanstout):@elia nice work ---------------------------------------------------------------------------------------------------- [22:26:42] George Plymale II(@ylluminarious):@elia :clap: ---------------------------------------------------------------------------------------------------- ############################## [2015-10-13] ############################## [05:01:54] Jared White(@jaredcwhite):@elia super cool news on opal 0.8.1 - also great to see opal-activesupport 0.2.0 with .try support!!! ---------------------------------------------------------------------------------------------------- [07:50:01] Elia Schito(@elia):Hey thanks everyone for the hard work!! ---------------------------------------------------------------------------------------------------- [18:45:21] Jamie Gaskins(@jgaskins):@elia Are the method-call optimizations we made included in 0.8.1 or are we holding onto those until 0.9? ---------------------------------------------------------------------------------------------------- [19:39:33] Elia Schito(@elia):0.9, this is just a bug fix release ---------------------------------------------------------------------------------------------------- [19:39:52] Elia Schito(@elia):mostly wrt sprockets compatibility ---------------------------------------------------------------------------------------------------- [19:39:55] Elia Schito(@elia):@jgaskins ---------------------------------------------------------------------------------------------------- [19:45:16] Jamie Gaskins(@jgaskins):@elia: Cool, just checking. :-) ---------------------------------------------------------------------------------------------------- [20:07:19] Elia Schito(@elia):yeah, just need to fix #1111 and that 0.9 can get out of the doors ---------------------------------------------------------------------------------------------------- [20:18:33] meh.(@meh):@elia any progress with that? ---------------------------------------------------------------------------------------------------- [20:19:07] Elia Schito(@elia):nothing usable ---------------------------------------------------------------------------------------------------- [20:20:02] Elia Schito(@elia):@meh but I'm now of the opinion that we should pile up another fix and do the proper overhaul after 0.9 ---------------------------------------------------------------------------------------------------- [20:20:26] meh.(@meh):@elia only way if you want 0.9 to be out before 2018 :P ---------------------------------------------------------------------------------------------------- [20:20:41] Elia Schito(@elia):exactly ---------------------------------------------------------------------------------------------------- [20:24:11] Ryan Stout(@ryanstout):@meh @elia what do you have to overhaul? :-) ---------------------------------------------------------------------------------------------------- [20:26:05] Elia Schito(@elia):@ryanstout the metaclass and module inclusion support ---------------------------------------------------------------------------------------------------- [20:26:31] Ryan Stout(@ryanstout):ah ---------------------------------------------------------------------------------------------------- [20:27:13] Elia Schito(@elia):everyday stuff works but edge cases are not covered properly ---------------------------------------------------------------------------------------------------- [20:30:00] Elia Schito(@elia):@meh I think though that differentiating between `def self.` and `def` inside the singleton class is key (inside the call.rb node) ---------------------------------------------------------------------------------------------------- ############################## [2015-10-14] ############################## [14:00:53] Elia Schito(@elia):@meh ^ ---------------------------------------------------------------------------------------------------- [14:01:53] Ilya Bylich(@iliabylich):I've seen this code. But object_id must a be a Fixnum, right? :D ---------------------------------------------------------------------------------------------------- [14:03:55] Elia Schito(@elia):``` irb(main):001:0> 123.__id__ => 247 irb(main):002:0> 125.__id__ => 251 irb(main):003:0> 125.234.__id__ => 214615662542620458 irb(main):004:0> ``` ---------------------------------------------------------------------------------------------------- [14:04:18] Elia Schito(@elia):apparently it's the expected behavior for Fixnums, but not for Float ---------------------------------------------------------------------------------------------------- [14:07:05] Ilya Bylich(@iliabylich):And in opal Float is a Fixnum, right? (like in js) So there's just no way to implement it ---------------------------------------------------------------------------------------------------- [14:08:08] Elia Schito(@elia):@iliabylich yeah, they're the same, although an inline check could probably work (assuming 1.0 is a Fixnum and 1.1 a Float) ---------------------------------------------------------------------------------------------------- [22:05:41] Elia Schito(@elia):@meh \o/ hard to believe but I may have fixed #1111 actually simplifying the code! ---------------------------------------------------------------------------------------------------- [22:09:17] meh.(@meh):elia, nice ---------------------------------------------------------------------------------------------------- [22:09:29] Elia Schito(@elia):prepping the PR ---------------------------------------------------------------------------------------------------- [23:01:49] Elia Schito(@elia):@meh please :eyeglasses: #1148 ---------------------------------------------------------------------------------------------------- [23:03:18] meh.(@meh):looks ok ---------------------------------------------------------------------------------------------------- [23:03:32] meh.(@meh):except for the failures :P ---------------------------------------------------------------------------------------------------- [23:03:50] Elia Schito(@elia):fixing the failure, I think Module#< is quite broken… ---------------------------------------------------------------------------------------------------- [23:29:31] Elia Schito(@elia):@meh fixed ---------------------------------------------------------------------------------------------------- [23:32:01] meh.(@meh):elia, looks fine ---------------------------------------------------------------------------------------------------- [23:32:05] meh.(@meh):feel free to merge ---------------------------------------------------------------------------------------------------- [23:32:36] Ryan Stout(@ryanstout)::clap: ---------------------------------------------------------------------------------------------------- [13:54:22] Ilya Bylich(@iliabylich):`135.6.object_id # => 272.2` - is this behavior expected? (opal master) ---------------------------------------------------------------------------------------------------- [14:00:40] Elia Schito(@elia):``` def __id__ `(self * 2) + 1` end ``` ---------------------------------------------------------------------------------------------------- ############################## [2015-10-15] ############################## [00:10:27] Forrest Chang(@fkchang):@elia on specs in opal-rails for 0.8.*, rake opal:spec works fine, /opal_spec shows the specs, but doesn't run anything, is there a missing instruction in the opal-rails readme ? ---------------------------------------------------------------------------------------------------- [00:18:08] Elia Schito(@elia):@fkchang IIRC you need to explicitly require opal & opal-rspec ---------------------------------------------------------------------------------------------------- [00:19:11] Elia Schito(@elia):have a look at the spec files in the dummy app in the opal-rails repo ---------------------------------------------------------------------------------------------------- [00:50:15] Vais Salikhov(@vais):@elia you rock! ---------------------------------------------------------------------------------------------------- [05:30:08] Forrest Chang(@fkchang):@elia, they're already required, the rake tasks runs the spec, but /opal_spec is aware of them, shows no js errors, but just doesn't run anything, it's like the runner is not being invoked ---------------------------------------------------------------------------------------------------- [05:35:05] Forrest Chang(@fkchang):@elia nm, figured it out https://github.com/opal/opal-rails/blob/master/test_app/spec-opal/spec_helper.rb has Opal::RSpec::Runner.autorun ---------------------------------------------------------------------------------------------------- [05:41:50] Forrest Chang(@fkchang):@elia this seems to make the rake task run specs 2x though (or is it 3x). I have 13 specs and the rake tasks gives this ``` HEDGMAC18:spike1 fkchang$ rake opal:spec 2015-10-14 22:38:14.730 phantomjs[68288:d07] CoreText performance note: Client called CTFontCreateWithName() using name "Times New Roman" and got font with PostScript name "TimesNewRomanPSMT". For best performance, only use PostScript names when calling this API. 2015-10-14 22:38:14.731 phantomjs[68288:d07] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug. Finished 13 examples, 0 failures (time taken: 0.036) Finished 26 examples, 0 failures (time taken: 0.022) ``` ---------------------------------------------------------------------------------------------------- ############################## [2015-10-17] ############################## [06:34:59] Dan Allen(@mojavelinux):Now that we're starting to more usage of Opal from Node modules (one case is Asciidoctor.js), the file stuff is becoming increasingly more important. ---------------------------------------------------------------------------------------------------- [06:35:47] Dan Allen(@mojavelinux):We've hacked some solutions in Asciidoctor.js, but I worry that Opal gets a stigma that it doesn't do file operations and that could severely limit its usage as JavaScript moves beyond the browser more and more ---------------------------------------------------------------------------------------------------- [06:36:05] Dan Allen(@mojavelinux):/starting to more/starting to see more/ ---------------------------------------------------------------------------------------------------- [07:08:54] Vais Salikhov(@vais):@mojavelinux looks like it's just a matter of putting in more blood, sweat, and tears into https://github.com/opal/opal/tree/master/stdlib/nodejs - @elia already laid down the groundwork for this to happen. It's no small task though! ---------------------------------------------------------------------------------------------------- [07:10:23] Vais Salikhov(@vais):I.e. fill out more of https://github.com/opal/opal/blob/master/stdlib/nodejs/file.rb, https://github.com/opal/opal/blob/master/stdlib/nodejs/fileutils.rb, https://github.com/opal/opal/blob/master/stdlib/nodejs/dir.rb, etc. etc. ---------------------------------------------------------------------------------------------------- [17:12:49] Forrest Chang(@fkchang):@mojavelinux what scenarios outside of asciidoctor.js are you using opal in node? ---------------------------------------------------------------------------------------------------- ############################## [2015-10-18] ############################## [19:58:52] Dany M(@dany-on-demand):quick question ---------------------------------------------------------------------------------------------------- [19:58:52] Dany M(@dany-on-demand):https://github.com/opal/opal/issues/520 ---------------------------------------------------------------------------------------------------- [19:58:55] Dany M(@dany-on-demand):does this still apply? ---------------------------------------------------------------------------------------------------- [20:08:58] meh.(@meh):@dany-on-demand numeric operators are now optimized ---------------------------------------------------------------------------------------------------- [20:09:02] meh.(@meh):but there will always be overhead ---------------------------------------------------------------------------------------------------- [20:09:08] Dany M(@dany-on-demand):awesome, thanks! ---------------------------------------------------------------------------------------------------- [20:09:27] meh.(@meh):there's also been a lot of work in performance lately ---------------------------------------------------------------------------------------------------- [20:09:45] meh.(@meh):the best way to go is write your stuff, benchmark and profile it, and post results ---------------------------------------------------------------------------------------------------- [20:09:56] meh.(@meh):there might be a chance that something can be done on the opal side of things to improve the performance ---------------------------------------------------------------------------------------------------- [20:10:53] meh.(@meh):but yeah, just see going down to JS for performance reasons as you'd go down to C with Ruby for performance reasons ---------------------------------------------------------------------------------------------------- ############################## [2015-10-19] ############################## [16:38:27] Martin Becker(@Thermatix):how optamized/fast is opal now? ---------------------------------------------------------------------------------------------------- [16:38:37] Martin Becker(@Thermatix):optimised* ---------------------------------------------------------------------------------------------------- [16:39:10] Elia Schito(@elia):@Thermatix there's a benchmark dir with instructions on how to compare to MRI, let me see if I can get you a link ---------------------------------------------------------------------------------------------------- [16:39:48] Martin Becker(@Thermatix):umm is that compaired to JS? ---------------------------------------------------------------------------------------------------- [16:39:54] Elia Schito(@elia):https://github.com/opal/opal/blob/master/CONTRIBUTING.md#benchmarking ---------------------------------------------------------------------------------------------------- [16:40:44] Elia Schito(@elia):that's the MRI reused for opal, otherwise I think you're better off with jsperf ---------------------------------------------------------------------------------------------------- [16:41:57] Martin Becker(@Thermatix):I'm guessing this benchmarks how long it takes to transpile the ruby to js? ---------------------------------------------------------------------------------------------------- [16:43:33] Elia Schito(@elia):no, benchmarks actual run time ---------------------------------------------------------------------------------------------------- [16:45:01] Elia Schito(@elia):@Thermatix are you interested in any particular benchmark? ---------------------------------------------------------------------------------------------------- [16:51:06] Martin Becker(@Thermatix):not really, just interested in how much of a difference between opal generated JS and equivalent "normal" JS is ---------------------------------------------------------------------------------------------------- [16:53:25] Elia Schito(@elia):method calls are 1:1 and Array,String,Numeric & some others are the same so in many many cases the overhead is just the same ---------------------------------------------------------------------------------------------------- [16:54:59] Elia Schito(@elia):i mean it's zero :) ---------------------------------------------------------------------------------------------------- [17:07:37] Elia Schito(@elia):@Thermatix more on that here: http://opalrb.org/docs/guides/0-8-stable/compiled_ruby.html ---------------------------------------------------------------------------------------------------- [17:42:30] Forrest Chang(@fkchang):@elia did u see my message about running specs 2x w/rake task on opal-rails. I'll see if I can look into if if I have time, but wondering if knew off hand what might cause it ---------------------------------------------------------------------------------------------------- [17:44:54] Elia Schito(@elia):I saw ---------------------------------------------------------------------------------------------------- [17:45:17] Elia Schito(@elia):But was on a poor connection during the last days ---------------------------------------------------------------------------------------------------- [17:45:56] Elia Schito(@elia):can you open an issue on Opal-rails so I can't forget? :P ---------------------------------------------------------------------------------------------------- [18:02:48] Forrest Chang(@fkchang):@elia sure ---------------------------------------------------------------------------------------------------- [18:03:19] Forrest Chang(@fkchang):btw, anyone know about wedge and opal-wedge? Just saw the gem, and I'm curious https://rubygems.org/gems/wedge ---------------------------------------------------------------------------------------------------- [20:05:31] Elia Schito(@elia):https://github.com/wedgeio/wedge ---------------------------------------------------------------------------------------------------- [20:12:47] Artur Ostręga(@aost):Somewhat late, but opal-minitest now supports Opal v0.8 and PhantomJS v2 https://github.com/aost/opal-minitest#readme ---------------------------------------------------------------------------------------------------- [20:19:36] Elia Schito(@elia):@aost great! ---------------------------------------------------------------------------------------------------- [20:20:32] Elia Schito(@elia):@aost I think I'll copy the phantomjs2 stuff over to opal and opal-rspec :) ---------------------------------------------------------------------------------------------------- [22:47:32] Forrest Chang(@fkchang):@elia what's in the 9.0 beta1 release? ---------------------------------------------------------------------------------------------------- [22:51:22] Elia Schito(@elia):Going to bed now ---------------------------------------------------------------------------------------------------- [22:52:03] Elia Schito(@elia):@fkchang but the change log should be pretty accurate ---------------------------------------------------------------------------------------------------- [22:52:27] Elia Schito(@elia):tldr is "a ton of stuff" tho :) ---------------------------------------------------------------------------------------------------- [23:11:39] Artur Ostręga(@aost):@elia Feel free! :grin: ---------------------------------------------------------------------------------------------------- ############################## [2015-10-20] ############################## [13:44:01] Martin Becker(@Thermatix):slow is relative in this case ---------------------------------------------------------------------------------------------------- [13:44:03] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [13:44:19] Elia Schito(@elia):yep, sorry if I stated the obvious ;) ---------------------------------------------------------------------------------------------------- [13:44:23] Martin Becker(@Thermatix):slower then clearwater but faster then anything else XD ---------------------------------------------------------------------------------------------------- [16:43:07] Jamie Gaskins(@jgaskins):@Thermatix I think most people would be surprised at how unimportant raw execution speed is in most front-end apps. :-) Coalescing renders is just about the most important thing, which any virtual DOM implementation gives you for free. In contrast, most apps using jQuery and Backbone, for example, interleave DOM reads and writes, which leads to a _lot_ of page reflows during render, which wastes time — and battery life, which seems to be a hot topic these days. Beyond that, you're looking at a difference of a handful of milliseconds, which only the most aggressive performance hounds will notice in most apps. :-) ---------------------------------------------------------------------------------------------------- [16:56:42] Martin Becker(@Thermatix):true enough, but for me it's not just speed, that was just icing on the cake ---------------------------------------------------------------------------------------------------- [16:57:20] Martin Becker(@Thermatix):The internet is supposed to be stateless and most frameworks go against that contract ---------------------------------------------------------------------------------------------------- [16:57:25] Martin Becker(@Thermatix):react doesn't ---------------------------------------------------------------------------------------------------- [16:57:36] Martin Becker(@Thermatix):everything flows in one direction like the internet is supposed to ---------------------------------------------------------------------------------------------------- [16:57:54] Martin Becker(@Thermatix):and once execution is finished, it's done, no state ---------------------------------------------------------------------------------------------------- [17:09:24] Brady Wied(@wied03):Not that my opinion matters a ton but I use react and I like it but I do think React (and the software world in general) is a little bit over the top with immutability these days. State is kind of a fact of life (I've never been able to have my chain of React components be state free). My worry is that the immutability movement is a reaction to OO done the wrong way. OO done the wrong way was Javabeans, etc. where public setters exposed the state of objects to the world. The right fix for that was to do what OO said from the beginning, which is encapsulate, control and ensure a valid state. I'm not sure if eliminating state was really necessary to fix that. I guess I'm a fan of partial immutability then. :) ---------------------------------------------------------------------------------------------------- [18:47:59] Martin Becker(@Thermatix):It's not immutability I have an issue with, just the internet is supposed to be stateless, the problem I have is that most frameworks have states that can change and then be written to backwards AND forwards. You can't do that in react, it has to go one way, something happens (button gets clicked on) which triggers a cascade of changes and then it stops until the next event, which is closer to how the web is because it's a one direction flow. It's because of that I feel it fits web development better then angular or ember ---------------------------------------------------------------------------------------------------- [19:39:36] Jamie Gaskins(@jgaskins):@wied03 Agreed. The craze over immutability is probably just the pendulum swinging the other direction. Immutability is great and solves a lot of problems, but it doesn't solve all of them. I really like Redux and its emphasis on immutability (so much that I based [`grand_central`](https://github.com/clearwater-rb/grand_central) on it) because it works really well for that purpose. UI elements being stateless is nice, but as you mentioned, it's not pragmatic to do it everywhere. You'd have to put that state in your store or in the URL. ---------------------------------------------------------------------------------------------------- [19:40:09] Jamie Gaskins(@jgaskins):@Thermatix I'm not sure I follow what you're saying. HTTP is stateless, but what else about the internet was intended to be? Also, how does this apply to front-end apps? They're a lot closer to native apps than they are to "the internet". That is, you fetch them from the internet, but after that, there's nothing else about them that relates to the internet at all. ---------------------------------------------------------------------------------------------------- [23:24:09] Elia Schito(@elia):@/all opal 0.9.0.beta1 is out, now's the time to test your apps and libs against it! :D https://twitter.com/rubygems/status/656214540363911168 changes: https://github.com/opal/opal/blob/master/CHANGELOG.md#090-edge ---------------------------------------------------------------------------------------------------- [23:25:31] Elia Schito(@elia):also any help in writing a blog post for 0.9 on opalrb.org would be appreciated :smile: ---------------------------------------------------------------------------------------------------- [23:41:21] Ryan Stout(@ryanstout):@elia nice work! ---------------------------------------------------------------------------------------------------- [23:41:27] Ryan Stout(@ryanstout)::clap: ---------------------------------------------------------------------------------------------------- [23:41:38] Ryan Stout(@ryanstout):I can help with a blog post if you need it ---------------------------------------------------------------------------------------------------- [23:41:53] Elia Schito(@elia):That would be awesome! ---------------------------------------------------------------------------------------------------- [23:42:08] Ryan Stout(@ryanstout):what were you thinking for a blog post? ---------------------------------------------------------------------------------------------------- [23:43:07] Elia Schito(@elia):Presenting the release, listing the new features, maybe some highlights, something that can be shared and make it to twitter/reddit/hn/… :) ---------------------------------------------------------------------------------------------------- [23:45:59] Ryan Stout(@ryanstout):cool, I'm pretty busy today, but I should have sometime tomorrow if that works. ---------------------------------------------------------------------------------------------------- [23:47:58] Elia Schito(@elia):no rush, the timeline is just after the 0.9 release, I think it will take a couple of weeks at least (a month?) to cycle betas and release candidates and have all major libs ready ---------------------------------------------------------------------------------------------------- [01:43:14] Jamie Gaskins(@jgaskins):@Thermatix I'll run a couple benchmarks comparing Opal vs JS, but I can guarantee you that, realistically, it doesn't matter. For example, people started using React.js because it allows them to write high-performance apps easily. An equivalent Clearwater app (a framework written with Opal — https://github.com/clearwater-rb/clearwater) is faster. ---------------------------------------------------------------------------------------------------- [01:51:23] Jamie Gaskins(@jgaskins):@Thermatix Deoptimizations in the JS VM like those that occur in React.js have far higher performance costs than the slight overhead incurred by Opal. I've submitted several PRs to Opal that do nothing more than remove deoptimizations, which is how Clearwater can run faster than React (anywhere from 20% to 100% faster, depending on the app). The only performance penalty you're really left with by using Opal is handling differences in scoping and truthiness between Ruby/JS. ---------------------------------------------------------------------------------------------------- [01:51:38] Jamie Gaskins(@jgaskins): And the best part is, if you think Opal is the bottleneck in a particular hot spot in your code, you can write it in JS to eke out the extra bit of performance you need. ---------------------------------------------------------------------------------------------------- [02:45:55] Jamie Gaskins(@jgaskins):@Thermatix here are a few quick benchmarks I checked (iterations per second for 5 seconds with a 1-second warmup, larger benchmark is better): https://gist.github.com/jgaskins/c5a066e12ad7bde48b22 Numeric operations aren't amazing in Opal, but you can see function calls and object instantiation are pretty damn good. If your app would be fast in JS, it'll be fast in Opal. ---------------------------------------------------------------------------------------------------- [12:35:49] giuan(@giuan): ---------------------------------------------------------------------------------------------------- [12:39:48] giuan(@giuan):Why does doc = `document` doc.JS[:title] = "title" work, bat document = `document` document.JS[:title] = "title" doesn't? (Opal 9.1beta) ---------------------------------------------------------------------------------------------------- [12:41:40] Elia Schito(@elia):@giuan you should wrap the code in triple backslashes or put it in a gist or some other service (pastebin.com or pastie.org) ---------------------------------------------------------------------------------------------------- [12:42:51] Elia Schito(@elia):but probably the problem with document = `document` is that it shadows `window.document` with a local `var` named `document` ---------------------------------------------------------------------------------------------------- [12:43:36] Elia Schito(@elia):Opal maps Ruby local variables to plain JS local variables ---------------------------------------------------------------------------------------------------- [12:54:58] giuan(@giuan):Ok it's ```document```. Also performance doesn't work, bat perform do. document is undefined `puts "document undefined" unless defined? document` -> document undefined. So its not possible to use variable named window, document, console, performance etc.. ? ---------------------------------------------------------------------------------------------------- [12:56:07] Elia Schito(@elia):I'd say you can use all of them but `window` and then access the others as `window.document` ---------------------------------------------------------------------------------------------------- [12:56:59] Elia Schito(@elia):or you can put them into globals (which they are already), e.g. $document = `document` ---------------------------------------------------------------------------------------------------- [13:14:54] giuan(@giuan):Thanks Elia! ---------------------------------------------------------------------------------------------------- [13:15:17] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [13:33:45] Martin Becker(@Thermatix):interesting, so basically not much of a difference in speed at all, thanks, is clearwater faster then react.rb because react.rb is a wrapper whereas clearwater is written directly in opal? ---------------------------------------------------------------------------------------------------- [13:35:57] Elia Schito(@elia):@Thermatix actually I think @jgaskins was writing about React.js, which has code that the browser can't optimize ---------------------------------------------------------------------------------------------------- [13:37:18] Martin Becker(@Thermatix):I see, hmmm ---------------------------------------------------------------------------------------------------- [13:38:09] Martin Becker(@Thermatix):I remember reading a blog which had benchmarks in it, the benchmark was just rendering 1000 li tags, and react.js was faster then even native code at doing it ---------------------------------------------------------------------------------------------------- [13:38:34] Martin Becker(@Thermatix):so does that mean react.js is faster in some places and slower in others because it can't be optimised? ---------------------------------------------------------------------------------------------------- [13:39:39] Elia Schito(@elia):no, well, react.js skips dom manipulation until the last moment, and I think you meant that by "native code", the same does clearwater ---------------------------------------------------------------------------------------------------- [13:40:06] Martin Becker(@Thermatix):I seee ---------------------------------------------------------------------------------------------------- [13:40:14] Elia Schito(@elia):said that, comparing the speed of react and clearwater is comparing raw js speed ---------------------------------------------------------------------------------------------------- [13:40:14] Martin Becker(@Thermatix):hmmm ---------------------------------------------------------------------------------------------------- [13:40:23] Martin Becker(@Thermatix):I think I'll still stick to react.rb ---------------------------------------------------------------------------------------------------- [13:40:32] Elia Schito(@elia):that's why JS engine optimization are important ---------------------------------------------------------------------------------------------------- [13:40:33] Martin Becker(@Thermatix):but maybe for personal projects I'll try clearwater ---------------------------------------------------------------------------------------------------- [13:41:26] Elia Schito(@elia):that kind of speed matters depending on the kind of app ---------------------------------------------------------------------------------------------------- [13:41:44] Elia Schito(@elia):for most apps jquery is fine ---------------------------------------------------------------------------------------------------- [13:41:45] Martin Becker(@Thermatix):speed isn't that important for the app I'm building ---------------------------------------------------------------------------------------------------- [13:42:08] Martin Becker(@Thermatix):but it's complictated so having a front end framework to manage things like states is going to be super helpfull ---------------------------------------------------------------------------------------------------- [13:42:18] Elia Schito(@elia):and of course the fact the clearwater performs better doesn't make react slow, but just slower ---------------------------------------------------------------------------------------------------- [13:43:55] Martin Becker(@Thermatix):I know, react is fast ---------------------------------------------------------------------------------------------------- ############################## [2015-10-21] ############################## [14:36:42] Jared White(@jaredcwhite):Awesome sauce! I'll wait to send out an Opalist issue until the blog post is up -- just looking at the Changelog though makes my mouth water 😜 ---------------------------------------------------------------------------------------------------- [14:37:46] Elia Schito(@elia):@jaredcwhite not sure I understood, the blog post won't be up for a while… :) ---------------------------------------------------------------------------------------------------- [14:37:57] Elia Schito(@elia):(weeks likely) ---------------------------------------------------------------------------------------------------- [14:38:00] Jared White(@jaredcwhite):Oh...right... ---------------------------------------------------------------------------------------------------- [14:38:52] Jared White(@jaredcwhite):Well then I can send it out now and then do another one in a couple weeks or so which works fine ---------------------------------------------------------------------------------------------------- [14:39:35] Elia Schito(@elia):@jaredcwhite I'll keep you posted about posts on the official blog ---------------------------------------------------------------------------------------------------- [14:41:17] Jared White(@jaredcwhite):@elia Yes, please keep me posted about any posts that get posted by posters, post-release 😝 ---------------------------------------------------------------------------------------------------- [14:44:41] Elia Schito(@elia):ex post I think you should be posting posts, unless it sounds preposterous to you… ---------------------------------------------------------------------------------------------------- [16:51:42] Brady Wied(@wied03):@jgaskins - I was talking with @elia about whether it should be goal of Opal to eventually be a first class citizen you can install via rbenv, etc. Then it becomes a runtime debate (best to run Ruby code via JS, the JVM, MRI, etc.). I care much less about runtimes than I do about the language, but someone might make the argument that the JS "runtime", node, etc. might be better at running Ruby code for certain things than the other runtimes are. Do you have any thoughts on the internals of Node running Opal vs. MRI, etc.? ---------------------------------------------------------------------------------------------------- [21:00:58] Jamie Gaskins(@jgaskins):@wied03: It's a cool idea. @vais set up some benchmarks to compare MRI vs Opal (via node, I think) execution speed. I haven't seen the benchmarks in a while, but I wonder what the new ones would look like with the performance enhancements that have gone in recently. Once we remove or minimize some of the other deoptimizations I've seen (such as methods like `String#gsub` wrapping the entire method in a `try` / `catch`), I think it would be pretty close in a lot of cases. I also wonder what the memory consumption would look like. ---------------------------------------------------------------------------------------------------- [21:05:41] Ryan Stout(@ryanstout):So question (not trolling): Is running general ruby code via opal on node possible? (like would it be possible to run bundler on node, considering that it uses a lot of file api's) I know node has the fs.readFileSync, but does that cause problems being sync? ---------------------------------------------------------------------------------------------------- [21:05:52] Ryan Stout(@ryanstout):is there a sync http api ---------------------------------------------------------------------------------------------------- [21:14:41] meh.(@meh):ryanstout, opal-browser does ---------------------------------------------------------------------------------------------------- [21:14:59] meh.(@meh):you just have to enable synchronous in Browser::HTTP::Request ---------------------------------------------------------------------------------------------------- [21:30:40] Jamie Gaskins(@jgaskins):@meh: I think he means does node.js do sync fetch? ---------------------------------------------------------------------------------------------------- [21:30:48] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [21:30:51] Jamie Gaskins(@jgaskins):… which I don't know the answer to, tbh. ---------------------------------------------------------------------------------------------------- [21:34:46] Jamie Gaskins(@jgaskins):@ryanstout: Latest docs seem to point to no: https://nodejs.org/api/http.html#http_http_request_options_callback ---------------------------------------------------------------------------------------------------- [21:35:02] Jamie Gaskins(@jgaskins):Doesn't seem to be an option for `sync: true` or anything like that. ---------------------------------------------------------------------------------------------------- [21:35:21] Ryan Stout(@ryanstout):ok ---------------------------------------------------------------------------------------------------- [21:35:30] Ryan Stout(@ryanstout):seems like those kind of issues would be pretty common in node ---------------------------------------------------------------------------------------------------- [21:35:32] Ryan Stout(@ryanstout):but maybe not ---------------------------------------------------------------------------------------------------- [21:37:15] Jamie Gaskins(@jgaskins):I dunno. I think all I/O in node is build around the same concept as on the client: run it async so you don't block anything else from happening. ---------------------------------------------------------------------------------------------------- ############################## [2015-10-22] ############################## [01:50:25] Brady Wied(@wied03):It wouldn't be too hard to write some wrapper code that blocks and makes it look synchronous, would it? If not, it might end up being in a C#/.NET situation where the Opal compiler would have to 'hide' the callbacks with async/await ---------------------------------------------------------------------------------------------------- [01:50:54] Brady Wied(@wied03):it is a nice feature of the last 2 C# compiler versions though. async code that reads/looks sync ---------------------------------------------------------------------------------------------------- [02:44:09] Ryan Stout(@ryanstout):@wied03 its mostly impossible to take an async api and make it sync without coroutines or threads, which node does not have (though there are some extensions) async/await in C# is available in ES7, but it changes the way you call methods, so it doesn't work with non-async/await aware code. ---------------------------------------------------------------------------------------------------- [02:44:15] Ryan Stout(@ryanstout):its a problem I've thought about a lot :-) ---------------------------------------------------------------------------------------------------- [03:07:37] Brady Wied(@wied03):@ryanstout - Would you be in the camp then that thinks Ruby (via Opal) on node (as a runtime) has some unique things to offer that MRI doesn't? Not a loaded question, just curious ---------------------------------------------------------------------------------------------------- [03:16:55] Jamie Gaskins(@jgaskins):I definitely think it'd be an interesting experiment. I wonder if it'd end up feeling a lot like EventMachine, for better or worse. I think EventMachine is pretty awesome, tbh, but it never took off primarily because you have to do everything differently to take advantage of async and so does every single gem you use that does I/O. :-\ ---------------------------------------------------------------------------------------------------- [03:28:28] Ryan Stout(@ryanstout):@wied03 I think it depends on what your doing. If we could get bundler working and more gems out of the box, I think it would be useful. But I'm not sure how practical that would be. ---------------------------------------------------------------------------------------------------- [03:58:18] Brady Wied(@wied03):One of the jruby guys had a decent prez on Ruby performance with MRI, JRuby, and RBX. It was easier for me to follow though because I think the JVM and its optimizations have been around longer and are more well known than node ---------------------------------------------------------------------------------------------------- [07:57:39] Elia Schito(@elia):One clear place opal+node is useful is with desktop apps like Electron and NW.js ---------------------------------------------------------------------------------------------------- [16:43:37] Brady Wied(@wied03):@jgaskins - What happened to thoughts you had about method optimization and try/catch? Working on a PR or anything? ---------------------------------------------------------------------------------------------------- [17:42:31] Forrest Chang(@fkchang):@/all anyone gotten javascript as node modules to work w/opal? ---------------------------------------------------------------------------------------------------- [19:08:22] Dan Allen(@mojavelinux):@fkchang Asciidoctor.js is published as a node module and uses Opal. See https://github.com/asciidoctor/asciidoctor.js/blob/master/package.json#L45 ---------------------------------------------------------------------------------------------------- [19:08:32] Dan Allen(@mojavelinux):I really would like to see Opal published officially as an npm module. ---------------------------------------------------------------------------------------------------- [19:08:38] Dan Allen(@mojavelinux):Currently we're doing it in Asciidoctor.js. ---------------------------------------------------------------------------------------------------- [19:08:58] Dan Allen(@mojavelinux):See https://github.com/anthonny/opal-npm-wrapper ---------------------------------------------------------------------------------------------------- [19:16:29] Forrest Chang(@fkchang):@mojavelinux I think I'm thinking of the reverse, if I want to use some js that is available in an opal app, can I do it w/modifying (i.e. copying the js, removing the module code), and then requiring it after modifying? ---------------------------------------------------------------------------------------------------- [20:15:49] Elia Schito(@elia):@fkchang I did some work with electron+opal and basically the code looks like this: ``` require 'nodejs/kernel' Native(node_require('app')) ``` ---------------------------------------------------------------------------------------------------- [20:22:31] Elia Schito(@elia):@mojavelinux I'd like to support that directly into Opal, and possibly release it on npm as https://www.npmjs.com/package/opal ---------------------------------------------------------------------------------------------------- [22:21:18] Dan Allen(@mojavelinux):That would be brilliant @elia! I'm sure Anthonny would love to help make it happen. I'll let him know to reach out. ---------------------------------------------------------------------------------------------------- [23:03:43] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- ############################## [2015-10-23] ############################## [01:56:07] stayfrostyn8(@stayfrostyn8): ---------------------------------------------------------------------------------------------------- [01:56:47] stayfrostyn8(@stayfrostyn8): ---------------------------------------------------------------------------------------------------- [01:57:45] stayfrostyn8(@stayfrostyn8): ---------------------------------------------------------------------------------------------------- [01:58:13] stayfrostyn8(@stayfrostyn8): ---------------------------------------------------------------------------------------------------- [01:58:42] stayfrostyn8(@stayfrostyn8): ---------------------------------------------------------------------------------------------------- [02:00:16] stayfrostyn8(@stayfrostyn8):Apologies for the deleted messages. I hadn't realized I had stepped outside of Volt's room. ---------------------------------------------------------------------------------------------------- [02:00:39] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [02:00:41] meh.(@meh):no worries ---------------------------------------------------------------------------------------------------- [02:46:48] George Plymale II(@ylluminarious):quick question: how does `include Native` also seemingly include `Native::Helpers`? for example: ```ruby %x{ function Message () { this.yo = function () { console.log("yo"); }; } } class Wrapper include Native def initialize @native = `new Message()` end alias_native :yo end wrapped_library = Wrapper.new wrapped_library.yo ``` ^ as you can clearly see there, `Native::Helpers` does not get explicitly included; only `Native` does. yet, i'm still able to access methods defined in `Native::Helpers` like `alias_native`. i assume that `Native` includes `Native::Helpers` upon its own inclusion, but i'm not sure of that and can't seem to find it in opal's source code. i'm just curious as to how this is working since i've built several wrappers with syntax similar to that above. ---------------------------------------------------------------------------------------------------- [03:20:14] meh.(@meh):@ylluminarious https://github.com/opal/opal/blob/master/stdlib/native.rb#L182-L184 ---------------------------------------------------------------------------------------------------- [03:23:28] George Plymale II(@ylluminarious):@meh yeah, i saw that method, but i'm not sure where it gets called. ---------------------------------------------------------------------------------------------------- [03:23:55] George Plymale II(@ylluminarious):thanks for confirming that that method is the one that does the magic though ---------------------------------------------------------------------------------------------------- [03:32:50] George Plymale II(@ylluminarious):@meh oh wait, never mind, just realized that is a ruby Module method ---------------------------------------------------------------------------------------------------- [03:33:09] George Plymale II(@ylluminarious):and that is me forgetting to look up ruby's docs :pensive: ---------------------------------------------------------------------------------------------------- [03:33:40] George Plymale II(@ylluminarious):thanks, again, though ---------------------------------------------------------------------------------------------------- [17:30:06] Jamie Gaskins(@jgaskins):@wied03 I haven't worked on it yet, tbh. Haven't had time. ---------------------------------------------------------------------------------------------------- [17:30:47] Jamie Gaskins(@jgaskins):I'm also still unsure of where the try/catch comes from in methods whose bodies are wrapped entirely on a `try` block :-) ---------------------------------------------------------------------------------------------------- [19:58:49] Brady Wied(@wied03):@jgaskins - I can't find a try/catch on String#gsub with the latest code. Are there other examples? ---------------------------------------------------------------------------------------------------- [19:59:47] Brady Wied(@wied03):@jgaskins - wait, it was up on the same line, missed it, you're right, it's there ---------------------------------------------------------------------------------------------------- [20:04:57] Brady Wied(@wied03):@jgaskins - I suspected the reason is that's inserted by the compiler as part of 'returner' logic. I think in `String#gsub`, that's caused by a `return` inside a closure (probably lines 493, 499, and 403-506 in string.rb). I bet the 'returner' logic the compiler puts in was mainly meant to apply to returns inside Ruby blocks/procs/lambdas, not JS. ---------------------------------------------------------------------------------------------------- [20:13:42] Brady Wied(@wied03):@jgaskins - I was wrong again, it's coming from the Ruby return at the top of the gsub method (line 458). Going to a pure JS return there takes care of it - https://github.com/opal/opal/pull/1166 ---------------------------------------------------------------------------------------------------- [20:22:21] Brady Wied(@wied03):That was the only case in corelib that used `#{return ..}` from within JS but there might be others like this. I did search for `{try {` in the compiled code and the other cases I saw were in `string/encoding.rb` and `set.rb` but that was from pure Ruby code and since those are probably used less often, I'm not sure if they warrant optimizing ---------------------------------------------------------------------------------------------------- ############################## [2015-10-24] ############################## [03:19:36] Vais Salikhov(@vais):@wied03 brilliantly simple fix, kudos! ---------------------------------------------------------------------------------------------------- [16:26:53] Brady Wied(@wied03): I was due for an easy one I guess ---------------------------------------------------------------------------------------------------- [17:17:59] Brady Wied(@wied03):Has anyone thought of doing this before? At first glance, it might have helpful results. https://gist.github.com/wied03/76cb79e6076e48eee9a5 ---------------------------------------------------------------------------------------------------- [17:25:10] meh.(@meh):wied03, looks very useful ---------------------------------------------------------------------------------------------------- [17:25:40] meh.(@meh):wied03, if you can conjure something up, we could have it ran alongside jshint ---------------------------------------------------------------------------------------------------- [17:26:05] Elia Schito(@elia):@wied03 was about to say the same ---------------------------------------------------------------------------------------------------- [17:35:18] Brady Wied(@wied03):Seems like the easiest way to look at the results would be to create an HTML report with tables. Any objection? Or do you prefer the text based tables like in benchmarking.rake ? ---------------------------------------------------------------------------------------------------- [17:36:36] meh.(@meh):wied03, text based is better ---------------------------------------------------------------------------------------------------- [17:36:41] meh.(@meh):wied03, since it's going to run on travis ---------------------------------------------------------------------------------------------------- [17:36:53] meh.(@meh):maybe add some colors or something ---------------------------------------------------------------------------------------------------- [17:43:25] Brady Wied(@wied03):then the fun will be interpreting the results. Some of these I have no idea why they aren't optimized. @jgaskins - Does that approach for checking optimization look like it's credible to you? ---------------------------------------------------------------------------------------------------- ############################## [2015-10-25] ############################## [01:24:41] Vais Salikhov(@vais):@wied03 great idea. Text is fine - it's a list, and the only part of the list you'd care about are the unoptimized methods. Output something like `String#[]`, etc. ---------------------------------------------------------------------------------------------------- [01:35:38] Vais Salikhov(@vais):@wied03 I imagine this would work the same way as rubyspec works now: have a white list of class#method items that are "allowed" to be not optimized, and fail the build if a class#method that's not on that list is not optimized. This would catch regressions, and would force one to add a class#method to the list explicitly if there's no other way to implement the method. This would also let us track progress on optimization, as the list gets shorter over time. Really cool. ---------------------------------------------------------------------------------------------------- [06:09:49] Jamie Gaskins(@jgaskins):@wied03 I like it. I'd read through that doc before, but I guess I missed that part because I didn't know about those directives in v8. :-) Nice work! ---------------------------------------------------------------------------------------------------- [06:12:15] Jamie Gaskins(@jgaskins):@vais I like that idea, because that'll help ensure that overall performance doesn't slip because someone accidentally committed something with a try/catch in a hot path. ---------------------------------------------------------------------------------------------------- [06:22:01] Jamie Gaskins(@jgaskins):It might be a good idea to make that run in its own process, though. That may already be the intended case, but just adding it here for posterity. The reason I mention it is that functions can get deoptimized for being too polymorphic. For example, if you call a function with more than some VM-specific number of different types of arguments (pretty sure in Safari it's 4, might be 3 in Chrome), it can decide to deoptimize the function because the cost (both performance and memory) of optimizing it for each different type of argument potentially outweighs the performance you gain from it. ---------------------------------------------------------------------------------------------------- [06:26:01] Jamie Gaskins(@jgaskins):In the Chrome profiler, the warning it gives for this is "Optimized too many times". ---------------------------------------------------------------------------------------------------- [15:37:00] Brady Wied(@wied03):@jgaskins isnt redux part of the immutable pendulum swing? It seems to strongly discourage mutating state in objects. ---------------------------------------------------------------------------------------------------- [20:23:57] Jamie Gaskins(@jgaskins):@wied03 It is, indeed. It's one place I like using immutability, though, because it allows O(1) cache invalidation on render. ---------------------------------------------------------------------------------------------------- [20:47:53] Jamie Gaskins(@jgaskins):It's more of a functional-core/imperative-shell thing than full immutable. The store modifies itself to change which object it uses to represent state, but that state object itself is treated as immutable. ---------------------------------------------------------------------------------------------------- [20:58:59] Jamie Gaskins(@jgaskins):I use caching pretty regularly in Clearwater and React apps. Not mutating the data structure you store state in lets you check whether an object has been modified by simply doing an identity comparison. ```ruby class TodoList include Clearwater::Component include Clearwater::CachedRender def should_render? previous !todos.equal?(previous.todos) end end ``` ---------------------------------------------------------------------------------------------------- ############################## [2015-10-26] ############################## [15:33:54] Brady Wied(@wied03):@meh or @elia - Is it consistent with Opal's direction to add an "async/await" keyword to Opal's Ruby 'keywords' that, under the hood, handle promise/callback stuff for you like the C# compiler or Babel ES7->ES6/5 tool does? ---------------------------------------------------------------------------------------------------- [15:35:05] meh.(@meh):@wied03 I'd rather not add keywords that aren't present in Ruby, if it's a library then I'm fine with it ---------------------------------------------------------------------------------------------------- [15:35:16] Elia Schito(@elia):right ---------------------------------------------------------------------------------------------------- [15:35:18] meh.(@meh):changing syntax means breaking tools ---------------------------------------------------------------------------------------------------- [15:36:23] Brady Wied(@wied03):yeah. I've wondered over the years why Ruby hasn't done anything with this. Maybe waiting for the hype over async to die down. Certainly a lot of people thinking they need async everywhere when they don't. That said, I think there are some benefits, obviously on the UI side. ---------------------------------------------------------------------------------------------------- [15:52:00] Martin Becker(@Thermatix):umm can some one quick-link me the opal simple sinatra opal app, I can't find it :P ---------------------------------------------------------------------------------------------------- [15:53:36] Elia Schito(@elia):@Thermatix https://github.com/opal/opal/tree/master/examples/sinatra ---------------------------------------------------------------------------------------------------- [15:53:38] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [15:53:48] Martin Becker(@Thermatix):tah very much, ---------------------------------------------------------------------------------------------------- [16:01:42] Brady Wied(@wied03):@jgaskins @vais @elia @meh - will work on the benchmark stuff over the next few weeks ---------------------------------------------------------------------------------------------------- [16:01:58] Brady Wied(@wied03):as in method optimization benchmark stuff ---------------------------------------------------------------------------------------------------- [16:02:05] Elia Schito(@elia):great news! ---------------------------------------------------------------------------------------------------- [16:02:29] Martin Becker(@Thermatix):cool beans! ---------------------------------------------------------------------------------------------------- [16:04:27] Brady Wied(@wied03):slower pace though than all the recent opal-rspec driven PRs ---------------------------------------------------------------------------------------------------- [16:05:58] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [16:10:22] Brady Wied(@wied03):@ryanstout and @jgaskins - when you have the time (ha), can you try out the new opal-rspec 0.5.0.beta3 release on volt/clearwater/etc. and report back on how it works for you ? ---------------------------------------------------------------------------------------------------- [16:59:00] Jamie Gaskins(@jgaskins):@wied03 Will do! ---------------------------------------------------------------------------------------------------- [16:59:26] Martin Becker(@Thermatix):@all I'm not sure who it is but I'm liking the errors that actually say what the error is ! ---------------------------------------------------------------------------------------------------- [18:25:31] Brady Wied(@wied03):@jgaskins @ryanstout - just don't rely on the "auto Opal load path" functionality. I'm trying to remove that from the 0.5 final because it's brittle. If you're setting the pattern/files to some directory other than spec and you want the Opal load path to follow suit, just do `Opal.append_path` on your own for the respective Opal load path changes you might wish to make. ---------------------------------------------------------------------------------------------------- [18:26:17] Ryan Stout(@ryanstout):@wied03 thanks for the info. I might need some help when I get a chance to upgrade. ---------------------------------------------------------------------------------------------------- [18:26:26] Ryan Stout(@ryanstout):the promise waiting stuff made it in right? ---------------------------------------------------------------------------------------------------- [18:26:57] Ryan Stout(@ryanstout):nevermind, looked at changelog ---------------------------------------------------------------------------------------------------- [18:27:01] Ryan Stout(@ryanstout):nice work! ---------------------------------------------------------------------------------------------------- ############################## [2015-10-27] ############################## [03:00:00] Jamie Gaskins(@jgaskins):I forgot to let you all know, I was on the Read the Source video podcast last Thursday chatting about Clearwater and Opal. They even invited Charles Max Wood from the Ruby Rogues/JS Jabber podcasts to chat about it. If you haven't watched it yet, you should. :-) ---------------------------------------------------------------------------------------------------- [03:01:00] Jamie Gaskins(@jgaskins):http://hangouts.readthesource.io/hangouts/clearwater/ ---------------------------------------------------------------------------------------------------- [08:32:35] Elia Schito(@elia):@jgaskins great intro! (still watching it) ---------------------------------------------------------------------------------------------------- [09:06:09] Vais Salikhov(@vais):@jgaskins cool! @wied03 definitely take your time on the benchmarking stuff, it's a tough one, thank you for taking it on! ---------------------------------------------------------------------------------------------------- [10:21:58] Vais Salikhov(@vais):Anyone have a chance to play with @fazibear's https://github.com/inesita-rb/inesita yet? I'm curious about where it stands in relation to clearwater... @jgaskins what do you think? ---------------------------------------------------------------------------------------------------- [12:10:20] Michał Kalbarczyk(@fazibear):@jgaskins great description talk !! ---------------------------------------------------------------------------------------------------- [12:21:43] Michał Kalbarczyk(@fazibear):I see a lot is going on around Clearwater, things starts moving really fast :) ---------------------------------------------------------------------------------------------------- [12:22:17] Michał Kalbarczyk(@fazibear):Any thoughts about Inesita ? ---------------------------------------------------------------------------------------------------- [13:42:32] Vais Salikhov(@vais):@fazibear right! I see both Clearwater and Inesita solving the same problem: back-end-agnostic Opal front-end ( as opposed to Volt, which is in a league of its own). But it would be really interesting to hear your and @jgaskins perspectives. E.g. what prompted you to create Inesita, in what ways is it different from Clearwater, etc. :sparkles: ---------------------------------------------------------------------------------------------------- [16:28:11] Jamie Gaskins(@jgaskins):@vais: I was thinking of writing a blog post about it, actually. In a lot of ways, the two are quite similar. ---------------------------------------------------------------------------------------------------- ############################## [2015-10-28] ############################## [00:25:26] Vais Salikhov(@vais):@jgaskins looking forward to it :) Again, great job on the ! ---------------------------------------------------------------------------------------------------- [00:29:35] Forrest Chang(@fkchang):@wied03 I see you added a wait_for_server call to the opal-rspec rake tasks. Turns out I needed a delay for our builds to run on against phantomjs linux as well, was this just for node? ---------------------------------------------------------------------------------------------------- [00:45:30] Mitch VanDuyn(@catmando):@/all THere will be a reactive-ruby open discussion on google hangouts tonight at 10:00 PM eastern. Here is the URL: @/all tonights discussion hosted by hangouts: here is the URL... https://plus.google.com/u/0/events/cg4rh8uqvvhk9n2o570s07hg5eo ---------------------------------------------------------------------------------------------------- [01:33:18] Brady Wied(@wied03):@fkchang - The wait_for_server call is done for both node and phantom when running the opal-rspec rake task ---------------------------------------------------------------------------------------------------- [01:51:39] Mitch VanDuyn(@catmando):@/all moving react ruby discussion back to 10:30 ---------------------------------------------------------------------------------------------------- [16:11:40] Ilya Bylich(@iliabylich):Is there a way to get a correct method arity? ``` Enumerator.new{}.method(:each).arity # => 0 (should be -1) ``` ---------------------------------------------------------------------------------------------------- [16:12:15] Ilya Bylich(@iliabylich):And the definition of `Enumerator#each`is `def each(*args, &block)` ---------------------------------------------------------------------------------------------------- [16:12:47] Martin Becker(@Thermatix):umm there is ---------------------------------------------------------------------------------------------------- [16:12:49] Elia Schito(@elia):@iliabylich I think it covers just the simple case, but maybe @wied03 has fresher knowledge… ---------------------------------------------------------------------------------------------------- [16:12:55] Martin Becker(@Thermatix):args.length ---------------------------------------------------------------------------------------------------- [16:13:34] Ilya Bylich(@iliabylich):@Thermatix I'm outside of the method, there are no `args ` yet ---------------------------------------------------------------------------------------------------- [16:13:37] Martin Becker(@Thermatix):ah ---------------------------------------------------------------------------------------------------- [16:13:59] Ilya Bylich(@iliabylich):I need to know if `random_object.each` supports passing extra parameters ---------------------------------------------------------------------------------------------------- [16:14:07] Martin Becker(@Thermatix):your right that's how it should work ---------------------------------------------------------------------------------------------------- [16:14:23] Martin Becker(@Thermatix):but you could try ---------------------------------------------------------------------------------------------------- [16:14:24] Martin Becker(@Thermatix):parameters ---------------------------------------------------------------------------------------------------- [16:14:24] Elia Schito(@elia):https://github.com/opal/opal/blob/master/opal/corelib/proc.rb#L50-L55 ---------------------------------------------------------------------------------------------------- [16:14:37] Elia Schito(@elia):that's the current status ---------------------------------------------------------------------------------------------------- [16:14:42] Ilya Bylich(@iliabylich):@elia got it ---------------------------------------------------------------------------------------------------- [16:14:51] Martin Becker(@Thermatix):method(:foo).parameters ---------------------------------------------------------------------------------------------------- [16:15:07] Martin Becker(@Thermatix):but only if it's been implimented ---------------------------------------------------------------------------------------------------- [16:15:32] Ilya Bylich(@iliabylich):@Thermatix This works for MRI, but not for Opal ---------------------------------------------------------------------------------------------------- [16:15:59] Elia Schito(@elia):@iliabylich also I think you need to enable arity checks at compiler level to get `$$artity` filled ---------------------------------------------------------------------------------------------------- [16:16:16] Martin Becker(@Thermatix):I c, so it's not been implimented yet then ---------------------------------------------------------------------------------------------------- [16:54:04] Jamie Gaskins(@jgaskins):@Thermatix Arity checks are indeed implemented in the compiler, but aren't enabled by default because there's a performance hit in using them. ---------------------------------------------------------------------------------------------------- [16:54:40] Martin Becker(@Thermatix):ah, I c ---------------------------------------------------------------------------------------------------- [16:54:50] Martin Becker(@Thermatix):fair enough ---------------------------------------------------------------------------------------------------- [17:06:14] meh.(@meh):@Thermatix the typical workflow is to enable them in debug mode ---------------------------------------------------------------------------------------------------- ############################## [2015-10-29] ############################## [14:45:55] Brady Wied(@wied03):assuming user's browser is compromised by bad guy of course ---------------------------------------------------------------------------------------------------- [14:49:23] Jamie Gaskins(@jgaskins):@wied03 You should be able to trust the client to make decisions about the currently logged-in user. So if my app lets users delete their accounts and the front-end app sends `DELETE /my_account`, I should go ahead and do it. ---------------------------------------------------------------------------------------------------- [14:50:14] Jamie Gaskins(@jgaskins):You’re right that you shouldn’t trust the client enough to delete anyone else’s accounts, though. ---------------------------------------------------------------------------------------------------- [14:51:49] Brady Wied(@wied03):I agree with you that if the client tells me to delete, I sort of have to assume I should do that. My point is that with more being done with JS, I already need to check that it's their account they are trying to delete even without marshalling ---------------------------------------------------------------------------------------------------- [14:52:12] Brady Wied(@wied03):frankly, even with no JS on the client side, I still need to not trust them ---------------------------------------------------------------------------------------------------- [15:00:24] Jamie Gaskins(@jgaskins):@wied03 Let’s assume `AccountDeletion` has no state at all because the user can only delete their own account; there’s no reason to have any state. So `AccountDeletion#call` is literally just `Browser::HTTP.delete ‘/my_account’`. If unmarshaling an object results in one of those objects and I send `call` to it, I’ve deleted my account. ---------------------------------------------------------------------------------------------------- [15:05:21] Brady Wied(@wied03):sure but what i'm trying to grasp is how is the threat of getting an unintended AccountDeletion unmarshal any different than getting an unintended HTTP.delete ? ---------------------------------------------------------------------------------------------------- [15:14:04] meh.(@meh):@iliabylich the biggest issue with supporting marshalling is it's a binary format ---------------------------------------------------------------------------------------------------- [15:16:16] meh.(@meh):and since you're in the browser and have json, you should use that instead ---------------------------------------------------------------------------------------------------- [15:16:34] meh.(@meh):they both support hooks to create classes, so you don't really need marshalling ---------------------------------------------------------------------------------------------------- [15:18:32] meh.(@meh):I honestly wouldn't be completely against adding marshal support ---------------------------------------------------------------------------------------------------- [15:18:52] meh.(@meh):but I think there are other areas of Opal that need love before marshalling can be considered ---------------------------------------------------------------------------------------------------- [15:21:58] Brady Wied(@wied03):@meh - Marshaling could be done in a different format though. Nothing says Opal would need to marshal into a byte stream like MRI/etc. do ---------------------------------------------------------------------------------------------------- [15:22:13] meh.(@meh):wied03, yeah but it would be pointless then, you already have json ---------------------------------------------------------------------------------------------------- [15:22:53] Brady Wied(@wied03):not exactly, I can't give an object graph to JSON, serialize it, then go back the other way with the same types intact ---------------------------------------------------------------------------------------------------- [15:23:01] meh.(@meh):wied03, yes you can ---------------------------------------------------------------------------------------------------- [15:23:16] meh.(@meh):I remember doing it ---------------------------------------------------------------------------------------------------- [15:23:31] meh.(@meh):I know because I fixed stdlib/json myself to do it ---------------------------------------------------------------------------------------------------- [15:24:14] Brady Wied(@wied03):this is the reason why things like the OJ GEM were made if I recall correctly ---------------------------------------------------------------------------------------------------- [15:24:19] Brady Wied(@wied03):but not for opal ---------------------------------------------------------------------------------------------------- [15:25:01] Brady Wied(@wied03):@meh - but that only works for built in types like Hash, array, etc. ---------------------------------------------------------------------------------------------------- [15:25:29] Brady Wied(@wied03):if I have some classes I create, I can't get back without writing a bunch of to_json or from_json code ---------------------------------------------------------------------------------------------------- [15:25:32] meh.(@meh):wied03, nope, you just have to define .json_create ---------------------------------------------------------------------------------------------------- [15:26:00] meh.(@meh):well of course, but you can just write a module that defines them to your liking ---------------------------------------------------------------------------------------------------- [15:26:29] meh.(@meh):I did it for lissio ---------------------------------------------------------------------------------------------------- [15:26:30] Brady Wied(@wied03):hmm, i didn't see json_create until you mentioned it ---------------------------------------------------------------------------------------------------- [15:27:00] Brady Wied(@wied03):that said, in my case, i'm serializing in MRI and deserializing in Opal, so I had to write my own ---------------------------------------------------------------------------------------------------- [15:27:36] Brady Wied(@wied03):but I suppose if I implemented some of the json_create stuff on the MRI side, I could cut out some code ---------------------------------------------------------------------------------------------------- [15:29:51] Brady Wied(@wied03):This is mainly just me reasoning through this, but I don't get the threat vector for this (as in controlled attribute) type of marshaling, which I guess is really serialization. I do think it would be worrisome (if it were some how implemented in Opal with a browser, hard to see how), to do binary marshaling and sent that to a server running MRI. I perceive the danger there to be that you're giving the marshalled bits fairly low level access to your memory ---------------------------------------------------------------------------------------------------- [15:32:27] Brady Wied(@wied03):I really have the same problem that @ryanstout does in my tinkering, which is I have object X on the MRI side and I want to represent it on the browser side (or vice versa), without having to define a chain of to_json/from_json. It looks like the json_create stuff might ease the Opal side of the problem ---------------------------------------------------------------------------------------------------- [15:33:15] meh.(@meh):wied03, it's just a matter of defining json_create ---------------------------------------------------------------------------------------------------- [15:33:18] meh.(@meh):everything works then ---------------------------------------------------------------------------------------------------- [15:33:54] meh.(@meh):wied03, https://github.com/meh/lissio/blob/master/opal/lissio/model.rb#L216-L235 ---------------------------------------------------------------------------------------------------- [15:34:00] meh.(@meh):that's it ---------------------------------------------------------------------------------------------------- [15:35:10] Ilya Bylich(@iliabylich):@meh But what about passing objects from MRI to Opal? MRI doesn't support json_create (it's an Opal's method, right?) ---------------------------------------------------------------------------------------------------- [15:35:27] meh.(@meh):iliabylich, nope, it's MRI behavior ---------------------------------------------------------------------------------------------------- [15:36:01] Brady Wied(@wied03):I actually do see json_create around MRI docs ---------------------------------------------------------------------------------------------------- [15:36:01] meh.(@meh):require 'json', it's all in there ---------------------------------------------------------------------------------------------------- [15:36:13] Brady Wied(@wied03):@meh - thanks for the info ---------------------------------------------------------------------------------------------------- [15:36:23] meh.(@meh):np ---------------------------------------------------------------------------------------------------- [15:36:29] meh.(@meh):the only advantage of marshalling ---------------------------------------------------------------------------------------------------- [15:36:33] meh.(@meh):is you're not forced to implement anything ---------------------------------------------------------------------------------------------------- [15:36:41] meh.(@meh):because ivars are automatically serialized/deserialized ---------------------------------------------------------------------------------------------------- [15:36:42] Ilya Bylich(@iliabylich):yep, didn't know that :smile: So the only difference is compaction? ---------------------------------------------------------------------------------------------------- [15:36:43] meh.(@meh):with internal magic ---------------------------------------------------------------------------------------------------- [15:36:55] meh.(@meh):and the marshal format can be a little more compact, yes ---------------------------------------------------------------------------------------------------- [15:37:15] meh.(@meh):the downside is that doing client -> server marshalling will open up deadly security issues ---------------------------------------------------------------------------------------------------- [15:37:25] meh.(@meh):server -> client does not, but then you might as well be using json and be done with it ---------------------------------------------------------------------------------------------------- [15:38:06] meh.(@meh):for instance, you still have to validate client -> server json serialization/deserialization ---------------------------------------------------------------------------------------------------- [15:38:12] meh.(@meh):but at least you CAN validate it ---------------------------------------------------------------------------------------------------- [15:38:13] meh.(@meh):because it's just json ---------------------------------------------------------------------------------------------------- [15:38:25] Brady Wied(@wied03):@meh - I get the security issues if it was binary, but I don't get the security issue if it's not binary ---------------------------------------------------------------------------------------------------- [15:38:45] meh.(@meh):wied03, if you just call JSON.load(stuff_from_the_client) ---------------------------------------------------------------------------------------------------- [15:39:08] meh.(@meh):I can forge JSON so that it calls json_create on any class ---------------------------------------------------------------------------------------------------- [15:39:38] meh.(@meh):and depending on how you do things, it might be a security issue ---------------------------------------------------------------------------------------------------- [15:40:02] meh.(@meh):it's LESS of a security issue using JSON and json_create, but it still is one ---------------------------------------------------------------------------------------------------- [15:40:50] Ilya Bylich(@iliabylich):@meh But I can validate it with `demarshaled.is_a?(MyClass)`. I mean, it's ugly, but seems to be possible ---------------------------------------------------------------------------------------------------- [15:41:10] meh.(@meh):iliabylich, if your json_create doesn't do anything that could be a security hole, yeah ---------------------------------------------------------------------------------------------------- [15:42:09] Brady Wied(@wied03):I didn't know MRI had JSON.load, interesting, https://www.ruby-lang.org/en/news/2013/02/22/json-dos-cve-2013-0269/ and what you said clarified it for me ---------------------------------------------------------------------------------------------------- [15:43:45] meh.(@meh):didn't even know it had a CVE ◕ ◡ ◔ ---------------------------------------------------------------------------------------------------- [15:49:40] meh.(@meh):wied03, in general, any automatic object creation with non-validated input, is a very bad idea ---------------------------------------------------------------------------------------------------- [15:52:55] Brady Wied(@wied03):I don't dispute that, but it comes down to where the validation is done. I was never suggesting that it not be validated ---------------------------------------------------------------------------------------------------- [15:53:14] Brady Wied(@wied03):I agree though that if it really is automatic, you lose the chance to validate ---------------------------------------------------------------------------------------------------- [16:11:12] Brady Wied(@wied03):seems like there still might be an opportunity to do something in this space, maybe like a graphQL opal client?? ---------------------------------------------------------------------------------------------------- [16:27:14] Brady Wied(@wied03):@meh - By this logic, is Opal is "vulnerable" to the issue the CVE pointed out. MRI will not use the `json_class` when you call `JSON::parse`, it returns a hash every time unless you use `JSON::load`. Opal on the other hand is paying attention to it and instantiating an object of that class ---------------------------------------------------------------------------------------------------- [16:27:34] meh.(@meh):wied03, that's definitely a bug ---------------------------------------------------------------------------------------------------- [16:28:55] Brady Wied(@wied03):I suppose in the server->client case, it's not a big issue, but Opal might eventually be used the other way, in which case I guess stdlib should offer parse AND load and behave accordingly, right ? ---------------------------------------------------------------------------------------------------- [16:29:19] meh.(@meh):wied03, personally, I see using Opal outside the browser like an awful idea ---------------------------------------------------------------------------------------------------- [16:29:32] meh.(@meh):so I don't even care about that case, but it's a bug since it's not consistent with MRI ---------------------------------------------------------------------------------------------------- [16:31:08] Brady Wied(@wied03):that goes back to that runtime debate ---------------------------------------------------------------------------------------------------- [16:31:54] Brady Wied(@wied03):I still don't have an opinion there but I think it's good to think about it, because people will ask those questions ---------------------------------------------------------------------------------------------------- [16:38:58] Brady Wied(@wied03):Parked the issue in https://github.com/opal/opal/issues/1174 - @jgaskins, @meh - thanks for the conversation, reminded me of a few important things ---------------------------------------------------------------------------------------------------- [16:49:19] Jamie Gaskins(@jgaskins)::+1: ---------------------------------------------------------------------------------------------------- [16:49:59] Ryan Stout(@ryanstout):@wied03 in volt we use json to serialize. It would be nice to be able to send objects from server to client (not the other way for obvious security reasons), but it's not really something we need. We made a simple EJSON parser (thing meteor made up) that adds time and binary to json. Which works for now. ---------------------------------------------------------------------------------------------------- [22:24:19] Martin Becker(@Thermatix):I have a question on stack that you lot might be able to answer, I've tried to do this twice already but it hasn't worked. ---------------------------------------------------------------------------------------------------- [22:24:22] Martin Becker(@Thermatix):http://stackoverflow.com/questions/33425460/same-class-but-different-behaviour-depending-on-whether-its-running-on-opal-or ---------------------------------------------------------------------------------------------------- [22:33:40] Jamie Gaskins(@jgaskins):@Thermatix Answering here because the SO login form is broken: Are you loading both classes from a directory that's in both client-side and server-side load paths? For example, if you're running on Rails and you're loading both from `app/shared`, just load one from `app/models` and the other from `app/assets/javascripts`. ---------------------------------------------------------------------------------------------------- [22:34:09] Jamie Gaskins(@jgaskins):If you're already not sharing load paths, they can have the same filename and it won't conflict. ---------------------------------------------------------------------------------------------------- [22:36:07] Martin Becker(@Thermatix):that's not the issue, I want to have a standardised way of defining them(fields and matching type), and since they exist on both the back and front ends (in different forms) I want to have a way to define them easily without having to define two seprate files for each pair. ---------------------------------------------------------------------------------------------------- [22:40:16] Jamie Gaskins(@jgaskins):@Thermatix You could use `if RUBY_ENGINE == 'opal'`, but I don't see how that's any better than two separate files. You're defining two entirely separate classes. ---------------------------------------------------------------------------------------------------- [22:41:21] Martin Becker(@Thermatix):so there's no way to do an isomorphic class? ---------------------------------------------------------------------------------------------------- [22:42:29] Jamie Gaskins(@jgaskins):@Thermatix There is, but this isn't isomorphic. You're running entirely different code on each platform. ---------------------------------------------------------------------------------------------------- [22:42:40] Jamie Gaskins(@jgaskins):The only thing they share is the name ---------------------------------------------------------------------------------------------------- [22:42:53] Martin Becker(@Thermatix):how would I do that then? ---------------------------------------------------------------------------------------------------- [22:44:57] Jamie Gaskins(@jgaskins):Are you using Rails? ---------------------------------------------------------------------------------------------------- [22:45:03] Martin Becker(@Thermatix):I am not ---------------------------------------------------------------------------------------------------- [22:45:05] Martin Becker(@Thermatix):sinatra ---------------------------------------------------------------------------------------------------- [22:46:01] Jamie Gaskins(@jgaskins):In that case, you can just put the server-side implementation where your server-side models go and your client-side implementation inside your assets directory. ---------------------------------------------------------------------------------------------------- [22:48:11] Martin Becker(@Thermatix):I see ---------------------------------------------------------------------------------------------------- [22:48:14] Martin Becker(@Thermatix):well, thanks at any rate ---------------------------------------------------------------------------------------------------- [22:50:43] Martin Becker(@Thermatix):also cup-ramen > pot noodle ---------------------------------------------------------------------------------------------------- [10:57:17] Ilya Bylich(@iliabylich):Is there a chance for Opal to support `Marshal.load/dump`? ---------------------------------------------------------------------------------------------------- [10:58:23] Ilya Bylich(@iliabylich):It would be nice to have an ability to pass some objects like `Struct/OpenStruct` (or even more complex) directly from server to the client ---------------------------------------------------------------------------------------------------- [13:00:07] Vais Salikhov(@vais):@iliabylich it's a minefield ---------------------------------------------------------------------------------------------------- [13:00:26] Vais Salikhov(@vais):security-wise AFAIK ---------------------------------------------------------------------------------------------------- [13:00:59] Ilya Bylich(@iliabylich):@vais I'm not talking about sending marshalled stuff to the server, only about server -> client ---------------------------------------------------------------------------------------------------- [13:02:58] Ilya Bylich(@iliabylich):But still, if something gives you an ability to make a potential vulnerability , it doesn't mean that it should not be implemented at all :smile: ---------------------------------------------------------------------------------------------------- [13:03:54] Vais Salikhov(@vais):Yeah, but having `Marshal` in Opal has been on @ryanstout's wish-list for a long time :wink2: ---------------------------------------------------------------------------------------------------- [13:04:39] Vais Salikhov(@vais):@meh may be able to explain better what the challenges are, I'm not sure to be honest... ---------------------------------------------------------------------------------------------------- [13:22:29] Ilya Bylich(@iliabylich):I've seen a node module https://github.com/instore/node-marshal - it seems to be working on simple cases, so I'm wondering why all the Marshal stuff is in unsupported section ---------------------------------------------------------------------------------------------------- [13:25:45] Jamie Gaskins(@jgaskins):@iliabylich If you're using Rails, you can use the `gon` gem to pass JSON-serialized objects from server to client. Then on the client side, it's just: ```ruby MyModel.new(Hash.new(`gon.things`)) ``` I do this a lot in JS and I've started using it in Clearwater apps pretty simply. ---------------------------------------------------------------------------------------------------- [13:27:56] Ilya Bylich(@iliabylich):@jgaskins Yeah, but it covers only simple cases, for every model you have to write your own `fromJSON` method (or custom `to_json` on the server) ---------------------------------------------------------------------------------------------------- [13:38:34] Jamie Gaskins(@jgaskins):@iliabylich Sort of. Rather than making serialization a model-level concern, I'd much rather have a serializer to take it back and forth between JSON. But yes, you would have to handle conversion between them. This isn't a bad thing, though. If you're expecting a specific set of objects from `gon` or an HTTP request, you can be sure that's exactly what you get if you're doing your own deserialization or raise an exception if that's not what you got. You don't have that guarantee when unmarshaling data. ---------------------------------------------------------------------------------------------------- [13:48:54] Brady Wied(@wied03):I recently rolled my own simple marshaller. JSON serialization (on its own) didn't satisfy me because it doesn't store type metadata, etc. I would have to tell each object how to deserialize itself. I ended up writing something that stored `{class: Something, value: 'something'}`. I use JSON as the format though. It's a little verbose but my developer time is more important (in my opinion :smile: ) ---------------------------------------------------------------------------------------------------- [13:49:52] Brady Wied(@wied03):In that sense, I do think marshaling, when you control both sides, could be useful for Opal, but it would probably need to be a JSON/text representation of the object rather than binary ---------------------------------------------------------------------------------------------------- [14:05:57] Jamie Gaskins(@jgaskins):It could definitely be useful, but I get nervous when talking about using marshaling because it’s an opaque process that results in arbitrary objects. Unmarshaling (well, YAML deserialization) values coming in from outside became one of the top security vulnerabilities ever in Rails. In my experience, if someone doesn't want to put in the effort to define a serializer to go back and forth between JSON, they’re not very likely to put in the effort to ensure the result is what they’re expecting, either. ---------------------------------------------------------------------------------------------------- [14:12:30] Jamie Gaskins(@jgaskins):Maybe that’s just fear of people doing stupid things they won’t actually do, but a decade of consulting and having to fix code that used things like `Marshal.dump` because it was fewer keystrokes really pushes me to want to make the good idea easier than the bad idea. ---------------------------------------------------------------------------------------------------- [14:16:29] Brady Wied(@wied03):I think there is a big difference though between using marshaling between browser and server with your code on both sides and using marshaling for service integration with 3rd parties. The latter is crazy ---------------------------------------------------------------------------------------------------- [14:17:14] Brady Wied(@wied03):if it's my own code, I can put malicious stuff in the code anyways (without it sneaking in via an unmarshal call) ---------------------------------------------------------------------------------------------------- [14:18:10] Brady Wied(@wied03):I agree that binary marshaling is more dangerous though ---------------------------------------------------------------------------------------------------- [14:19:17] Jamie Gaskins(@jgaskins):I don’t know enough about the `Marshal` format to know if there’s a way to format a string attribute of that object that could be supplied by a user (say, the `body` attribute of a serialized chat message) that could get it interpreted as a marshaled object instead of a string. ---------------------------------------------------------------------------------------------------- [14:24:46] Jamie Gaskins(@jgaskins):@wied03 I do agree with you, but I’m not confident enough in any marshaling format that I would want to trust an opaque unmarshaling process from string to arbitrary objects with anything that has any attributes supplied by arbitrary users. With JSON, at least I know I can _only_ get a hash/array/string/number out of it. That gives me a lot more confidence in it. ---------------------------------------------------------------------------------------------------- [14:28:25] Ilya Bylich(@iliabylich):@jgaskins In MRI there are marshaling hooks (`marshal_dump/marshal_load`) that are invoked after object is built - this is probably the only dangerous place. No hooks - no code invocation. De-marshaling goes like `instance = SomeClass.allocate; instance.instance_variable_set(:@ivar, ...nested vars...)` + hooks ---------------------------------------------------------------------------------------------------- [14:31:57] Brady Wied(@wied03):I suppose the code I rolled is kind of a middle ground. I explicitly enlist classes in it and I explicitly say which attributes go in. And in the end, since I lack memory representation control, I'm ultimately just setting class attributes from a hash ---------------------------------------------------------------------------------------------------- [14:33:15] Brady Wied(@wied03):My code might be a giant turd for all I know, but I was looking for something to ease my isomorphic experiment ---------------------------------------------------------------------------------------------------- [14:35:55] Brady Wied(@wied03):In other news, it's not quite actual GEM worthy yet (still need to resolve a few more of their specs), but I've got https://github.com/wied03/opal-factory_girl working to build test objects for my client side code. No AR support of course but I found factory girl convenient for building test objects even w/o persistence ---------------------------------------------------------------------------------------------------- [14:35:57] Jamie Gaskins(@jgaskins):@iliabylich Not exactly. The dangerous part is when two objects in the system have a method with the same name but do different things. So, for example, if you’re expecting to run `Foo#call`, but instead of a `Foo`, you got back an `AccountDeletion` service object from unmarshaling, then the user’s browser requests that the server delete their account. ---------------------------------------------------------------------------------------------------- [14:37:47] Brady Wied(@wied03):@jgaskins - Interesting point. From a threat vector standpoint though, doesn't that presuppose that you've managed to get untainted JS from an initial payload but a subsequent AJAX request was man in the middled, etc. ? ---------------------------------------------------------------------------------------------------- [14:41:01] Jamie Gaskins(@jgaskins):@wied03 Nah, that’s kinda what I was getting at before. If some container object has an attribute you thought was a string, but that string can trick the unmarshaler into thinking it’s actually another type of object. I don’t know if this can happen, but I don’t trust it not to. ---------------------------------------------------------------------------------------------------- [14:45:40] Brady Wied(@wied03):You kind of have to not trust the client irrespective of marshalling, right? I'm not sure I see the difference between a bad guy telling the user's browser to send me DELETE /account/2 vs. having their marshalled JS send me an `AccountDeletion` object ---------------------------------------------------------------------------------------------------- ############################## [2015-10-30] ############################## [15:33:44] Elia Schito(@elia):ok, wasn't sure because opal uses mspec, not opal-rspec ---------------------------------------------------------------------------------------------------- [15:33:56] Ilya Bylich(@iliabylich):I've got a lot of tests from rubyspec that are failing for now. All of them are in a single file ---------------------------------------------------------------------------------------------------- [15:34:04] Elia Schito(@elia):you can focus on a specific spec by using the PATTERN env var ---------------------------------------------------------------------------------------------------- [15:34:06] Ilya Bylich(@iliabylich):yep, mspec, sorry ---------------------------------------------------------------------------------------------------- [15:34:19] Elia Schito(@elia):ah, I see ---------------------------------------------------------------------------------------------------- [15:34:25] Ilya Bylich(@iliabylich):A single file :smile: ---------------------------------------------------------------------------------------------------- [15:34:56] Elia Schito(@elia):personally if I'm hacking on stuff I just go to the file and comment out all but what I want to run ---------------------------------------------------------------------------------------------------- [15:35:28] Elia Schito(@elia):having rubyspec as a repo allows for easy git resets from inside it ---------------------------------------------------------------------------------------------------- [15:36:37] Jamie Gaskins(@jgaskins):@Thermatix I’m not sure what you mean by params. I think I need more context. ---------------------------------------------------------------------------------------------------- [15:36:40] Elia Schito(@elia):it's also not uncommon (for me at least) to fill in the rubyspec with debug code like prints or tmp additional expectations etc. ---------------------------------------------------------------------------------------------------- [15:37:12] Jamie Gaskins(@jgaskins):Like, what framework are you using for this stuff? ---------------------------------------------------------------------------------------------------- [15:37:33] Ilya Bylich(@iliabylich):@elie This file has ~700 lines of mixed tests. nvm, I'll try to play with grep, thanks ---------------------------------------------------------------------------------------------------- [15:41:50] Elia Schito(@elia):@iliabylich What I do to add stuff to bugs/unsupported is to manually copy paste from the rubyspec run output, and mangle it a bit with the editor to get the error messages, but from that I proceed manually if the failing messages are to be distributed among the various filter files ---------------------------------------------------------------------------------------------------- [15:41:57] Elia Schito(@elia):@iliabylich maybe @vais has some better technique ---------------------------------------------------------------------------------------------------- [15:43:57] Elia Schito(@elia):@jgaskins I skimmed the messages from the last days and wanted to mention that opal-rails has some gon-like capabilities when using template handlers (e.g. opal files in app/views), I'd like to hear if there's anything else we could do to improve on that side ---------------------------------------------------------------------------------------------------- [15:54:05] Martin Becker(@Thermatix):... ah I see... wrong chat thread >_< ---------------------------------------------------------------------------------------------------- [15:54:17] Martin Becker(@Thermatix):I thought I was inside of the react.rb chat thread ---------------------------------------------------------------------------------------------------- [16:48:59] Jamie Gaskins(@jgaskins):@elia Interesting, I’ll check it out ---------------------------------------------------------------------------------------------------- [17:28:03] Forrest Chang(@fkchang):@elia can you describe the gon-like capabilities? ---------------------------------------------------------------------------------------------------- [15:23:28] Martin Becker(@Thermatix):I'm still having trouble with the label function ---------------------------------------------------------------------------------------------------- [15:26:19] Martin Becker(@Thermatix):I tried something to get some output and here's what happens in the javascript console: ***** React Browser Context Initialized ***** # # Element # # Element # # Element # user name String # email String # password String when using the following code: ```ruby def label_for(value,hash={}) l = label(*{html_for: value, id: "field_#{value}"}.merge!(hash)).tap {puts self.inspect} puts l puts l.class l end ``` ---------------------------------------------------------------------------------------------------- [15:27:20] Martin Becker(@Thermatix):when it's used inside of the form component, `l` is an `Element`, when used inside of a field sub component `l` is a `String`. ---------------------------------------------------------------------------------------------------- [15:27:30] Martin Becker(@Thermatix):I got no idea why it's doing that though ---------------------------------------------------------------------------------------------------- [15:31:52] Jamie Gaskins(@jgaskins):@Thermatix What happens when you remove the `*` before the hash? ---------------------------------------------------------------------------------------------------- [15:32:12] Ilya Bylich(@iliabylich):@elia When you add a new functionality to opal, how do you proceed with all the tests that are broken? I have ~120 tests right now, so I'd like to move them to `bugs/` for now. For example, is there any way to change opal-rspec formatter so I could copy-paste failing specs? ---------------------------------------------------------------------------------------------------- [15:32:34] Martin Becker(@Thermatix):Never mind figured it out, I had a pram called `label` that was interfering with the function called `label`, which to be honest doesn't make sense since I thought you could only access params through `params` ? ---------------------------------------------------------------------------------------------------- [15:33:04] Elia Schito(@elia):@iliabylich are you adding stuff to opal itself or to a project? ---------------------------------------------------------------------------------------------------- [15:33:16] Ilya Bylich(@iliabylich):@elia to opal ---------------------------------------------------------------------------------------------------- ############################## [2015-10-31] ############################## [00:14:59] Elia Schito(@elia):@fkchang https://github.com/opal/opal-rails/blob/master/README.md#as-a-template ---------------------------------------------------------------------------------------------------- [00:17:53] Elia Schito(@elia): when rendering an opal template ivars & locals are passed to the template after "digesting" them with JSON ---------------------------------------------------------------------------------------------------- [10:48:23] Michał Kalbarczyk(@fazibear):`Opal.use_gem` throw exception in Opal 0.9beta ``` /Users/fazibear/.rubies/2.2.3/lib/ruby/gems/2.2.0/gems/opal-0.9.0.beta1/lib/opal/paths.rb:36:in `require_paths_for_gem': undefined method `runtime_dependencies' for nil:NilClass (NoMethodError) from /Users/fazibear/.rubies/2.2.3/lib/ruby/gems/2.2.0/gems/opal-0.9.0.beta1/lib/opal/paths.rb:37:in `block in require_paths_for_gem' from /Users/fazibear/.rubies/2.2.3/lib/ruby/gems/2.2.0/gems/opal-0.9.0.beta1/lib/opal/paths.rb:36:in `each' from /Users/fazibear/.rubies/2.2.3/lib/ruby/gems/2.2.0/gems/opal-0.9.0.beta1/lib/opal/paths.rb:36:in `require_paths_for_gem' from /Users/fazibear/.rubies/2.2.3/lib/ruby/gems/2.2.0/gems/opal-0.9.0.beta1/lib/opal/paths.rb:27:in `use_gem' ``` ---------------------------------------------------------------------------------------------------- [11:12:04] Elia Schito(@elia):@fazibear can you open an issue for it? It's a bugs that must be fixed before 0.9 release ---------------------------------------------------------------------------------------------------- [12:05:37] Michał Kalbarczyk(@fazibear):sure ---------------------------------------------------------------------------------------------------- [12:05:39] Michał Kalbarczyk(@fazibear):np ---------------------------------------------------------------------------------------------------- [14:01:53] Michał Kalbarczyk(@fazibear):BTW What this method do ? Should I use it ? I'm see it in opal-browser gem to use paggio. `require` is not enough ? Commented out this line, and everything works fine. ---------------------------------------------------------------------------------------------------- [14:04:11] Elia Schito(@elia):@fazibear use_gem adds the "lib" paths of a regular gem to opal paths, if you have a gem that has code that works with both MRI and opal that's the way to go ---------------------------------------------------------------------------------------------------- [16:56:28] Michał Kalbarczyk(@fazibear):I see, thnx ---------------------------------------------------------------------------------------------------- [16:56:51] Michał Kalbarczyk(@fazibear):I just noticed that http://opalrb.org/try/# is `0.8.0.beta1` :) ---------------------------------------------------------------------------------------------------- [16:57:49] Elia Schito(@elia):yeah, could use some help there :) ---------------------------------------------------------------------------------------------------- [19:04:23] giuan(@giuan):Why `require` or `require_relative` doesn't work? I tried ``` require './hello' require_relative './hello' require './hello.rb' require_relative './hello.rb' ``` All work on MRI. Opal 9.0 beta Thanks ---------------------------------------------------------------------------------------------------- [19:07:28] giuan(@giuan):Sorry! running with command opal `$ opal main.rb` ---------------------------------------------------------------------------------------------------- ############################## [2015-11-01] ############################## [04:31:04] Vais Salikhov(@vais):@elia @iliabylich I copy/paste the output from rubyspec to gvim (or pipe it if it's very long), then do a little vim magic with it, then copy/paste the results to an appropriate filter file. ---------------------------------------------------------------------------------------------------- ############################## [2015-11-03] ############################## [14:44:35] Michał Kalbarczyk(@fazibear):curiosity I did a benchmarks for opal 0.9 JS ``` Benchmark.bm do |x| x.report { 1_000_000.times { `document.location.pathname` } } x.report { 1_000_000.times { JS.global.JS[:document].JS[:location].JS[:pathname] } } end ``` ``` user system total real 1.025000 1.025000 4.100000 ( 1.025000) 0.802000 0.802000 3.208000 ( 0.802000) ``` ---------------------------------------------------------------------------------------------------- [14:49:37] Elia Schito(@elia):maybe it needs some warm up time, have you tried switching the order? ---------------------------------------------------------------------------------------------------- [14:57:58] Michał Kalbarczyk(@fazibear):first one is always slower ---------------------------------------------------------------------------------------------------- [14:58:54] Michał Kalbarczyk(@fazibear):i think there is no any performance issues to switch to JS :) ---------------------------------------------------------------------------------------------------- [15:05:05] Elia Schito(@elia):yes, that's pretty neat work from @jeremyevans :) ---------------------------------------------------------------------------------------------------- ############################## [2015-11-04] ############################## [00:07:18] Elia Schito(@elia):`20 examples, 21 failures (time taken: 0.06400012969970703)` that's when it becomes interesting… :D ---------------------------------------------------------------------------------------------------- [00:30:48] meh.(@meh):kek ---------------------------------------------------------------------------------------------------- [00:31:19] Elia Schito(@elia):apparently one can't simply escape yak shaving… ---------------------------------------------------------------------------------------------------- [13:43:21] Ilya Bylich(@iliabylich):Is there a way to get instances variables that are actually instance variables? ``` ruby >> Object.new.instance_variables => ["@constructor", "@toString"] ``` ---------------------------------------------------------------------------------------------------- [13:45:37] Elia Schito(@elia):probably a check with hasOwnProperties can help, not sure it's ok for classes and modules ---------------------------------------------------------------------------------------------------- [13:45:43] Ilya Bylich(@iliabylich):Instances of `Object` class have only `@constructor` and `@toString`, but `String` has `@encoding`. From what I see in the source code, `instance_variables` returns all fields in the object that do not start from `$`. ---------------------------------------------------------------------------------------------------- [13:46:12] Ilya Bylich(@iliabylich):Ok, I'll try ---------------------------------------------------------------------------------------------------- [13:49:54] Ilya Bylich(@iliabylich):@elia seems to work, thank you ---------------------------------------------------------------------------------------------------- [17:00:00] Martin Becker(@Thermatix):do heredoc's work in opal? ---------------------------------------------------------------------------------------------------- [17:00:09] Elia Schito(@elia):yes ---------------------------------------------------------------------------------------------------- [17:01:11] Martin Becker(@Thermatix):cool ---------------------------------------------------------------------------------------------------- [17:01:12] Martin Becker(@Thermatix):thanks ---------------------------------------------------------------------------------------------------- [17:30:33] Alex Egg(@eggie5):how do you call javascript libraries? ---------------------------------------------------------------------------------------------------- [18:30:23] Elia Schito(@elia):@eggie5 here's an overview https://github.com/opal/opal/blob/959da7babe9dfb0ac47934451a5930e4412e3dce/docs/compiled_ruby.md#javascript-from-ruby ---------------------------------------------------------------------------------------------------- [18:30:43] Elia Schito(@elia):and here's a TLDR: https://github.com/opal/opal/blob/959da7babe9dfb0ac47934451a5930e4412e3dce/docs/compiled_ruby.md#wrapping-javascript-libraries ---------------------------------------------------------------------------------------------------- [18:37:55] Ilya Bylich(@iliabylich):@elia do you have any ideas how to filter these "instance variables" - http://opalrb.org/try/?code:string%20%3D%20%22string%22%0Astring.instance_variable_set(%3A%40ivar%2C%20%27value%27)%0Aputs%20string.instance_variables%0A%25x%7B%0A%20%20for%20(var%20i%20in%20Object.keys(string))%20%7B%0A%20%20%20%20var%20own%20%3D%20string.hasOwnProperty(i)%3B%0A%20%20%20%20%23%7Bputs%20%60i%60%20if%20%60own%60%7D%0A%20%20%7D%0A%7D ---------------------------------------------------------------------------------------------------- [18:38:14] Ilya Bylich(@iliabylich):instance variables on `String` seems to be completely broken :( ---------------------------------------------------------------------------------------------------- [18:39:42] Ilya Bylich(@iliabylich):`@0` is not a valid instance variable name. Do you think it's ok to filter them directly in `Kernel#instance_variables` method? ---------------------------------------------------------------------------------------------------- [18:43:39] Elia Schito(@elia):Probably `@encoding` should become `$$encoding` at JS level, and yes, invalid var names should be skipped ---------------------------------------------------------------------------------------------------- [18:44:54] Elia Schito(@elia):@iliabylich I think I saw somewhere a check for valid ivar names, but don't remember exactly where (or if) atm ---------------------------------------------------------------------------------------------------- [18:45:06] Ilya Bylich(@iliabylich):I've found it ---------------------------------------------------------------------------------------------------- [18:45:29] Ilya Bylich(@iliabylich):Also I've stuck with setting ivar on string. Previous example shows that it seems to be impossible ---------------------------------------------------------------------------------------------------- [18:45:55] Elia Schito(@elia):Strings are rather special in JS ---------------------------------------------------------------------------------------------------- [18:48:16] Ilya Bylich(@iliabylich):Completely immutable, right? Have you ever thought about writing a wrapper for `String`? :smile: ---------------------------------------------------------------------------------------------------- [19:23:09] meh.(@meh):@elia any bug to fix that has some priority? I just got done fixing GNU screen and I'm bored ---------------------------------------------------------------------------------------------------- [19:26:54] Elia Schito(@elia):Lol, check If there's something in the 0.9 milestone or just rewrite the class/module system! 😎😂 ---------------------------------------------------------------------------------------------------- [19:31:10] meh.(@meh):@elia there's nothing for 0.9 ---------------------------------------------------------------------------------------------------- [19:51:37] Elia Schito(@elia):@meh heres a good one: promise taking multiple thens ---------------------------------------------------------------------------------------------------- [19:52:00] Elia Schito(@elia):also I remember an issue with always ---------------------------------------------------------------------------------------------------- [19:59:11] meh.(@meh):the always issue was fixed ---------------------------------------------------------------------------------------------------- [20:16:58] Jared White(@jaredcwhite):the opal-rails project is being featured on Hacker News right now. cool :) ---------------------------------------------------------------------------------------------------- [20:17:58] Elia Schito(@elia):\o/ ---------------------------------------------------------------------------------------------------- [20:20:05] Jared White(@jaredcwhite):also the Opalist is over 300 subscribers now. :clap: ---------------------------------------------------------------------------------------------------- [20:27:01] meh.(@meh):>more replies to someone posting 941 than anything else ---------------------------------------------------------------------------------------------------- [20:27:08] meh.(@meh):usual top quality comments ---------------------------------------------------------------------------------------------------- [21:05:24] meh.(@meh):@elia where even are the mspec_opal_node specs in? ---------------------------------------------------------------------------------------------------- [21:05:38] meh.(@meh):ah, they're the opal specs ---------------------------------------------------------------------------------------------------- [21:06:29] meh.(@meh):mh ---------------------------------------------------------------------------------------------------- [21:06:59] meh.(@meh):ah ---------------------------------------------------------------------------------------------------- [21:07:02] meh.(@meh):there's the problem ---------------------------------------------------------------------------------------------------- [22:04:29] Elia Schito(@elia):@elia to Be back in an hour ---------------------------------------------------------------------------------------------------- [22:50:46] meh.(@meh):@elia we're fucked :DDDD ---------------------------------------------------------------------------------------------------- [22:51:06] meh.(@meh):@elia #1173 might be unfixable, or have a deadly performance hit ---------------------------------------------------------------------------------------------------- [22:53:02] meh.(@meh):or maybe I'm seeing things ---------------------------------------------------------------------------------------------------- [22:56:28] meh.(@meh):I guess I'm seeing things ---------------------------------------------------------------------------------------------------- [22:56:46] meh.(@meh):and it's just a stupid compiler bug ---------------------------------------------------------------------------------------------------- ############################## [2015-11-05] ############################## [16:10:42] meh.(@meh):it yields the Request object ---------------------------------------------------------------------------------------------------- [16:11:47] Martin Becker(@Thermatix):It doesn't, it returns a promise ---------------------------------------------------------------------------------------------------- [16:11:57] meh.(@meh):yields, not returns ---------------------------------------------------------------------------------------------------- [16:12:07] meh.(@meh):HTTP.post(url, data) { content_type 'application/json' } ---------------------------------------------------------------------------------------------------- [16:12:51] meh.(@meh):that will also return a promise ---------------------------------------------------------------------------------------------------- [16:12:52] Martin Becker(@Thermatix):when I do: ```ruby Request.get("/api/forms/tree/#{id}") do |result| puts result end ``` I get a promise not a request object is what I meant ---------------------------------------------------------------------------------------------------- [16:13:25] meh.(@meh):Thermatix, `HTTP.get("/api/forms/tree/#{id}").then { |result| } ---------------------------------------------------------------------------------------------------- [16:13:33] meh.(@meh):for the post ---------------------------------------------------------------------------------------------------- [16:13:49] meh.(@meh):`HTTP.post(url, hash) { content_type 'application/json' }.then { |result }` ---------------------------------------------------------------------------------------------------- [16:16:04] Martin Becker(@Thermatix):I realised what I was doing wrong, but It's now saying `NoMethodError: undefined method 'content_type=' for #` ---------------------------------------------------------------------------------------------------- [16:17:04] meh.(@meh):it's `content_type` not `content_type=` ---------------------------------------------------------------------------------------------------- [16:17:12] meh.(@meh):it's made so you don't have to provide an argument ---------------------------------------------------------------------------------------------------- [16:17:31] meh.(@meh):it's either `HTTP.post(..) { |r| r.content_type 'application/json' }` or `HTTP.post(..) { content_type 'application/json' } ---------------------------------------------------------------------------------------------------- [16:18:34] Martin Becker(@Thermatix):got it, thanks for the help.. I don't think I'm firing on all cylinders atm ---------------------------------------------------------------------------------------------------- [16:21:41] meh.(@meh):Thermatix, no worries, it ain't your fault, I suck at explaining things :P ---------------------------------------------------------------------------------------------------- [16:41:06] Vais Salikhov(@vais):@meh I think you're doing great :+1: ---------------------------------------------------------------------------------------------------- [16:49:42] meh.(@meh):@elia, @vais, I still think we're fucked one way or the other, I didn't consider the fact `$$s` is currently used for the inheret self of a block ---------------------------------------------------------------------------------------------------- [16:50:04] meh.(@meh):this means we have to figure something else out ---------------------------------------------------------------------------------------------------- [16:50:12] meh.(@meh):actually, I think it's easy ---------------------------------------------------------------------------------------------------- [16:50:39] meh.(@meh):basically `$$s` remains, but instead of the common check being `self = $$s || this`, it becomes `self = $$m.self || $$s || this` ---------------------------------------------------------------------------------------------------- [16:50:57] meh.(@meh):that way we still DO NOT have to ensure the caller try/catches it to reset it properly, and we get all the benfits ---------------------------------------------------------------------------------------------------- [16:51:00] meh.(@meh):that should work ---------------------------------------------------------------------------------------------------- [16:57:01] Vais Salikhov(@vais):@meh sorry, what is `$$m.self`? ---------------------------------------------------------------------------------------------------- [17:10:37] meh.(@meh):vais, the new metadata stuff ---------------------------------------------------------------------------------------------------- [17:10:57] meh.(@meh):it will probably be `$m` or `$meta` or `$metadata` in the prelude ---------------------------------------------------------------------------------------------------- [17:20:08] Martin Becker(@Thermatix):does opal support `prepend` ? ---------------------------------------------------------------------------------------------------- [17:20:10] Martin Becker(@Thermatix):like in http://dev.af83.com/2012/10/19/ruby-2-0-module-prepend.html ---------------------------------------------------------------------------------------------------- [17:20:49] meh.(@meh):nope ---------------------------------------------------------------------------------------------------- [17:20:53] meh.(@meh):not yet ---------------------------------------------------------------------------------------------------- [17:21:42] Martin Becker(@Thermatix):damn ---------------------------------------------------------------------------------------------------- [17:21:51] Martin Becker(@Thermatix):would have been awesome, oh well ---------------------------------------------------------------------------------------------------- [17:22:11] Martin Becker(@Thermatix):would easily allow me to add method extentions ---------------------------------------------------------------------------------------------------- [17:28:15] Martin Becker(@Thermatix):umm question are cookies sent with every ajax request? ---------------------------------------------------------------------------------------------------- [17:28:28] meh.(@meh):yeah ---------------------------------------------------------------------------------------------------- [17:28:30] meh.(@meh):by the browser ---------------------------------------------------------------------------------------------------- [17:28:44] Martin Becker(@Thermatix):kk ---------------------------------------------------------------------------------------------------- [23:13:03] Elia Schito(@elia):@/all 0.9.0.beta2 is out! here's the new stuff from beta1: https://gist.github.com/elia/72872e47b23423228f09 (would post the rubygems tweet but apparently I have some connection issues 😕 ) ---------------------------------------------------------------------------------------------------- [23:25:04] George Plymale II(@ylluminarious):@elia my connection seems fine, so here's the tweet: https://twitter.com/rubygems/status/662404555448164352 ---------------------------------------------------------------------------------------------------- [13:12:04] Vais Salikhov(@vais):@Thermatix yes and no. HTTPS is usually handled by the web server (apache, nginx) that proxies to your application server (webrick, thin, puma). If you expose your application server directly to the interwebs (without a front proxy), you *can* make webrick/thin/puma handle https for you. This is not how it's usually done for production apps, but each of these rack servers supports https. ---------------------------------------------------------------------------------------------------- [13:13:47] Martin Becker(@Thermatix):I c so beyond changing the protocol to https, I don't have to do anything else? ---------------------------------------------------------------------------------------------------- [13:14:10] Martin Becker(@Thermatix):how do I ensure that the protocol is set to http when doing an ajax request in opal? ---------------------------------------------------------------------------------------------------- [13:14:20] Martin Becker(@Thermatix):I'm using the jquery library for ajax requests ---------------------------------------------------------------------------------------------------- [13:17:35] Elia Schito(@elia):@Thermatix you still need the certificate, I suggest finding a tutorial of some kind depending on what you need (e.g. https://duckduckgo.com/?q=https+ruby+server+setup&t=osx&ia=qa) ---------------------------------------------------------------------------------------------------- [13:31:50] Vais Salikhov(@vais):@Thermatix correct, once https is set up on the server side, all you have to do it use https:// urls instead of http://. Opal does not care about that, and neither does jquery. If you load the initial html page over https, you can make ajax calls to relative urls (no need to specify https etc), and these requests will be going through https. Hope this makes sense. In addition to what @elia said, you can try to use a self-signed SSL certificate to test with. The browser will complain that the connection is not secure (since your self-signed certificate does not come from a "trusted" source), but that's ok for testing purposes. ---------------------------------------------------------------------------------------------------- [13:34:27] Martin Becker(@Thermatix):can I use opal to then ensure that the protocol is set to https in the first place? ---------------------------------------------------------------------------------------------------- [13:34:56] meh.(@meh):just do not expose a clear-text port ---------------------------------------------------------------------------------------------------- [13:42:02] Vais Salikhov(@vais):I think you can check this client-side, but a better approach is what @meh suggested: either do not expose a clear-text port (http port 80) at all, or check on the server-side if a request is using SSL and if not, redirect to the https URL. ---------------------------------------------------------------------------------------------------- [13:42:43] Vais Salikhov(@vais):@Thermatix I think the general theme here is: do not make encryption a client-side concern in any way :smile: ---------------------------------------------------------------------------------------------------- [13:47:09] Martin Becker(@Thermatix):ok ---------------------------------------------------------------------------------------------------- [14:04:11] Vais Salikhov(@vais):@elia re the `opal -R server my_code.rb` trick that you mentioned, I am getting `Empty reply from server` for `http://localhost:3000` What am I missing? ---------------------------------------------------------------------------------------------------- [14:05:08] Elia Schito(@elia):@vais not sure, I used it with a pipe: `pbpaste | opal -R server`, does it work that way? ---------------------------------------------------------------------------------------------------- [14:07:18] Vais Salikhov(@vais):let me try... ---------------------------------------------------------------------------------------------------- [14:14:19] Vais Salikhov(@vais):@elia my bad, the issue seems to be with my vagrant forwarded port (I decided to use Vagrant running Ubuntu even on my Mac, so I have the same environment everywhere. The jury is still out on whether this was a good idea :wink2:) ---------------------------------------------------------------------------------------------------- [14:15:08] Vais Salikhov(@vais):As they say, you can always add another layer of indirection. ---------------------------------------------------------------------------------------------------- [14:15:18] Elia Schito(@elia):@vais go docker! ---------------------------------------------------------------------------------------------------- [14:15:40] Elia Schito(@elia):and eventually dind! ---------------------------------------------------------------------------------------------------- [14:16:09] Ilya Bylich(@iliabylich):@elia Is it possible to run generated tmp/mspec_node.rb this way? As I know, it uses some node-specific stuff... ---------------------------------------------------------------------------------------------------- [14:16:31] Vais Salikhov(@vais):@elia :weary: ---------------------------------------------------------------------------------------------------- [14:17:46] Vais Salikhov(@vais):@iliabylich maybe try mspec_phantom instead :wink: ---------------------------------------------------------------------------------------------------- [14:19:08] Elia Schito(@elia):@iliabylich rake should output the actual commands it runs and it should be fairly easy to reuse them adding that option (and probably remove the node/phantom specific `-r` requires) ---------------------------------------------------------------------------------------------------- [14:24:55] Ilya Bylich(@iliabylich):@elia wow. I'm so tired of debugging through `node debug ...`. Thanks you so much :) ---------------------------------------------------------------------------------------------------- [14:31:25] Vais Salikhov(@vais):@elia hmm, so it's not my vagrant port forwarding, because other web things work (even just `ruby -run -e httpd . -p 3000`) It's gotta be something in that server cli runner, but wth? I'm not having a good day today, one mystery after another :smile: Thought maybe it's thin, but the same result with webrick. Better luck tomorrow perhaps. ---------------------------------------------------------------------------------------------------- [14:39:00] Elia Schito(@elia):@iliabylich the only regret is that I didn't publicize it more :) ---------------------------------------------------------------------------------------------------- [14:39:46] Elia Schito(@elia):@vais does it work from inside the machine? (pseudocode: `vagrant ssh curl localhost:3000`) ---------------------------------------------------------------------------------------------------- [14:48:48] Vais Salikhov(@vais):@elia yep, it does with curl inside the ssh session, but not from the outside (outside Chrome shows me the empty reply error). ---------------------------------------------------------------------------------------------------- [14:49:47] Vais Salikhov(@vais):I have used this vagrant setup with rails and sinatra before, using thin and webrick, so I have no idea what gives in this case. ---------------------------------------------------------------------------------------------------- [14:52:09] Martin Becker(@Thermatix):how do I do a setTimeout in opal without using native javascript? ---------------------------------------------------------------------------------------------------- [14:55:22] Elia Schito(@elia):@Thermatix you can use native (which is already required if you're using opal-jquery) in this way: `$$.setTimeout(-> { callback code }, 500)` ---------------------------------------------------------------------------------------------------- [14:56:25] Martin Becker(@Thermatix):thanks that worked ---------------------------------------------------------------------------------------------------- [15:08:13] Ilya Bylich(@iliabylich):@Thermatix As I remember, there is a method `delay` in opal-browser that takes a timeout and a block ---------------------------------------------------------------------------------------------------- [15:08:50] Ilya Bylich(@iliabylich):https://github.com/opal/opal-browser/blob/1336a869be2ff2aa1cbc57b323359b49cc47e7db/opal/browser/delay.rb#L58 method `after` ---------------------------------------------------------------------------------------------------- [15:09:41] Martin Becker(@Thermatix):thanks but I don't really want to install an entire gem just for a single function ---------------------------------------------------------------------------------------------------- [15:10:16] Martin Becker(@Thermatix):although... ---------------------------------------------------------------------------------------------------- [15:10:27] Martin Becker(@Thermatix):it might be worth using over the jquery library ---------------------------------------------------------------------------------------------------- [15:10:39] Martin Becker(@Thermatix):do I need jquery included for opal-browser? ---------------------------------------------------------------------------------------------------- [15:11:49] Ilya Bylich(@iliabylich):I don't think so, there is no `opal-browser` dependency in `opal-jquery`'s gemspec ---------------------------------------------------------------------------------------------------- [15:12:32] Martin Becker(@Thermatix):I mean do I need the jquery library to use opal-browser ---------------------------------------------------------------------------------------------------- [15:13:14] Ilya Bylich(@iliabylich):No, `opal-browser` is a wrapper for a native browser functionality ---------------------------------------------------------------------------------------------------- [15:13:46] Martin Becker(@Thermatix):AH ok, thats what I wanted to know, thanks. ---------------------------------------------------------------------------------------------------- [15:14:03] Martin Becker(@Thermatix):in that case I think I'm going to ditch the jquery library and switch to opal-browser ---------------------------------------------------------------------------------------------------- [15:19:53] meh.(@meh):Thermatix, opal-browser is cherry-pickable ---------------------------------------------------------------------------------------------------- [15:19:59] meh.(@meh):if you just need delay, just require 'browser/delay' ---------------------------------------------------------------------------------------------------- [15:20:04] meh.(@meh):and it will just be one class ---------------------------------------------------------------------------------------------------- [15:20:24] meh.(@meh):Thermatix, if you find it's not cherry-pickable enough and it's bringing in stuff you don't want, open an issue and I can make it more granular ---------------------------------------------------------------------------------------------------- [15:21:31] Martin Becker(@Thermatix):... it's saying that Browser::HTTP doesn't exist... ---------------------------------------------------------------------------------------------------- [15:21:40] meh.(@meh):because it's cherry-pickable ---------------------------------------------------------------------------------------------------- [15:21:44] meh.(@meh):require 'browser/http' ---------------------------------------------------------------------------------------------------- [15:21:57] Martin Becker(@Thermatix):i'm requiring 'browser' for the moment ---------------------------------------------------------------------------------------------------- [15:22:02] meh.(@meh):yes ---------------------------------------------------------------------------------------------------- [15:22:08] meh.(@meh):require 'browser'; require 'browser/http' ---------------------------------------------------------------------------------------------------- [15:22:20] Martin Becker(@Thermatix):I c, so I can't just require 'browser' ---------------------------------------------------------------------------------------------------- [15:22:29] meh.(@meh):'browser' requires only the basic browser stuff ---------------------------------------------------------------------------------------------------- [15:22:34] meh.(@meh):events, window, dom and cssom ---------------------------------------------------------------------------------------------------- [15:22:45] meh.(@meh):if you need additional stuff you also have to require it ---------------------------------------------------------------------------------------------------- [15:23:06] Martin Becker(@Thermatix):I seee ---------------------------------------------------------------------------------------------------- [15:23:22] Martin Becker(@Thermatix):and browser/delay is not a basic thing? ---------------------------------------------------------------------------------------------------- [15:23:32] meh.(@meh):nope ---------------------------------------------------------------------------------------------------- [15:23:36] meh.(@meh):you have to require it too ---------------------------------------------------------------------------------------------------- [15:23:38] Martin Becker(@Thermatix):gotcha ---------------------------------------------------------------------------------------------------- [15:24:17] Martin Becker(@Thermatix):hmmm I don't think it mentions that in the readme for opal-browser ---------------------------------------------------------------------------------------------------- [15:25:32] meh.(@meh):doubt it does ---------------------------------------------------------------------------------------------------- [15:25:48] Martin Becker(@Thermatix):shouldn't it? ---------------------------------------------------------------------------------------------------- [15:25:52] meh.(@meh):probably ---------------------------------------------------------------------------------------------------- [15:25:53] meh.(@meh)::D ---------------------------------------------------------------------------------------------------- [15:36:09] Martin Becker(@Thermatix):why doesn't `object.inspect` return the object and it's attributes? only the object itself? ---------------------------------------------------------------------------------------------------- [15:36:20] meh.(@meh):what object? ---------------------------------------------------------------------------------------------------- [15:38:30] Martin Becker(@Thermatix):lets say I'm doing: ```ruby Request.get("/api/forms/tree/#{id}") do |result| result.on :success do |response| puts response.inspect end end ``` it only displays `#` and nothing else I have to do `puts response.instance_variables` to see anything and I'd still have to iterate over each one to find the value of each attribute (if they are a public attribute at all). ---------------------------------------------------------------------------------------------------- [15:38:56] meh.(@meh):Thermatix, because inspect isn't implemented for it, pull request welcome ---------------------------------------------------------------------------------------------------- [15:39:58] Martin Becker(@Thermatix):isn't .inspect a basic ruby object method that standardly returns an object and it's instance variables and there values? ---------------------------------------------------------------------------------------------------- [15:45:07] Ilya Bylich(@iliabylich):@Thermatix Not for every single object. For example, for Object - yes, for String - no :) ---------------------------------------------------------------------------------------------------- [15:46:20] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [15:46:42] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [15:47:09] Martin Becker(@Thermatix):lets try that again ---------------------------------------------------------------------------------------------------- [15:47:25] Martin Becker(@Thermatix):I'm having some trouble sending JSON data to my server. ---------------------------------------------------------------------------------------------------- [15:47:53] Martin Becker(@Thermatix):here's my request class that makes the request: ```ruby require 'browser/http' class Request class << self %w{get post delete put patch head}.each do |http_verb| define_method http_verb do |*args,&block| self.make(http_verb,*args,&block) end end def make(type,url,payload=nil, &block) data_hash = {dataType: 'json'} data_hash.merge!({payload: payload.to_json})if payload Browser::HTTP.send type, url, *data_hash do |response| puts response.inspect # results = [response.status_code,response.json] if block_given? block.call(*response) else response end end end end end ``` ---------------------------------------------------------------------------------------------------- [15:48:25] Martin Becker(@Thermatix):and I'm using it like so: ```ruby def handle_validation event value = event.target.value ::Request.post("/api/forms/validate/#{Form.tree[:meta][:id]}",format_validation(event)) do |result| result.on :success do |response| self.tree = response.json set_pair_validation_field_value true, value set_validation_messages 'correct', false end result.on :failure do |response| set_pair_validation_field_value false set_validation_messages response.json[:data][:message], true end end end ``` ---------------------------------------------------------------------------------------------------- [15:48:45] Martin Becker(@Thermatix):the problem is that the server is receiving the data like this and erroring: ---------------------------------------------------------------------------------------------------- [15:49:27] Martin Becker(@Thermatix):`unexpected token at 'dataType=json&payload=%7B%22meta%22%3A%7B%22context%22%3A%22form.validation.check%22%2C%20%22target%22%3A%22form.account%22%7D%2C%20%22data%22%3A%7B%22field%22%3A%22user%20name%22%2C%20%22value%22%3A%22%22%7D%7D':` ---------------------------------------------------------------------------------------------------- [15:50:20] Martin Becker(@Thermatix):all `format_validation` does is just make sure it's in the correct hash structure, nothing more ---------------------------------------------------------------------------------------------------- [15:55:12] Ilya Bylich(@iliabylich):Check out this code: https://github.com/opal/opal-browser/blob/master/opal/browser/http/request.rb#L297 (parameters is your `data_hash`) ---------------------------------------------------------------------------------------------------- [15:56:00] meh.(@meh):Thermatix, the problem is HTTP::Request is not a normal object ---------------------------------------------------------------------------------------------------- [15:56:11] meh.(@meh):most of the stuff that you care about isn't in instance variables, but on the underlying native object ---------------------------------------------------------------------------------------------------- [15:58:24] Ilya Bylich(@iliabylich):When you pass a `Hash` to the `send` method, `Browser::HTTP::Request` encodes it as "key1=value1&key2=value2" (while you need json). The solution is: encode your data with `to_json` manually before passing it to `Browser::HTTP.send` ---------------------------------------------------------------------------------------------------- [15:59:08] Martin Becker(@Thermatix):I see ---------------------------------------------------------------------------------------------------- [15:59:28] Martin Becker(@Thermatix):does it pick up on JSON automaticly so you don't need to tell it that your sending JSON? ---------------------------------------------------------------------------------------------------- [15:59:37] Martin Becker(@Thermatix):automatically* ---------------------------------------------------------------------------------------------------- [15:59:38] Ilya Bylich(@iliabylich):@Thermatix The only http-related example in readme is a simple http get (without any parameters), so start reading the source :) ---------------------------------------------------------------------------------------------------- [15:59:39] meh.(@meh):Thermatix, nope ---------------------------------------------------------------------------------------------------- [16:00:45] Martin Becker(@Thermatix):so how do you tell it the content type? because `hash[:payload]` is a JSON string ---------------------------------------------------------------------------------------------------- [16:01:00] meh.(@meh):well, first of all you have to use post ---------------------------------------------------------------------------------------------------- [16:01:41] Martin Becker(@Thermatix):wait, I think I get it ---------------------------------------------------------------------------------------------------- [16:01:43] meh.(@meh):so just HTTP.post(url, hash) ---------------------------------------------------------------------------------------------------- [16:01:55] meh.(@meh):Thermatix, there is documentation ---------------------------------------------------------------------------------------------------- [16:02:29] meh.(@meh):Thermatix, http://www.rubydoc.info/github/opal/opal-browser/ ---------------------------------------------------------------------------------------------------- [16:02:34] meh.(@meh):almost everything has docs ---------------------------------------------------------------------------------------------------- [16:09:58] Martin Becker(@Thermatix):how do I set the content_type header on the request object when `Browser::HTTP.post` returns a promise and not the request object? It seems strange that `Browser::HTTP.post` only takes a url and the payload but not the payload type, I don't see how to set the `content_type` when I don't get access to the request object directly nor can you pass it into the request object. ---------------------------------------------------------------------------------------------------- [16:10:31] meh.(@meh):Thermatix, read the docs ---------------------------------------------------------------------------------------------------- [16:10:38] meh.(@meh):you just pass a block to post ---------------------------------------------------------------------------------------------------- [10:44:42] Michał Kalbarczyk(@fazibear):Inesita's livereload works! https://www.youtube.com/watch?v=7h6wn8tF9Rw ---------------------------------------------------------------------------------------------------- [10:45:32] Michał Kalbarczyk(@fazibear):Needs lot of cleanups but it works :tada: ---------------------------------------------------------------------------------------------------- [11:09:26] Vais Salikhov(@vais):@fazibear sweet! ---------------------------------------------------------------------------------------------------- [11:09:37] Elia Schito(@elia):@fazibear retweeted! ---------------------------------------------------------------------------------------------------- [12:21:40] Martin Becker(@Thermatix):whats inestia? ---------------------------------------------------------------------------------------------------- [12:31:05] Martin Becker(@Thermatix):is there an opal library for encrypting data before transport via ajax? ---------------------------------------------------------------------------------------------------- [12:31:26] meh.(@meh):@/alll need opinions on https://github.com/opal/opal/issues/1181 ---------------------------------------------------------------------------------------------------- [12:31:34] Martin Becker(@Thermatix):that also matches equivalent ruby gem library? ---------------------------------------------------------------------------------------------------- [12:32:16] meh.(@meh):Thermatix, not that I know of ---------------------------------------------------------------------------------------------------- [12:32:49] Martin Becker(@Thermatix):*sigh* ---------------------------------------------------------------------------------------------------- [12:33:04] Martin Becker(@Thermatix):can you point me in the right direction for encryption/decryption? ---------------------------------------------------------------------------------------------------- [12:33:24] meh.(@meh):what kind of encryption do you need? ---------------------------------------------------------------------------------------------------- [12:35:00] Martin Becker(@Thermatix):I want to encrypt form data before sending to the back end ---------------------------------------------------------------------------------------------------- [12:35:18] Martin Becker(@Thermatix):I also want to know of a good js password hasing library ---------------------------------------------------------------------------------------------------- [12:41:26] Vais Salikhov(@vais):@Thermatix what's wrong with using https? Why encrypt in JS? This is generally considered a Bad Idea AFAIK ---------------------------------------------------------------------------------------------------- [12:44:08] Martin Becker(@Thermatix):does sinatra/padrino suppourt https out of the box? ---------------------------------------------------------------------------------------------------- ############################## [2015-11-06] ############################## [00:25:41] Vais Salikhov(@vais):@elia :tada: @meh got it, thanks, makes sense! ---------------------------------------------------------------------------------------------------- [01:32:06] Mitch VanDuyn(@catmando):How do you post tweets like that? ---------------------------------------------------------------------------------------------------- [02:26:59] Alexandr Smirnov(@JelF):Does lastest versions of opal provide good sourcemap support? ---------------------------------------------------------------------------------------------------- [02:40:36] Mitch VanDuyn(@catmando):since version 0.8 on, and i understand 0.9 is faster and better! ---------------------------------------------------------------------------------------------------- [02:41:49] Alexandr Smirnov(@JelF):it seems, that optimisation conflicts with either rails or our code base :( ---------------------------------------------------------------------------------------------------- [08:55:37] Elia Schito(@elia):@JelF tell me more about that! : ) ---------------------------------------------------------------------------------------------------- [08:56:26] Elia Schito(@elia):@catmando pasting a tweet url is eough ---------------------------------------------------------------------------------------------------- [16:35:16] Brendan Grainger(@rainkinz):Hi All, I am playing with opal-rails and specifically this usage: https://github.com/opal/opal-rails#as-a-template but if I call `render_to_string` as in the example the opal create template does not seem to be called at all. Am I missing something (also is this the right place to ask about opal-rails?). Thanks ---------------------------------------------------------------------------------------------------- [16:40:53] Elia Schito(@elia):@rainkinz right place indeed! : ) Can you tell me more about the template you want to render and its path? ---------------------------------------------------------------------------------------------------- [16:45:11] Brendan Grainger(@rainkinz):sure ---------------------------------------------------------------------------------------------------- [16:47:33] Brendan Grainger(@rainkinz):I have a messages_controller with the following create method: ``` def create @message = Message.create!(message_params) render type: :js, locals: { messages_html: render_to_string(@message) } # render type: :js, locals: { messages_html: "from controller" } end ``` and a create.js.opal file in: app/views/messages/create.js.opal with the following code: ``` require 'opal-jquery' Document.ready? do puts "Adding message #{@message}" Element.find('#chat').append(messages_html) end ``` ---------------------------------------------------------------------------------------------------- [16:48:01] Brendan Grainger(@rainkinz):note that if I don’t call `render_to_string` in the controller the opal code is called ---------------------------------------------------------------------------------------------------- [16:48:36] Brendan Grainger(@rainkinz):so I think it’s actually a rails thing, but given the example here: https://github.com/opal/opal-rails#as-a-template I thought it might work ---------------------------------------------------------------------------------------------------- [16:49:14] Brendan Grainger(@rainkinz):thank you so much for your help by the way ---------------------------------------------------------------------------------------------------- [16:52:31] Elia Schito(@elia):Sorry, I don't see anything obvious, can you open an issue over at https://github.com/opal/opal-rails/issues/new ? ---------------------------------------------------------------------------------------------------- [16:53:08] Elia Schito(@elia):I'll add a spec for it and then try to find out what's wrong ---------------------------------------------------------------------------------------------------- [16:54:38] Brendan Grainger(@rainkinz):sure, by the way if I change: ``` render type: :js, locals: { messages_html: render_to_string(@message) } ``` to ``` render type: :js, locals: { messages_html: "from controller” } ``` the opal code is called. So I think it’s more of a rails thing and perhaps that I’m trying to render an erb template using render_to_string then call render again to get it to call the create.js.opal template ---------------------------------------------------------------------------------------------------- [16:59:33] Elia Schito(@elia):the interaction is really strange, gotta go now, be sure to post anything you find about it here or in the issue, thanks! ---------------------------------------------------------------------------------------------------- [16:59:49] Brendan Grainger(@rainkinz):will do. Thank you ---------------------------------------------------------------------------------------------------- [21:30:15] Michał Kalbarczyk(@fazibear):How can I get this thing work ? ```ruby # `new Websocket("ws://sdfsdf") x = JS.global.JS['WebSocket'] JS.new(x, "ws://localhost") # ``` ---------------------------------------------------------------------------------------------------- [22:08:27] meh.(@meh):fazibear, is there any specific reason you don't want to use opal-browser? ---------------------------------------------------------------------------------------------------- [22:08:30] meh.(@meh):it has websocket support ---------------------------------------------------------------------------------------------------- [23:04:21] Michał Kalbarczyk(@fazibear):Wish `opal-browser` be more modular, and not require for example `paggio` just to have `$document.body` :) ---------------------------------------------------------------------------------------------------- [23:04:34] Michał Kalbarczyk(@fazibear):but 'WebSocket' is just example for use of JS ---------------------------------------------------------------------------------------------------- [23:04:41] meh.(@meh):fazibear, it's cherry-pickable ---------------------------------------------------------------------------------------------------- [23:05:01] meh.(@meh):but do open an issue if you find it's not enough ---------------------------------------------------------------------------------------------------- [23:05:26] meh.(@meh):also yeah, I don't think `new` was implemented properly in JS ---------------------------------------------------------------------------------------------------- [23:06:49] Michał Kalbarczyk(@fazibear):you mean cherry-pickable with git right ? ---------------------------------------------------------------------------------------------------- ############################## [2015-11-07] ############################## [00:08:32] meh.(@meh):fazibear, no, with require ---------------------------------------------------------------------------------------------------- [15:50:43] Brendan Grainger(@rainkinz):@elia I’ve submitted a bug here: https://github.com/opal/opal-rails/issues/72 (with a link to an example app) for the issue we discussed yesterday. It looks like the response has the content-type set to ‘text/html’ in this case. If I force it to be ‘application/javascript’ it works as expected. Thanks for your help on this. Also, I’m a total newb to opal so it might be something I’m doing. ---------------------------------------------------------------------------------------------------- ############################## [2015-11-08] ############################## [23:06:03] Elia Schito(@elia):@rainkinz thanks! replied on the issue ---------------------------------------------------------------------------------------------------- ############################## [2015-11-09] ############################## [03:39:07] Colin Gunn(@balmoral):does ** splat work in opal, e.g. ``` something.some_method(**args) ``` where `args` is a hash? ---------------------------------------------------------------------------------------------------- [03:39:49] meh.(@meh):balmoral, it should ---------------------------------------------------------------------------------------------------- [03:39:56] meh.(@meh):I think ---------------------------------------------------------------------------------------------------- [03:40:02] meh.(@meh):or not, I'm not sure ---------------------------------------------------------------------------------------------------- [03:40:05] Colin Gunn(@balmoral):I’m getting error ``` parse error on value "**" (tPOW) ``` ---------------------------------------------------------------------------------------------------- [03:40:12] meh.(@meh):yeah, guess we don't then ---------------------------------------------------------------------------------------------------- [03:40:19] meh.(@meh):they're supported in method definitions tho ---------------------------------------------------------------------------------------------------- [03:40:41] Colin Gunn(@balmoral):yep, the method definitions get through, but the splat on the calls don't ---------------------------------------------------------------------------------------------------- [03:41:31] meh.(@meh):yeah, guess they aren't supported yet ---------------------------------------------------------------------------------------------------- [03:42:00] Colin Gunn(@balmoral):do you think it’s on the todo list, or should I raise an issue? ---------------------------------------------------------------------------------------------------- [03:43:37] meh.(@meh):open an issue so it can be kept track of, I thought it was supported ---------------------------------------------------------------------------------------------------- [03:43:49] Colin Gunn(@balmoral):ok, thanks ---------------------------------------------------------------------------------------------------- [16:53:33] Mitch VanDuyn(@catmando):any advise for converting Time strings (standard ruby format) back to Time values? I get method missing error on TIme.parse ---------------------------------------------------------------------------------------------------- [17:15:01] Elia Schito(@elia):@catmando have you required 'time' or 'date'? (don't remember which one…) ---------------------------------------------------------------------------------------------------- [17:15:23] Mitch VanDuyn(@catmando):well I definitely think I have time, as I can do a Time.now ---------------------------------------------------------------------------------------------------- [17:15:27] Mitch VanDuyn(@catmando):but I can't do a parse ---------------------------------------------------------------------------------------------------- [17:15:32] Mitch VanDuyn(@catmando):throws method missing ---------------------------------------------------------------------------------------------------- [17:16:22] Elia Schito(@elia):Time is part of the core lib, but in MRI you have to require either 'time' or 'date' to have those additional features ---------------------------------------------------------------------------------------------------- [17:16:47] Mitch VanDuyn(@catmando):so just a simple require 'Time" is all we are missing? Ho ho ho ---------------------------------------------------------------------------------------------------- [17:17:07] Elia Schito(@elia):`require 'time'` is the right one ---------------------------------------------------------------------------------------------------- [17:17:16] Elia Schito(@elia):just checked in IRB ---------------------------------------------------------------------------------------------------- [17:18:15] Mitch VanDuyn(@catmando):trying now... ---------------------------------------------------------------------------------------------------- [17:26:15] Mitch VanDuyn(@catmando):@elia - works great... I never knew... we have been just thinking it wasn't implemented... glad I asked! ---------------------------------------------------------------------------------------------------- [18:16:29] Elia Schito(@elia):That's the sign of too much rails! :D ---------------------------------------------------------------------------------------------------- [21:04:51] Mitch VanDuyn(@catmando)::-) ---------------------------------------------------------------------------------------------------- ############################## [2015-11-10] ############################## [13:16:20] Elia Schito(@elia):@iliabylich you're right opal uses mspec in js-land ---------------------------------------------------------------------------------------------------- [13:17:13] Elia Schito(@elia):@Qqwy `Opal.use_gem` will properly add the lib dir of those gems to `Opal.paths`, eg. `Opal.use_gem("ruby-ecsda")` ---------------------------------------------------------------------------------------------------- [16:22:15] Qqwy / Wiebe-Marten(@Qqwy):@elia: Thank you for your help! I tried using `Opal.use_gem`. It seems to do what it says on the tin. However, because the Ruby stdlib `Digest` and `OpenSSL` classes are not (yet) rewritten for Opal, I've hit a dead end there. ---------------------------------------------------------------------------------------------------- [16:22:20] Qqwy / Wiebe-Marten(@Qqwy):But nevertheless, thank you for your help ---------------------------------------------------------------------------------------------------- [16:24:37] Elia Schito(@elia):my pleasure, do you plan to implement any of Digest or OpenSSL for opal? ---------------------------------------------------------------------------------------------------- [16:26:20] Qqwy / Wiebe-Marten(@Qqwy):I fear that my mathematical expertise is too limited to be of use to implement a cryptographic library directly ---------------------------------------------------------------------------------------------------- [16:27:26] Qqwy / Wiebe-Marten(@Qqwy):Although there are some great javascript-native libraries out there that implement SHA1, SHA2, SHA3(/Keccak), MD5 and the likes that Opal might be able to tap in to. ---------------------------------------------------------------------------------------------------- [16:28:09] Elia Schito(@elia):yeah, reusing JS stuff sounds like the best option here ---------------------------------------------------------------------------------------------------- [10:01:28] Qqwy / Wiebe-Marten(@Qqwy):I'm building a webapp with Rails, and I want to use Opal. For some end-to-end encryption things, I need to use the `ruby-ecdsa` and `digest-sha3` gems, both on the server-side and the client-side. Both of these gems do not have any external dependencies, so I think they should be able to interace with Opal. How can I get Opal/opal-rails to compile these gems so they can be used in the client-side code? ---------------------------------------------------------------------------------------------------- [12:16:59] Ilya Bylich(@iliabylich):Does opal-rspec support `let`? ---------------------------------------------------------------------------------------------------- [12:36:37] Qqwy / Wiebe-Marten(@Qqwy):@iliabylich as it is used inside the spec (https://github.com/opal/opal-rspec/blob/ceb3bc658cdf333b85e86fb9cee0256270e19e9a/spec/opal/example_spec.rb) I believe it does. ---------------------------------------------------------------------------------------------------- [12:39:13] Ilya Bylich(@iliabylich):@Qqwy It's opal-rspec 0.5.0.beta2, I don't think that opal master uses it :( Thank you ---------------------------------------------------------------------------------------------------- [12:43:04] Ilya Bylich(@iliabylich):@elia Do specs in /spec/opal use mspec inside? ---------------------------------------------------------------------------------------------------- [12:45:53] Ilya Bylich(@iliabylich):sure, that's why there's no `let ` :smile: ---------------------------------------------------------------------------------------------------- ############################## [2015-11-11] ############################## [06:21:06] Forrest Chang(@fkchang):@/all I added react support to opal playground http://git.io/v8Sm7 ---------------------------------------------------------------------------------------------------- [06:21:43] Forrest Chang(@fkchang):will tabify it also ---------------------------------------------------------------------------------------------------- [13:23:33] Martin Becker(@Thermatix):@all how do I do chunked file-uploads in opal? ---------------------------------------------------------------------------------------------------- [13:24:01] Elia Schito(@elia):@Thermatix are you using opal-browser or opal-jquery? ---------------------------------------------------------------------------------------------------- [13:24:05] Martin Becker(@Thermatix):browser ---------------------------------------------------------------------------------------------------- [13:24:20] Martin Becker(@Thermatix):also ---------------------------------------------------------------------------------------------------- [13:24:44] Martin Becker(@Thermatix):is it possible for the backend (sinatra) to give a progress update every time it gets a chunk? ---------------------------------------------------------------------------------------------------- [13:25:03] Elia Schito(@elia):@Thermatix never tried, google says something? ---------------------------------------------------------------------------------------------------- [13:25:55] Martin Becker(@Thermatix):well, that part isn't important ---------------------------------------------------------------------------------------------------- [13:25:58] Martin Becker(@Thermatix):it's the file upload that is ---------------------------------------------------------------------------------------------------- [13:26:17] Martin Becker(@Thermatix):I was thinking of using the following code for moving the chunked data to a target location https://gist.github.com/sasimpson/1112739 ---------------------------------------------------------------------------------------------------- [13:27:33] Elia Schito(@elia):I'd rather search for a javscript in-browser example and then convert it to opal cc @meh ---------------------------------------------------------------------------------------------------- [13:28:09] Martin Becker(@Thermatix):hmm I seee ---------------------------------------------------------------------------------------------------- [14:25:41] Mitch VanDuyn(@catmando):@thermatix - indeed.. there are good jquery plugins for this... no need to write new, although a opal wrapper would be nice! ---------------------------------------------------------------------------------------------------- [14:34:44] Mitch VanDuyn(@catmando):@thermatix, and yes the backend can monitor the progress. I can give you detailed code example for a sinatra app that does this. It does require some apache plugins etc to work (at least pre html5) ---------------------------------------------------------------------------------------------------- [14:38:53] Martin Becker(@Thermatix):I'm currently doing something like this: https://gist.github.com/Thermatix/3a8138baf705b55a565c ---------------------------------------------------------------------------------------------------- [14:39:17] Martin Becker(@Thermatix):for the backend ---------------------------------------------------------------------------------------------------- [14:40:03] Martin Becker(@Thermatix):because I intend to push the uploaded file to a remote server (s3 most probably) ---------------------------------------------------------------------------------------------------- [14:40:16] Martin Becker(@Thermatix):it probably won't be exactly like this ---------------------------------------------------------------------------------------------------- [14:40:30] Martin Becker(@Thermatix):but I'm trying to make it remote server agnostic ---------------------------------------------------------------------------------------------------- [14:41:18] Martin Becker(@Thermatix):also @catmando cool, I Iook forward to seeing it ---------------------------------------------------------------------------------------------------- [14:41:48] Mitch VanDuyn(@catmando):okay... sure I can paste the code someplace, but there are some important things to understand. ---------------------------------------------------------------------------------------------------- [14:43:44] Mitch VanDuyn(@catmando):you will get MUCH BETTER performance if you client app pushes directly to the cloud service, and then once its there, you can pull onto the server and process. Why? because the cloud storage is highly optimized to receive your files rapidly, at low overhead. But if you send to your server you are tying up a server process for the whole upload story. So for best results it goes like this: ---------------------------------------------------------------------------------------------------- [14:44:08] Mitch VanDuyn(@catmando):1) client initiates an upload ---------------------------------------------------------------------------------------------------- [14:45:01] Mitch VanDuyn(@catmando):2) server provides a unique id (or you can just do a random hash on the client) ---------------------------------------------------------------------------------------------------- [14:45:37] Mitch VanDuyn(@catmando):3) client pushes the files directly to a cloud location named using the id. ---------------------------------------------------------------------------------------------------- [14:45:56] Mitch VanDuyn(@catmando):4) the cloud service will provide the incremental feedback ---------------------------------------------------------------------------------------------------- [14:46:13] Mitch VanDuyn(@catmando):5) once done the client notifies the server that there is new data waiting to process ---------------------------------------------------------------------------------------------------- [14:47:56] Mitch VanDuyn(@catmando):Lots of stuff out in google land explaining how to do this. Strongly suggest you do not try to re-invent this particular wheel, as it gets really tricky. ---------------------------------------------------------------------------------------------------- [15:47:04] Martin Becker(@Thermatix):is it possible to remote_require a js file? ---------------------------------------------------------------------------------------------------- [15:55:39] Elia Schito(@elia):@Thermatix yes, but you have to implement it yourself, there's a `remote_require` in `opal-parser`, but it's a sync request and fetches ruby code instead of js so it's probably not what you need ---------------------------------------------------------------------------------------------------- [15:56:06] Elia Schito(@elia):https://github.com/opal/opal/blob/c6ffbfee22c031e90f30adfd8daf7ac23650e430/stdlib/opal-parser.rb#L11-L19 ---------------------------------------------------------------------------------------------------- [15:57:15] Martin Becker(@Thermatix):hmmm ---------------------------------------------------------------------------------------------------- [16:04:56] Martin Becker(@Thermatix):Ok, so I found a solution here: https://gitter.im/opal/opal ---------------------------------------------------------------------------------------------------- [16:05:01] Martin Becker(@Thermatix):what I'm doing is: ---------------------------------------------------------------------------------------------------- [16:05:22] Martin Becker(@Thermatix):```ruby def load_library &block raise 'no provider_url present' unless @provider_url %x' url = #{@provider_url} var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; #{block.call} } }; } else { //Others script.onload = function(){ #{block.call} }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); ' end ``` ---------------------------------------------------------------------------------------------------- [17:38:17] Martin Becker(@Thermatix):how do I convert `#` into a type that a standard file uploader can understand? ---------------------------------------------------------------------------------------------------- [17:39:13] Martin Becker(@Thermatix):with `file.name`, `file.type`, etc ---------------------------------------------------------------------------------------------------- [17:39:31] meh.(@meh):Thermatix, call `#to_n` ---------------------------------------------------------------------------------------------------- [17:39:40] Martin Becker(@Thermatix):ah, thanks! ---------------------------------------------------------------------------------------------------- [17:52:31] Martin Becker(@Thermatix):I can't find the file reader in opal-browser ---------------------------------------------------------------------------------------------------- [17:52:38] Martin Becker(@Thermatix):can some one link it? ---------------------------------------------------------------------------------------------------- [17:57:24] meh.(@meh):Thermatix, it's not implemented if I recall correctly ---------------------------------------------------------------------------------------------------- [17:57:29] meh.(@meh):shouldn't be hard to add tho ---------------------------------------------------------------------------------------------------- ############################## [2015-11-12] ############################## [21:54:58] meh.(@meh):1) it won't change the API, so no possible breaking for whatever reason ---------------------------------------------------------------------------------------------------- [21:55:15] meh.(@meh):2) if you're doing double thenning, you're already using a variable, so it doesn't make the chaining ugly/weird ---------------------------------------------------------------------------------------------------- [21:55:44] meh.(@meh):3) you know in the code you're using multiple thenning ---------------------------------------------------------------------------------------------------- [21:57:17] meh.(@meh):@Thermatix by the way I just noticed there's actually documentation on providing APIs using promises in promise.rb inline-doc ---------------------------------------------------------------------------------------------------- [21:59:24] Ryan Stout(@ryanstout):@meh so let me explain my use case, that might make it clearer. In volt we have methods like: store.posts.first, which returns a promise. Sometimes you'll assign that promise to an instance variable or something, then have other methods that use that Promise. ---------------------------------------------------------------------------------------------------- [21:59:49] Ryan Stout(@ryanstout):that lets people setup things using the promise before it resolves ---------------------------------------------------------------------------------------------------- [21:59:52] Ryan Stout(@ryanstout):which is common ---------------------------------------------------------------------------------------------------- [22:00:01] Ryan Stout(@ryanstout):like when bindings render ---------------------------------------------------------------------------------------------------- [22:00:20] Ryan Stout(@ryanstout):each of the bindings resolves the value if its a promise ---------------------------------------------------------------------------------------------------- [22:00:50] meh.(@meh):ryanstout, sounds like it wouldn't hurt too much then to do things like I said ---------------------------------------------------------------------------------------------------- [22:00:59] meh.(@meh):ryanstout, it just sounds weird to me that a promise would resolve to multiple things at once ---------------------------------------------------------------------------------------------------- [22:09:30] Ryan Stout(@ryanstout):@meh thats how all of the other promise libs do it though ---------------------------------------------------------------------------------------------------- [22:09:49] Ryan Stout(@ryanstout):I'll have to change a bunch of things in volt to make it use .then! ---------------------------------------------------------------------------------------------------- [22:10:01] meh.(@meh):wouldn't it not work in the first place tho? ---------------------------------------------------------------------------------------------------- [22:10:14] Ryan Stout(@ryanstout):yea, but right now people are just getting errors ---------------------------------------------------------------------------------------------------- [22:10:31] Ryan Stout(@ryanstout):its like the number one issue people have in volt right now ---------------------------------------------------------------------------------------------------- [22:10:46] meh.(@meh):ryanstout, I'm not convinced :D ---------------------------------------------------------------------------------------------------- [22:10:53] Ryan Stout(@ryanstout):ok, fair enough ---------------------------------------------------------------------------------------------------- [22:11:05] meh.(@meh):nah, I'm making it the opposite ---------------------------------------------------------------------------------------------------- [22:11:51] Ryan Stout(@ryanstout):sorry, are you saying you'll do .then! to raise an exception :-) ---------------------------------------------------------------------------------------------------- [22:11:55] meh.(@meh):yes ---------------------------------------------------------------------------------------------------- [22:12:01] Ryan Stout(@ryanstout):cool, thanks! ---------------------------------------------------------------------------------------------------- [22:12:09] Ryan Stout(@ryanstout):I do understand though if you don't want to, your call ---------------------------------------------------------------------------------------------------- [22:12:16] Ryan Stout(@ryanstout):but it would help me out quite a bit to have .then do multiple ---------------------------------------------------------------------------------------------------- [22:12:47] meh.(@meh):ryanstout, nah, it comes down to personal preference here, and since there are more people using volt than being pedantic like me, I'll go for the least annoying for the most people ---------------------------------------------------------------------------------------------------- [22:47:26] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- [22:50:26] meh.(@meh):now if I could figure out why this happened I'd be happier ---------------------------------------------------------------------------------------------------- [22:50:35] meh.(@meh):this wasn't failing before, and the #then changes shouldn't affect it ---------------------------------------------------------------------------------------------------- [23:09:45] meh.(@meh):ah I think I get it ---------------------------------------------------------------------------------------------------- [15:17:30] Ilya Bylich(@iliabylich):Does opal have an issue with method dispatching in Module -> Class chain? I have a method `method1` for both Class and Module. When I write `Module.new.method1` opal always invokes a method for Class. Is it a know problem or should I create an issue on github? ---------------------------------------------------------------------------------------------------- [15:18:50] Elia Schito(@elia):@iliabylich fire the issue, without a full example I may misunderstand the problem :) ---------------------------------------------------------------------------------------------------- [15:18:55] Ilya Bylich(@iliabylich):I've made a workaround with joining this method into a single one + inline check `if self.is_a?(Class)` for running a correct sub-method ---------------------------------------------------------------------------------------------------- [15:18:59] Ilya Bylich(@iliabylich):@elia ok, thanks ---------------------------------------------------------------------------------------------------- [15:22:10] Elia Schito(@elia):thank you! ---------------------------------------------------------------------------------------------------- [16:02:18] giuan(@giuan):I tried to require a file, but with the opal runner it doesn't work. ``` # all work with ruby; all doesn't with opal # require_relative 'lib/hello' require_relative './lib/hello.rb' # require './lib/hello' # require './lib/hello.rb' print_hello ``` I run with `$ opal main.rb` I guess that with opal require search only the gems. Can anyone help me? ---------------------------------------------------------------------------------------------------- [16:06:34] Elia Schito(@elia):@giuan try `opal -I. main.rb` ---------------------------------------------------------------------------------------------------- [16:09:57] Martin Becker(@Thermatix):part of my app will have file uploads (to s3) but to ensure file integrity I want to hash the file (md5) and use that as the file name and reference to the file in s3, then check if the file made it without issues by checking the hash against the MD5 header that AWS s3 sends to check for integrity. Is it a good idea/viable to MD5 hash (using crypto-js) on the front end for the use of file integrity checking? ---------------------------------------------------------------------------------------------------- [18:02:43] Martin Becker(@Thermatix):you can ignore the last chat message, I've decided to do it but, can I have a link to an example to implementing promises? ---------------------------------------------------------------------------------------------------- [18:20:17] Elia Schito(@elia):@Thermatix there s a blog post on them on opalrb.org ---------------------------------------------------------------------------------------------------- [18:24:09] Martin Becker(@Thermatix):it shows how to use them, not implement them for something, unless I misread it? ---------------------------------------------------------------------------------------------------- [18:34:19] Elia Schito(@elia):Uhm maybe you can have a look at how they're used in opal-jquery ---------------------------------------------------------------------------------------------------- [18:35:20] meh.(@meh):Thermatix, all you need to do is `Promise.new`, return that promise, and call `#resolve` or `#reject` in your callback ---------------------------------------------------------------------------------------------------- [19:20:17] Ryan Stout(@ryanstout):@meh any plans to change Promise so it doesn't give you the "a promise has already been chained" message? ---------------------------------------------------------------------------------------------------- [19:20:25] Ryan Stout(@ryanstout):(just curious) ---------------------------------------------------------------------------------------------------- [19:30:03] meh.(@meh):ryanstout, I'm personally kind of against it because it complicates the code and isn't compatible with the promise standard ---------------------------------------------------------------------------------------------------- [19:30:11] meh.(@meh):ryanstout, but feel free to change my mind :) ---------------------------------------------------------------------------------------------------- [19:30:40] Jamie Gaskins(@jgaskins):@meh You mean the JS Promise standard? ---------------------------------------------------------------------------------------------------- [19:30:51] meh.(@meh):jgaskins, yes ---------------------------------------------------------------------------------------------------- [19:30:59] meh.(@meh):the A+ one ---------------------------------------------------------------------------------------------------- [19:31:04] meh.(@meh):unsure if there were new ones that allow multiple thens ---------------------------------------------------------------------------------------------------- [19:31:59] meh.(@meh):if there are, you already changed my mind :P ---------------------------------------------------------------------------------------------------- [19:36:57] Ryan Stout(@ryanstout):@meh yea, I think pretty much every promise lib out there in JS land does it ---------------------------------------------------------------------------------------------------- [19:37:10] Ryan Stout(@ryanstout):its a pretty common use case (at least for me) ---------------------------------------------------------------------------------------------------- [19:37:15] meh.(@meh):ryanstout, really? ---------------------------------------------------------------------------------------------------- [19:37:18] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [19:38:15] Ryan Stout(@ryanstout):@jgaskins you've needed it also right? ---------------------------------------------------------------------------------------------------- [19:39:01] Ryan Stout(@ryanstout):I started trying to change https://github.com/lgierth/promise.rb to be compatible with your promise's api, but ran into a few issues. ---------------------------------------------------------------------------------------------------- [19:41:36] Ryan Stout(@ryanstout):anyway, not complaining, just was curious if you were interested in changing it. If not, I'll probably need to write my own or modify something else. In volt there's a lot of cases where it needs to be able to chain multiple times. ---------------------------------------------------------------------------------------------------- [19:49:56] Jamie Gaskins(@jgaskins):@ryanstout Yep :-) https://github.com/opal/opal/issues/1142 ---------------------------------------------------------------------------------------------------- [19:52:22] Jamie Gaskins(@jgaskins):@meh I can confirm what @ryanstout said about other promises allowing multiple `then` calls. For example, there's a difference between `p.then.catch` and `p.then; p.catch`. The first one can call `.catch` if a failure occurs anywhere in the chain, but the second catch won't be triggered if the failure occurs inside the `then`. ---------------------------------------------------------------------------------------------------- [19:52:51] meh.(@meh):ryanstout, jgaskins, fine, you've changed my mind ---------------------------------------------------------------------------------------------------- [19:53:05] Jamie Gaskins(@jgaskins):More info: https://ponyfoo.com/articles/es6-promises-in-depth ---------------------------------------------------------------------------------------------------- [19:53:28] Ryan Stout(@ryanstout):@meh not sure if it makes things easier, but that promise.rb library has a nice clean implementation. ---------------------------------------------------------------------------------------------------- [19:53:54] Ryan Stout(@ryanstout):it had a bit different api, and for some reason raised exceptions through on failure ---------------------------------------------------------------------------------------------------- [21:33:25] giuan(@giuan):@elia ` opal -I. main.rb` doesn't work! But if i copy the file `hello.rb` in the gems/opal/stdlib it works. I'm using opal 9 beta 2 (i tried also with opal 0.8) ---------------------------------------------------------------------------------------------------- [21:51:37] meh.(@meh):giuan, where is hello.rb? ---------------------------------------------------------------------------------------------------- [21:53:25] meh.(@meh):@ryanstout @jgaskins anything against the non-checking then/etc being banged version? ---------------------------------------------------------------------------------------------------- [21:53:38] meh.(@meh):I'd still like to have a checked version ---------------------------------------------------------------------------------------------------- [21:53:47] meh.(@meh):or do you think that's useless? ---------------------------------------------------------------------------------------------------- [21:54:08] Ryan Stout(@ryanstout):@meh you mean having .then! which would raise an error if its already chained? ---------------------------------------------------------------------------------------------------- [21:54:14] meh.(@meh):ryanstout, no, the other way around ---------------------------------------------------------------------------------------------------- [21:54:18] Ryan Stout(@ryanstout):ah ---------------------------------------------------------------------------------------------------- [21:54:28] Ryan Stout(@ryanstout):usually the bang version raises an error :-) ---------------------------------------------------------------------------------------------------- [21:54:37] meh.(@meh):or is an "unsafe" version ---------------------------------------------------------------------------------------------------- [21:54:41] meh.(@meh):or anything really :P ---------------------------------------------------------------------------------------------------- [21:54:44] Ryan Stout(@ryanstout):yea ---------------------------------------------------------------------------------------------------- [21:54:50] meh.(@meh):the rationale is ---------------------------------------------------------------------------------------------------- ############################## [2015-11-13] ############################## [05:49:09] Brady Wied(@wied03):@ryanstout - another twist I've been working on opal-rspec that might be of use to you - https://github.com/wied03/karma-opal-rspec. Main aim is to speed up debugging and take advantage of how many things hook into Karma (and Karma's convenient spin up/throw away browser stuff). ---------------------------------------------------------------------------------------------------- [07:56:02] Iaroslav Kukharuk(@brbrr):Hi guys! I'm looking for a way to use external gems with opal i.e. `rest-client`. Im quite sure that I requiring that gem incorrectly: ``` require 'rest-client' Opal.append_path '/Users/brbrr/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rest-client-1.8.0/lib' ``` Another question is how to make compiled js to run in console(node/browser) ---------------------------------------------------------------------------------------------------- [10:51:23] Martin Becker(@Thermatix):if you want it to work for opal you'll need to port it to opal compatible ruby, some of the code won't be compatible; for example dynamic requires won't work so will have to be changed to `require_tree` directive. ---------------------------------------------------------------------------------------------------- [10:52:43] Martin Becker(@Thermatix):second of all if you want to make HTTP requests I'd recommend using the HTTP client that comes with opal-browser it's super easy to use, here, in fact I'll post you my request module that I built on top of it: ```ruby require 'browser/http' class Request class << self %w{get post delete put patch head}.each do |http_verb| define_method http_verb do |*args,&block| self.make(http_verb,*args,&block) end end def make(type,url,payload=nil, &block) # data_hash = {dataType: 'json'} # data_hash.merge!({payload: payload.to_json})if payload Browser::HTTP.send type, url, payload.to_json do |request| request.content_type 'application/json' if block_given? block.call(*request) else request end end end end end ``` ---------------------------------------------------------------------------------------------------- [10:53:53] Martin Becker(@Thermatix):Why did I build this? Because I want to ensure anything is correctly formatted and I can do that here so now every method will share any current and future formatting requirements. ---------------------------------------------------------------------------------------------------- [11:01:13] Iaroslav Kukharuk(@brbrr):@Thermatix isn't `require 'browser/http'` is dynamic require? actually `rest-client` was used as an example, and Im just playing around with opal, not trying to solve something. In what way I could just use gem as-is? ---------------------------------------------------------------------------------------------------- [12:42:48] Martin Becker(@Thermatix):no, dynamic require means for example iterating over a `Dir['.']` blob and requiring each one ---------------------------------------------------------------------------------------------------- [12:45:55] Iaroslav Kukharuk(@brbrr):anyway generated js is not works for me: ``` require 'rest-client' Opal.compile("RestClient.get('http://goo.gl'") ``` ---------------------------------------------------------------------------------------------------- [12:46:40] Martin Becker(@Thermatix):try: ---------------------------------------------------------------------------------------------------- [12:48:29] Martin Becker(@Thermatix):```ruby script = <<- OPAL require 'rest-client RestClient.get('http://goo.gl' OPAL Opal.compile(script) ``` Though, I'm not sure that's the best way to do it, have you tried starting an opal server like in the example and then loading the scripts as assets and then lettings sprockets handle file processing and serving? ---------------------------------------------------------------------------------------------------- [13:03:52] Iaroslav Kukharuk(@brbrr):ok, now how could I execute that js with opal included? sorry about my kinda silly questions. I suppose I need to include opal.js lib in to js repl on machine where RestClient is reachable. so using opalrb.org/try is not an option ---------------------------------------------------------------------------------------------------- [13:08:44] Martin Becker(@Thermatix):you might want to try following this example to set a basic opal environment up: https://github.com/opal/opal/tree/master/examples/sinatra use this to append your paths to the opal server: ```ruby opal = Opal::Server.new {|s| s.append_path 'assets/javascripts/' s.main = 'application' } ``` set up opal variables: ```ruby sprockets = opal.sprockets prefix = '/assets/javascripts' maps_prefix = '/__OPAL_SOURCE_MAPS__' maps_app = Opal::SourceMapServer.new(sprockets, maps_prefix) # Monkeypatch sourcemap header support into sprockets ::Opal::Sprockets::SourceMapHeaderPatch.inject!(maps_prefix) ``` set up the opal header ```ruby opal_header = ::Opal::Sprockets.javascript_include_tag('application', sprockets: sprockets, prefix: prefix, debug: true) ``` and then set up a basic sinatra root: ```ruby get '/' do <<-HTML #{opal_header} HTML end ``` ---------------------------------------------------------------------------------------------------- [13:28:21] Martin Becker(@Thermatix):how do I push a value from embedded javascript to an opal function and or object? ---------------------------------------------------------------------------------------------------- [13:55:17] Martin Becker(@Thermatix):nvm figured it out ---------------------------------------------------------------------------------------------------- [14:10:03] Iaroslav Kukharuk(@brbrr):ah, I didnt look in to config.ru. Thanks for pointing me! ---------------------------------------------------------------------------------------------------- [14:48:51] giuan(@giuan):@elia, @meh the problem with require is only on Mac. Linux and windows are ok. The file `./main.rb` require `./lib/hello.rb` running with ` opal main.rb` ---------------------------------------------------------------------------------------------------- [15:12:36] Dany M(@dany-on-demand): ---------------------------------------------------------------------------------------------------- [15:15:21] Dany M(@dany-on-demand):```ruby `user = "Dongs all over!"` puts `user` `array = ["dongs", "dings"]` puts `array` array = `array` array.push("mobs") puts array ``` opal is nice! ---------------------------------------------------------------------------------------------------- [15:36:39] Martin Becker(@Thermatix):lol ---------------------------------------------------------------------------------------------------- [20:22:11] Ryan Stout(@ryanstout):@wied03 thanks for the info. I haven't used karma, does it use webdriver under the hood? ---------------------------------------------------------------------------------------------------- [22:05:01] Brady Wied(@wied03):@ryanstout - No. It's not an integration test tool. It's solely for JS unit testing. Since it's good at spinning up browsers and several tools I use can hook into it, I'm exploring using it for debugging instead of the opal-rspec rake task or opal-rspec browser runner ---------------------------------------------------------------------------------------------------- [22:05:33] Brady Wied(@wied03):You pick what it should run tests in (Chrome, Phantom, Firefox, etc.). A lot of people use it to run their Jasmine tests ---------------------------------------------------------------------------------------------------- [22:11:07] Ryan Stout(@ryanstout):cool ---------------------------------------------------------------------------------------------------- [22:11:14] Ryan Stout(@ryanstout):so it doesn't use webdriver under the hood? ---------------------------------------------------------------------------------------------------- [22:23:10] Michał Kalbarczyk(@fazibear):Why #1188 fails ? How can I fix it ? ---------------------------------------------------------------------------------------------------- [23:32:45] meh.(@meh):fazibear, I can't even see the build log, travis doesn't load ---------------------------------------------------------------------------------------------------- [23:36:43] Brady Wied(@wied03):@ryanstout - No it doesn't. As far as I know, webdriver would be useful if you needed capybara type stuff to manipulate web pages, but that would be integration testing ---------------------------------------------------------------------------------------------------- [23:37:15] meh.(@meh):ryanstout, found the issue with allowing multiple thens ---------------------------------------------------------------------------------------------------- [23:37:19] meh.(@meh):trace won't work anymore ---------------------------------------------------------------------------------------------------- [23:37:23] meh.(@meh):and I like trace ---------------------------------------------------------------------------------------------------- [23:37:33] Ryan Stout(@ryanstout):@meh what's trace? ---------------------------------------------------------------------------------------------------- [23:38:29] meh.(@meh):ryanstout, a method on Promise ---------------------------------------------------------------------------------------------------- [23:38:37] meh.(@meh):it allows you to fetch every resolution backwards ---------------------------------------------------------------------------------------------------- [23:38:47] meh.(@meh):so you can do something like a map through promises ---------------------------------------------------------------------------------------------------- [23:39:31] Ryan Stout(@ryanstout):@meh humm ---------------------------------------------------------------------------------------------------- [23:39:44] Ryan Stout(@ryanstout):@meh why doesn't it work with multiple thens? ---------------------------------------------------------------------------------------------------- [23:40:00] meh.(@meh):ryanstout, because it uses @prev ---------------------------------------------------------------------------------------------------- [23:40:11] meh.(@meh):so the promises have to be linear ---------------------------------------------------------------------------------------------------- [23:40:12] meh.(@meh):and not a tree ---------------------------------------------------------------------------------------------------- [23:40:17] meh.(@meh):with multiple @next it becomes a tree ---------------------------------------------------------------------------------------------------- [23:40:25] meh.(@meh):and @prev is non-obvious ---------------------------------------------------------------------------------------------------- [23:40:30] meh.(@meh):because it will become a reverse Promise::When ---------------------------------------------------------------------------------------------------- [23:43:32] Ryan Stout(@ryanstout):can you make it work with .then! and not with .then :-) ---------------------------------------------------------------------------------------------------- [23:43:55] Ryan Stout(@ryanstout):@meh I guess I don't quite understand, what's your use case for trace? ---------------------------------------------------------------------------------------------------- [23:45:19] Ryan Stout(@ryanstout):@meh did you get it working with multiple .then's? (if so, can I just run my own version of Promise in volt with multiple then's and you can leave opal's the same?) ---------------------------------------------------------------------------------------------------- [23:46:22] meh.(@meh):ryanstout, When is broken too with multiple thens ---------------------------------------------------------------------------------------------------- [23:46:25] meh.(@meh):I'm still trying to fix it ---------------------------------------------------------------------------------------------------- [23:49:31] Ryan Stout(@ryanstout):thanks ---------------------------------------------------------------------------------------------------- ############################## [2015-11-14] ############################## [10:20:11] Michał Kalbarczyk(@fazibear):@meh travis log: ``` $ bundle exec rake $RUN mkdir -p tmp ruby -rbundler/setup bin/opal -ce '23' > tmp/jshint.js jshint --verbose tmp/jshint.js tmp/jshint.js: line 1757, col 7, 'BasicObjectClass' was used before it was defined. (W003) tmp/jshint.js: line 1760, col 7, 'ObjectClass' was used before it was defined. (W003) tmp/jshint.js: line 1763, col 7, 'ModuleClass' was used before it was defined. (W003) tmp/jshint.js: line 1766, col 7, 'ClassClass' was used before it was defined. (W003) tmp/jshint.js: line 1831, col 7, 'nil' was used before it was defined. (W003) 5 errors rake aborted! Command failed with status (2): [jshint --verbose tmp/jshint.js...] /home/travis/build/opal/opal/tasks/testing.rake:166:in `block in ' /home/travis/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval' /home/travis/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `
' Tasks: TOP => jshint (See full trace by running task with --trace) The command "bundle exec rake $RUN" exited with 1. ``` ---------------------------------------------------------------------------------------------------- [10:40:14] Michał Kalbarczyk(@fazibear):And its just fine on local machine: ```sh ✓ ~/dev/opal 🌴 fix-js-new ➜ bundle exec rake jshint SUITE=core mkdir -p tmp ruby -rbundler/setup bin/opal -ce '23' > tmp/jshint.js jshint --verbose tmp/jshint.js ✓ ~/dev/opal 🌴 fix-js-new ➜ ``` ---------------------------------------------------------------------------------------------------- [13:43:26] Vais Salikhov(@vais):@fazibear Travis is using the latest version of jshint automatically. If you update jshint on your local machine, you will see the same problem. I already fixed it in this PR https://github.com/opal/opal/pull/1189 just waiting for @meh or @elia to merge :wink: ---------------------------------------------------------------------------------------------------- [13:44:08] Vais Salikhov(@vais):@fazibear to be specific, this commit https://github.com/vais/opal/commit/71c57c07bd02e986c0f1b8afd08c73936d8d7a3f is what fixes the jshint problem. ---------------------------------------------------------------------------------------------------- ############################## [2015-11-15] ############################## [19:15:50] meh.(@meh):@ryanstout ping ---------------------------------------------------------------------------------------------------- [19:15:57] meh.(@meh):@jgaskins you too ---------------------------------------------------------------------------------------------------- [19:47:08] Ryan Stout(@ryanstout):@meh how's it going? ---------------------------------------------------------------------------------------------------- [19:47:34] meh.(@meh):ryanstout, still trying to figure out multiple then promises ---------------------------------------------------------------------------------------------------- [19:47:54] meh.(@meh):ryanstout, what's the return value of a promise with multiple thens? ---------------------------------------------------------------------------------------------------- [19:49:14] Ryan Stout(@ryanstout):You mean when you do .then on it? ---------------------------------------------------------------------------------------------------- [19:49:36] meh.(@meh):ryanstout, yes ---------------------------------------------------------------------------------------------------- [19:49:43] meh.(@meh):it wouldn't create another promise ---------------------------------------------------------------------------------------------------- [19:49:58] meh.(@meh):wait ---------------------------------------------------------------------------------------------------- [19:50:01] meh.(@meh):no I'm dumb ---------------------------------------------------------------------------------------------------- [19:50:13] meh.(@meh):confusion intensifies ---------------------------------------------------------------------------------------------------- [19:51:31] Ryan Stout(@ryanstout):That promise.rb library has a pretty simple implementation of that helps. ---------------------------------------------------------------------------------------------------- [19:54:53] meh.(@meh):ryanstout, can you link it again please? ---------------------------------------------------------------------------------------------------- [21:22:02] Elia Schito(@elia):@meh I think it's this one: https://github.com/lgierth/promise.rb ---------------------------------------------------------------------------------------------------- ############################## [2015-11-18] ############################## [23:45:56] Martin Becker(@Thermatix):any way, afk, got some daredevil to watch then... back to work! ---------------------------------------------------------------------------------------------------- [23:46:18] Elia Schito(@elia):``` [alias] snap = "!sh -c \"git add -A; git commit -u -m '[snapshot] $*'\"" yolo = "!sh -c 'git add -A; git commit -u -m \"YOLO! $1\"'" y = "!sh -c 'git add -A; git commit -u -m \"YOLO! $1\"'" mega-yolo = "!sh -c \"git add -A && git commit -u -m 'MEGA-YOLO!1!! $*'\"" ``` from my `.gitconfig` ---------------------------------------------------------------------------------------------------- [23:47:01] CJ Lazell(@cj):ha, nice :) ---------------------------------------------------------------------------------------------------- [23:48:15] Elia Schito(@elia):@elia goes to sleep ---------------------------------------------------------------------------------------------------- [23:50:40] CJ Lazell(@cj):k, opened a ticket https://github.com/opal/opal/issues/1197 ---------------------------------------------------------------------------------------------------- [16:31:43] Martin Becker(@Thermatix):because I'm doing `s.append_path 'assets/images/'` ---------------------------------------------------------------------------------------------------- [16:32:01] Martin Becker(@Thermatix):and then doing `src= "/assets/images/spinner.GIF"` for an img tag ---------------------------------------------------------------------------------------------------- [16:32:08] Martin Becker(@Thermatix):but it's just going not found ---------------------------------------------------------------------------------------------------- [16:32:20] Elia Schito(@elia):@Thermatix yes, it's sprockets at its core ---------------------------------------------------------------------------------------------------- [16:32:55] Martin Becker(@Thermatix):so what am I doing wrong? ---------------------------------------------------------------------------------------------------- [16:33:06] Elia Schito(@elia):try with "/assets/spinner.GIF" ---------------------------------------------------------------------------------------------------- [16:33:40] Elia Schito(@elia):if you append assets/images sprockets will search directly into images/ ---------------------------------------------------------------------------------------------------- [16:34:50] Martin Becker(@Thermatix):just tried that, and "/images/spinner.GIF" and "spinner.GIF" ---------------------------------------------------------------------------------------------------- [16:34:55] Martin Becker(@Thermatix):and still no dice ---------------------------------------------------------------------------------------------------- [16:37:23] Elia Schito(@elia):try appending `'asset/images'` without the slash ---------------------------------------------------------------------------------------------------- [16:39:57] Martin Becker(@Thermatix):but I'm already appending without the slash ---------------------------------------------------------------------------------------------------- [16:41:08] Elia Schito(@elia):try pasting the whole chunk of code, I'm afraid you need to start debugging :) ---------------------------------------------------------------------------------------------------- [16:41:30] Elia Schito(@elia):best chance is to inspect the sprockets env paths ---------------------------------------------------------------------------------------------------- [16:41:46] Elia Schito(@elia):also the upcased "GIF" looks suspicious… ---------------------------------------------------------------------------------------------------- [16:43:21] Martin Becker(@Thermatix):I changed that ---------------------------------------------------------------------------------------------------- [16:43:25] Martin Becker(@Thermatix):but not differance ---------------------------------------------------------------------------------------------------- [16:44:14] Martin Becker(@Thermatix):I think I might just skip the whole spinner thing ---------------------------------------------------------------------------------------------------- [16:44:33] Martin Becker(@Thermatix):here's my code: ---------------------------------------------------------------------------------------------------- [16:44:38] Martin Becker(@Thermatix):```ruby opal = Opal::Server.new {|s| s.append_path 'assets/javascripts/' s.append_path 'assets/images/' s.main = 'application' } ``` ---------------------------------------------------------------------------------------------------- [16:45:13] Elia Schito(@elia):and how you reference js/opal files in your html? ---------------------------------------------------------------------------------------------------- [16:46:22] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [16:47:13] Martin Becker(@Thermatix):```ruby <<-HTML HTML ``` ---------------------------------------------------------------------------------------------------- [16:48:35] Elia Schito(@elia):``` def append_path path @sprockets.append_path path end ``` ---------------------------------------------------------------------------------------------------- [16:49:12] Elia Schito(@elia):this the append_path implementation, `src="#{prefix}/spinner.gif"` should work fine ---------------------------------------------------------------------------------------------------- [16:49:36] Elia Schito(@elia):at this point I'd check for typos if it were my code ---------------------------------------------------------------------------------------------------- [20:08:18] CJ Lazell(@cj):I found something strange with inherited: ---------------------------------------------------------------------------------------------------- [20:08:19] CJ Lazell(@cj):http://opalrb.org/try/?code:class%20Wedge%0A%20%20module%20ClassMethods%0A%20%20%20%20def%20inherited(subclass)%0A%20%20%20%20%20%20store%20%3D%20Class.new%20self%3A%3AStore%0A%20%20%20%20%20%20puts%20%22wedge_class%20%3D%20%23%7Bsubclass%7D%22%0A%20%20%20%20%20%20store.wedge_class%20%3D%20subclass%0A%20%20%20%20%20%20subclass.const_set%20%3AStore%2C%20store%0A%20%20%20%20end%0A%20%20end%0A%20%20%0A%20%20extend%20ClassMethods%0A%20%20%0A%20%20module%20StoreClass%0A%20%20%20%20attr_accessor%20%3Awedge_class%0A%20%20%20%20%0A%20%20%20%20def%20inspect%0A%20%20%20%20%20%20%22%23%7Bwedge_class.inspect%7D%3A%3AStore%22%20%0A%20%20%20%20end%0A%20%20end%0A%20%20%0A%20%20class%20Store%0A%20%20%20%20extend%20StoreClass%0A%20%20end%0Aend%0A%0Aclass%20TestWedge%20%3C%20Wedge%3B%20end%0A%0Aputs%20TestWedge%3A%3AStore.inspect ---------------------------------------------------------------------------------------------------- [20:09:03] CJ Lazell(@cj):will show two `puts` if you then run the command it will only show one `puts` which is wrong…. if you then run against opal 9 it will fail completely saying `wedge_class` is nil ---------------------------------------------------------------------------------------------------- [20:09:38] CJ Lazell(@cj):when you run in any version of ruby you’ll get two `puts` ---------------------------------------------------------------------------------------------------- [20:09:44] Elia Schito(@elia):@cj can you open an issue, looks like something that should be fixed before the release ---------------------------------------------------------------------------------------------------- [20:10:07] CJ Lazell(@cj):@elia sure thing ---------------------------------------------------------------------------------------------------- [20:12:32] CJ Lazell(@cj):@elia https://github.com/opal/opal/issues/1196 ---------------------------------------------------------------------------------------------------- [20:15:08] Elia Schito(@elia):thanks ---------------------------------------------------------------------------------------------------- [20:15:27] CJ Lazell(@cj):no problem ---------------------------------------------------------------------------------------------------- [20:41:05] CJ Lazell(@cj):It might be a bigger issue than just inherited, take a look at that last example that fails ---------------------------------------------------------------------------------------------------- [20:59:36] CJ Lazell(@cj):ok, it appears to be `super` ---------------------------------------------------------------------------------------------------- [20:59:55] CJ Lazell(@cj):also http://opalrb.org/try appears to be using two different versions of Opal ---------------------------------------------------------------------------------------------------- [21:01:40] Elia Schito(@elia):@cj if you have time please help by reducing the code that causes the issue to the bare minimum and post it directly in the issue ---------------------------------------------------------------------------------------------------- [21:02:28] CJ Lazell(@cj):I’ve been trying to do that :) ---------------------------------------------------------------------------------------------------- [21:04:43] Elia Schito(@elia):Yeah I see that :smile: and appreciate, the more you can do the better, as time permits of course ---------------------------------------------------------------------------------------------------- [21:10:48] CJ Lazell(@cj):@elia holy crap this is random… not sure if its a fail on ruby though ---------------------------------------------------------------------------------------------------- [21:11:30] CJ Lazell(@cj):so if `wedge_class`is nil and you run this via opal `wedge_class::Store`you get this error ---------------------------------------------------------------------------------------------------- [21:11:36] CJ Lazell(@cj):'undefined' is not an object (evaluating '(self.$wedge_class()).$$scope.get') ---------------------------------------------------------------------------------------------------- [21:11:45] CJ Lazell(@cj):if you run it in ruby, it works just fine ---------------------------------------------------------------------------------------------------- [21:12:00] CJ Lazell(@cj):so I tried nil::Store and that works just fine in ruby too ---------------------------------------------------------------------------------------------------- [21:12:24] CJ Lazell(@cj):ruby 2.1.4p265 ---------------------------------------------------------------------------------------------------- [21:12:47] CJ Lazell(@cj):shouldn’t ruby be throwing an error? ---------------------------------------------------------------------------------------------------- [21:17:42] Chris Watson(@watzon):Anyone have a good guide for wrapping a javascript library with Opal? I'd like to try it with https://github.com/allouis/minivents, but I have no idea how to get started ---------------------------------------------------------------------------------------------------- [21:25:29] George Plymale II(@ylluminarious):@iDev0urer here's an article i wrote a while back for writing opal wrappers. it's pretty basic, though: https://docs.google.com/document/d/103teLAAvsrW690Q0uIm43xyEmEWizVIdzMtSc79sYCQ/. also, here's some other good resources for that: http://opalrb.org/docs/guides/0-8-stable/compiled_ruby.html, http://funkworks.blogspot.com/2015/06/accessing-javascript-from-opal.html?m=0, http://dev.mikamai.com/post/79398725537/using-native-javascript-objects-from-opal ---------------------------------------------------------------------------------------------------- [21:26:17] George Plymale II(@ylluminarious):you also might look at some other opal wrappers like opal-phaser, opal-browser, opal-jquery, react.rb, etc. ---------------------------------------------------------------------------------------------------- [21:28:02] Chris Watson(@watzon):Awesome! That's exactly what I'm looking for. I see a lot of potential in this project and want to get involved ---------------------------------------------------------------------------------------------------- [21:28:32] George Plymale II(@ylluminarious):@iDev0urer yeah, definitely agree on that ;) ---------------------------------------------------------------------------------------------------- [21:29:40] George Plymale II(@ylluminarious):i've had a lot of good experience with opal for as long as i've used it, and have even forgotten what it's like to write js from time to time thanks to opal :D ---------------------------------------------------------------------------------------------------- [22:03:07] Mitch VanDuyn(@catmando):@iDev0urer also have a look at https://github.com/catprintlabs/opal-aasm not a wrapper but it runs acts-as-state-machine in opal. Also if you want to use react.rb then the gitter.im is pretty active if you have questions. ---------------------------------------------------------------------------------------------------- [22:24:19] jusjmkim(@jusjmkim):I've just started looking at Opal, and I was curious. Which version of ECMAscript does Opal compile Ruby to? ---------------------------------------------------------------------------------------------------- [22:24:41] meh.(@meh):jusjmkim, it should even run on IE 6 ---------------------------------------------------------------------------------------------------- [22:57:20] Mitch VanDuyn(@catmando):@/all has anybody noticed that e.backtrace (where e is an Exception) is empty on safari? ---------------------------------------------------------------------------------------------------- [23:12:07] Colin Gunn(@balmoral):@iDev0urer https://github.com/balmoral/opal-highcharts is a pretty straightforward opal wrapping of the Highcharts javascript library. You can see it in action (via Volt) at http://volt-highcharts-app.herokuapp.com. ---------------------------------------------------------------------------------------------------- [23:33:01] Martin Becker(@Thermatix):@catmando I wouldn't know... I mean I use a mac but I switched to chrome straight away... ---------------------------------------------------------------------------------------------------- [23:34:36] Elia Schito(@elia):@catmando been a while since I poked around with backtrace ---------------------------------------------------------------------------------------------------- [23:35:25] CJ Lazell(@cj):@elia thank you for cleaning up my examples. did you see my other message above? should I open a ticket for it? ---------------------------------------------------------------------------------------------------- [23:35:44] Mitch VanDuyn(@catmando):looking at the code, its not clear where .stack gets set, but if its not set, then backtrace returns an empty array, so I am assuming that .stack is not getting set on safari. Not a biggie... ---------------------------------------------------------------------------------------------------- [23:36:50] Martin Becker(@Thermatix):wouldn't that happen on any browser? what's special about safari? Isn't this not the first time there's been a safari specific issue? ---------------------------------------------------------------------------------------------------- [23:37:13] Martin Becker(@Thermatix):#SafariIsTheNewIE9 ---------------------------------------------------------------------------------------------------- [23:37:25] Elia Schito(@elia):stack traces have no standard IIRC, thus every browser do its own thing ---------------------------------------------------------------------------------------------------- [23:37:28] Martin Becker(@Thermatix):... that was supposed to be hash-tag... ---------------------------------------------------------------------------------------------------- [23:37:50] Martin Becker(@Thermatix):so why does backtracing work every where but safari? ---------------------------------------------------------------------------------------------------- [23:37:55] Martin Becker(@Thermatix):or... ---------------------------------------------------------------------------------------------------- [23:37:59] Elia Schito(@elia):truth is that Chrome is the new IE, since there's already a number of sites that are "Chrome-only"… :P ---------------------------------------------------------------------------------------------------- [23:38:07] Martin Becker(@Thermatix):LOL really? ---------------------------------------------------------------------------------------------------- [23:38:15] Martin Becker(@Thermatix):link me! ---------------------------------------------------------------------------------------------------- [23:38:25] CJ Lazell(@cj):I’ve been saying Chrome is the new IE for awhile! It’s sooo bloated now ---------------------------------------------------------------------------------------------------- [23:38:34] Elia Schito(@elia):google "cool web design" :D ---------------------------------------------------------------------------------------------------- [23:38:35] Martin Becker(@Thermatix):btw, just subscribed to netflix ---------------------------------------------------------------------------------------------------- [23:38:59] Martin Becker(@Thermatix):and then? ---------------------------------------------------------------------------------------------------- [23:39:11] Martin Becker(@Thermatix):ugh bloat was why I ditched firefox ---------------------------------------------------------------------------------------------------- [23:39:37] Martin Becker(@Thermatix):I'm getting the Feeling I'm going to have to do it again... ---------------------------------------------------------------------------------------------------- [23:39:48] Martin Becker(@Thermatix):and opera is just chrome with a mask ---------------------------------------------------------------------------------------------------- [23:40:11] Elia Schito(@elia):since Apple cares about battery stats they put a lot of effort to make it very lightweight ---------------------------------------------------------------------------------------------------- [23:40:26] Martin Becker(@Thermatix):... soooo safari is what I should then switch to? ---------------------------------------------------------------------------------------------------- [23:41:01] Martin Becker(@Thermatix):nvm ---------------------------------------------------------------------------------------------------- [23:41:08] Martin Becker(@Thermatix):I'm going to go and look for a new browser ---------------------------------------------------------------------------------------------------- [23:41:21] Elia Schito(@elia):I use that and TextMate 2, it gives me that hipster-y feeling, you know… ---------------------------------------------------------------------------------------------------- [23:41:29] Martin Becker(@Thermatix):LOL ---------------------------------------------------------------------------------------------------- [23:41:31] Martin Becker(@Thermatix):I use atom ---------------------------------------------------------------------------------------------------- [23:41:41] Martin Becker(@Thermatix):I ditched sublime becuase... ---------------------------------------------------------------------------------------------------- [23:41:49] Martin Becker(@Thermatix):eh don't remember but I did ---------------------------------------------------------------------------------------------------- [23:41:50] Elia Schito(@elia):that's so mainstream :joy_cat: ---------------------------------------------------------------------------------------------------- [23:41:58] Martin Becker(@Thermatix):ha! ---------------------------------------------------------------------------------------------------- [23:42:00] CJ Lazell(@cj):@elia using the example on opalrb.org http://goo.gl/Lp9MQa ---------------------------------------------------------------------------------------------------- [23:42:41] Elia Schito(@elia):`nil::User`? does it work in MRI? ---------------------------------------------------------------------------------------------------- [23:43:00] CJ Lazell(@cj):yeep ---------------------------------------------------------------------------------------------------- [23:43:18] Martin Becker(@Thermatix):it's this line `user = ((nil).$$scope.get('User')).$new("Bob");` ---------------------------------------------------------------------------------------------------- [23:43:20] Martin Becker(@Thermatix):line 28 ---------------------------------------------------------------------------------------------------- [23:44:06] Martin Becker(@Thermatix):why would you do `nil::User`? ---------------------------------------------------------------------------------------------------- [23:44:30] CJ Lazell(@cj):I wouldn’t seems like its a bug in ruby ---------------------------------------------------------------------------------------------------- [23:44:33] Elia Schito(@elia):so who's up to adding a `$$scope` to nil? had enough for tonite (https://github.com/opal/opal/commit/b0324043c1803d75bcd571f193e99b106210f11f) ---------------------------------------------------------------------------------------------------- [23:45:00] CJ Lazell(@cj):I just ran into it randomly lol :) ---------------------------------------------------------------------------------------------------- [23:45:23] Martin Becker(@Thermatix):nooo I got my own problems to deal with, I need to refine,document and create tests ---------------------------------------------------------------------------------------------------- [23:45:23] CJ Lazell(@cj):that commit message! LOL ---------------------------------------------------------------------------------------------------- [06:23:29] George Plymale II(@ylluminarious):here's a question of curiosity about requiring in opal if anyone feels like answering: http://stackoverflow.com/questions/33773098/how-and-where-does-the-require-table-variable-get-stored-opalrb ---------------------------------------------------------------------------------------------------- [09:11:21] Elia Schito(@elia):@ylluminarious done, it's great to see people read through the runtime! ---------------------------------------------------------------------------------------------------- [14:29:22] George Plymale II(@ylluminarious):@elia thanks for clearing that up! i went ahead and accepted your answer. ---------------------------------------------------------------------------------------------------- [14:29:35] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [16:31:11] Martin Becker(@Thermatix):can the `Opal::Server` serve images? ---------------------------------------------------------------------------------------------------- ############################## [2015-11-19] ############################## [00:07:42] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [10:13:22] Alexandr Smirnov(@JelF):@elia yolo must contain push --force ---------------------------------------------------------------------------------------------------- [10:13:52] Elia Schito(@elia):@JelF good point ---------------------------------------------------------------------------------------------------- [10:15:52] Alexandr Smirnov(@JelF):can i define ActiveModel::EachValidatior validator inside a module? How should i use it in this case? ---------------------------------------------------------------------------------------------------- [10:16:39] Elia Schito(@elia):no idea, is that related to opal or just a general question? ---------------------------------------------------------------------------------------------------- [10:17:23] Alexandr Smirnov(@JelF):sory, wrong chat ---------------------------------------------------------------------------------------------------- [10:18:28] Elia Schito(@elia):np :) ---------------------------------------------------------------------------------------------------- [16:43:38] Elia Schito(@elia):A nice way to help out with opal: http://www.codetriage.com/opal/opal ---------------------------------------------------------------------------------------------------- [17:22:21] Forrest Chang(@fkchang):@/all anyone savvy with using opal and npm and/or webpack? I think some integration will be very influential on us playing with rest of the js world, and there are some nice benefits to webpack like hot reloading -- this article http://www.railsonmaui.com/blog/2014/10/03/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/ calls it tourist javascript vs 1st class citizens. If possible, if opal can become more of a 1st class citizen, it would definitely help ---------------------------------------------------------------------------------------------------- [17:22:22] Forrest Chang(@fkchang):http://www.railsonmaui.com/images/2014-09-react-webpack-rails-tutorial/javascript-tourists.jpg ---------------------------------------------------------------------------------------------------- [17:24:41] Forrest Chang(@fkchang):I haven't checked it out aside from the README, but I believe is an attempt to do so https://github.com/zetachang/opalrb-loader ---------------------------------------------------------------------------------------------------- [17:28:28] Forrest Chang(@fkchang):and the accompanying blog post, https://medium.com/@zetachang/from-sprockets-to-webpack-5f3d1afbd1b0#.fqw7uxh7m - I think the ability to seemlessly pull in js in npm modules is an answer to a question I was asking ---------------------------------------------------------------------------------------------------- [17:44:39] Forrest Chang(@fkchang):@/all given that everyone is packaging their javascript as npm modules I think this is a key point for anyone wanting to javascript -- i.e. 'reuse all of your (npm packaged) js, and start doing new stuff opal...') ---------------------------------------------------------------------------------------------------- ############################## [2015-11-20] ############################## [09:57:59] Michał Kalbarczyk(@fazibear):@fkchang Is webpack hot module replacement works in this configuration ? ---------------------------------------------------------------------------------------------------- [11:37:46] Martin Becker(@Thermatix):could I use opal-webpack to load (for example) crypto-js? ---------------------------------------------------------------------------------------------------- [11:37:49] Martin Becker(@Thermatix):and how? ---------------------------------------------------------------------------------------------------- [12:22:16] Michał Kalbarczyk(@fazibear):Opal related projects/gems in one place :) https://github.com/fazibear/awesome-opal ---------------------------------------------------------------------------------------------------- [14:55:17] Martin Becker(@Thermatix):should I use yardoc for documentation? ---------------------------------------------------------------------------------------------------- [14:55:31] meh.(@meh):for what? ---------------------------------------------------------------------------------------------------- [14:58:27] Martin Becker(@Thermatix):documenting front end code ---------------------------------------------------------------------------------------------------- [15:00:49] meh.(@meh):I like yard ---------------------------------------------------------------------------------------------------- [17:22:33] Brady Wied(@wied03):@fkchang - You can go that direction and also the other direction (NPM into "gems"). I personally like the GEM packaging system better so I'd love rails-assets.org for NPM packages (not just Bower). I do think it's good to support the other direction (opal into NPM) as well though. ---------------------------------------------------------------------------------------------------- [17:28:18] Brady Wied(@wied03):@fkchang - I also don't see why Sprockets needs to go away in favor of webpack. commonjs/requirejs are not exactly relevant in my view because it's not an apples to apples comparison. Opal Ruby modules are already providing the "require" dependency functionality from a runtime perspective. Sprockets covers the actual file dependency piece. I think fixing source maps in concatenated files is on Sprockets' radar (see https://github.com/rails/sprockets-rails/issues/254). I can't make the argument that Sprockets is absolutely better than webpack. I just don't necessarily agree with the reasons in the blog post. ---------------------------------------------------------------------------------------------------- [19:13:01] Forrest Chang(@fkchang):@fazibear do mean does hot module replacement work for opalrb-loader? If so, https://github.com/zetachang/opalrb-loader/tree/master/examples/simple says yes ---------------------------------------------------------------------------------------------------- [19:36:21] George Plymale II(@ylluminarious):@fazibear re: awesome-opal, great job on that! i've been waiting for an awesome-opal for a while and, if iirc, others here like @elia have expressed interest in it too. ---------------------------------------------------------------------------------------------------- [21:16:08] Forrest Chang(@fkchang):@wied03 I think there are advantages to being "1st class citizen" of JS, but something that would let me have things like * hot module reloading * painless integration of npm js modules (is this actually possible?), -- for react.rb I want to use existing react.js modules, they are all npm distributed and usually ES6, so I always have to process some and the save that as sometihng I require. Extend this to every npm module. * the ability to package only the needed assets for an entry point vs "the whole world" approach that sprockets does. I think react-router is really trying to do this and only load the appropriate js needed for particular routes, which ought to improve start up times, etc. All of which webpack does, but if we can it else wise, that would be cool. I'm not bound to webpack, but it seems like it's what all the JS ppl are doing, certain the react folks which is where I'm spending a lot of time researching ---------------------------------------------------------------------------------------------------- [21:44:50] Brady Wied(@wied03):@fkchang - the 1st 2 bullets are good reasons IMO. Doesn't the 3rd one come back to AMD vs. not? One could make the case that sending all of the JS so it can be cached is better than having to go back to the server for bits and pieces. ---------------------------------------------------------------------------------------------------- [22:00:01] Elia Schito(@elia):@fazibear awesome! can you send a couple PRs to add the link to the README and to opalrb.org? ---------------------------------------------------------------------------------------------------- [22:00:24] Elia Schito(@elia):never realized there's so much stuff! ---------------------------------------------------------------------------------------------------- [22:23:33] meh.(@meh):@fazibear where's lissio? :(( ---------------------------------------------------------------------------------------------------- [22:51:04] Elia Schito(@elia):@meh re yardoc, I'll revert the API docs to yard and rewrite those I written in tomdoc ---------------------------------------------------------------------------------------------------- [22:51:39] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [22:52:20] Elia Schito(@elia):i still like the sdoc search more, but yes, I repent! :D ---------------------------------------------------------------------------------------------------- [22:54:34] Elia Schito(@elia):also I still delude myself in thinking I'll have time to port the sdoc search to yard :P ---------------------------------------------------------------------------------------------------- ############################## [2015-11-21] ############################## [00:03:01] Forrest Chang(@fkchang):@wied03 I actually support all the module systems allows webpack to do all 3, hot reload is useful because data is separate from the module definitions, npm are all packaged as modules, knowing which modules to load and just those have to do with knowing module dependencies ---------------------------------------------------------------------------------------------------- [00:11:00] Forrest Chang(@fkchang):@fazibear my mistake that example is a live reloader not hot module reloader. I'll poke around and see if it's easy to add that ---------------------------------------------------------------------------------------------------- [16:51:15] Michał Kalbarczyk(@fazibear):@meh Lissio added, all this stuff found with github search, I guess there are more. ---------------------------------------------------------------------------------------------------- [16:53:04] Michał Kalbarczyk(@fazibear):@elia you mean the link to the awesome-opal or to individual gems ? ---------------------------------------------------------------------------------------------------- [16:55:27] Michał Kalbarczyk(@fazibear):@meh If you know about any opal gem I didn't notice let me know :) ---------------------------------------------------------------------------------------------------- ############################## [2015-11-22] ############################## [00:29:07] Elia Schito(@elia):@fazibear i mean linking the whole page, and if that's common among other "awesome" I'd like to move it to the opal org ---------------------------------------------------------------------------------------------------- [19:14:10] Jamie Gaskins(@jgaskins):@fazibear Kudos on that list. I was surprised all my Opal-based repos were on the list, even ones I never told people about. :-) ---------------------------------------------------------------------------------------------------- [20:03:19] Forrest Chang(@fkchang):@fazibear made a pull request, added blogs, videos, newsletters and some other corrections, links, etc. ---------------------------------------------------------------------------------------------------- [20:04:54] Michał Kalbarczyk(@fazibear):@fkchang thanks! ---------------------------------------------------------------------------------------------------- [20:05:52] Michał Kalbarczyk(@fazibear):@fkchang I think live examples should be in separate section :) ---------------------------------------------------------------------------------------------------- [21:09:49] Forrest Chang(@fkchang):@fazibear separate section is not a bad idea ---------------------------------------------------------------------------------------------------- [21:11:54] Michał Kalbarczyk(@fazibear):@fkchang just changed it :) ---------------------------------------------------------------------------------------------------- ############################## [2015-11-23] ############################## [04:24:07] Jared White(@jaredcwhite):@fazibear Wow, Awesome-Opal looks great! Thanks for putting that together ---------------------------------------------------------------------------------------------------- [19:59:13] Mitch VanDuyn(@catmando):@fkchang seems like require_js should return a promise? ---------------------------------------------------------------------------------------------------- [20:35:25] Forrest Chang(@fkchang):@catmando the current implementation adds the ` ---------------------------------------------------------------------------------------------------- [16:37:42] Martin Becker(@Thermatix):and If I iterate through all the files sprockets can find ---------------------------------------------------------------------------------------------------- [16:37:54] Martin Becker(@Thermatix):I can see `main_application.rb` in the list ---------------------------------------------------------------------------------------------------- [16:38:41] Martin Becker(@Thermatix):but it reports a 404, that it can't find `main_application.js` ---------------------------------------------------------------------------------------------------- [16:43:52] Elia Schito(@elia):how are you serving sprockets? Opal::Server? rails? ---------------------------------------------------------------------------------------------------- [16:43:55] Elia Schito(@elia):@Thermatix ^ ---------------------------------------------------------------------------------------------------- [16:44:59] Martin Becker(@Thermatix):Sinatra ---------------------------------------------------------------------------------------------------- [16:45:11] Martin Becker(@Thermatix):I'm creating a sprockets instance ---------------------------------------------------------------------------------------------------- [16:45:32] Martin Becker(@Thermatix):in `set :assets` ---------------------------------------------------------------------------------------------------- [16:45:39] Elia Schito(@elia):then maybe it serves stuff under `/assets/*` ---------------------------------------------------------------------------------------------------- ############################## [2016-01-12] ############################## [07:20:41] Bernhard Weichel(@bwl21):@elia there is no reason to waste time with making cdn.opal.com work again. cdn.opal.org is ok as long as it is reliable. ---------------------------------------------------------------------------------------------------- [08:00:01] Elia Schito(@elia):@bwl21 :+1: ---------------------------------------------------------------------------------------------------- [16:49:56] Ilya Bylich(@iliabylich):@elia Do you plan to release opal-rails with opal 0.9? It seems that the latest available version uses 0.8 - https://rubygems.org/gems/opal-rails ---------------------------------------------------------------------------------------------------- [16:51:15] Ilya Bylich(@iliabylich):I'm getting bugs that I was fixing myself in opal 0.9 :smile: ---------------------------------------------------------------------------------------------------- [16:55:11] Elia Schito(@elia):@iliabylich it's WIP, I've extracted opal-rspec support to decouple and allow people to choose between it and (the not yet implemented) opal-minitest-rails ---------------------------------------------------------------------------------------------------- [16:56:10] Elia Schito(@elia):I did it also because it wasn't possible to use sprockets specific assets in specs with the previous implementation (e.g. requiring an opal-haml template) ---------------------------------------------------------------------------------------------------- [16:56:39] Elia Schito(@elia):@iliabylich would be great if you tried master ---------------------------------------------------------------------------------------------------- [16:59:47] Ilya Bylich(@iliabylich):I didn't notice that I have some gems that depend explicitly on opal 0.8, nvm then :smile: I'll try it later ---------------------------------------------------------------------------------------------------- [17:08:37] Elia Schito(@elia):@iliabylich anything I can do let me know :) ---------------------------------------------------------------------------------------------------- ############################## [2016-01-13] ############################## [15:51:06] meh.(@meh):iliabylich, yeah I'd prefer that ---------------------------------------------------------------------------------------------------- [16:19:58] Jared White(@jaredcwhite):@elia Here you go! https://github.com/opal/opal.github.io/pull/34 ---------------------------------------------------------------------------------------------------- [16:22:43] Elia Schito(@elia):Thanks! Reading it now :eyeglasses: ---------------------------------------------------------------------------------------------------- [16:23:12] Jared White(@jaredcwhite):feel free to make changes, suggest improvements, etc. ---------------------------------------------------------------------------------------------------- [16:23:38] Elia Schito(@elia):First thing is updating docs with 0.9.2 ---------------------------------------------------------------------------------------------------- [16:23:57] Elia Schito(@elia):which I'm doing now :) ---------------------------------------------------------------------------------------------------- [16:24:07] Jared White(@jaredcwhite):oh ok -- then we can update the links in the blog post ---------------------------------------------------------------------------------------------------- [16:25:08] Elia Schito(@elia):indeed, the other thing I'd like to do before posting it is to update the changelog to use the http://keepachangelog.com (even if not strictly) ---------------------------------------------------------------------------------------------------- [16:31:30] Jared White(@jaredcwhite):@elia Seems like a good idea ---------------------------------------------------------------------------------------------------- [16:32:11] Elia Schito(@elia):Already experimented with it on opal-rails and looks good: https://github.com/opal/opal-rails/blob/master/CHANGELOG.md#090---unreleased ---------------------------------------------------------------------------------------------------- [16:32:47] Jared White(@jaredcwhite)::+1: ---------------------------------------------------------------------------------------------------- [16:34:21] Elia Schito(@elia):@jaredcwhite you had any plan to write something for 0.8 too? ---------------------------------------------------------------------------------------------------- [16:35:21] Jared White(@jaredcwhite):@elia I wasn't planning to - I know there was a lot of good stuff in that release too. But I wanted to help out going forward, in part so there's something good to link to from release announcements in Opalist as well ---------------------------------------------------------------------------------------------------- [16:36:14] Elia Schito(@elia):@jaredcwhite maybe a mention in the 0.9 post could be added, just to signal that there's more from the last blog post that can be read in the changelog ---------------------------------------------------------------------------------------------------- [16:36:22] Elia Schito(@elia):wdyt? ---------------------------------------------------------------------------------------------------- [16:36:39] Jared White(@jaredcwhite):@elia Sounds good. I'll commit an update ---------------------------------------------------------------------------------------------------- [16:41:08] Jared White(@jaredcwhite):done ---------------------------------------------------------------------------------------------------- [17:13:46] Elia Schito(@elia):@jaredcwhite updated changelog and docs https://github.com/opal/opal/blob/master/CHANGELOG.md#092-2016-01-10 http://opalrb.org/docs/ ---------------------------------------------------------------------------------------------------- [17:38:41] Jared White(@jaredcwhite):@elia OK, I updated links accordingly. ---------------------------------------------------------------------------------------------------- [17:42:35] Jared White(@jaredcwhite):@elia And...sigh...renamed the file so it says 2016, not 2015 :neutral_face: ---------------------------------------------------------------------------------------------------- [17:43:09] Elia Schito(@elia):Merged ---------------------------------------------------------------------------------------------------- [17:43:45] Elia Schito(@elia): don't know if the latest fix made into it, ---------------------------------------------------------------------------------------------------- [17:44:08] Elia Schito(@elia):if it didn't I'll update it before publishing ---------------------------------------------------------------------------------------------------- [17:44:48] Elia Schito(@elia):(which I need to later tonight) ---------------------------------------------------------------------------------------------------- [18:19:23] Jared White(@jaredcwhite):looks like it did :+1: ---------------------------------------------------------------------------------------------------- [01:01:17] Jared White(@jaredcwhite):@elia @meh I've been meaning to ask you about blog updates on the Opal website. Seems like (how to put this nicely) it could use some love, at least in regards to major gem releases (like v0.8, now v0.9, etc.). I'd be willing to help out in this endeavor, or better yet coordinate with any other volunteers for the blog. ---------------------------------------------------------------------------------------------------- [02:34:32] George Plymale II(@ylluminarious):@drewhamlett re: [that article on web development](https://medium.com/@wob/the-sad-state-of-web-development-1603a861d29f#.1k67qu72s), glad to see that some folks like yourself are appreciating opal as a respectable web development technology :D. yeah, i have to agree that it's kind of sad to see people abandon tried and true tools just to be like the cool kids, so to speak. it's kind of odd that that sort of thing has fallen into the domain of javascript, since it used to not be so insanely popular. i think that there is too much politics and not enough pragmatism going on in people's toolkits these days. that's just my 2¢, though. btw, are you the one that wrote that article? cause i see your name at the top of the page, but i'm not sure if you just reposted that article from somewhere else. ---------------------------------------------------------------------------------------------------- [03:55:33] George Plymale II(@ylluminarious):oh wait, never mind. just saw the bottom of the article and saw your signature there :P ---------------------------------------------------------------------------------------------------- [07:50:27] Elia Schito(@elia):@jaredcwhite triple 👍🏼 tell me more good luck ---------------------------------------------------------------------------------------------------- [10:12:47] Martin Becker(@Thermatix):random question, which online regex checker do you use? I tend to use rubular.com ---------------------------------------------------------------------------------------------------- [10:13:10] Elia Schito(@elia):TextMate 2 :^) ---------------------------------------------------------------------------------------------------- [10:27:27] Martin Becker(@Thermatix):hmm , question, when you add a global variable using $ in sinatra, is this information sent to the front end somehow? or is it only when there's an error or somthing? ---------------------------------------------------------------------------------------------------- [10:28:26] Elia Schito(@elia):it's not sent to the frontend ---------------------------------------------------------------------------------------------------- [10:28:43] Elia Schito(@elia):~~finisco una cosa e arrivo~~ ---------------------------------------------------------------------------------------------------- [10:29:59] Martin Becker(@Thermatix):cool, thanks for the response, especially as it's kind of off-topic ---------------------------------------------------------------------------------------------------- [10:30:27] Martin Becker(@Thermatix):I know it's not but it feels like this is a chat room for stuff related to opal other stuff ---------------------------------------------------------------------------------------------------- [10:30:33] Martin Becker(@Thermatix)::D ---------------------------------------------------------------------------------------------------- [10:31:03] Martin Becker(@Thermatix):Any way, I've managed to now have separate front end interface components in seprate folders ---------------------------------------------------------------------------------------------------- [10:31:15] Martin Becker(@Thermatix):so I can now have all my contexts seperated ---------------------------------------------------------------------------------------------------- [10:31:16] Martin Becker(@Thermatix):wooo ---------------------------------------------------------------------------------------------------- [10:31:30] Martin Becker(@Thermatix):... huh that's what I should have called it, contexts not interface... silly me ---------------------------------------------------------------------------------------------------- [10:33:25] Elia Schito(@elia):_ouch, wrong chat_ ---------------------------------------------------------------------------------------------------- [10:42:33] Martin Becker(@Thermatix):umm does `require_tree` include sub-folders? ---------------------------------------------------------------------------------------------------- [11:02:52] Elia Schito(@elia):keeps the same behavior as the `require_tree` directive in sprockets (which I don't remember but you can look it up) ---------------------------------------------------------------------------------------------------- [11:06:23] Martin Becker(@Thermatix):it say's it loads files recursively so I'm guessing this means it loads all sub folders as well ---------------------------------------------------------------------------------------------------- [11:06:38] Elia Schito(@elia):yes it should then ---------------------------------------------------------------------------------------------------- [11:06:46] Martin Becker(@Thermatix):oh umm btw I'm getting a `Uncaught ReferenceError: Opal is not defined` error ---------------------------------------------------------------------------------------------------- [11:07:02] Elia Schito(@elia):you need to `require 'opal'` ---------------------------------------------------------------------------------------------------- [11:07:20] Martin Becker(@Thermatix):AH ---------------------------------------------------------------------------------------------------- [11:07:36] Martin Becker(@Thermatix):right.. silly me! had a derp moment ---------------------------------------------------------------------------------------------------- [11:26:27] Martin Becker(@Thermatix):I might have an encountered a bug... ---------------------------------------------------------------------------------------------------- [11:27:23] Ilya Bylich(@iliabylich):@elia Why ivars in Opal are just properties? I mean, why ivars are not prefixed with anything like `$` or `$$` (well, these are reserved, but `$$$` is still free :smile: )? I'm asking it because there are conflicts with constants and array indexes (which are also properties) ---------------------------------------------------------------------------------------------------- [11:27:25] Martin Becker(@Thermatix):when I do `require './example'` the code in file example.rb doesn't seem to execute but if i do `require_relative './example'` it does, or have I missed somthing? ---------------------------------------------------------------------------------------------------- [11:30:05] Elia Schito(@elia):@iliabylich I think the initial rationale is that they map nicely and make debug straightforward, we could think of switching the bare name with `$$` and make internal properties be unprefixed, but that should be discussed in depth cc @meh ---------------------------------------------------------------------------------------------------- [11:31:54] Elia Schito(@elia):@Thermatix please open an issue so the info isn't lost : ) (but it lack of documentation or a very bug) ---------------------------------------------------------------------------------------------------- [11:34:07] Ilya Bylich(@iliabylich):Year, I understand that, it seems that nobody uses stuff like `instance_variables` :smile: . I'm getting very strange behavior like ``` ruby [1,2,3].instance_variables # => ["@0", "@1", "@2"] ``` ---------------------------------------------------------------------------------------------------- [11:34:31] Martin Becker(@Thermatix):@elia ok, done ---------------------------------------------------------------------------------------------------- [11:34:34] Elia Schito(@elia):I think numeric ivars are invalid tho ---------------------------------------------------------------------------------------------------- [11:34:37] Elia Schito(@elia):@Thermatix thanks ---------------------------------------------------------------------------------------------------- [11:34:49] Martin Becker(@Thermatix):issue #1286 ---------------------------------------------------------------------------------------------------- [11:38:49] Ilya Bylich(@iliabylich):I know, there's a code that checks for a property to not be a reserved object property (like proto or constructor). But it looks unsafe, some day new version of "browser N" may get some extra property (which is not blacklisted in Opal explicitly) and `instance_variables` may return it ---------------------------------------------------------------------------------------------------- [11:39:34] Elia Schito(@elia):that's true ---------------------------------------------------------------------------------------------------- [11:40:06] Ilya Bylich(@iliabylich):What do you think about `$$$ivar`? :smile: ---------------------------------------------------------------------------------------------------- [11:40:17] Elia Schito(@elia):too expensive :D ---------------------------------------------------------------------------------------------------- [11:40:46] Elia Schito(@elia)::money_with_wings: ---------------------------------------------------------------------------------------------------- [11:42:02] Elia Schito(@elia):As said I'd rather switch internal properties and ivars, giving ivars the `$$` prefix ---------------------------------------------------------------------------------------------------- [13:39:24] Martin Becker(@Thermatix):does opal have a problem parsing procs that have return values? ---------------------------------------------------------------------------------------------------- [13:43:33] Elia Schito(@elia):`return` in a procs is tricky to implement, I think there's still a bunch of cases which are unsupported ---------------------------------------------------------------------------------------------------- [13:44:16] Martin Becker(@Thermatix):I don't mean return in proc, I mean.. I think return is the wrong word ---------------------------------------------------------------------------------------------------- [13:44:28] Martin Becker(@Thermatix):I mean passing args to a proc, sorry ---------------------------------------------------------------------------------------------------- [13:44:38] Martin Becker(@Thermatix):I'm doing : ---------------------------------------------------------------------------------------------------- [13:45:02] Martin Becker(@Thermatix):```ruby -> { |some_value| puts some_value } ``` ---------------------------------------------------------------------------------------------------- [13:45:10] Martin Becker(@Thermatix):and I get a parsing error ---------------------------------------------------------------------------------------------------- [13:45:35] Elia Schito(@elia):because it's not valid ruby! :D ---------------------------------------------------------------------------------------------------- [13:45:35] Martin Becker(@Thermatix):removing `|some_value|` removes the parsing error ---------------------------------------------------------------------------------------------------- [13:45:50] Elia Schito(@elia):`-> some_value { … }` is the right syntax ---------------------------------------------------------------------------------------------------- [13:45:57] Martin Becker(@Thermatix):OH ---------------------------------------------------------------------------------------------------- [13:46:29] Martin Becker(@Thermatix):right ---------------------------------------------------------------------------------------------------- [15:21:59] Jared White(@jaredcwhite):@elia cool about the :+1: on blog updates...how should I approach it? Submit a PR for a new post in the opal.github.io project (source branch)? ---------------------------------------------------------------------------------------------------- [15:22:18] Elia Schito(@elia):@jaredcwhite that would be perfect ---------------------------------------------------------------------------------------------------- [15:22:50] Jared White(@jaredcwhite):@elia :shipit: ---------------------------------------------------------------------------------------------------- [15:33:52] Jared White(@jaredcwhite):saw this in the changelog: "Now you can bridge a native class to a Ruby class that inherits from another Ruby class" sounds interesting but not sure exactly what that's for (code example?) ---------------------------------------------------------------------------------------------------- [15:35:15] meh.(@meh):jaredcwhite, Number < Numeric ---------------------------------------------------------------------------------------------------- [15:35:18] Ilya Bylich(@iliabylich):@jaredcwhite https://github.com/opal/opal/blob/master/opal/corelib/boolean.rb#L1 ---------------------------------------------------------------------------------------------------- [15:35:27] meh.(@meh):where Number is bridged to the JS Number ---------------------------------------------------------------------------------------------------- [15:36:53] Elia Schito(@elia):@meh https://gitter.im/opal/opal?at=5696353d2bc35f6c1c19d0d6 (in case you missed it) ---------------------------------------------------------------------------------------------------- [15:36:54] Jared White(@jaredcwhite):@meh oh OK, using Opal.bridge - so is this mainly to help with Opal internals or could it be useful to the average developer? ---------------------------------------------------------------------------------------------------- [15:38:41] meh.(@meh):elia, I'd rather keep them unprefixed ---------------------------------------------------------------------------------------------------- [15:38:56] meh.(@meh):jaredcwhite, it technically could be useful when writing wrappers for other libraries if you want a common ancestor or something ---------------------------------------------------------------------------------------------------- [15:39:49] Jared White(@jaredcwhite):@meh cool. will have to look at what Opal.bridge does further ---------------------------------------------------------------------------------------------------- [15:45:20] Ilya Bylich(@iliabylich):@meh Then how could we resolve these issues like the one with array? Filtering them explicitly for each class? Like `super.reject { ... }`? ---------------------------------------------------------------------------------------------------- ############################## [2016-01-14] ############################## [00:25:29] Elia Schito(@elia):@jaredcwhite it's ok if I change the title to 0.9 instead of 0.9.2? ---------------------------------------------------------------------------------------------------- [00:26:12] Jared White(@jaredcwhite):@elia heh, I originally put 0.9 myself, and then thought maybe it wasn't accurate enough. so sure, that's fine with me :) ---------------------------------------------------------------------------------------------------- [12:55:38] Martin Becker(@Thermatix):is there an instance where a block `do;end` is not recognised as a block BUT is still parsed without errors? ---------------------------------------------------------------------------------------------------- [13:45:38] Elia Schito(@elia):@Thermatix what do you mean? CRuby or Opal? ---------------------------------------------------------------------------------------------------- [13:45:59] Elia Schito(@elia):@/all https://twitter.com/opalrb/status/687567542479622144 thanks again to @jaredcwhite ---------------------------------------------------------------------------------------------------- [13:51:48] Martin Becker(@Thermatix):opal ---------------------------------------------------------------------------------------------------- [13:52:26] Martin Becker(@Thermatix):in the end I moved the functions args to variables and then passed the variables in and then it started working ---------------------------------------------------------------------------------------------------- [13:53:32] Elia Schito(@elia):@Thermatix please open an issue if it looks like some kind of bug and you have some code that can reproduce it! : ) ---------------------------------------------------------------------------------------------------- [14:27:31] Martin Becker(@Thermatix):I don't know if I can get code to re-produce it ---------------------------------------------------------------------------------------------------- [15:20:46] ylluminate(@ylluminate):@elia what's been your thoughts on es6 so far? ---------------------------------------------------------------------------------------------------- [15:21:06] Elia Schito(@elia):hadn't the chance to try it enough ---------------------------------------------------------------------------------------------------- [15:21:35] ylluminate(@ylluminate):more and more discussion is going on with projects shifting over to es6 (eg, phaser 3 -> "lazer" pure es6) ---------------------------------------------------------------------------------------------------- [15:22:02] Elia Schito(@elia):do they use babel or rely on modern browsers only? ---------------------------------------------------------------------------------------------------- [15:22:49] ylluminate(@ylluminate):looking like babel for the time being ---------------------------------------------------------------------------------------------------- [15:23:00] ylluminate(@ylluminate):(i see a .babelrc in their root) ---------------------------------------------------------------------------------------------------- [15:23:24] Elia Schito(@elia):expected that, so in the end the still have raw JS… ---------------------------------------------------------------------------------------------------- [15:24:09] ylluminate(@ylluminate):that might present some peculiarities as far as debugging goes, but i've not even poked babel / es6 yet ---------------------------------------------------------------------------------------------------- [15:24:49] Torstein Saltvedt(@saltvedt):will opal compile to es6 somewhere down the road? ---------------------------------------------------------------------------------------------------- [15:25:40] Elia Schito(@elia):We thought about that, but for now there's seems to be no advantage in doing that (apart from being "cool" of course :P ) ---------------------------------------------------------------------------------------------------- [15:26:20] ylluminate(@ylluminate):hmm. definitely something to think about ---------------------------------------------------------------------------------------------------- [15:27:03] Elia Schito(@elia):The way I look at ES6/Babel is that's still "just" another compile-to-JS language ---------------------------------------------------------------------------------------------------- [15:27:31] ylluminate(@ylluminate):right, ---------------------------------------------------------------------------------------------------- [15:27:56] Elia Schito(@elia):more interesting IMO would be to leverage stuff such as Set, Map and maybe Symbol, but that can't happen unless browser support is widespread enough ---------------------------------------------------------------------------------------------------- [15:27:59] ylluminate(@ylluminate):but if more and more projects shift to es6, the question becomes, what if we want to create es6 project wrappers ---------------------------------------------------------------------------------------------------- [15:28:21] ylluminate(@ylluminate):so we will need an es6 -> babel -> opal workflow ---------------------------------------------------------------------------------------------------- [15:28:47] Elia Schito(@elia):what do you mean by "project wrappers"? ---------------------------------------------------------------------------------------------------- [15:29:09] ylluminate(@ylluminate):reactrb, opal-phaser, etc. ---------------------------------------------------------------------------------------------------- [15:29:59] Elia Schito(@elia):so you mean using opal-phaser from an ES6/babel project or the other way around? ---------------------------------------------------------------------------------------------------- [15:31:05] ylluminate(@ylluminate):so let's just say phaser-3 (lazer) suddenly popped out the door and is pure es6 via babel. and we want to still write games / apps with ruby via opal-phaser (lazer) ---------------------------------------------------------------------------------------------------- [15:31:16] ylluminate(@ylluminate):thinking about the pipeline there ---------------------------------------------------------------------------------------------------- [15:32:06] Elia Schito(@elia):can't you get the compiled-to-js phaser-3 and use it from opal-phaser (just trying to understand how it works) ---------------------------------------------------------------------------------------------------- [15:33:28] ylluminate(@ylluminate):i'm assuming so, but then i was thinking about the inclusion of the original es6 src for debug. it's something we'll have to look at as time goes forward here i guess ---------------------------------------------------------------------------------------------------- [15:38:34] Elia Schito(@elia):keep me posted on your findings, maybe the solution for that is just to use sprockets tho ---------------------------------------------------------------------------------------------------- [15:38:48] ylluminate(@ylluminate)::thumbsup: ---------------------------------------------------------------------------------------------------- [16:19:11] Torstein Saltvedt(@saltvedt):is there any specific reason Range#step is not implemented? https://github.com/opal/opal/blob/master/opal/corelib/range.rb#L128 ---------------------------------------------------------------------------------------------------- [16:28:10] Ilya Bylich(@iliabylich):@saltvedt No, it can be easily implemented. For now you can simulate it by converting your range to array ---------------------------------------------------------------------------------------------------- [16:29:13] Ilya Bylich(@iliabylich):Of course, if your range is a range of integers ---------------------------------------------------------------------------------------------------- [16:30:36] Torstein Saltvedt(@saltvedt):simulate it how? `(0..10).step(2).to_a` blows up ---------------------------------------------------------------------------------------------------- [16:30:43] Torstein Saltvedt(@saltvedt):not that it's hard to work around, just curios ---------------------------------------------------------------------------------------------------- [16:32:15] Martin Becker(@Thermatix):`(0..10).to_a.step(2)` ? ---------------------------------------------------------------------------------------------------- [16:33:00] Ilya Bylich(@iliabylich):As far as I remember, `Array#step` doesn't exist ---------------------------------------------------------------------------------------------------- [16:34:18] Ilya Bylich(@iliabylich):`(0..10).to_a.some_logic` ---------------------------------------------------------------------------------------------------- [16:34:47] Torstein Saltvedt(@saltvedt):yeah, I'll just select by n % 2 == 0 or something ---------------------------------------------------------------------------------------------------- [16:35:02] Ilya Bylich(@iliabylich):You can try `each_with_index.map { |item, index| ... }` ---------------------------------------------------------------------------------------------------- [18:39:36] Jamie Gaskins(@jgaskins):@iliabylich Speaking of which, at one point, `enum.map.with_index { |item, index| ... }` used to work but it doesn't anymore. I keep forgetting to file an issue about it. ---------------------------------------------------------------------------------------------------- [18:54:51] Elia Schito(@elia):@jgaskins ಠ_ಠ →→→ ruby/spec ---------------------------------------------------------------------------------------------------- [19:00:07] Elia Schito(@elia):@jgaskins is enum a non-array? ``` >> [1,2,3].each.with_index {|n,i| p [n,i]} [1, 0] [2, 1] [3, 2] => [1, 2, 3] >> RUBY_ENGINE_VERSION => "0.10.0.dev" >> ``` ---------------------------------------------------------------------------------------------------- ############################## [2016-01-15] ############################## [18:56:40] Ilya Bylich(@iliabylich):There's a difference between some MRI method implementations depending on the passed object. For example, `Range#step` behaves in a different way when you pass float/integer ---------------------------------------------------------------------------------------------------- [18:57:02] meh.(@meh):I'm aware of that, but full compliancy in this regard just adds overhead ---------------------------------------------------------------------------------------------------- [18:57:14] meh.(@meh):and besides ---------------------------------------------------------------------------------------------------- [18:57:21] Ilya Bylich(@iliabylich):I'm not sure are there any other methods like this, but all of them can't be fully implemented until Floats are Integers ---------------------------------------------------------------------------------------------------- [18:57:23] meh.(@meh):all you have to do is check for Integer first ---------------------------------------------------------------------------------------------------- [18:57:25] meh.(@meh):and Float after ---------------------------------------------------------------------------------------------------- [18:57:30] meh.(@meh):Integer will return true only when there's no decimal part ---------------------------------------------------------------------------------------------------- [19:05:20] Ilya Bylich(@iliabylich):Yeah, you are right, the only advantage that it gives is (partially) correct implementation of `Float.===` (which can be simulated by calling `!(Integer === number) && Float === number)`. I thought that it may allow us to define float logic directly on the `Float` class, but there's no sense to do that ---------------------------------------------------------------------------------------------------- [19:07:00] meh.(@meh):@iliabylich to be clear, I know it's a huge pain in the ass, when I was working on `Numeric` compliancy I thought about it for a long while, but the cons are more than the pros ---------------------------------------------------------------------------------------------------- [19:43:58] Forrest Chang(@fkchang):@wied03 good job, I'll have to check it out ---------------------------------------------------------------------------------------------------- [16:08:01] Brady Wied(@wied03):For those interested in running opal-rspec specs in Karma, here is another option - https://www.npmjs.com/package/karma-opal-rspec ---------------------------------------------------------------------------------------------------- [16:46:08] Brady Wied(@wied03):Was (officially) released today ---------------------------------------------------------------------------------------------------- [16:48:11] Elia Schito(@elia)::clap: ---------------------------------------------------------------------------------------------------- [17:43:45] Ilya Bylich(@iliabylich):@meh Is there any chance to fix `Float.===`? Right now it returns `true` for any number. Writing something like ``` ruby class Float < Numeric def self.===(other) %x{ if (!other.$$is_number) { return false; } return (other % 1) !== 0; } end end ``` breaks floats coersion (i.e. `1.to_f` returns a `Number` and `Opal.coerce_to!` throws an error) ---------------------------------------------------------------------------------------------------- [17:45:52] meh.(@meh):iliabylich, nope ---------------------------------------------------------------------------------------------------- [17:47:31] meh.(@meh):iliabylich, all numbers are float in js ---------------------------------------------------------------------------------------------------- [17:49:10] Ilya Bylich(@iliabylich):@meh I see, thanks ---------------------------------------------------------------------------------------------------- [17:49:24] meh.(@meh):they're actually double, but you get the point ---------------------------------------------------------------------------------------------------- [18:48:28] Ilya Bylich(@iliabylich):@meh How about wrapping each float on the compilation stage to `Float(number)` and modify `Kernel#Float` to: ``` ruby def Float %x{ float = (... previous code ...); float = new Number(float); float.$$is_float = true; return float; } end ``` Then `Float.===` may look like: ``` ruby def self.===(other) return (other.$$is_float) || ((other % 1) !== 0); end ``` Plus some changes in Math logic like ``` ruby def *(other) if Float === other Float(self * `#{other}.valueOf()`}) else # current logic end ``` After theses changes we will get only one difference with MRI: inline `number.0`, because it's not a compiled number and it doesn't have floating value. What do you think about it? ---------------------------------------------------------------------------------------------------- [18:48:55] meh.(@meh):then you can't just pass a float to JS functions ---------------------------------------------------------------------------------------------------- [18:48:59] meh.(@meh):and it adds overhead ---------------------------------------------------------------------------------------------------- [18:49:05] meh.(@meh):and you can't do what you did ---------------------------------------------------------------------------------------------------- [18:49:13] meh.(@meh):ah wait, you can ---------------------------------------------------------------------------------------------------- [18:49:16] meh.(@meh):but yeah, they're not literals ---------------------------------------------------------------------------------------------------- [18:49:22] meh.(@meh):object literals are way different from literals ---------------------------------------------------------------------------------------------------- [18:49:33] meh.(@meh):> typeof new Number(2) ---------------------------------------------------------------------------------------------------- [18:49:34] meh.(@meh):'object' ---------------------------------------------------------------------------------------------------- [18:49:43] meh.(@meh):> typeof 2 ---------------------------------------------------------------------------------------------------- [18:49:44] meh.(@meh):'number' ---------------------------------------------------------------------------------------------------- [18:49:54] Ilya Bylich(@iliabylich):@meh Yes, but you can check it in the code ---------------------------------------------------------------------------------------------------- [18:50:08] meh.(@meh):not on native JS code ---------------------------------------------------------------------------------------------------- [18:50:12] meh.(@meh):then you'd have to call #to_n ---------------------------------------------------------------------------------------------------- [18:50:20] meh.(@meh):it just adds pain for not much advantage ---------------------------------------------------------------------------------------------------- [18:52:07] Ilya Bylich(@iliabylich):Why not much? It allows you to completely split `Integer` values from `Float` ---------------------------------------------------------------------------------------------------- [18:52:28] meh.(@meh):iliabylich, yes, and what's the practical advantage to that? ---------------------------------------------------------------------------------------------------- [18:52:35] Ilya Bylich(@iliabylich):And I don't get where's the problem with native values ---------------------------------------------------------------------------------------------------- [18:53:02] meh.(@meh):iliabylich, object literals behave differently from actual literals ---------------------------------------------------------------------------------------------------- [18:53:16] meh.(@meh):it just makes interaction way harder ---------------------------------------------------------------------------------------------------- ############################## [2016-01-16] ############################## [01:10:24] Jamie Gaskins(@jgaskins):@elia: It was on an array, actually. It might be fixed on `master`, but I tried it on one of the released versions and it didn't work. ---------------------------------------------------------------------------------------------------- [01:12:49] Elia Schito(@elia):@jgaskins as usual let me know if you think it makes sense to backport a fix (if it's feasible of course) ---------------------------------------------------------------------------------------------------- [01:14:33] Jamie Gaskins(@jgaskins):@elia: Okay, I honestly don't remember what I was doing at the time, tbh. I just remember being confused when it didn't work. ---------------------------------------------------------------------------------------------------- [01:16:12] Elia Schito(@elia):@jgaskins :+1: keep me posted on this type of issues, hopefully 0.10 will take less time than 0.9 before it comes out : ) ---------------------------------------------------------------------------------------------------- [01:16:33] Jamie Gaskins(@jgaskins):Sweet ---------------------------------------------------------------------------------------------------- [10:09:54] Bernhard Weichel(@bwl21):I am still trying to understand more of `Native()` vs. `.JS` @vais thanks for the pointer to the documentation. Is it correct to say: * Native() pulls an object from Javascript to Ruby-land by creating wrapper (decorator) for a javascript object * .JS pokes in javascript Land using ruby style syntax * Native returns a Ruby Object and is executed at runtime * JS by itself returns nothing, even if it looks like a method. It is kind of syntactic sugar and is basically handled at compile time. Methods sent to JS usually yield the return value of the invoked javascript method/property ... which is a javascript object. ---------------------------------------------------------------------------------------------------- [11:16:00] Elia Schito(@elia):@bwl21 that's correct ---------------------------------------------------------------------------------------------------- ############################## [2016-01-19] ############################## [00:50:35] Cassio Godinho(@cpgo):@elia , Im very new to opal and front end in general. I'm currently working with Vue.js. Would it be too much work to try and wire opal and vue together? ---------------------------------------------------------------------------------------------------- [00:56:28] Elia Schito(@elia):@CassioGodinho it shouldn't be very difficult but I wouldn't advise it as the first task. If you still want to undertake such a challenge I suggest looking at how it's done in Opal-jquery and Opal-browser (in addition to reading the guides of course) :) ---------------------------------------------------------------------------------------------------- [01:00:46] Cassio Godinho(@cpgo):Thanks @elia, I will take a look at opal-jquery ---------------------------------------------------------------------------------------------------- [10:22:10] Martin Becker(@Thermatix):would the following work in opal? ```ruby for_ident = args.shift if args.first.is_a? Symbol ``` ---------------------------------------------------------------------------------------------------- [10:22:36] Martin Becker(@Thermatix):I'm guessing it wouldn't but I just want to make sure, any way to deal with this better? ---------------------------------------------------------------------------------------------------- [10:34:21] Elia Schito(@elia):It works unless you need to differentiate between String and Symbol ---------------------------------------------------------------------------------------------------- [10:36:12] Martin Becker(@Thermatix):ah.... ---------------------------------------------------------------------------------------------------- [10:36:14] Martin Becker(@Thermatix):bollox ---------------------------------------------------------------------------------------------------- [10:36:32] Martin Becker(@Thermatix):ah I mean bugger... ---------------------------------------------------------------------------------------------------- [10:36:34] Martin Becker(@Thermatix):... ---------------------------------------------------------------------------------------------------- [10:36:38] Martin Becker(@Thermatix):nvm that's not much better ---------------------------------------------------------------------------------------------------- [10:40:16] Martin Becker(@Thermatix):I'm getting a non-helpful parsing error ---------------------------------------------------------------------------------------------------- [10:40:22] Martin Becker(@Thermatix):I'm doing : ---------------------------------------------------------------------------------------------------- [10:40:44] Martin Becker(@Thermatix):```ruby button class_name: "mui-btn mui-btn--primary" do "Previous renders" end.on(:click) do state.display_prev_renders_modal!(true) end ``` ---------------------------------------------------------------------------------------------------- [10:40:51] Martin Becker(@Thermatix):but it's erroring on the `do` ---------------------------------------------------------------------------------------------------- [10:40:56] Martin Becker(@Thermatix):if I remove the block it works fine ---------------------------------------------------------------------------------------------------- [10:41:04] Martin Becker(@Thermatix):what is it that I'm not seeing that's causing the error? ---------------------------------------------------------------------------------------------------- [10:44:56] Elia Schito(@elia):@Thermatix remove stuff untill you understand what exactly is causing the error ---------------------------------------------------------------------------------------------------- [10:45:33] Martin Becker(@Thermatix):I did, it's the block itself, if I comment out the block it works, adding it in and it breaks, but it should work that's why I don't understand it ---------------------------------------------------------------------------------------------------- [10:45:53] Martin Becker(@Thermatix):I've had a block like this before so why it shouldn't work doesn't make sense ---------------------------------------------------------------------------------------------------- [10:45:59] Martin Becker(@Thermatix):obviously I've missed somthing but I just don't see it ---------------------------------------------------------------------------------------------------- [10:46:42] Martin Becker(@Thermatix):... but ---------------------------------------------------------------------------------------------------- [10:46:49] Martin Becker(@Thermatix):changing the first block to be brackerts... AH ---------------------------------------------------------------------------------------------------- [10:46:51] Martin Becker(@Thermatix):I get it ---------------------------------------------------------------------------------------------------- [10:46:57] Martin Becker(@Thermatix):it's a precedent's issue ---------------------------------------------------------------------------------------------------- [10:47:05] Martin Becker(@Thermatix):changing the first block to braces fixes it ---------------------------------------------------------------------------------------------------- [11:11:29] Martin Becker(@Thermatix):that's super anoying ---------------------------------------------------------------------------------------------------- [11:14:07] Elia Schito(@elia):please open an issue unless there's already one ---------------------------------------------------------------------------------------------------- [11:20:38] Martin Becker(@Thermatix):done! ---------------------------------------------------------------------------------------------------- [11:20:43] Elia Schito(@elia):thanks ---------------------------------------------------------------------------------------------------- [11:20:59] Martin Becker(@Thermatix):https://github.com/opal/opal/issues/1299 ---------------------------------------------------------------------------------------------------- [19:18:13] Forrest Chang(@fkchang):@/all DDH's explanation on the Rails Doctrine http://rubyonrails.org/doctrine I want to write something similar as to why I would prefer to do opal over js ---------------------------------------------------------------------------------------------------- [20:21:25] Mitch VanDuyn(@catmando):anybody remember how to update Element so it accepts new methods (like .datepicker)... I believe there was an easy way??? ---------------------------------------------------------------------------------------------------- [20:23:18] Mitch VanDuyn(@catmando):got it... Element.expose ---------------------------------------------------------------------------------------------------- [23:02:35] Jared White(@jaredcwhite):@fkchang I read that today as well, and that was my first thought -- not that there's an "Opal Doctrine" per se as Opal isn't a framework but a platform to build frameworks on top of -- something more along the lines of "The Ruby in the Browser Manifesto" or whatever. Totally would love to see what you come up with! ---------------------------------------------------------------------------------------------------- [23:03:38] Elia Schito(@elia):@catmando side note: on master you should be able to leverage method_missing for that ---------------------------------------------------------------------------------------------------- ############################## [2016-01-20] ############################## [16:14:57] Ilya Bylich(@iliabylich):@meh Should `Opal.respond_to?(BasicObject.new, :some_method)` raise an error? Is it a safe implementation that always returns `true/false`? ---------------------------------------------------------------------------------------------------- ############################## [2016-01-21] ############################## [20:18:57] Bernhard Weichel(@bwl21):It appears that cdn.opal.org is down again :-) ---------------------------------------------------------------------------------------------------- [21:22:39] Elia Schito(@elia):And I have no idea why :/ ---------------------------------------------------------------------------------------------------- [21:47:50] Bernhard Weichel(@bwl21):maybe it wanted to break my demo with a customer :-) ---------------------------------------------------------------------------------------------------- [22:01:40] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [22:03:59] Torstein Saltvedt(@saltvedt):is the next release 1.0.0 or 0.10.0? ---------------------------------------------------------------------------------------------------- [22:04:11] meh.(@meh):0.10 ---------------------------------------------------------------------------------------------------- [22:04:42] Torstein Saltvedt(@saltvedt):is there a roadmap or some milestones before version 1? ---------------------------------------------------------------------------------------------------- ############################## [2016-01-22] ############################## [09:47:04] Elia Schito(@elia):@saltvedt we're aiming at passing all the language specs for v1.0 https://github.com/opal/opal/blob/565f717664a89abc2f468194c57418aa60f26677/spec/filters/bugs/language.rb ---------------------------------------------------------------------------------------------------- [10:32:44] Benoit Daloze(@eregon):@elia That would be awesome! ---------------------------------------------------------------------------------------------------- [10:35:50] Benoit Daloze(@eregon):Does the ! means whole file exclusion in https://github.com/opal/opal/blob/565f717664a89abc2f468194c57418aa60f26677/spec/rubyspecs#L103-L119 ? ---------------------------------------------------------------------------------------------------- [10:36:11] Elia Schito(@elia):yes ---------------------------------------------------------------------------------------------------- [10:37:47] Elia Schito(@elia):@eregon but I have the suspect that many of those files are because of unsupported syntax, and some of them could be enabled after the great work done by @alexdowad ---------------------------------------------------------------------------------------------------- [10:39:14] Elia Schito(@elia):@eregon also personally I was ready to go 1.0 in 2012 :P when I started to use opal in production :) but @vais had the smart idea of binding _The_ release to the passing of the language specs ---------------------------------------------------------------------------------------------------- [12:18:17] Benoit Daloze(@eregon):From the experience with JRuby+Truffle, the last 5-10% is really hardcore, so I think a 90% coverage would already be a very significant milestone. ---------------------------------------------------------------------------------------------------- [12:19:21] Benoit Daloze(@eregon):The core library is also pretty important, but I would guess there the users tend to ask or add the missing functionality they need (i.e.: probably no much point in having all the encoding stuff in Opal) ---------------------------------------------------------------------------------------------------- [13:04:25] Elia Schito(@elia):@eregon indeed, there's a number of things that are useful just to make existing libs work, but they add little value otherwise ---------------------------------------------------------------------------------------------------- [13:06:11] Elia Schito(@elia):btw congrats in passing all those specs! :D ---------------------------------------------------------------------------------------------------- [23:49:56] Loïc Boutet(@loicboutet):Hi all ---------------------------------------------------------------------------------------------------- [23:50:23] Loïc Boutet(@loicboutet):has anyone already encountered : ``` /gems/opal-rails-0.8.0/lib/opal/rails/engine.rb:34:in `block in ': undefined method `append_path' for nil:NilClass (NoMethodError) ``` when having opal-rails installed? ---------------------------------------------------------------------------------------------------- [23:51:23] Loïc Boutet(@loicboutet):looks to me that some opal path is not set, but I don t see anywhere in the working apps I have where it should be defined ---------------------------------------------------------------------------------------------------- ############################## [2016-01-23] ############################## [00:24:06] Loïc Boutet(@loicboutet):Yeah, I can't wait for the time when a ruby front dev will be a thing ;-) ---------------------------------------------------------------------------------------------------- [00:26:22] George Plymale II(@ylluminarious):@ylluminate +1 regarding opal 1.0 ---------------------------------------------------------------------------------------------------- [00:28:08] Jared White(@jaredcwhite):+1 on v 1.0 -- it's a marketing thing, anything 0.x sounds experimental, but Opal is totally usable in production apps at this point so the versioning should convey that ---------------------------------------------------------------------------------------------------- [00:49:42] Loïc Boutet(@loicboutet):hmm ... since you guys were so helpful ---------------------------------------------------------------------------------------------------- [00:50:02] Loïc Boutet(@loicboutet):I'm still trying to follow the reactrb tuto and now I got : ``` ActionView::Template::Error (Opal is not defined): 1: <%= react_component @component_name, @render_params, { prerender: !params[:no_prerender] } %> app/controllers/home_controller.rb:5:in `show' ``` ---------------------------------------------------------------------------------------------------- [00:50:13] Loïc Boutet(@loicboutet):any idea? ---------------------------------------------------------------------------------------------------- [00:50:25] ylluminate(@ylluminate):exactly @jaredcwhite ---------------------------------------------------------------------------------------------------- [00:50:46] Elia Schito(@elia):@loicboutet not sure, but somewhere you should `require 'opal'` in your assets ---------------------------------------------------------------------------------------------------- [00:51:47] Loïc Boutet(@loicboutet):@elia the thing is I am, in the components file ---------------------------------------------------------------------------------------------------- [00:52:25] Elia Schito(@elia):@loicboutet let's cc @catmando and @fkchang, hopefully they know better ---------------------------------------------------------------------------------------------------- [00:52:39] Loïc Boutet(@loicboutet):thx ^^ ---------------------------------------------------------------------------------------------------- [00:55:03] Elia Schito(@elia):@jaredcwhite @ylluminate @ylluminarious you've been heared 😉 – I'll check with @meh and @vais what they think about accelerating towards 1.0. Personally I'd also like to stabilize the API a bit more, I mean the CRuby API, but that's something that can be done regardless ---------------------------------------------------------------------------------------------------- [00:56:29] George Plymale II(@ylluminarious):@elia thanks! i think we'd all appreciate 1.0 ;) ---------------------------------------------------------------------------------------------------- [00:57:49] Elia Schito(@elia):(and docs too! …btw for that I could use some help, especially from native speakers 😸) ---------------------------------------------------------------------------------------------------- [01:00:07] George Plymale II(@ylluminarious):yeah, that definitely would be nice. i'll see what i can do with that (when i'm not waist-deep in schoolwork :() ---------------------------------------------------------------------------------------------------- [01:01:24] Elia Schito(@elia):sure thing, it's especially valuable a fresh perspective on "getting started" : ) ---------------------------------------------------------------------------------------------------- [01:01:45] George Plymale II(@ylluminarious):lol, yeah ---------------------------------------------------------------------------------------------------- [01:01:56] George Plymale II(@ylluminarious):but i've had some time freeing up lately, so hopefully that's something i can do :D ---------------------------------------------------------------------------------------------------- [01:03:51] Torstein Saltvedt(@saltvedt):I've got some notes on that Elia :) ---------------------------------------------------------------------------------------------------- [01:21:44] Forrest Chang(@fkchang):@elia I hear, will address on the react.rb gitter ---------------------------------------------------------------------------------------------------- [01:21:55] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [01:22:15] Loïc Boutet(@loicboutet):@fkchang Actually it was a naming problem on my side ---------------------------------------------------------------------------------------------------- [01:22:26] Loïc Boutet(@loicboutet):putting the right module fixed the problem ---------------------------------------------------------------------------------------------------- [01:22:40] Forrest Chang(@fkchang):oh, ok, cool, I was just about to dump some info ---------------------------------------------------------------------------------------------------- [01:22:47] Forrest Chang(@fkchang):what exactly was the prob? ---------------------------------------------------------------------------------------------------- [01:23:20] Loïc Boutet(@loicboutet):I forgot the `module Components` ---------------------------------------------------------------------------------------------------- [01:23:48] Loïc Boutet(@loicboutet):and was thinking that `class Home::Show` would be equivalent to ``` module Home class Show ``` ---------------------------------------------------------------------------------------------------- [01:23:56] Loïc Boutet(@loicboutet):but s that definitely not the case :D ---------------------------------------------------------------------------------------------------- [04:55:18] Vais Salikhov(@vais):@elia I'm not against :sparkles: 1.0 :sparkles: My concern was disappointing new users if not all *language* specs are passing. If something's missing from *core*, it's clear that it could be added, but if a *language* feature is broken, it could be kind of disheartening. You can only play the 1.0 card once :) ---------------------------------------------------------------------------------------------------- [09:55:49] Guillaume Grossetie(@Mogztter):Hello, I have an issue with the Node.js implementation, corelib methods are not overridden by "nodejs" methods ---------------------------------------------------------------------------------------------------- [09:56:00] Guillaume Grossetie(@Mogztter):```javascript var Opal = require('opal-npm-wrapper').Opal; require('./opal-builder.js'); require('./pathname.js'); require('./nodejs.js'); Opal.require('nodejs'); Opal.require('opal-builder'); Opal.get('File').$expand_path("."); // returns "." (corelib/dir $pwd method is used instead of nodejs/dir $pwd method) ``` ---------------------------------------------------------------------------------------------------- [09:56:23] Guillaume Grossetie(@Mogztter):Any idea ? ---------------------------------------------------------------------------------------------------- [15:32:50] Elia Schito(@elia):@Mogztter do you get anything in `Opal.modules.nodejs` after `require('./nodejs.js');`? ---------------------------------------------------------------------------------------------------- [16:03:16] Elia Schito(@elia):> It appears that cdn.opal.org is down again :-) @bwl21 :D it's `cdn.opalrb.org`, you were missing the `rb`, but I must say it took a bit for me to spot the error! ---------------------------------------------------------------------------------------------------- [17:01:17] Mitch VanDuyn(@catmando):@elia (or anybody else :-) having this little problem with @loicboutet new generator... application.js is doing a //= require 'components' which does not seem to work ---------------------------------------------------------------------------------------------------- [17:01:48] Mitch VanDuyn(@catmando):but if I change application.js to application.rb and change to ruby syntax everything is fine :-) ---------------------------------------------------------------------------------------------------- [17:02:16] Mitch VanDuyn(@catmando):its like I can't do a JS require of components (which is a .rb file) ---------------------------------------------------------------------------------------------------- [17:07:54] Mitch VanDuyn(@catmando):Yeah I can't even get it to load a plain old .rb file from the .js directory... I have been using the same old set of apps so long, I can't remember what you need to do to configure rails to convert the .rb files to .js (i guess) ---------------------------------------------------------------------------------------------------- [17:13:36] Mitch VanDuyn(@catmando):okay got it... found the note about having to use application.rb unless you want to manually load stuff. (which I dont) ---------------------------------------------------------------------------------------------------- [17:13:59] Mitch VanDuyn(@catmando):The only problem is it means converting the existing application.js file to rb syntax right? ---------------------------------------------------------------------------------------------------- [17:14:11] Mitch VanDuyn(@catmando):which might be a bit harder for the generator... ---------------------------------------------------------------------------------------------------- [19:06:32] Elia Schito(@elia):@catmando that's a problem that I'd like to solve for opal-rails too ---------------------------------------------------------------------------------------------------- [19:07:13] Mitch VanDuyn(@catmando):@elia - so we are just doing an Opal.load('components') and it seems to be working... ---------------------------------------------------------------------------------------------------- [19:07:19] Mitch VanDuyn(@catmando):but I have another question: ---------------------------------------------------------------------------------------------------- [19:07:38] Mitch VanDuyn(@catmando):I need to require browser and browser/interval ---------------------------------------------------------------------------------------------------- [19:07:44] Mitch VanDuyn(@catmando):but only on the client! ---------------------------------------------------------------------------------------------------- [19:07:46] Elia Schito(@elia):(the sprockets directives `//= require` only make files available to the opal module system) ---------------------------------------------------------------------------------------------------- [19:08:17] Elia Schito(@elia):use the special `if RUBY_ENGINE == 'opal'` ---------------------------------------------------------------------------------------------------- [19:09:37] Elia Schito(@elia):unless of course your server is nodejs :trollface: :smile_cat: ---------------------------------------------------------------------------------------------------- [19:09:50] Mitch VanDuyn(@catmando):exactly the problem ---------------------------------------------------------------------------------------------------- [19:09:57] Mitch VanDuyn(@catmando):anyway I figured it out: ---------------------------------------------------------------------------------------------------- [19:10:31] Mitch VanDuyn(@catmando):```ruby if React::IsomorphicBase.on_opal_client? require 'browser' require 'browser/interval' end ``` (because React.rb has those handy methods :-) ) ---------------------------------------------------------------------------------------------------- [19:15:05] Elia Schito(@elia):in opal 0.9 there's also `opal/platform` in stdlib that should correctly detect the JS platform and set `OPAL_PLATFORM` ---------------------------------------------------------------------------------------------------- [19:15:19] Elia Schito(@elia):`if OPAL_PLATFORM == 'nodejs'` ---------------------------------------------------------------------------------------------------- [22:03:41] Bernhard Weichel(@bwl21):@elia sorry, it was a typo here at gitter. When i posted it, cdn.opalrb.org did not work. I was in discussion with a client and during the meeting it stopped working. Now it is back. I will give up cdn and put the files on my server. ---------------------------------------------------------------------------------------------------- [22:08:35] Elia Schito(@elia):@bwl21 yeah, for non-toy stuff is always advisable : ) ---------------------------------------------------------------------------------------------------- [00:00:49] Torstein Saltvedt(@saltvedt):silly question, have you restarted the rails server after installing opal? ---------------------------------------------------------------------------------------------------- [00:01:09] Loïc Boutet(@loicboutet):actually I can't even start the server ^^ ---------------------------------------------------------------------------------------------------- [00:01:18] Loïc Boutet(@loicboutet):any rails * command throw the error ---------------------------------------------------------------------------------------------------- [00:01:23] Loïc Boutet(@loicboutet)::( ---------------------------------------------------------------------------------------------------- [00:02:33] Torstein Saltvedt(@saltvedt):never used opal-rails, but seems like the config the rails initializers is wrong then ---------------------------------------------------------------------------------------------------- [00:03:05] Loïc Boutet(@loicboutet):yeah ... but that s really weird ---------------------------------------------------------------------------------------------------- [00:03:23] Loïc Boutet(@loicboutet):I m just trying to configure opal the way shown here : http://reactrb.org/docs/getting-started.html ---------------------------------------------------------------------------------------------------- [00:03:26] Loïc Boutet(@loicboutet):in an empty app ---------------------------------------------------------------------------------------------------- [00:03:59] Loïc Boutet(@loicboutet):I would say it s a bug, but if this is a bug I don't get how anyone is using opal-rails ^^ ---------------------------------------------------------------------------------------------------- [00:04:10] Loïc Boutet(@loicboutet):so I guess I m doing something wrong... ---------------------------------------------------------------------------------------------------- [00:06:50] Elia Schito(@elia):@loicboutet I think it's the latest sprockets version ---------------------------------------------------------------------------------------------------- [00:08:05] Brady Wied(@wied03):@elia - Had a similar issue with karma-opal-rspec ---------------------------------------------------------------------------------------------------- [00:08:11] Elia Schito(@elia):@loicboutet try adding this line to your gemfile: https://github.com/opal/opal-rails/blob/master/opal-rails.gemspec#L29 ---------------------------------------------------------------------------------------------------- [00:08:19] Loïc Boutet(@loicboutet):testing that ---------------------------------------------------------------------------------------------------- [00:08:25] Elia Schito(@elia):``` gem 'sprockets-rails', '< 3.0' ``` ---------------------------------------------------------------------------------------------------- [00:08:45] Brady Wied(@wied03):https://github.com/wied03/karma-opal-rspec/commit/c60bf2c14eabd6fca23f9b7a06d8a2a056e18086 ---------------------------------------------------------------------------------------------------- [00:10:19] Loïc Boutet(@loicboutet):Indeed ---------------------------------------------------------------------------------------------------- [00:10:23] Loïc Boutet(@loicboutet):that does fix the issue ---------------------------------------------------------------------------------------------------- [00:10:31] Loïc Boutet(@loicboutet):should I open an issue on opal-rails? ---------------------------------------------------------------------------------------------------- [00:11:10] Elia Schito(@elia):@loicboutet no, just update to 0.8.1 ;) https://github.com/opal/opal-rails/blob/master/CHANGELOG.md#081---2015-12-18 ---------------------------------------------------------------------------------------------------- [00:11:25] Loïc Boutet(@loicboutet):OK ---------------------------------------------------------------------------------------------------- [00:11:58] ylluminate(@ylluminate):my 2¢: I think a 1.0 should be released sooner than later for pulling more confidence and growing the user base. ---------------------------------------------------------------------------------------------------- [00:12:24] ylluminate(@ylluminate):where are things falling as far as coverage right now? 87% ---------------------------------------------------------------------------------------------------- [00:13:07] Loïc Boutet(@loicboutet):I confirm that 0.8.1 works ---------------------------------------------------------------------------------------------------- [00:22:55] Jared White(@jaredcwhite):Quick aside...I'm literally arranging my programming career on purpose (if at all possible) so I don't ever have to get pulled into working on an Angular project. Every time I've seen Angular 1 code, it's made me feel ill. In recent times, though, I was thinking maybe Angular 2 would be a lot better. Then I saw this: https://medium.com/@MikeRyan52/angular-2-first-app-post-mortem-b2b2b3618828#.m710h172i and...OMG that is ugly!! How can anyone stand to deal with this syntax soup? :question: :question: :question: ---------------------------------------------------------------------------------------------------- [00:23:04] Jared White(@jaredcwhite):Needless to say, I am *so* glad that Opal is a thing :) ---------------------------------------------------------------------------------------------------- ############################## [2016-01-24] ############################## [15:40:47] Loïc Boutet(@loicboutet):nope you'll have to look for yourself ^^ ---------------------------------------------------------------------------------------------------- [15:41:07] bhanu singh(@bhanu2795):😕 huh... ---------------------------------------------------------------------------------------------------- [15:42:13] bhanu singh(@bhanu2795):well thanks a lot dude... ---------------------------------------------------------------------------------------------------- [15:44:34] Loïc Boutet(@loicboutet):no problem, for any opal related question you are welcome, people here will help you ---------------------------------------------------------------------------------------------------- [15:46:03] bhanu singh(@bhanu2795):btw can plz introduce yourself... ---------------------------------------------------------------------------------------------------- [15:08:29] Guillaume Grossetie(@Mogztter):@elia Yes `Opal.modules.nodejs` contains the function and require `nodejs/kernel`, `nodejs/dir`, `nodejs/file` and `nodejs/io` ---------------------------------------------------------------------------------------------------- [15:16:22] Loïc Boutet(@loicboutet):Is there any kind of JS to Opal converter existing somewhere? ---------------------------------------------------------------------------------------------------- [15:22:55] Jose Añasco(@merongivian):You can use the `Native` library to wrap yourself, if your js code is OOP-ish , im working on a wrapper library called `opal-wrappable`, its not ready yet though, im still working on it ---------------------------------------------------------------------------------------------------- [15:23:25] Loïc Boutet(@loicboutet):hmm I see ---------------------------------------------------------------------------------------------------- [15:26:29] bhanu singh(@bhanu2795):hey! guys i am new here can anyone tell me what is opal? ---------------------------------------------------------------------------------------------------- [15:27:16] Loïc Boutet(@loicboutet):You write ruby code, Opal transforms it in JS ---------------------------------------------------------------------------------------------------- [15:27:34] Loïc Boutet(@loicboutet):So you can write ruby code and execute it on the client for example ---------------------------------------------------------------------------------------------------- [15:28:23] bhanu singh(@bhanu2795):so basically its a type of compilers... ---------------------------------------------------------------------------------------------------- [15:28:33] Loïc Boutet(@loicboutet):It allows you to have nice stuff like : - https://github.com/zetachang/react.rb - https://github.com/opal/opal-jquery ---------------------------------------------------------------------------------------------------- [15:28:55] Jose Añasco(@merongivian):@loicboutet yea exactly, they called transpi ---------------------------------------------------------------------------------------------------- [15:29:00] Loïc Boutet(@loicboutet):yup, if you read the description : Ruby to JavaScript compiler ---------------------------------------------------------------------------------------------------- [15:29:15] Jose Añasco(@merongivian):Transpiling heheh ---------------------------------------------------------------------------------------------------- [15:29:27] bhanu singh(@bhanu2795):thanks dude.... ---------------------------------------------------------------------------------------------------- [15:29:43] Loïc Boutet(@loicboutet):@bhanu2795 what are you looking for? :D ---------------------------------------------------------------------------------------------------- [15:30:33] bhanu singh(@bhanu2795):can do me a favour @loicboutet ppz provide me a begginer guide for it ---------------------------------------------------------------------------------------------------- [15:30:49] Loïc Boutet(@loicboutet):it largely depends on what you are looking for ---------------------------------------------------------------------------------------------------- [15:31:09] bhanu singh(@bhanu2795):plz* ---------------------------------------------------------------------------------------------------- [15:31:35] Loïc Boutet(@loicboutet):you can use opal directly, but your need is probably more geared toward using one of the library built on top of opal I would say ---------------------------------------------------------------------------------------------------- [15:32:02] Loïc Boutet(@loicboutet):if you could explain more what you are looking for in Opal, it could help us to point you in the right direction ---------------------------------------------------------------------------------------------------- [15:34:24] bhanu singh(@bhanu2795):ryt now i want to learn about opal because before i never heard about it as i am new in this field don't have deep knowlege about it can you plz help me for that why it is used what are its application etc things..... ---------------------------------------------------------------------------------------------------- [15:35:23] Loïc Boutet(@loicboutet):I guess you can start with the website : http://opalrb.org/ ---------------------------------------------------------------------------------------------------- [15:35:41] bhanu singh(@bhanu2795):okay thanks ---------------------------------------------------------------------------------------------------- [15:35:55] Loïc Boutet(@loicboutet):There is a try section where you can play by writing ruby code and see what it does in JS ---------------------------------------------------------------------------------------------------- [15:35:59] Loïc Boutet(@loicboutet):and a doc section : http://opalrb.org/docs/guides/master/index.html ---------------------------------------------------------------------------------------------------- [15:36:16] bhanu singh(@bhanu2795):okay ---------------------------------------------------------------------------------------------------- [15:36:27] Loïc Boutet(@loicboutet):are you a rails dev? ---------------------------------------------------------------------------------------------------- [15:36:34] bhanu singh(@bhanu2795):yup ---------------------------------------------------------------------------------------------------- [15:36:56] bhanu singh(@bhanu2795):how you get to know about that? ---------------------------------------------------------------------------------------------------- [15:37:27] Loïc Boutet(@loicboutet):You should probably look at : https://github.com/opal/opal-rails#readme ---------------------------------------------------------------------------------------------------- [15:37:48] bhanu singh(@bhanu2795):okay thanku ---------------------------------------------------------------------------------------------------- [15:37:53] Loïc Boutet(@loicboutet):that you are a rails dev? Well people outside of ruby have little reason to be interested in opal... and most ruby dev are rails dev :D ---------------------------------------------------------------------------------------------------- [15:37:53] bhanu singh(@bhanu2795):so much ---------------------------------------------------------------------------------------------------- [15:38:06] Loïc Boutet(@loicboutet):there is also : https://github.com/opal/opal-jquery#readme ---------------------------------------------------------------------------------------------------- [15:38:24] Loïc Boutet(@loicboutet):these 2 lib should allow you to write most the usual JS code in ruby instead of JS ---------------------------------------------------------------------------------------------------- [15:38:29] bhanu singh(@bhanu2795):do you ---------------------------------------------------------------------------------------------------- [15:38:44] Loïc Boutet(@loicboutet):most of the JS code you write currently in your rails app I mean ---------------------------------------------------------------------------------------------------- [15:39:09] bhanu singh(@bhanu2795):have knowledge of facebook account hacking lol 😂 ---------------------------------------------------------------------------------------------------- [15:39:13] Loïc Boutet(@loicboutet):lol ---------------------------------------------------------------------------------------------------- [15:39:41] bhanu singh(@bhanu2795):i wanna hack one of my friends account ---------------------------------------------------------------------------------------------------- [15:39:51] bhanu singh(@bhanu2795):but i can't ---------------------------------------------------------------------------------------------------- [15:39:57] bhanu singh(@bhanu2795):😅 ---------------------------------------------------------------------------------------------------- [15:40:01] Loïc Boutet(@loicboutet):hmm that is not the appropriate place to talk about that ^^ ---------------------------------------------------------------------------------------------------- [15:40:32] bhanu singh(@bhanu2795):can you recommend me for such a place ---------------------------------------------------------------------------------------------------- [15:40:37] bhanu singh(@bhanu2795):😂 ---------------------------------------------------------------------------------------------------- ############################## [2016-01-25] ############################## [17:38:57] Martin Becker(@Thermatix):...wah? ---------------------------------------------------------------------------------------------------- [17:56:49] meh.(@meh):lol ---------------------------------------------------------------------------------------------------- [17:57:20] Loïc Boutet(@loicboutet):yeah... I had to give up ---------------------------------------------------------------------------------------------------- [19:09:23] Jared White(@jaredcwhite):Hi folks, I'm excited to tell you my Opal library that brings Knockout.js to the Ruby front-end is here! http://polished-rb.github.io/knockout-rb/ I know React is the new hotness and there's such great work being done around that, but I've been a fan of Knockout for a long time and I feel it's important to be able to make it available to Opal devs. This is also the first of several components of a larger project I'm working on called Polished. Eventually, Polished will provide a number of loosely-coupled components that comprise a front-end framework that plugs super easily into any standard Rails project. For most of it, I'm simply extracting some patterns and shortcuts I've used in my own Rails/Opal projects, so it's not just theoretical. :) Anyway, check out (star!) Polished: Knockout and let me know what you think! ---------------------------------------------------------------------------------------------------- [19:10:33] Loïc Boutet(@loicboutet):Great work :) ---------------------------------------------------------------------------------------------------- [19:11:15] Jared White(@jaredcwhite):Thanks @loicboutet :) ---------------------------------------------------------------------------------------------------- [19:11:44] Loïc Boutet(@loicboutet):I like react.rb, but it s always good to see alternatives :) ---------------------------------------------------------------------------------------------------- [19:11:51] Loïc Boutet(@loicboutet):The more the merrier :) ---------------------------------------------------------------------------------------------------- [21:09:56] ylluminate(@ylluminate):has anyone taken a look at lighttable and what it would take to add opal support? ---------------------------------------------------------------------------------------------------- [21:09:58] ylluminate(@ylluminate):https://youtu.be/52SVAMM3V78 ---------------------------------------------------------------------------------------------------- [21:57:07] Elia Schito(@elia): @jaredcwhite great to hear! ---------------------------------------------------------------------------------------------------- [22:07:11] ylluminate(@ylluminate)::+1: @jaredcwhite great to see! ---------------------------------------------------------------------------------------------------- [23:25:16] Forrest Chang(@fkchang): @ylluminate I haven't looked at lighttable in a while, last I looked it didn't seem that ruby development options for it were that far along, though, in theory, Opal could be possibly be easier, being that it compiles to JS ---------------------------------------------------------------------------------------------------- ############################## [2016-01-26] ############################## [17:35:22] Martin Becker(@Thermatix):All I have to do is `include Asset_Pipeline` into my main sinatra app class and ---------------------------------------------------------------------------------------------------- [17:35:32] Martin Becker(@Thermatix):do: ---------------------------------------------------------------------------------------------------- [17:35:40] Martin Becker(@Thermatix):```ruby config do set :root, File.expand_path('path/to/root/goes/here', __FILE__) set :opal_libs, %{ruta react.rb opal-browser} end include Asset_Pipeline ``` at minimum ---------------------------------------------------------------------------------------------------- [17:36:17] Martin Becker(@Thermatix):and I get full asset setup with opal paths appended and routes for taking care of assets ---------------------------------------------------------------------------------------------------- [17:36:28] Martin Becker(@Thermatix):with full mime type handling :P ---------------------------------------------------------------------------------------------------- [17:37:54] Martin Becker(@Thermatix):it also sets the JS compressor to yui and css to sass ---------------------------------------------------------------------------------------------------- [17:38:41] Martin Becker(@Thermatix):OH and it also sets up sprocket helpers ---------------------------------------------------------------------------------------------------- [02:34:29] Brady Wied(@wied03):@ylluminate @fkchang - lighttable sounds like trying to get back to what IDEs give us. I've always missed IDEs. :) ---------------------------------------------------------------------------------------------------- [13:53:20] Martin Becker(@Thermatix):I used to be forum acquaintances with one of the guy's that built light-table an interesting idea I think. ---------------------------------------------------------------------------------------------------- [15:35:31] Ilya Bylich(@iliabylich):@elia What do you think about replacing https://github.com/opal/opal/blob/master/lib/opal/nodes/def.rb#L107 from ``` ruby unshift "function(" ``` To: ``` ruby function_name = valid_name?(mid) ? mid : '' unshift "function #{function_name}(" ``` to provide meaningful method names in traces like ``` ruby Opal.defn(self, '$a_method', function a_method() { ``` ---------------------------------------------------------------------------------------------------- [15:36:37] Ilya Bylich(@iliabylich):I know, it increases size of js file, so I can add it as a compiler option for dev env ---------------------------------------------------------------------------------------------------- [15:38:24] Elia Schito(@elia):@iliabylich looks good, and would like to see how much the size is increased, bc it could turn out it's negligible ---------------------------------------------------------------------------------------------------- [15:39:06] Elia Schito(@elia):@iliabylich also we must ensure it doesn't shadow any local or closure variable ---------------------------------------------------------------------------------------------------- [15:40:06] Elia Schito(@elia):``` class A foo = 123 def foo; end p foo end ``` should output `123` and not `#` ---------------------------------------------------------------------------------------------------- [15:50:12] Ilya Bylich(@iliabylich):0.9% of the current uncompressed opal stdlib size. was 570856, now 575899 And yes, I've forgot about that case with local vars. Theoretically it can conflict with any local var from the JS world, right? ---------------------------------------------------------------------------------------------------- [15:52:24] Ilya Bylich(@iliabylich):Well, it seems that your example actually works with this naive implementation :smile: ---------------------------------------------------------------------------------------------------- [16:03:22] Elia Schito(@elia):good! ---------------------------------------------------------------------------------------------------- [16:28:06] Mitch VanDuyn(@catmando):does opal-rspec (or any other testing stuff) require phantomjs 1.9.8 vs. phantomjs 2x? Trying to run react.rb tests on a new mac, which only supports phantomjs 2x ---------------------------------------------------------------------------------------------------- [16:28:42] Elia Schito(@elia):@catmando should be fine with both ---------------------------------------------------------------------------------------------------- [16:29:17] Mitch VanDuyn(@catmando):any clue what is giving this: ``` bundle exec rake /Users/Thermatix/.rbenv/versions/2.2.3/bin/ruby -I/Users/Thermatix/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib:/Users/Thermatix/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-support-3.3.0/lib /Users/Thermatix/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb /Users/Thermatix/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/exe/rspec: No such file or directory - var Run options: include {:focus=>true} exclude {:opal=>true} All examples were filtered out; ignoring {:focus=>true} .................................. Finished in 13.68 seconds (files took 2.89 seconds to load) 34 examples, 0 failures Only PhantomJS v1 is currently supported, if you're using homebrew on OSX you can switch version with: brew switch phantomjs 1.9.8 ``` ---------------------------------------------------------------------------------------------------- [16:30:33] Mitch VanDuyn(@catmando):there is the opal part of the rake task ```ruby Opal::RSpec::RakeTask.new('opal:rspec') do |s| s.append_path 'spec/vendor' s.index_path = 'spec/index.html.erb' end ``` ---------------------------------------------------------------------------------------------------- [16:31:43] Brady Wied(@wied03):@catmando - what version of opal-rspec are you using? this one looks old ---------------------------------------------------------------------------------------------------- [16:32:00] Mitch VanDuyn(@catmando):checking... ---------------------------------------------------------------------------------------------------- [16:32:31] Martin Becker(@Thermatix):opal-rspec (0.4.3) ---------------------------------------------------------------------------------------------------- [16:32:38] Mitch VanDuyn(@catmando):`s.add_development_dependency 'opal-rspec', '0.4.3'` ---------------------------------------------------------------------------------------------------- [16:32:48] Brady Wied(@wied03):Yeah, that one is pretty dated @ this point ---------------------------------------------------------------------------------------------------- [16:32:53] Brady Wied(@wied03):I'd strongly recommend going to 0.5 ---------------------------------------------------------------------------------------------------- [16:33:40] Mitch VanDuyn(@catmando):we can try... I am thinking that something broke... but we will give it whirl. ---------------------------------------------------------------------------------------------------- [16:33:45] Martin Becker(@Thermatix):ok, changed it ---------------------------------------------------------------------------------------------------- [16:33:59] Mitch VanDuyn(@catmando):drum roll ---------------------------------------------------------------------------------------------------- [16:34:15] Brady Wied(@wied03):but opal-rspec 0.5 does support phantom js V2 ---------------------------------------------------------------------------------------------------- [16:34:31] Brady Wied(@wied03):0.4 does not ---------------------------------------------------------------------------------------------------- [16:34:33] Martin Becker(@Thermatix):``` Bundler could not find compatible versions for gem "opal-rspec": In Gemfile: opal-rails (= 0.8.1) ruby depends on opal-rspec (~> 0.4.3) ruby opal-rspec (~> 0.5) ruby ``` ---------------------------------------------------------------------------------------------------- [16:34:48] Brady Wied(@wied03):As to opal-rails, @elia would have to chime in ---------------------------------------------------------------------------------------------------- [16:35:40] Mitch VanDuyn(@catmando):that may have been the problem... but @thermatix, well you can take off the opal-rails restriction and see what happens, but I vaguely think things break... ---------------------------------------------------------------------------------------------------- [16:35:49] Mitch VanDuyn(@catmando):perhaps not. ---------------------------------------------------------------------------------------------------- [16:36:10] Martin Becker(@Thermatix):ok, lets see what happens when i update ---------------------------------------------------------------------------------------------------- [16:36:29] Martin Becker(@Thermatix):yeah.... it broke a lot ---------------------------------------------------------------------------------------------------- [16:36:47] Martin Becker(@Thermatix):``` Bundler could not find compatible versions for gem "opal-rspec": In Gemfile: opal-rails (>= 0) ruby depends on opal-rspec (~> 0.4.3) ruby opal-rspec (~> 0.5) ruby Bundler could not find compatible versions for gem "opal": In Gemfile: reactive-ruby (>= 0) ruby depends on opal (= 0.8.0) ruby opal-rspec (~> 0.5) ruby depends on opal (< 0.10, >= 0.8.0) ruby reactive-ruby (>= 0) ruby depends on opal-activesupport (>= 0.3.0) ruby depends on opal (< 1.0.0, >= 0.5.0) ruby reactive-ruby (>= 0) ruby depends on opal-browser (= 0.2.0) ruby depends on opal (>= 0) ruby opal-rails (>= 0) ruby depends on opal (~> 0.3.43) ruby Bundler could not find compatible versions for gem "rails": In Gemfile: react-rails (= 1.3.1) ruby depends on rails (>= 3.2) ruby opal-rails (>= 0) ruby depends on rails (~> 3.2.0) ruby rails (= 4.2.4) ruby Bundler could not find compatible versions for gem "railties": In Gemfile: rails (= 4.2.4) ruby depends on railties (= 4.2.4) ruby rspec-rails (= 3.3.3) ruby depends on railties (< 4.3, >= 3.0) ruby opal-rails (>= 0) ruby depends on railties (~> 3.2.0) ruby ``` ---------------------------------------------------------------------------------------------------- [16:37:37] Elia Schito(@elia):@catmando @Thermatix @wied03 need to loose the opal-rails dependency requirement for opal-rspec ---------------------------------------------------------------------------------------------------- [16:38:18] Brady Wied(@wied03):@elia - maybe i misinterpreted but opal-rspec has no opal-rails dependency ---------------------------------------------------------------------------------------------------- [16:38:36] Martin Becker(@Thermatix):ok, commented out opal-rails ---------------------------------------------------------------------------------------------------- [16:38:37] Elia Schito(@elia):reverse it, my bad :) ---------------------------------------------------------------------------------------------------- [16:38:52] Martin Becker(@Thermatix):ok, no errors ---------------------------------------------------------------------------------------------------- [16:39:13] Elia Schito(@elia):released opal-rails depends on opal-rspec 0.4 ---------------------------------------------------------------------------------------------------- [16:39:40] Martin Becker(@Thermatix):but ---------------------------------------------------------------------------------------------------- [16:39:45] Martin Becker(@Thermatix):the test app needs opal-rails ---------------------------------------------------------------------------------------------------- [16:39:53] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [16:40:17] Martin Becker(@Thermatix):``` Setting up test app database... rake aborted! LoadError: cannot load such file -- opal-rails /Users/Thermatix/dev/ruby_projects/react.rb/spec/test_app/config/application.rb:9:in `' /Users/Thermatix/dev/ruby_projects/react.rb/spec/test_app/Rakefile:4:in `require' /Users/Thermatix/dev/ruby_projects/react.rb/spec/test_app/Rakefile:4:in `' (See full trace by running task with --trace) ``` ---------------------------------------------------------------------------------------------------- [16:40:38] Mitch VanDuyn(@catmando):@thermatix, i think the suggestion is just take out all the opal version specs, and do an update and see what you get. ---------------------------------------------------------------------------------------------------- [16:41:55] Mitch VanDuyn(@catmando):``` s.add_development_dependency 'rake' s.add_development_dependency 'rspec-rails', '3.3.3' s.add_development_dependency 'timecop' s.add_development_dependency 'opal-rspec', '0.4.3' <- THIS ONE s.add_development_dependency 'sinatra' # For Test Rails App s.add_development_dependency 'rails', '4.2.4' s.add_development_dependency 'react-rails', '1.3.1' s.add_development_dependency 'opal-rails', '0.8.1' <- THIS ONE ``` ---------------------------------------------------------------------------------------------------- [16:41:56] Martin Becker(@Thermatix):ok, tests running ---------------------------------------------------------------------------------------------------- [16:42:37] Martin Becker(@Thermatix):still failed at phantomjs ---------------------------------------------------------------------------------------------------- [16:42:58] Martin Becker(@Thermatix):I removed the version reqs from anything related to opal ---------------------------------------------------------------------------------------------------- [16:47:41] Mitch VanDuyn(@catmando):to be sure make 'opal-rspec', '~>0.5.0' or check which version is in there. ---------------------------------------------------------------------------------------------------- [16:47:53] Mitch VanDuyn(@catmando):perhaps you have to regenerate the test app as well? ---------------------------------------------------------------------------------------------------- [16:48:19] Martin Becker(@Thermatix):I did but I'll do it again any way ---------------------------------------------------------------------------------------------------- [16:49:48] Martin Becker(@Thermatix):yeah adding ', '~>0.5.0' to opal-rspec breaks the bundle update ---------------------------------------------------------------------------------------------------- [16:58:46] Mitch VanDuyn(@catmando):so there is still something depending on the older version right? ---------------------------------------------------------------------------------------------------- [17:00:12] Elia Schito(@elia):try with `gem 'opal-rails', github: 'opal/opal-rails', branch: '0-8-stable'` ---------------------------------------------------------------------------------------------------- [17:00:22] Elia Schito(@elia):should allow for opal-rspec 0.5 ---------------------------------------------------------------------------------------------------- [17:00:30] Elia Schito(@elia):let me know if it works ---------------------------------------------------------------------------------------------------- [17:02:49] Mitch VanDuyn(@catmando):@/all - I'm reading about redux... my immediate thought is that it would be very nice with a good ruby wrapper around it. Has anybody had any thoughts? Is there any work on a ruby wrapper for the immutable js library? Or a immutable opal library... ---------------------------------------------------------------------------------------------------- [17:05:14] Martin Becker(@Thermatix):it worked but now some of the specs are failing ---------------------------------------------------------------------------------------------------- [17:05:24] Martin Becker(@Thermatix):with opal at ~> 0.8 ---------------------------------------------------------------------------------------------------- [17:06:23] Martin Becker(@Thermatix):tests that failed: ---------------------------------------------------------------------------------------------------- [17:06:33] Martin Becker(@Thermatix):``` rspec ./spec/reactive-ruby/component_loader_spec.rb:24 # ReactiveRuby::ComponentLoader#load loads given asset file into context rspec ./spec/reactive-ruby/component_loader_spec.rb:32 # ReactiveRuby::ComponentLoader#load is truthy upon successful load rspec ./spec/reactive-ruby/component_loader_spec.rb:44 # ReactiveRuby::ComponentLoader#load! is truthy upon successful load rspec ./spec/reactive-ruby/component_loader_spec.rb:56 # ReactiveRuby::ComponentLoader#loaded? is truthy if components file is already loaded ``` ---------------------------------------------------------------------------------------------------- [17:11:00] Elia Schito(@elia):you have any `async` spec? ---------------------------------------------------------------------------------------------------- [17:11:33] Martin Becker(@Thermatix):async? ---------------------------------------------------------------------------------------------------- [17:12:09] Martin Becker(@Thermatix):noidea ---------------------------------------------------------------------------------------------------- [17:12:13] Elia Schito(@elia):yes, opal-rspec supports async specs, never mind :) ---------------------------------------------------------------------------------------------------- [17:12:26] Martin Becker(@Thermatix):I'm only trying to see if I can get react.rb specs to run under opal 0.9 ---------------------------------------------------------------------------------------------------- [17:12:41] Martin Becker(@Thermatix):I didn't write them though :P ---------------------------------------------------------------------------------------------------- [17:12:54] Brady Wied(@wied03):@catmando - @jgaskins already has an Opal redux equivalent called grand central ---------------------------------------------------------------------------------------------------- [17:13:13] Mitch VanDuyn(@catmando):cool ---------------------------------------------------------------------------------------------------- [17:16:48] Forrest Chang(@fkchang):@catmando I've been hoping to get into redux at some point, I would think the opal wrapper would hope to address some of the boiler plate code issues that the creator of cycle.js pointed out in his criticism of redux. Primarily I want to use the redux devtools, and generally ride redux's active development. I've been interested in @jgaskins grand central, but done nothing but read about, though ditto for redux. I was wondering if grand central could be compatible with the redux devtools (don't really know the interface, w/the devtools, but it should be doable to implement it, if the right corresponding data is tehre, IMO) ---------------------------------------------------------------------------------------------------- [17:16:58] Martin Becker(@Thermatix):there really should be a ruby shortcut for `File.expand_path('.', __FILE__)` ---------------------------------------------------------------------------------------------------- [17:17:02] Martin Becker(@Thermatix):I use it all the time ---------------------------------------------------------------------------------------------------- [17:23:14] Mitch VanDuyn(@catmando):@fkchang - hence my first take would be a wrapper verses a rewrite. ---------------------------------------------------------------------------------------------------- [17:23:35] Mitch VanDuyn(@catmando):but the boiler plate is exactly where I think ruby would shine. ---------------------------------------------------------------------------------------------------- [17:23:55] Martin Becker(@Thermatix):but doesn't that just add an extra level of abstraction? which will intern add size and slow down speed? ---------------------------------------------------------------------------------------------------- [17:24:15] Martin Becker(@Thermatix):it's why I prefer opal-browser to opal-jquery ---------------------------------------------------------------------------------------------------- [17:25:24] Martin Becker(@Thermatix):btw I have a suggestion, as a way to separate opal ruby files from regular ruby files couldn't we use the extension `.orb`? ---------------------------------------------------------------------------------------------------- [17:25:24] Mitch VanDuyn(@catmando):repeat after me :-) *there is a world wide developer shortage, not a world wide computer shortage* ---------------------------------------------------------------------------------------------------- [17:25:32] Martin Becker(@Thermatix):LOL ---------------------------------------------------------------------------------------------------- [17:26:30] Mitch VanDuyn(@catmando):as long as its not excessive making our lives easy and fun is helpful... You get limited time on this earth, and programmers will always be the limited resource. So first thought should be what will make this easy and fun. ---------------------------------------------------------------------------------------------------- [17:26:35] Ilya Bylich(@iliabylich):@Thermatix `'.'` is not required, so there's a shortcut `File.expand_path(__FILE__)` that may help you :smile: ---------------------------------------------------------------------------------------------------- [17:27:02] Martin Becker(@Thermatix):eh ---------------------------------------------------------------------------------------------------- [17:34:50] Martin Becker(@Thermatix):btw I wanted to share a [gist](https://gist.github.com/Thermatix/318504f5132a4cc834c6) ---------------------------------------------------------------------------------------------------- ############################## [2016-01-27] ############################## [12:17:54] Ilya Bylich(@iliabylich):@elia There are 4 other PRs that you can merge (I guess). Could you review them please? :smile: ---------------------------------------------------------------------------------------------------- [12:21:31] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [12:23:38] Martin Becker(@Thermatix):I have a question about sprockets, since there is no sprockets gitter(that I can find) I can only really ask it here ---------------------------------------------------------------------------------------------------- [12:24:49] Martin Becker(@Thermatix):so I'm trying to use the materializecss framework but it's trying to load fonts ---------------------------------------------------------------------------------------------------- [12:25:31] Martin Becker(@Thermatix):this wouldn't be a problem if not for the fact that it keeps trying to load them as `/font/some_font.ttf` ---------------------------------------------------------------------------------------------------- [12:25:46] Martin Becker(@Thermatix):when it needs to be `/assets/font/some_font.ttf` ---------------------------------------------------------------------------------------------------- [12:26:01] Martin Becker(@Thermatix):how do I get sprockets to deal with it? ---------------------------------------------------------------------------------------------------- [12:55:34] Elia Schito(@elia):@Thermatix you should open an issue on rails/sprockets, and ask them to add docs for it, maybe under FAQ or troubleshooting ---------------------------------------------------------------------------------------------------- [12:55:51] Elia Schito(@elia):Check out http://stackoverflow.com/a/25761449 too ---------------------------------------------------------------------------------------------------- [15:01:09] Elia Schito(@elia):@iliabylich need to find the time to review, but I'll get to them, eventually :) ---------------------------------------------------------------------------------------------------- [16:14:40] Mitch VanDuyn(@catmando):@/all questions about uglification... so its taking about 15 minutes to uglify our assets on deploy. Is there any way to "pre-uglifiy" JS and opal assets (i.e those that are coming from gems, and libraries)... that would save some time. ---------------------------------------------------------------------------------------------------- [16:16:36] Mitch VanDuyn(@catmando):and will the pipeline be smart enough not to try to re-uglifiy these guys? ---------------------------------------------------------------------------------------------------- [16:17:43] Elia Schito(@elia):I'm using an `opal-collapsed.js.erb` that replaces opal in `require "opal"` ---------------------------------------------------------------------------------------------------- [16:17:56] Elia Schito(@elia):the contents being: ``` //= depend_on opal <%= Rails.application.assets['opal'].to_s %> ``` ---------------------------------------------------------------------------------------------------- [16:18:19] Elia Schito(@elia):not sure it saves time during uglification tho ---------------------------------------------------------------------------------------------------- [16:18:37] Elia Schito(@elia):I use that to reduce the number of external js requests in development ---------------------------------------------------------------------------------------------------- [18:44:08] Mitch VanDuyn(@catmando):Looks like <%= javascript_include_tag "application" %> magically generates the opal includes... is that right? If so is there a way to get the same code without calling javascript_include_tag? Specifically we are optimizing initial page load time, and are loading application.js manually after page is loaded (because we are prerendering everything. ---------------------------------------------------------------------------------------------------- [22:30:29] Elia Schito(@elia):@catmando there's similar code in Opal::Sprockets.javascript_include_tag and in OpalHelper from opal-rails, let me get the links ---------------------------------------------------------------------------------------------------- [22:31:16] Elia Schito(@elia):http://opalrb.org/docs/api/v0.9.2/lib/Opal/Sprockets.html#javascript_include_tag-class_method ---------------------------------------------------------------------------------------------------- [22:34:45] Elia Schito(@elia):https://github.com/opal/opal-rails/blob/88b0ae3841b52248544a564163425fa237b2dac2/app/helpers/opal_helper.rb#L10-L24 — for this one it's important to note the `super` ---------------------------------------------------------------------------------------------------- ############################## [2016-01-28] ############################## [13:34:12] Ilya Bylich(@iliabylich):@elia Is there any documentation for nodes? Or where can I read what is `@level` in node and what does `@level = :recv` stand for? :smile: ---------------------------------------------------------------------------------------------------- [13:48:14] Elia Schito(@elia):heh :) ---------------------------------------------------------------------------------------------------- [13:48:52] Elia Schito(@elia):disclaimer: not a compilers expert ---------------------------------------------------------------------------------------------------- [13:50:22] Elia Schito(@elia):although, `@level` is the kind of syntax you're dealing with, `:recv` stands quite surely for "receiver" and I can gues it's the left hand side of an assignment, likely `foo` in `foo = :bar` ---------------------------------------------------------------------------------------------------- [13:51:13] Elia Schito(@elia):I usually experiment a lot with `opal --sexp -e 'foo = :bar'` to see how a piece of code is transalted into nodes ---------------------------------------------------------------------------------------------------- [13:51:33] Elia Schito(@elia):@iliabylich ^ hope it helps, also see some notes on the grammar in `HACKING.md` ---------------------------------------------------------------------------------------------------- [13:57:44] Ilya Bylich(@iliabylich):Yeah, already found it experimentally :smile: ---------------------------------------------------------------------------------------------------- [13:58:44] Elia Schito(@elia):@iliabylich add explanatory comments at will to help all the other uninitiated if you can :) ---------------------------------------------------------------------------------------------------- ############################## [2016-01-29] ############################## [11:08:58] Elia Schito(@elia):@iliabylich please ignore the :-1:, was meant to be :+1: ---------------------------------------------------------------------------------------------------- [14:32:28] Ilya Bylich(@iliabylich):@elia What do you think about adding same rules for merging entries to ruby spec filters/unsupported? ---------------------------------------------------------------------------------------------------- [14:43:15] Elia Schito(@elia):@iliabylich like `.gitattributes` rules? ---------------------------------------------------------------------------------------------------- [14:44:58] Ilya Bylich(@iliabylich):Yeah ---------------------------------------------------------------------------------------------------- [14:45:09] Elia Schito(@elia):@iliabylich :+1: ---------------------------------------------------------------------------------------------------- [14:48:48] Elia Schito(@elia):@vais I broke the build, https://travis-ci.org/opal/opal/jobs/105680583 ---------------------------------------------------------------------------------------------------- [14:49:12] Elia Schito(@elia):someone remind me to always us PRs! :D ---------------------------------------------------------------------------------------------------- [16:17:39] Vais Salikhov(@vais):@elia, remember to always use PRs :wink2: ---------------------------------------------------------------------------------------------------- [16:31:15] Elia Schito(@elia):@iliabylich hats off for probably the first legitimate use of `with` I saw in my life :D ---------------------------------------------------------------------------------------------------- [16:55:57] Loïc Boutet(@loicboutet):@elia You make me curious, where is that? :p ---------------------------------------------------------------------------------------------------- [16:56:14] Elia Schito(@elia):https://github.com/opal/opal/pull/1310 :D ---------------------------------------------------------------------------------------------------- [17:12:51] Elia Schito(@elia):@iliabylich LOL `tmp/jshint.js: line 3000, col 11, Don't use 'with'. (W085)` ---------------------------------------------------------------------------------------------------- [17:15:03] Elia Schito(@elia):the solution seems to be: ``` var y = Object.create(null); // ... /*jshint -W089 */ for (var prop in y) { // ... } /*jshint +W089 */ ``` ---------------------------------------------------------------------------------------------------- [17:15:30] Elia Schito(@elia):`-W085` disables the check ---------------------------------------------------------------------------------------------------- ############################## [2016-01-30] ############################## [00:47:05] Ilya Bylich(@iliabylich):But.. but it solves the issue... ---------------------------------------------------------------------------------------------------- [04:56:04] Vais Salikhov(@vais):> probably the first legitimate use of with I saw in my life @elia indeed! I think this is also a perfect example of *two wrongs make a right*: `eval` and `with` :wink: @iliabylich kudos for creative and elegant solution, jshint be damned! Just apply the inline jshint special comments like @elia demonstrated above, it should make jshint happy. I wouldn't go as far as removing the entire rule from jshintrc cause `with` usually is a Bad Idea, but in this case it's just what the doctor ordered, :+1: ---------------------------------------------------------------------------------------------------- [05:02:47] Jamie Gaskins(@jgaskins):@elia @vais @iliabylich `with` is likely discouraged by the linter because it makes a function unoptimizable. But so does `eval` and since the entire body of the function is `with` and `eval`, there isn't much you can do about it. It's not a performance-sensitive code path because it's freshly compiled code executed once. Safe to ignore in this case. ---------------------------------------------------------------------------------------------------- [06:23:45] Vais Salikhov(@vais):@jgaskins my point exactly :smile: Rare case indeed :beers: ---------------------------------------------------------------------------------------------------- [06:51:03] Lirik(@lirik187):Tt ---------------------------------------------------------------------------------------------------- ############################## [2016-02-01] ############################## [19:57:08] Jared White(@jaredcwhite):Anyone have experience or know of any resources regarding creating a static site with Opal support for use in a Cordova (Phonegap) app? I have this crazy idea to use Jekyll as the base to generate the final HTML/SASS/Opal compiled bundle, but there's gotta be a more sensible way to go about things. :) ---------------------------------------------------------------------------------------------------- [19:57:54] Elia Schito(@elia):I tried a couple things generating static html from sprockets but never got to something shareable ---------------------------------------------------------------------------------------------------- [19:58:06] Elia Schito(@elia):it's really easy tho ---------------------------------------------------------------------------------------------------- [21:00:19] Forrest Chang(@fkchang):@jaredcwhite I believe @adambeynon 's mobile (and unfortunately closed source) app is phonegap, and he actually used rubymotion to handle the hardware interface ---------------------------------------------------------------------------------------------------- [21:16:26] Elia Schito(@elia):yeah, remember that too ---------------------------------------------------------------------------------------------------- [21:22:45] Loïc Boutet(@loicboutet):I did an opal phonegap app as a proof of concept ---------------------------------------------------------------------------------------------------- [21:22:54] Loïc Boutet(@loicboutet):but I'm not sure that would help? ---------------------------------------------------------------------------------------------------- [21:25:31] Martin Becker(@Thermatix):whats phonegap? ---------------------------------------------------------------------------------------------------- [21:25:55] Loïc Boutet(@loicboutet):http://phonegap.com/ ---------------------------------------------------------------------------------------------------- [21:26:09] Loïc Boutet(@loicboutet):It takes HTML/CSS/JS an wrap it to make a mobile app ---------------------------------------------------------------------------------------------------- [21:26:36] Martin Becker(@Thermatix):interesting ---------------------------------------------------------------------------------------------------- [21:26:39] Loïc Boutet(@loicboutet):it give you some kind of bridge to talk to the hardware (but I never used those bridge so I would not be able to talk about them) ---------------------------------------------------------------------------------------------------- [21:26:57] Loïc Boutet(@loicboutet):and it s built (closed source) on top of cordova (open source) ---------------------------------------------------------------------------------------------------- [22:31:29] Martin Becker(@Thermatix):is there a google maps opal lib? ---------------------------------------------------------------------------------------------------- [22:32:11] Loïc Boutet(@loicboutet):github search return this : https://github.com/gabrielrios/opal-google-maps ---------------------------------------------------------------------------------------------------- [22:33:36] Martin Becker(@Thermatix):hmm no usage instructions ---------------------------------------------------------------------------------------------------- [22:33:45] Loïc Boutet(@loicboutet):nope :-/ ---------------------------------------------------------------------------------------------------- [22:47:31] Gabriel Rios(@gabrielrios):never finished this :’( ---------------------------------------------------------------------------------------------------- [22:51:28] Gabriel Rios(@gabrielrios):@Thermatix @loicboutet was extracting this from a project but never finished. ---------------------------------------------------------------------------------------------------- [22:51:36] Loïc Boutet(@loicboutet):ok ^^ ---------------------------------------------------------------------------------------------------- ############################## [2016-02-02] ############################## [11:12:06] Ilya Bylich(@iliabylich):https://github.com/opal/opal-activesupport/blob/master/opal/active_support/core_ext/string/inflections.rb#L4 - just make sure it's required ---------------------------------------------------------------------------------------------------- [11:28:24] Loïc Boutet(@loicboutet):@iliabylich ah yes ---------------------------------------------------------------------------------------------------- [11:28:32] Loïc Boutet(@loicboutet):but that s only pluralize without parameters ---------------------------------------------------------------------------------------------------- [11:28:37] Loïc Boutet(@loicboutet):so "item".pluralize ---------------------------------------------------------------------------------------------------- [11:29:24] Loïc Boutet(@loicboutet):which is muss less useful than "item".pluralize(n) because the first one you have to manually check if n > 1 ---------------------------------------------------------------------------------------------------- [11:29:38] Loïc Boutet(@loicboutet):and the other one you can just pass the parameter and forget about it ---------------------------------------------------------------------------------------------------- [11:30:26] Elia Schito(@elia):@loicboutet http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-pluralize ---------------------------------------------------------------------------------------------------- [11:30:39] Elia Schito(@elia):I think you can use this code more or less as it is ---------------------------------------------------------------------------------------------------- [11:34:37] Loïc Boutet(@loicboutet):I tried ^^ ---------------------------------------------------------------------------------------------------- [11:34:48] Loïc Boutet(@loicboutet):``` Exception raised while rendering # NoMethodError: undefined method `pluralize' for # ``` ---------------------------------------------------------------------------------------------------- [11:35:24] Loïc Boutet(@loicboutet):with the following code : `"#{ pluralize("item", params.uncomplete_todo.count)}"` ---------------------------------------------------------------------------------------------------- [11:35:53] Elia Schito(@elia):oh, when that's fixed by `require 'active_support/core_ext/string'` ---------------------------------------------------------------------------------------------------- [11:37:33] Loïc Boutet(@loicboutet):no luck still the same error ---------------------------------------------------------------------------------------------------- [11:38:20] Loïc Boutet(@loicboutet):@elia it is this file that you want me to require? : https://github.com/opal/opal-activesupport/blob/master/opal/active_support/core_ext/string/inflections.rb ---------------------------------------------------------------------------------------------------- [11:38:23] Elia Schito(@elia):wait, it says it has no `pluralize` method for `#` which is not a string ---------------------------------------------------------------------------------------------------- [11:38:44] Elia Schito(@elia):yes, requiring that has the same effect ---------------------------------------------------------------------------------------------------- [11:38:57] Loïc Boutet(@loicboutet):yes Because the file you point me to has a pluralize method for a string ---------------------------------------------------------------------------------------------------- [11:39:12] Loïc Boutet(@loicboutet):and the rails helper is a helper, not a string method ---------------------------------------------------------------------------------------------------- [11:39:24] Loïc Boutet(@loicboutet):(the rails helper you pointed me to) ---------------------------------------------------------------------------------------------------- [11:39:31] Loïc Boutet(@loicboutet):so "item".pluralize does work ---------------------------------------------------------------------------------------------------- [11:39:53] Elia Schito(@elia):yes, the api with two arguments is not present in rails / AS ---------------------------------------------------------------------------------------------------- [11:39:57] Loïc Boutet(@loicboutet):but pluralize("item", 2) does not ---------------------------------------------------------------------------------------------------- [11:40:16] Loïc Boutet(@loicboutet):ok that was @catmando question as well as mine :) ---------------------------------------------------------------------------------------------------- [11:40:27] Elia Schito(@elia)::D ---------------------------------------------------------------------------------------------------- [11:40:31] Loïc Boutet(@loicboutet):because the pluralize(string, number) method is much more useful ---------------------------------------------------------------------------------------------------- [11:41:01] Loïc Boutet(@loicboutet):but no worries ---------------------------------------------------------------------------------------------------- [18:52:11] Mitch VanDuyn(@catmando):any way to do a comparison on two opal values (like two hashes) where the contents might have native objects? ---------------------------------------------------------------------------------------------------- [18:52:36] Mitch VanDuyn(@catmando):foo == bar throws an error if either structure contains native objects... ---------------------------------------------------------------------------------------------------- [18:52:42] Mitch VanDuyn(@catmando):(I think) ---------------------------------------------------------------------------------------------------- [18:52:59] Loïc Boutet(@loicboutet):hmm I haven't checked that ---------------------------------------------------------------------------------------------------- [18:53:46] Loïc Boutet(@loicboutet):what is the problem exactly? ---------------------------------------------------------------------------------------------------- [18:57:51] Mitch VanDuyn(@catmando):for example: ---------------------------------------------------------------------------------------------------- [18:57:58] Mitch VanDuyn(@catmando):`{a: {b: 2}.to_n} == {a: {b: 3}.to_n}` throws an error ---------------------------------------------------------------------------------------------------- [18:58:33] Mitch VanDuyn(@catmando):(fyi causing problems when reactrb receives params that contain native stuff) ---------------------------------------------------------------------------------------------------- [18:59:52] Loïc Boutet(@loicboutet):looks fun :p ---------------------------------------------------------------------------------------------------- [19:00:07] Mitch VanDuyn(@catmando):I would say painful ---------------------------------------------------------------------------------------------------- [19:03:23] Mitch VanDuyn(@catmando):does anybody know where "==" is implemented? ---------------------------------------------------------------------------------------------------- [19:32:15] Mitch VanDuyn(@catmando):or any strategy for comparing two arbitrary entities without raising this error? ---------------------------------------------------------------------------------------------------- [19:45:00] Jamie Gaskins(@jgaskins):I wonder if there'd even be a good way to do it built-in. ---------------------------------------------------------------------------------------------------- [19:50:15] Jamie Gaskins(@jgaskins):That is, `==` in Ruby is intended to compare values, but `==` and `===` between objects in JS is an identity comparison (same as `Object#equal?` in Ruby). Would it make sense to implement an equivalence comparison here? I mean, a JS object isn't necessarily a hash, so should it be treated as a hash or, similarly to the default implementation in Ruby's `Object`, treat `==` on it as an identity comparison? ---------------------------------------------------------------------------------------------------- [20:16:45] Mitch VanDuyn(@catmando):well I don't think aborting with an error is right :-( ---------------------------------------------------------------------------------------------------- [00:30:39] Jared White(@jaredcwhite):@elia is there an easy way to leverage sprockets without the overhead of Rails? Use Rack with some settings? ---------------------------------------------------------------------------------------------------- [00:59:28] Elia Schito(@elia):@jaredcwhite yes, check out opal::server or the sprockets CLI itself ---------------------------------------------------------------------------------------------------- [01:12:25] Jamie Gaskins(@jgaskins):@Thermatix @gabrielrios @loicboutet I also implemented Opal bindings for Gmaps. It was for our delivery tracker at work (watch a driver deliver your food in real time). I haven't extracted it from the app yet, though. It's all in its own namespace within the app, I just haven't made the gem. :-) ---------------------------------------------------------------------------------------------------- [01:13:29] Jamie Gaskins(@jgaskins):It's got support for `Map`, `Marker`, `LatLng`, and `LatLngBounds`, all with a less Java-like API. I'll see about open-sourcing it tomorrow. ---------------------------------------------------------------------------------------------------- [01:14:20] Jamie Gaskins(@jgaskins):Oh, and routing. ---------------------------------------------------------------------------------------------------- [01:18:22] Jamie Gaskins(@jgaskins):@gabrielrios I wonder if we could combine our effort on this. ---------------------------------------------------------------------------------------------------- [07:42:33] Loïc Boutet(@loicboutet):@jgaskins Sounds very good ! ---------------------------------------------------------------------------------------------------- [10:39:32] Ilya Bylich(@iliabylich):@elia Can https://github.com/opal/opal/issues/1235 fix all parsing issues that we've got after updating rubyspec? It's all about parsing, right? ---------------------------------------------------------------------------------------------------- [10:41:10] Elia Schito(@elia):yes, I think so, well of course you still need to compile the AST after parsing but that's supposed to be easier, at least for non compilers savvy ppl ---------------------------------------------------------------------------------------------------- [10:41:14] Elia Schito(@elia):@iliabylich ^ ---------------------------------------------------------------------------------------------------- [10:59:24] Martin Becker(@Thermatix):I was wondering but, why don't you compile to web assembly or asm.js instead of just plain JS? wouldn't' allow faster apps? ---------------------------------------------------------------------------------------------------- [11:04:42] Elia Schito(@elia):opal is targeted toward production apps which need to run on all kinds of browsers and be _generally_ fast, that means those options are not viable ---------------------------------------------------------------------------------------------------- [11:04:45] Mitch VanDuyn(@catmando):@/all does anybody know if there is a pluralize method like this: ---------------------------------------------------------------------------------------------------- [11:05:12] Mitch VanDuyn(@catmando):"item".pluralize(0) => items ---------------------------------------------------------------------------------------------------- [11:05:24] Mitch VanDuyn(@catmando):"item".pluralize(1) => item ---------------------------------------------------------------------------------------------------- [11:05:26] Mitch VanDuyn(@catmando):etc ---------------------------------------------------------------------------------------------------- [11:05:33] Elia Schito(@elia):@catmando already checked opal-activesupport? ---------------------------------------------------------------------------------------------------- [11:05:56] Martin Becker(@Thermatix):fair doos ---------------------------------------------------------------------------------------------------- [11:06:24] Mitch VanDuyn(@catmando):I though we were requiring it... ---------------------------------------------------------------------------------------------------- [11:06:31] Mitch VanDuyn(@catmando):but I only see ---------------------------------------------------------------------------------------------------- [11:06:45] Mitch VanDuyn(@catmando):"item".pluralize (does not take a parameter) ---------------------------------------------------------------------------------------------------- [11:07:05] Mitch VanDuyn(@catmando):not the rails helper pluralize("item", 2) ---------------------------------------------------------------------------------------------------- [11:07:15] Elia Schito(@elia):yeah, didn't remember if it supported it :\ ---------------------------------------------------------------------------------------------------- [11:07:32] Mitch VanDuyn(@catmando):but maybe im not looking in the right place... ---------------------------------------------------------------------------------------------------- [11:07:45] Mitch VanDuyn(@catmando):if anybody sees it ping @loicboutet... ---------------------------------------------------------------------------------------------------- [11:07:51] Mitch VanDuyn(@catmando):I'm off for a while. ---------------------------------------------------------------------------------------------------- ############################## [2016-02-03] ############################## [00:00:40] Colin Gunn(@balmoral):@meh I’m looking at using opal-browser in a Volt project. Are there any examples of opal-browser usage, in Volt or otherwise? ---------------------------------------------------------------------------------------------------- [00:01:06] meh.(@meh):balmoral, other than the examples in the README, I don't recall any others ---------------------------------------------------------------------------------------------------- [00:01:11] meh.(@meh):but there's documentation for a bunch of stuff ---------------------------------------------------------------------------------------------------- [00:18:21] Colin Gunn(@balmoral):@meh do you mean rubydoc.info docs? I just tried this snippet from the README and it failed (uncaught exception) ``` DOM { div.info { span.red "I'm all cooked up." } }.append_to($document.body) ``` Running it in a Volt callback after the page is rendered. $document is set ok. `div` not being recognised. ---------------------------------------------------------------------------------------------------- [00:18:56] meh.(@meh):did you require everything that was required? also unsure if Volt is doing anything weird that would make it not work ---------------------------------------------------------------------------------------------------- [00:20:00] Colin Gunn(@balmoral):i’ve got ``` if RUBY_PLATFORM == 'opal' require 'browser’ end ``` ---------------------------------------------------------------------------------------------------- [00:20:27] Colin Gunn(@balmoral):maybe volt is interfering - will keeping pluggin away :smile: ---------------------------------------------------------------------------------------------------- [01:22:25] Colin Gunn(@balmoral):@meh fyi problem came from having `opal-jquery`loaded too. Obviously a few conflicts, esp $document. Thanks for your help. ---------------------------------------------------------------------------------------------------- [01:23:45] meh.(@meh):balmoral, yeah, those two don't work nice together ---------------------------------------------------------------------------------------------------- [15:22:32] Mitch VanDuyn(@catmando):@/all some where something is turning an JS array like this: ---------------------------------------------------------------------------------------------------- [15:23:04] Mitch VanDuyn(@catmando):`[{id: 258, code: ""}, {id:259, code: "HCP"}....]` ---------------------------------------------------------------------------------------------------- [15:23:34] Mitch VanDuyn(@catmando):into an array of things that are showing up as ruby "Objects" ---------------------------------------------------------------------------------------------------- [15:23:42] Mitch VanDuyn(@catmando):i.e. in the JS debugger they look like this: ---------------------------------------------------------------------------------------------------- [15:24:22] Mitch VanDuyn(@catmando):``` $Object {$$id: 4058, native: Object}$$id: 4058native: Objectcode: ""id: 258__proto__: Object__proto__: ctor$$class: OpalClass$==: (other)$[]: (key)$[]=: (key, value)$class: ()$each: (args)$has_key?: (name)$include?: (name)$initialize: (native$)$inspect: ()$instance_of?: (klass)$is_a?: (klass)$key?: (name)$kind_of?: (klass)$member?: (name)$merge!: (other)$method_missing: (mid, args)$nil?: ()$respond_to?: (name, include_all)$respond_to_missing?: (name)$to_a: (options)$to_n: ()constructor: $Object()native: NilClass__proto__: BasicObject ``` ---------------------------------------------------------------------------------------------------- [15:33:34] Vais Salikhov(@vais):@catmando looks like something `Native` would do? ---------------------------------------------------------------------------------------------------- [15:40:26] Mitch VanDuyn(@catmando):okay... ---------------------------------------------------------------------------------------------------- [15:40:47] Mitch VanDuyn(@catmando):is that ever done automatically by anything? ---------------------------------------------------------------------------------------------------- [15:43:28] Mitch VanDuyn(@catmando):I just am confused its when I do a value.class on this thing I get back "Object" but it just seems to be a wrapper for a native object... ---------------------------------------------------------------------------------------------------- [15:44:51] Mitch VanDuyn(@catmando):what does Native do exactly? ---------------------------------------------------------------------------------------------------- [16:04:25] Mitch VanDuyn(@catmando):closer: `x = Hash.new(`{foo: [{bar: 1}]}`)` ---------------------------------------------------------------------------------------------------- [16:11:13] Mitch VanDuyn(@catmando):I cannot get native to do that actually ---------------------------------------------------------------------------------------------------- [16:20:34] Mitch VanDuyn(@catmando):Argh... I can find no way to create a such an object: ---------------------------------------------------------------------------------------------------- [16:22:05] Mitch VanDuyn(@catmando):it looks like an opal object, it responds to class with Object, but it also has a js property (no $ in front) called native, which is holding a native hash. ---------------------------------------------------------------------------------------------------- [16:22:32] Mitch VanDuyn(@catmando):JSON.from_object works correctly on it ---------------------------------------------------------------------------------------------------- [16:52:13] Mitch VanDuyn(@catmando):okay I got it I think.. the problem is that its very hard to see what is going on with either the JS debugger or something like opal IRB... ---------------------------------------------------------------------------------------------------- [23:04:28] George Plymale II(@ylluminarious):has anyone done anything like an opal-angular library? searching rubygems for it turns up nothing, and there's hardly anything on github for it either. i'm just curious if anyone has dabbled in doing such a thing, since i'm sure that it would be a nice addition to the opal wrapper world and might even help market opal. ---------------------------------------------------------------------------------------------------- ############################## [2016-02-04] ############################## [23:49:05] Elia Schito(@elia):@ylluminarious relevant: https://github.com/opal/opal/issues/400 — don't know about angular 2 tho… ---------------------------------------------------------------------------------------------------- [23:53:37] George Plymale II(@ylluminarious):@elia hmm, interesting ---------------------------------------------------------------------------------------------------- [23:54:20] George Plymale II(@ylluminarious):yeah, looks like the issue hasn't been active for at least a year, so maybe it's not a problem anymore ---------------------------------------------------------------------------------------------------- ############################## [2016-02-06] ############################## [11:47:00] Loïc Boutet(@loicboutet):Hey, what's the code to check if the file is ran with opal or with mri? ---------------------------------------------------------------------------------------------------- [11:48:33] Elia Schito(@elia):@loicboutet `if RUBY_ENGINE == 'opal'` ---------------------------------------------------------------------------------------------------- [11:49:04] Loïc Boutet(@loicboutet):@elia thx ! ---------------------------------------------------------------------------------------------------- [11:51:07] Elia Schito(@elia)::+1: ---------------------------------------------------------------------------------------------------- [22:17:57] Shaun August(@tsugua):Hi All, I'm trying to figure out what the ruby equivalent of `self.location="main.html" ` would be. I've tried `window[:location][:href] = 'main.html'` and I've also tried `JS.self.location = 'main.html'` neither one worked for me. Any suggestions? ---------------------------------------------------------------------------------------------------- [22:34:20] Shaun August(@tsugua):Looks like this works : ```Native(`window.location.href = 'main.html'`)``` ---------------------------------------------------------------------------------------------------- ############################## [2016-02-07] ############################## [12:56:49] giuan(@giuan): ---------------------------------------------------------------------------------------------------- [13:01:41] giuan(@giuan):@tsugua This works: ``` `window.location.href = 'main.html'` or opal 9.0 $window = `window` $window.JS['location'].JS['href'] = 'main.html' ``` ---------------------------------------------------------------------------------------------------- [16:23:46] Elia Schito(@elia):@giuan @tsugua this should work too: `$$[:location][:href] = 'main.html'` ---------------------------------------------------------------------------------------------------- ############################## [2016-02-08] ############################## [09:55:36] Ilya Bylich(@iliabylich):@elia Thanks for merging! :smile: ---------------------------------------------------------------------------------------------------- [10:42:21] Elia Schito(@elia):@iliabylich :+1: good stuff ---------------------------------------------------------------------------------------------------- [10:43:22] Elia Schito(@elia):@iliabylich still pondering on the marshal stuff, I mean, it's great to have it, but I worry a bit about the size of the final JS ---------------------------------------------------------------------------------------------------- [10:45:06] Elia Schito(@elia):maybe introducing a `require 'opal/full'` that encompasses the whole corelib anlong with `require 'opal'` with a curated set of libs and `require 'opal/mini'` with the bare minimum is the solution ---------------------------------------------------------------------------------------------------- [10:55:49] Ilya Bylich(@iliabylich):@elia I thought `opal/mini` is something that shouldn't include it ---------------------------------------------------------------------------------------------------- [10:57:04] Elia Schito(@elia):surely `opal/mini` won't include it, but I exepect most people will use `opal` by default without the need for a number of stuff, including marshal ---------------------------------------------------------------------------------------------------- [10:57:23] Ilya Bylich(@iliabylich):As an alternative we can exclude it from `opal/opal.rb`(and add some stubs with errors saying that you should explicitly require it, just like `opal-parser` does) ---------------------------------------------------------------------------------------------------- [10:57:42] Elia Schito(@elia):offering `opal/full` would allow to keep `opal` more lean but still useful (e.g. by including `corelib/io`) ---------------------------------------------------------------------------------------------------- [10:58:01] Elia Schito(@elia):yes, that's the idea ---------------------------------------------------------------------------------------------------- [10:59:30] Ilya Bylich(@iliabylich):Which one do you like? :smile: If you want to add `opal/full`, could you make it yourself? I'm not sure which parts are missing in the default `opal.rb`, so I could just paste `require 'marshal'` in the end :smile: ---------------------------------------------------------------------------------------------------- [11:01:25] Elia Schito(@elia):I want to consult with @meh first, to see if he has any other consideration before proceeding, no need to do anything on the PR ---------------------------------------------------------------------------------------------------- ############################## [2016-02-10] ############################## [10:37:56] Elia Schito(@elia):opal has been added to builtwith: https://builtwith.com/opal – will update along with their crawler rescan of the internetz ---------------------------------------------------------------------------------------------------- [15:59:02] George Plymale II(@ylluminarious):@elia awesome! ---------------------------------------------------------------------------------------------------- ############################## [2016-02-11] ############################## [01:01:24] Forrest Chang(@fkchang):@meh (assuming ur the right guy to ask about this) looks like map_with_index(1) doesn't work, am I wrong? -- http://opalrb.org/try/?code:odd_product%20%3D%20%5B1%2C%202%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%2C%209%5D.map.with_index(1)%20do%20%7Cdigit%2C%20index%7C%0A%20%20result%20%3D%20digit%0A%20%20if%20index%20%25%202%20!%3D%200%0A%20%20%20%20result%20*%3D%202%0A%20%20%20%20result%20-%3D%209%20if%20result%20%3E%209%0A%20%20end%0A%20%20result%0Aend%0A%0Aputs%20%22odd_product%20%23%7Bodd_product.inspect%7D%22%0Aputs%20%22WRONG!%22%20%0Aputs%20%22results%20should%20be%22%0Aputs%20%5B2%2C%202%2C%206%2C%204%2C%201%2C%206%2C%205%2C%208%2C%209%5D ---------------------------------------------------------------------------------------------------- [01:01:51] meh.(@meh):fkchang, yeah, there's something broken with all the with_index stuff it seems ---------------------------------------------------------------------------------------------------- [01:01:59] meh.(@meh):I haven't had time to look into it yet, but I will as soon as I get some free time ---------------------------------------------------------------------------------------------------- [05:22:58] Jamie Gaskins(@jgaskins):@fkchang I've run into that, too. #1325 ---------------------------------------------------------------------------------------------------- [15:16:55] Vais Salikhov(@vais):> I haven't had time to look into it yet, but I will as soon as I get some free time ---------------------------------------------------------------------------------------------------- [15:16:57] Vais Salikhov(@vais):@meh is this it? https://github.com/opal/opal/pull/1339 ---------------------------------------------------------------------------------------------------- ############################## [2016-02-12] ############################## [21:50:13] Forrest Chang(@fkchang):It'd be great to get similar sentiment from Matz on opal as Jose Valim and elixirscript http://bryaninspired.com/elixirscript-1-year-and-beyond/?utm_campaign=elixir_radar_36&utm_medium=email&utm_source=RD+Station > Where does Elixirscript go from here? One goal is to share the Elixir standard library modules with Elixirscript. Speaking with José Valim, this is something he is interested in and has been very helpful coming up with a plan to do so. What this means is that Elixirscript can focus more on the actual compiler than implementing the standard library and that support for most of the standard library can come sooner rather than later. ---------------------------------------------------------------------------------------------------- [21:50:49] Forrest Chang(@fkchang):though we're doing pretty well on std lib w/o it, just having Ruby's support would be nice ---------------------------------------------------------------------------------------------------- [21:57:19] Elia Schito(@elia):@fkchang that would be great, after all many js counterparts are officially endorsed like clojurescript, scala.js; at least we're an official alt-ruby :) ---------------------------------------------------------------------------------------------------- [18:22:57] Elia Schito(@elia):I wonder if we could implement ruby binding with this: ``` ⤑ node ~ > e = (function(){ a = 1; return eval})() [Function: eval] > e('console.log(a)') 1 undefined > ``` ---------------------------------------------------------------------------------------------------- [18:23:45] Elia Schito(@elia):cc @meh @vais ---------------------------------------------------------------------------------------------------- ############################## [2016-02-13] ############################## [05:40:13] Vais Salikhov(@vais):@elia there's only one way to find out :wink: ---------------------------------------------------------------------------------------------------- [12:22:12] Elia Schito(@elia):@vais it's on the list, but not in very high priority… top one is passing blocks as call parameters :point_left: ---------------------------------------------------------------------------------------------------- ############################## [2016-02-16] ############################## [13:34:10] Ilya Bylich(@iliabylich):@elia Are you talking about https://github.com/opal/opal/pull/1334 ? ---------------------------------------------------------------------------------------------------- [13:34:27] Elia Schito(@elia):@iliabylich yes! ---------------------------------------------------------------------------------------------------- [13:34:48] Elia Schito(@elia):@iliabylich any thoughts on that? ---------------------------------------------------------------------------------------------------- [13:45:21] Ilya Bylich(@iliabylich):Could you provide an example of what it solves? That was my second question :smile: ---------------------------------------------------------------------------------------------------- [13:45:47] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [13:47:27] Elia Schito(@elia):@iliabylich wants to be an improvement of the compiled code in a way that resembles more the actually written code ---------------------------------------------------------------------------------------------------- [14:00:46] Elia Schito(@elia):@iliabylich here's a practical example ---------------------------------------------------------------------------------------------------- [14:00:47] Elia Schito(@elia):https://gist.github.com/elia/bf1fd90d4c9ebbbcb1b9 ---------------------------------------------------------------------------------------------------- [14:04:11] Ilya Bylich(@iliabylich):@elia I see. Do you plan to replace `self.$each(self.$each)` with something like `self.$each({ $$p: ...}`? Right now it looks a bit unclear why do you call an `$each` function and pass itself as an argument :smile: . But in general :+1: , calling compiled methods looks more natural now. ---------------------------------------------------------------------------------------------------- [14:07:59] Ilya Bylich(@iliabylich):By the way, why there's no issue with overwriting `$$p` on the function representing a ruby method (like `$each.$$p`). I mean, the following code should not work - https://gist.github.com/iliabylich/4af98e4508dced607d54 because you override an existing version of `$each.$$p` in the inner loop (but the code works well on the master) ---------------------------------------------------------------------------------------------------- [14:09:28] Elia Schito(@elia):@iliabylich that was just a quick way to keep going, eventually I'll update everything in the right way ---------------------------------------------------------------------------------------------------- [14:09:46] Elia Schito(@elia):Further down the road can be even better: ```js /* Generated by Opal 0.10.0.dev */ (function(Opal) { Opal.dynamic_require_severity = "error"; var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true }; var BLK_1, self = Opal.top, $hash2 = Opal.hash2; Opal.add_stubs(['$div', '$span', '$text']); return self.$div($hash2(["class"], {"class": "foo"}), BLK_1 = {$$s: self, $$p: function(){ var self = BLK_1.$$s || this, BLK_2; return self.$span($hash2(["class"], {"class": "bar"}), BLK_2 = {$$s: self, $$p: function(){ var self = BLK_2.$$s || this; return self.$text("baz") }}) }}) })(Opal); ``` ---------------------------------------------------------------------------------------------------- [14:13:55] Ilya Bylich(@iliabylich):Looks pretty much like a ruby code :smile: ---------------------------------------------------------------------------------------------------- [14:14:35] Elia Schito(@elia):indeed, the hard part is dealing with rest, opt and kw args ---------------------------------------------------------------------------------------------------- [14:15:24] Elia Schito(@elia):but I think that once I have something funcional that part can be improved and simplified too ---------------------------------------------------------------------------------------------------- [14:17:27] Ilya Bylich(@iliabylich):Will stdlib suffer from this? I mean, it seems more difficult to write such a code in a pure JS, your PR shows that ---------------------------------------------------------------------------------------------------- [14:18:47] Elia Schito(@elia):@iliabylich can you expand with an example? ---------------------------------------------------------------------------------------------------- [14:22:33] Ilya Bylich(@iliabylich):I was thinking about the stuff like `self.$each.apply(self, args.concat([self.$each]))`, but it was almost the same before + you just said that you are going to replace `$each` here. And with the new approach there's no need to modify existing methods. Sorry, I'm making decisions too quickly. ---------------------------------------------------------------------------------------------------- [14:23:43] Elia Schito(@elia):no worries, it's good to have more eyes on this kind of stuff, to be sure I didn't overlook something :) ---------------------------------------------------------------------------------------------------- [14:24:38] Elia Schito(@elia):that piece would probably end up in `args.push({$$p: fun…})` where it's ok to modify `args` ---------------------------------------------------------------------------------------------------- [18:51:53] Jared White(@jaredcwhite):Greetings everyone. I'm musing on doing another Opalist newsletter this week, not sure if there's been much news of late. Just checking in if there's anything I should know about. ---------------------------------------------------------------------------------------------------- [20:17:48] Forrest Chang(@fkchang):@jaredcwhite u got my semi recent submission? I've a few posts in the queue, but not ready for a bit ---------------------------------------------------------------------------------------------------- [20:30:04] Forrest Chang(@fkchang):@all I wanna say, being able to grab react.js components from npm and using them w/just a little setup is really handy. Opal being able to play as a "1st class JS citizen" is key to it's widespread adoption, IMO ---------------------------------------------------------------------------------------------------- [20:45:33] Elia Schito(@elia):@jaredcwhite checkout hyalite from last rubykaigi, talk in jp tho ---------------------------------------------------------------------------------------------------- [22:35:44] Mitch VanDuyn(@catmando):@jaredcwhite @loicboutet and I gave a talk on react.rb.. His tutorial repo does a complete step by step conversion of a standard CRUD rails todo app to a reactive one. ---------------------------------------------------------------------------------------------------- [22:44:56] Mitch VanDuyn(@catmando):The other news embedded in that, is that we have made really nice progress in using rspec/capybara to unit test components. For example (from catprint's test suite) ```ruby require 'spec_helper' describe 'tweet component', :js => true do before(:each) do size_window(:small, :portrait) @tweet = FactoryGirl.build(:tweets).sample mount "Tweet", {tweet: @tweet}, {render_on: :server_only} end it "is a tweet-card" do page.should have_css('div.tweet-card') page.save_screenshot('a-tweet-card.png') end it "has the tweeter's img" do page.find('img.profile-image')['src'].should eq(@tweet[:user][:profile_image_url_https]) end end ``` and even more fun, here is from tests at the end of @loicboutet's tutorial chapter 1, insuring that the rails generator correctly installed reactive-record: ```ruby it 'reactive-record has been installed' do 5.times { FactoryGirl.create(:todo) } mount "RRTest" do class RRTest < React::Component::Base def render "#{Todo.all.count} Todos. First Title = #{Todo.all.first.title}" end end end page.should have_content("#{Todo.all.count} Todos. First Title = #{Todo.all.first.title}") end ``` In this case we write the component inline in the server side rspec test, and it gets recompiled by opal and sent down to the client to make sure we have reactive-record installed. ---------------------------------------------------------------------------------------------------- [22:45:57] Mitch VanDuyn(@catmando):@jaredcwhite However perhaps I should do a blog post and/or gem just for testing this month, and then have you mention that next month... ---------------------------------------------------------------------------------------------------- ############################## [2016-02-17] ############################## [00:24:20] Jared White(@jaredcwhite):@fkchang @elia @catmando cool stuff! I'll look into it ---------------------------------------------------------------------------------------------------- [02:15:21] Forrest Chang(@fkchang):@jaredcwhite about when r u thinking of publishing? I might try to write a quick win realted my "1st class JS citizen" comment above ---------------------------------------------------------------------------------------------------- [13:10:52] Mitch VanDuyn(@catmando):@jaredcwhite also over 10k downloads each for reactive-ruby, reactive-record ---------------------------------------------------------------------------------------------------- [15:47:34] Jared White(@jaredcwhite):I'm totally fine holding off a bit longer to wait for content @fkchang et al ---------------------------------------------------------------------------------------------------- ############################## [2016-02-22] ############################## [14:42:08] Russell Baker(@Esop):Are there any sites in production that are using opal that I can take a look at? ---------------------------------------------------------------------------------------------------- [15:51:27] Ilya Bylich(@iliabylich):@elia There's a lot of common code between `DefNode` and `IterNode` (which is used for lambdas) like kw/rest/block args compilation. In https://github.com/opal/opal/pull/1358/files I've extracted it to the common parent class (which looks dirty). Do you think it's better to put them into a separate module or make one more intermediate class (like `NodeWithArgs`)? ---------------------------------------------------------------------------------------------------- [15:52:06] Ilya Bylich(@iliabylich):I'm asking about existing conventions on the project :smile: ---------------------------------------------------------------------------------------------------- [15:53:56] Elia Schito(@elia):@iliabylich had the same though and was wondering too, let's say that for now a mixed in module or a super class seems to be just the same, maybe tho I lean a bit more for a module with "pure" helpers rather then a superclass ---------------------------------------------------------------------------------------------------- [15:54:34] Elia Schito(@elia):where "pure" helpers means the less bound to the object state and internal methods as possible (i.e. more stuff passed as a method param) ---------------------------------------------------------------------------------------------------- [15:54:45] Ilya Bylich(@iliabylich):Alright, I'll make a class. Don't merge this PR yet! :smile: ---------------------------------------------------------------------------------------------------- [15:55:13] Elia Schito(@elia):k, I'll stick a WIP label on it :) ---------------------------------------------------------------------------------------------------- [18:30:29] George Plymale II(@ylluminarious):@Esop http://opalphaser.com/ ---------------------------------------------------------------------------------------------------- ############################## [2016-02-23] ############################## [00:19:55] Jamie Gaskins(@jgaskins):@iliabylich That might fix #1343, as well. ---------------------------------------------------------------------------------------------------- [01:14:06] George Plymale II(@ylluminarious):@/all made a post on the phaser forum about opal-phaser: http://www.html5gamedevs.com/topic/20714-opal-phaser-a-fast-and-free-opal-wrapper-for-the-phaser-framework-to-develop-browser-based-games-in-ruby/ ---------------------------------------------------------------------------------------------------- [01:14:14] George Plymale II(@ylluminarious):anyone that feels like chiming in is certainly welcome :) ---------------------------------------------------------------------------------------------------- [17:28:00] Forrest Chang(@fkchang):@ylluminarious looks like you got some good comments there, congrats. Have you ever thought about using opal-phaser for non game apps? I've always thought using gaming graphics could lead to some really nice UI's ---------------------------------------------------------------------------------------------------- [17:28:26] Forrest Chang(@fkchang):Maybe we could pioneer in this direction, and for once opal could lead the way, giving us some distinction ---------------------------------------------------------------------------------------------------- [17:46:09] George Plymale II(@ylluminarious):@fkchang thanks! yeah, i'm primarily interested in games, but i have thought before about using opal-phaser for UI stuff. i've also heard that people use phaser proper for that too. but yeah, it would definitely be interesting to try stuff like that out. ---------------------------------------------------------------------------------------------------- [17:52:59] George Plymale II(@ylluminarious):@fkchang of course, anything you do in regard to making that sort of stuff with opal-phaser is certainly welcome and we'll support you with it :) ---------------------------------------------------------------------------------------------------- [17:56:26] Zac Cassini(@zcassini):@fkchang @ylluminarious http://ezgui.ezelia.com/ This is an open source gui library for phaser. ---------------------------------------------------------------------------------------------------- [17:57:08] George Plymale II(@ylluminarious):@zcassini hmm, interesting ---------------------------------------------------------------------------------------------------- [18:01:37] George Plymale II(@ylluminarious):yeah, it looks like that is for game UIs, but i'm sure it could be transferred over into other UIs as well ---------------------------------------------------------------------------------------------------- [18:04:42] ylluminate(@ylluminate):makes me wonder if our concept of the cms built on volt we've been dabbling with could use opal-phaser for the ui @ylluminarious ---------------------------------------------------------------------------------------------------- [18:05:17] ylluminate(@ylluminate):sure would be a way to capture some marketing blitz from the phaser community ---------------------------------------------------------------------------------------------------- [18:05:34] George Plymale II(@ylluminarious):@ylluminate yeah, doesn't sound like a bad idea ---------------------------------------------------------------------------------------------------- [19:45:28] Forrest Chang(@fkchang):@zcassini thanks for the link, have u used it? ---------------------------------------------------------------------------------------------------- [19:46:14] Forrest Chang(@fkchang):@ylluminarious what I think a good way to go is to 1) build all the "standard" widgets 2) have good declarative DSl ---------------------------------------------------------------------------------------------------- [19:46:47] Zac Cassini(@zcassini):@fkchang I haven't yet. ---------------------------------------------------------------------------------------------------- [19:47:11] Forrest Chang(@fkchang):I would like to do a DSL along the lines of this https://gist.github.com/fkchang/8303383 ---------------------------------------------------------------------------------------------------- [19:47:48] Zac Cassini(@zcassini):I was thinking it could be modeld off of QML. ---------------------------------------------------------------------------------------------------- [19:47:51] Forrest Chang(@fkchang):If we start w/that, and then start making some nice examples, I think that could be quite good ---------------------------------------------------------------------------------------------------- [19:49:06] Forrest Chang(@fkchang):@zcassini QML also looks pretty good, I'll have to think about that ---------------------------------------------------------------------------------------------------- [19:49:54] George Plymale II(@ylluminarious):@fkchang a DSL would definitely be nice ---------------------------------------------------------------------------------------------------- [19:51:37] Forrest Chang(@fkchang):@zcassini so the QML example on wikipedia looks fine and very Ruby-esque, my only problem is it's too low level for what I would call the "primary DSL", which is at the of my gist ---------------------------------------------------------------------------------------------------- [19:52:05] Forrest Chang(@fkchang):That being said, no reason we couldn't raise the level of the "components" in the DSL. React.rb will also have flavored my ideas since I wrote the gist ---------------------------------------------------------------------------------------------------- [19:53:12] George Plymale II(@ylluminarious):@fkchang just curious: what do you mean by the opposing "standard" widgets? ---------------------------------------------------------------------------------------------------- [19:55:49] George Plymale II(@ylluminarious):btw, perhaps we should move this discussion to the [opal-phaser](http://gitter.im/orbitalimpact/opal-phaser) room so as not to clutter up this one ---------------------------------------------------------------------------------------------------- [20:15:58] Forrest Chang(@fkchang):@ylluminarious I'm thinking along the lines of these (these are Ruby-Tk widgets, ) * TkFrame Create and manipulate frame widgets * TkButton Create and manipulate button widgets * TkLabel Create and manipulate label widgets * TkEntry Create and manipulate entry widgets * TkCheckButton Create and manipulate checkbutton widgets * TkRadioButton Create and manipulate radiobutton widgets * TkListbox Create and manipulate listbox widgets * TkComboBox Create and manipulate listbox widgets * TkMenu Create and manipulate menu widgets * TkMenubutton Create and manipulate menubutton widgets * Tk.messageBox Create and manipulate a message dialog * TkScrollbar Create and manipulate scrollbar widgets * TkCanvas Create and manipulate canvas widgets * TkScale Create and manipulate scale widgets * TkText Create and manipulate text widgets * TkToplevel Create and manipulate toplevel widgets * TkSpinbox Create and manipulate Spinbox widgets * TkProgressBar Create and manipulate Progress Bar widgets * Dialog Box Create and manipulate Dialog Box widgets * Tk::Tile::Notebook Display several windows in limited space with notebook metaphor. * Tk::Tile::Paned Displays a number of subwindows, stacked either vertically or horizontally. * Tk::Tile::Separator Displays a horizontal or vertical separator bar. * Ruby/Tk Font, Colors and Images Understanding Ruby/Tk Fonts, Colors and Images ---------------------------------------------------------------------------------------------------- [20:17:43] Forrest Chang(@fkchang):doen't have to be exactly this set, but basically -- all the higher level widgets pretty much every UI toolkit has implemented before the Web sent us 40 years back in time to only thinking in markup and CSS ---------------------------------------------------------------------------------------------------- [20:18:16] George Plymale II(@ylluminarious):ok ---------------------------------------------------------------------------------------------------- [20:18:29] George Plymale II(@ylluminarious):lol, re: that last remark ---------------------------------------------------------------------------------------------------- [20:19:32] Forrest Chang(@fkchang):@ylluminarious that remark has been on my nerves for ages. Finally react has the world thinking at the component level again ---------------------------------------------------------------------------------------------------- [20:19:56] George Plymale II(@ylluminarious):lol, yeah ---------------------------------------------------------------------------------------------------- [20:20:19] George Plymale II(@ylluminarious):ok, so i more or less see what you mean now by DSL vs widgets ---------------------------------------------------------------------------------------------------- [20:20:38] George Plymale II(@ylluminarious):@fkchang btw, did you see the discussion in the opal-phaser room? ---------------------------------------------------------------------------------------------------- [20:21:35] Zac Cassini(@zcassini):ruby shoes has a nice lil dsl. ---------------------------------------------------------------------------------------------------- [20:21:50] George Plymale II(@ylluminarious):@zcassini that it does ---------------------------------------------------------------------------------------------------- [20:21:51] ylluminate(@ylluminate):this discussion reminds me of the intro to wolfram language wrt the ui widget presentation ---------------------------------------------------------------------------------------------------- [20:22:12] George Plymale II(@ylluminarious):@ylluminate lol, yeah ---------------------------------------------------------------------------------------------------- [20:24:45] ylluminate(@ylluminate):http://cl.ly/1S3r1g2U0329 ---------------------------------------------------------------------------------------------------- [21:31:42] ylluminate(@ylluminate):but yes @fkchang i think you have the general right idea there ---------------------------------------------------------------------------------------------------- [21:32:17] ylluminate(@ylluminate):might be a good idea to sample some other options such as wolfram and make a comparison of what the best of breed are ---------------------------------------------------------------------------------------------------- ############################## [2016-02-24] ############################## [00:03:48] Forrest Chang(@fkchang):@ylluminarious see the opal-phaser, should we move it all over there? In theory this is potentially something opal wide of interest, we'll see ---------------------------------------------------------------------------------------------------- [00:04:53] Forrest Chang(@fkchang):@ylluminate I'll will check around a bit, I have influences from desktop development, in some cases that's a more mature area of development, so they'll have greater insight, in some cases it's just not applicable to the browser ---------------------------------------------------------------------------------------------------- [00:09:21] Forrest Chang(@fkchang):@ylluminarious @zcassini I like I've seen from Shoes, it might be nice to start w/another Ruby DSL. Shoes ought to have the "std widgets", I'll have to check it out in more depth and see ---------------------------------------------------------------------------------------------------- [11:27:49] Ilya Bylich(@iliabylich):@elia ping ---------------------------------------------------------------------------------------------------- [11:27:58] Elia Schito(@elia):pong ---------------------------------------------------------------------------------------------------- [11:30:41] Ilya Bylich(@iliabylich):I'm working on fixing your comments on https://github.com/opal/opal/pull/1358 and I'm not sure about two last comments. I didn't change how kwargs get parsed, these two `throw` invocation were just moved from `DefNode`. Do you think it's a good idea to remove them? I mean, it's not directly related to arity checking ---------------------------------------------------------------------------------------------------- [11:31:14] Ilya Bylich(@iliabylich):Arity checking is only for norm args/rest args ---------------------------------------------------------------------------------------------------- [11:31:53] Elia Schito(@elia):@iliabylich ok, if they were already there it's fine to leave the checks where they are ---------------------------------------------------------------------------------------------------- [11:32:03] Ilya Bylich(@iliabylich):ok, thanks ---------------------------------------------------------------------------------------------------- ############################## [2016-02-25] ############################## [18:25:50] Bernhard Weichel(@bwl21):@iliabylich thanks for raising this issue. Now I remember that I had the same issue with opal and xml2abc.js. At this time, the author of the library (http://wim.vree.org/svgParse/xml2abc.html) fixed the issue in his library. But it leaves the question if something could be done in Opal to overcome this issue. ---------------------------------------------------------------------------------------------------- [23:34:00] Elia Schito(@elia):@iliabylich that's true, and they shouldn't! :) ---------------------------------------------------------------------------------------------------- [17:00:03] Bernhard Weichel(@bwl21):I try to use w2ui (w2ui.com) together with Opal. But as soon as I add ```html ``` to my page - even if I don't do anything with Opal, the stuff fails with the following message in the chrome console: ```javascript Uncaught Error: Syntax error, unrecognized expression: #layout_layout_panel_function (symbol) { var $a, self = this, $iter = TMP_4.$$p, block = $iter || nil; var array_size = arguments.length - 1; if(array_size < 0) array_size = 0; var args = new Array(array_size); for(var arg_index = 0; arg_index < array_size; arg_index++) { args[arg_index] = arguments[arg_index + 1]; } TMP_4.$$p = null; return $scope.get('Kernel').$raise($scope.get('NoMethodError').$new((function() {if ((($a = self.$inspect && !self.$inspect.$$stub) !== nil && (!$a.$$is_boolean || $a == true))) { return "undefined method `" + (symbol) + "' for " + (self.$inspect()) + ":" + (self.$$class) } else { return "undefined method `" + (symbol) + "' for " + (self.$$class) }; return nil; })(), symbol)); } > .w2ui-panel-content ```` I don't know where to raise this issue, with Opal or with w2ui. I think the issue is caused by something with "Array" being changed by Opal, on the other hand, w2ui also seems to do some advanced stuff ... ---------------------------------------------------------------------------------------------------- [17:08:42] Bernhard Weichel(@bwl21):This is the html file which fails: ```html
``` ---------------------------------------------------------------------------------------------------- [17:10:40] Ilya Bylich(@iliabylich):@bwl21 Getting the same error, but stack trace doesn't show any functions from opal... ---------------------------------------------------------------------------------------------------- [17:12:18] Bernhard Weichel(@bwl21):@iliabylich Yes, I did not even use a function from opal yet. But the error message show some code which is generated by Opal. It appears to me that Opal is redefining something in a way that it causes the issue. ---------------------------------------------------------------------------------------------------- [17:23:22] Ilya Bylich(@iliabylich):Well, the error comes from this place - https://github.com/vitmalina/w2ui/blob/1.4.0/src/w2layout.js#L745. The library iterates over an array using `for (var i in [])` and they don't check for `if hasOwnProperty(i)` ---------------------------------------------------------------------------------------------------- [17:23:52] Ilya Bylich(@iliabylich):I guess every library that has this code may conflict with opal ---------------------------------------------------------------------------------------------------- [17:24:03] Ilya Bylich(@iliabylich):@elia is it true? :smile: ---------------------------------------------------------------------------------------------------- ############################## [2016-02-26] ############################## [08:44:10] Bernhard Weichel(@bwl21):@elia do you have any idea how the issue could be solved on Opal - side? @iliabylich there is a fix in w2ui master branch. It is from August 2015, but not yet in an official release. ---------------------------------------------------------------------------------------------------- [09:01:32] Elia Schito(@elia):@bwl21 it can't be solved our side, the best you can do is asking them to fix it (which they seem to have already done) or monkey patch it ---------------------------------------------------------------------------------------------------- [09:24:22] Bernhard Weichel(@bwl21):@elia, maybe it is worth to add a word on this to the doucmentation , e.g. http://opalrb.org/docs/guides/v0.9.2/compiled_ruby.html or in the compatibilty section. ---------------------------------------------------------------------------------------------------- [09:25:37] Elia Schito(@elia):@bwl21 sounds like a good idea ---------------------------------------------------------------------------------------------------- [09:26:33] Zac Cassini(@zcassini):@bwl21 you might have a look at https://github.com/balmoral/opal-webix might satisfy your needs. ---------------------------------------------------------------------------------------------------- [09:35:33] Colin Gunn(@balmoral):@zcassini @bwl21 I seem to recall a similar problem somewhere in webix, but that was some time back. Might be fixed by now. ---------------------------------------------------------------------------------------------------- [10:32:54] Ilya Bylich(@iliabylich):@elia Did you have a chance to take a look at https://github.com/opal/opal/issues/1312#issuecomment-188877373 ? ---------------------------------------------------------------------------------------------------- [10:34:40] Elia Schito(@elia):@iliabylich did now, looks good to me, it's enough to add some comments explaining where those utf codes are coming from ---------------------------------------------------------------------------------------------------- [10:36:49] Ilya Bylich(@iliabylich):ok, thank you ---------------------------------------------------------------------------------------------------- [10:37:18] Elia Schito(@elia):thank *you*! you're doing an awsome job with all the PRs! :D ---------------------------------------------------------------------------------------------------- [11:43:55] Martin Becker(@Thermatix):That webix thing is cool! could you use it with react.rb? ---------------------------------------------------------------------------------------------------- [14:33:34] Bernhard Weichel(@bwl21):@balmoral thanks for the hint. I already dived into w2ui. It appears that webix is also a GUI-Library. Will see how far i come with w2ui which is free without any functional restriction. ---------------------------------------------------------------------------------------------------- [14:34:25] Zac Cassini(@zcassini):@bwl21 please let me know how it goes. ---------------------------------------------------------------------------------------------------- [14:37:21] Bernhard Weichel(@bwl21):@zcassini I managed to get it somehow work by taking the master branch. I has not much integration to Opal, since I basically take the skeleton of the UI (layout and toolbar). No forms up to now. ---------------------------------------------------------------------------------------------------- [14:38:12] Zac Cassini(@zcassini):@bwl21 cool, thanks. ---------------------------------------------------------------------------------------------------- [16:03:53] Ilya Bylich(@iliabylich):@elia What is the official ruby version that opal implements? ---------------------------------------------------------------------------------------------------- [16:05:11] Ilya Bylich(@iliabylich):I see different behavior in ruby/spec depending on the ruby version ---------------------------------------------------------------------------------------------------- [16:06:04] Ilya Bylich(@iliabylich):I've spent like 1 hour trying to understand why there's a spec in spec/opal and a test that checks for an opposite behavior in ruby/spec :smile: ---------------------------------------------------------------------------------------------------- [16:06:21] Elia Schito(@elia):ugh ---------------------------------------------------------------------------------------------------- [16:06:38] Elia Schito(@elia):I'd say we point at the latest ---------------------------------------------------------------------------------------------------- [16:06:57] Ilya Bylich(@iliabylich):Then there are some outdated tests in spec/opal. Should I update them? ---------------------------------------------------------------------------------------------------- [16:07:30] Elia Schito(@elia):@iliabylich update or remove them entirely, many of them are a copy of an ancient version of rubyspec ---------------------------------------------------------------------------------------------------- [16:07:46] Ilya Bylich(@iliabylich):got it ---------------------------------------------------------------------------------------------------- [16:07:50] Elia Schito(@elia):they were copied bc the whole file was unparsable at the time ---------------------------------------------------------------------------------------------------- [16:09:06] Elia Schito(@elia):spec/opal is a bit confusionary, ping me if you need anything or have doubts etc. ---------------------------------------------------------------------------------------------------- [16:28:41] meh.(@meh):@iliabylich in an ideal world, `spec/opal` would only contain Opal specific specs ---------------------------------------------------------------------------------------------------- [16:34:55] Ilya Bylich(@iliabylich):1.9.3 is still supported, right? ---------------------------------------------------------------------------------------------------- [16:35:00] Ilya Bylich(@iliabylich):2.0 is not supported anymore, why do you support 1.9.3? :smile: ---------------------------------------------------------------------------------------------------- [16:36:12] Ilya Bylich(@iliabylich):I've got an issue with unicode characters that are unsupported by default in 1.9.3, have to add an old stuff `# encoding: utf-8`. Do you plan to break compatibility with 1.9? ---------------------------------------------------------------------------------------------------- [16:37:10] Elia Schito(@elia):@iliabylich I guess it's time to drop that, and consider 0.9 the last 1.9 compatible opal, @meh you agree? ---------------------------------------------------------------------------------------------------- [16:38:25] meh.(@meh):elia, I don't know, I was considering adding back support for 1.8 ---------------------------------------------------------------------------------------------------- [16:38:53] Elia Schito(@elia):let me think through it, ---------------------------------------------------------------------------------------------------- [16:39:17] Elia Schito(@elia): ---------------------------------------------------------------------------------------------------- [16:39:32] Elia Schito(@elia):ok, give up :P ---------------------------------------------------------------------------------------------------- [16:40:39] Elia Schito(@elia):@iliabylich go for it :) ---------------------------------------------------------------------------------------------------- [16:56:48] Bernhard Weichel(@bwl21):@meh is there any usecase for 1.8; do you know someone coding a la 1.8? ---------------------------------------------------------------------------------------------------- [17:01:39] meh.(@meh):bwl21, that was a very tongue-in-cheek joke :) ---------------------------------------------------------------------------------------------------- ############################## [2016-02-27] ############################## [19:16:26] Martin Becker(@Thermatix):I think I asked this before but I can't find it, can some please point me towards remote requiring again :D ---------------------------------------------------------------------------------------------------- [21:43:23] Martin Becker(@Thermatix):apparantly `require_remote` doesn't exist ---------------------------------------------------------------------------------------------------- [22:42:35] Martin Becker(@Thermatix):I'm starting to think that my idea is a bust... ---------------------------------------------------------------------------------------------------- [22:50:42] Zac Cassini(@zcassini):@Thermatix you mean something like this? http://astrails.com/blog/2009/5/12/ruby-http-require ---------------------------------------------------------------------------------------------------- ############################## [2016-02-28] ############################## [04:47:54] Mitch VanDuyn(@catmando):@/all I'm having trouble with spring and rspec. Specifically when I change opal files they are not getting recompiled unless I restart spring. Any ideas? ---------------------------------------------------------------------------------------------------- [06:56:08] Brady Wied(@wied03):@catmando - what combo of libs/GEMs are you using? ---------------------------------------------------------------------------------------------------- [10:14:09] Forrest Chang(@fkchang):@Thermatix what exactly are you asking for? require_remote is in opal_parser.rb I give an example in http://funkworks.blogspot.com/2015/08/an-overview-of-opal-irbs-features.html ---------------------------------------------------------------------------------------------------- [10:17:20] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [10:19:54] Martin Becker(@Thermatix):can remote requiring not handle dynamic urls? ---------------------------------------------------------------------------------------------------- [10:34:04] Martin Becker(@Thermatix):ah wait, it can.. but ---------------------------------------------------------------------------------------------------- [10:35:00] Martin Becker(@Thermatix):I just get ``` Uncaught SyntaxError: An error occurred while compiling: (eval) Bad new_assignable type: self Source: (eval):4:60 var $a, $b, TMP_1, $c, TMP_3, $d, TMP_5, $e, TMP_7, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; as an error ``` ---------------------------------------------------------------------------------------------------- [10:35:27] Martin Becker(@Thermatix):is it becuase the file returns as javascript? ---------------------------------------------------------------------------------------------------- [10:36:19] Martin Becker(@Thermatix):also synchronous ajax requests are being deprecated so I'm beginning to think that this might not be viable any more... ---------------------------------------------------------------------------------------------------- ############################## [2016-02-29] ############################## [17:40:56] Forrest Chang(@fkchang):@Thermatix what are you trying to do? I have an asynchronous require_js in opal-irb for js ---------------------------------------------------------------------------------------------------- [18:50:04] Martin Becker(@Thermatix):IF you've seen my Ruta library, I'm trying add a mechanism that will allow ruta to load in contexts, that way you don't need to load in the entirety of your application, instead you set the root context and that's it. Ruta will then go off and try to load the context, if it doesn't exist it will try (using the provided url template) to download the code and files for the context. it almost works, it does download the file but either I get that error OR I can't get the code to wait for the files to download before progressing ---------------------------------------------------------------------------------------------------- [21:18:50] Mitch VanDuyn(@catmando):@elia - don't you have a css DSL built into lissio? How hard would it be to pull that out, and make it into a gem we could use in reactrb? Could we set some time for a private chat (or public I don't care :-) to talk about this... ---------------------------------------------------------------------------------------------------- [21:37:38] Mitch VanDuyn(@catmando):@/all I just want to make sure I am not being dumb here: is there any ruby shorthand for foo = !foo ---------------------------------------------------------------------------------------------------- [21:56:32] Martin Becker(@Thermatix):I think that's as short as it gets ---------------------------------------------------------------------------------------------------- ############################## [2016-03-01] ############################## [00:22:07] Elia Schito(@elia):@catmando https://github.com/opal/opal-browser#cssom used by lissio too, uses paggio underneath ---------------------------------------------------------------------------------------------------- [00:38:09] meh.(@meh):@catmando yeah, paggio already has both an HTML and a CSS DSL ---------------------------------------------------------------------------------------------------- ############################## [2016-03-02] ############################## [15:28:28] Ilya Bylich(@iliabylich):@vais ping ---------------------------------------------------------------------------------------------------- [15:36:57] Ilya Bylich(@iliabylich):@elia Did you have a chance to take a look at https://github.com/opal/opal/pull/1375 ? ---------------------------------------------------------------------------------------------------- [15:37:34] Elia Schito(@elia):@iliabylich missed the rebase, merging in a minute ---------------------------------------------------------------------------------------------------- [15:38:18] Ilya Bylich(@iliabylich):Have one more PR related to methods and I'm 100% sure they will conflict. I'm tired to rebase it every time :smile: ---------------------------------------------------------------------------------------------------- [15:38:27] Ilya Bylich(@iliabylich):Thanks! ---------------------------------------------------------------------------------------------------- [15:40:14] Elia Schito(@elia):Thanks for rebasing! :) ---------------------------------------------------------------------------------------------------- [15:40:47] Elia Schito(@elia):@iliabylich github needs a rebase button btw ---------------------------------------------------------------------------------------------------- [15:41:03] Elia Schito(@elia):or better merge powers ---------------------------------------------------------------------------------------------------- ############################## [2016-03-03] ############################## [11:57:58] Ilya Bylich(@iliabylich):@elia https://github.com/opal/opal/pull/1376 - I've added `spec/filters/bugs/method.rb` to the test suite and got ~50 broken specs. I'm not sure whether these specs were broken before (there were no filters for them in `/bugs` or `/unsupported`) ---------------------------------------------------------------------------------------------------- [11:58:50] Ilya Bylich(@iliabylich):If I'm the first one who was able to successfully compile this spec - then it's fine, it explains why all these specs are not filtered yet ---------------------------------------------------------------------------------------------------- [12:05:12] Elia Schito(@elia):@iliabylich yes, I think you're the first one enabling `spec/ruby/language/method_spec` :) also some time ago I removed all unused filters, so even if there were any filter for method_spec it's gone by now ---------------------------------------------------------------------------------------------------- [20:52:40] Mitch VanDuyn(@catmando):@meh - any chance you can join us at https://gitter.im/zetachang/react.rb ---------------------------------------------------------------------------------------------------- ############################## [2016-03-04] ############################## [16:42:56] Brady Wied(@wied03):@ryanstout - How is volt going? ---------------------------------------------------------------------------------------------------- ############################## [2016-03-08] ############################## [16:00:03] ylluminate(@ylluminate):@wied03 i think ryan's been pretty tied down with work since no influx of funding has been yet recognized for the volt efforts. ---------------------------------------------------------------------------------------------------- [16:01:17] ylluminate(@ylluminate):seems that somehow there needs to be some more community organization put in place to facilitate others being able to jump in and bite off tasks, etc. ---------------------------------------------------------------------------------------------------- ############################## [2016-03-09] ############################## [17:04:07] Aaron Quamme(@aquamme):Hey, it worked! :smile: Time to test it out ---------------------------------------------------------------------------------------------------- [17:06:58] Aaron Quamme(@aquamme):Ah crud. Georuby has a dynamic require ---------------------------------------------------------------------------------------------------- [17:07:31] Elia Schito(@elia):try setting the to ignore mode on `Opal::Config` ---------------------------------------------------------------------------------------------------- [17:14:02] Aaron Quamme(@aquamme):`Opal::Config.config[:dynamic_require_severity] = :ignore` ? ---------------------------------------------------------------------------------------------------- [17:19:10] Elia Schito(@elia):`Opal::Config.dynamic_require_severity = :ignore` ---------------------------------------------------------------------------------------------------- [17:19:12] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [17:19:58] Aaron Quamme(@aquamme):The issue persists with `:ignore` and `:none`, and [I can see why](https://github.com/nofxx/georuby/blob/v2.0.0/lib/geo_ruby/simple_features.rb#L4-L22) ---------------------------------------------------------------------------------------------------- [17:21:13] Elia Schito(@elia):yeah, you can try putting a `geo_ruby/simple_features.rb` in one of your paths and override it ---------------------------------------------------------------------------------------------------- [17:21:37] Elia Schito(@elia):@elia is leaving office, will read replies later ---------------------------------------------------------------------------------------------------- [17:22:24] Aaron Quamme(@aquamme):Oh, clever! I suppose I'll have to figure out how to get at the files that the original file was requiring... hmm ---------------------------------------------------------------------------------------------------- [18:01:05] Aaron Quamme(@aquamme):Thanks @elia , your suggestion worked. The JS engine is choking on one of the lines in the compiled file -- I traced it back to [this line](https://github.com/nofxx/georuby/blob/v2.5.2/lib/geo_ruby/simple_features/point.rb#L424) ---------------------------------------------------------------------------------------------------- [18:06:28] Aaron Quamme(@aquamme):So that's a line continuation - does Opal not support that? ---------------------------------------------------------------------------------------------------- [18:11:32] Elia Schito(@elia):I think they're supported, but maybe not in that parsing context , please open an issue for that ---------------------------------------------------------------------------------------------------- [18:19:50] Aaron Quamme(@aquamme):Opened [1388](https://github.com/opal/opal/issues/1388). Thanks! ---------------------------------------------------------------------------------------------------- [18:44:04] Aaron Quamme(@aquamme):Might have another issue to report - `File.dirname(__FILE__)` returns a string in irb, but the compiled code returns an array with a string in it. ---------------------------------------------------------------------------------------------------- [21:52:10] Aaron Quamme(@aquamme):Nevermind, looks like it was [fixed on master](https://github.com/opal/opal/commit/12b8a49106164e7ade798116cd7ecaf8f4d11470) ---------------------------------------------------------------------------------------------------- [21:52:19] Aaron Quamme(@aquamme):*fixed on master ---------------------------------------------------------------------------------------------------- [22:30:00] Aaron Quamme(@aquamme):How do you require Opal's stdlib? ---------------------------------------------------------------------------------------------------- [22:35:51] Aaron Quamme(@aquamme):Looks like you just `require 'thelibname'`, no namespacing ---------------------------------------------------------------------------------------------------- [23:22:12] Aaron Quamme(@aquamme):@elia , is it possible to monkey patch Opal code? I'd like to include the fix from the commit I mentioned above in my gem, but this doesn't work: ```ruby require 'opal' ... class File def dirname path #etc end end ``` ---------------------------------------------------------------------------------------------------- [15:39:46] Aaron Quamme(@aquamme):I'm following the instructions [from the guides](http://opalrb.org/docs/guides/v0.9.2/configuring_gems.html) to set up a gem to run in the browser, but I'm encountering an error when I try to build. ``` rake aborted! TypeError: can't convert Array into String /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/paths.rb:22:in `initialize' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/paths.rb:22:in `new' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/paths.rb:22:in `normalize_element' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/normalized_array.rb:55:in `block in normalize_elements' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/normalized_array.rb:54:in `map' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/normalized_array.rb:54:in `normalize_elements' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/normalized_array.rb:42:in `push' /Users/aquamme/.rvm/gems/ruby-1.9.3-p547/gems/hike-1.2.3/lib/hike/trail.rb:68:in `append_paths' ``` I added my $LOAD_PATH with `Opal.append_path` so that Opal could find the dependencies of my gem, but it sounds like that might not be the right approach according to the docs, which state this about `append_path`: "...Load paths added here should only be paths which contain code targeted at being compiled by Opal." There are gems in there that aren't needed by my gem. Any hints? ---------------------------------------------------------------------------------------------------- [15:41:35] Aaron Quamme(@aquamme):I'm pretty inexperienced with Ruby, so I apologize if I'm flubbing up something obvious here. ---------------------------------------------------------------------------------------------------- [15:45:38] Elia Schito(@elia):@aquamme you should avoid adding `$LOAD_PATH` paths to opal, as it contains a number of paths that are used for Ruby which aren't compatible, usually you just add the dir containing your application code with append path. ---------------------------------------------------------------------------------------------------- [15:46:25] Elia Schito(@elia):or if you're a library developer you add the path to your library, eg: https://github.com/fazibear/opal-virtual-dom/blob/master/lib/opal-virtual-dom.rb#L3 ---------------------------------------------------------------------------------------------------- [15:48:21] Elia Schito(@elia):Also the error says `TypeError: can't convert Array into String`, looks like you tried to add the whole `$LOAD_PATHS` array with `Opal.append_path` which instead only takes a single string ---------------------------------------------------------------------------------------------------- [15:49:13] Elia Schito(@elia):here's a rather simple usage example for Rack: https://github.com/opal/opal/blob/master/examples/rack/config.ru#L17 ---------------------------------------------------------------------------------------------------- [15:59:22] Aaron Quamme(@aquamme):Thanks! I'll give that a shot ---------------------------------------------------------------------------------------------------- [16:06:27] Aaron Quamme(@aquamme):To be clear, I'm trying to do a static build of the gem so it can be included in a SPA. It looks like the examples you linked assume Ruby code is running on the server? ---------------------------------------------------------------------------------------------------- [16:09:58] Elia Schito(@elia):then you should require 'opal-parser', which will parse `
The time brought to you by inline-reactive-ruby
``` ---------------------------------------------------------------------------------------------------- [16:10:40] Mitch VanDuyn(@catmando):no gem file needed :-) ---------------------------------------------------------------------------------------------------- [16:11:18] Elia Schito(@elia):@catmando not very familiar with chrome driver, any gem I can install or command to run? ---------------------------------------------------------------------------------------------------- [16:11:41] Mitch VanDuyn(@catmando):hang on... ---------------------------------------------------------------------------------------------------- [16:12:17] Mitch VanDuyn(@catmando):I think all you need is this: ---------------------------------------------------------------------------------------------------- [16:12:23] Mitch VanDuyn(@catmando): gem 'chromedriver-helper' ---------------------------------------------------------------------------------------------------- [16:18:47] Mitch VanDuyn(@catmando):FYI - to simplify things (perhaps) the same problem arises at http://opalrb.org/try/ ---------------------------------------------------------------------------------------------------- [16:19:06] Mitch VanDuyn(@catmando):(which does not include reactive-ruby and some other stuff) ---------------------------------------------------------------------------------------------------- [16:29:45] Mitch VanDuyn(@catmando):ha! and now to narrow it down even more: ---------------------------------------------------------------------------------------------------- [16:30:46] Mitch VanDuyn(@catmando):```ruby require 'selenium/webdriver' driver = Selenium::WebDriver.for :chrome # grab any old insecure page that happens to have jQuery it driver.navigate.to "http://www.webdesignerdepot.com/2010/07/20-demos-showing-advanced-jquery-effects/" driver.execute_script("true") # works fine # now load opal driver.execute_script("jQuery.getScript('http://cdn.opalrb.org/opal/current/opal.min.js')") # now it will break! driver.execute_script("true") ``` ---------------------------------------------------------------------------------------------------- [16:56:13] meh.(@meh):@catmando I did try to make a reduced test case at the time, when Opal was much smaller, no luck ---------------------------------------------------------------------------------------------------- ############################## [2016-04-05] ############################## [14:54:12] Brady Wied(@wied03): ---------------------------------------------------------------------------------------------------- [14:55:22] Brady Wied(@wied03):@cj @catmando - I've joined the dark side and started tinkering with webpack (for testing only, sprockets and I are still a happy couple :) . Hopefully zetachang will take some of my pull requests. ---------------------------------------------------------------------------------------------------- [14:56:59] Mitch VanDuyn(@catmando)::-) ---------------------------------------------------------------------------------------------------- [16:17:40] CJ Lazell(@cj):@catmando I already have it working :) ---------------------------------------------------------------------------------------------------- [16:20:36] CJ Lazell(@cj):@wied03 nice, you managed to get require_relative to work :) ---------------------------------------------------------------------------------------------------- [18:16:59] CJ Lazell(@cj):anyone here played with http://crystal-lang.org/ ? ---------------------------------------------------------------------------------------------------- [21:26:06] Elia Schito(@elia):@cj I did some time ago, moved a gem to it ---------------------------------------------------------------------------------------------------- [21:26:13] Elia Schito(@elia):very cool stuff ---------------------------------------------------------------------------------------------------- [21:26:47] Elia Schito(@elia):but had some problems with concurrency, probably it's much better now ---------------------------------------------------------------------------------------------------- [21:27:00] CJ Lazell(@cj):yee, they solved a lot of that ---------------------------------------------------------------------------------------------------- [21:27:23] CJ Lazell(@cj):the only thing stopping me from using it is no opal :) ---------------------------------------------------------------------------------------------------- [21:27:47] Elia Schito(@elia):what do you mean? ---------------------------------------------------------------------------------------------------- [21:28:03] Elia Schito(@elia):I fancied many times of demoing a crystal server + opal frontend ---------------------------------------------------------------------------------------------------- [21:28:04] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- [21:29:39] CJ Lazell(@cj):well the way I use opal is making it so I can have a single code base, i.e. my forms work client and server side. there are a bunch of differences, so I'd run into issues ---------------------------------------------------------------------------------------------------- [21:32:25] Elia Schito(@elia):I see ---------------------------------------------------------------------------------------------------- [21:32:30] Elia Schito(@elia):makes sense ---------------------------------------------------------------------------------------------------- [21:33:00] CJ Lazell(@cj):so for instance I use https://github.com/cj/scrivener client/server side. that way it will validate client side and not hit the server. then it will validate server side using the same code ---------------------------------------------------------------------------------------------------- ############################## [2016-04-06] ############################## [01:00:26] Earl Balai Jr(@earlbalai):Anyone know if this is working on rails 5 now? ---------------------------------------------------------------------------------------------------- [07:31:29] Elia Schito(@elia):@earlbalai still WIP, due to sprockets4 internal api ---------------------------------------------------------------------------------------------------- ############################## [2016-04-07] ############################## [01:10:35] Forrest Chang(@fkchang):@cj played around w/crystal a bit. Did some benchmarking, wrote some websocket code. I have high hopes for it's future ---------------------------------------------------------------------------------------------------- [14:41:33] Brady Wied(@wied03):@elia - back to opal-rspec master working with 0.10 if I can just figure out the one issue with https://github.com/opal/opal/pull/1423 ---------------------------------------------------------------------------------------------------- [14:45:49] Brady Wied(@wied03):The last commit I added to the PR was supposed to fix everything and then I realized I regressed something :( ---------------------------------------------------------------------------------------------------- [14:49:20] Elia Schito(@elia):heheheh ---------------------------------------------------------------------------------------------------- [23:55:21] Brady Wied(@wied03):https://travis-ci.org/opal/opal-rspec/builds/121572465 - Yay! ---------------------------------------------------------------------------------------------------- [23:55:49] CJ Lazell(@cj):w00t! ---------------------------------------------------------------------------------------------------- ############################## [2016-04-08] ############################## [13:09:59] Ilya Bylich(@iliabylich):@elia Is there any way to get compiler options in compiled JS? ---------------------------------------------------------------------------------------------------- [13:10:25] Ilya Bylich(@iliabylich):Getting issues with `Kernel#eval`, it calls opal compiler with blank options (even if `-A` was provided) ---------------------------------------------------------------------------------------------------- [13:11:24] Ilya Bylich(@iliabylich):I know that some time ago (at least in `0.9`) there was a variable `OPAL_CONFIG` with compiler options, but I can't find it anymore ---------------------------------------------------------------------------------------------------- [16:21:52] Martin Becker(@Thermatix):i've been paying attention to crystal since it first came out, it will be the perfect compiled language for me. ---------------------------------------------------------------------------------------------------- ############################## [2016-04-09] ############################## [15:55:53] Brady Wied(@wied03):@iliabylich - I noticed the config variable went away too. Maybe that can/should be a flag to opt into it. I'm guessing it was removed to reduce noise in the default case ---------------------------------------------------------------------------------------------------- [16:58:30] Elia Schito(@elia):@iliabylich if that's the area in which we need to know about the compiler option I propose to dump them just in `opal-parser`, would it work? ---------------------------------------------------------------------------------------------------- ############################## [2016-04-11] ############################## [02:37:59] Stanislav Katkov(@skatkov):Good Day. ---------------------------------------------------------------------------------------------------- [06:56:51] Elia Schito(@elia):@skatkov hey :) ---------------------------------------------------------------------------------------------------- [23:50:03] CJ Lazell(@cj):@elia think I found another bug in the 0.10 parser :) it fails on `"#{somthing.present?? foo : bar}"` points to `:` changing it to `"#{somthing.present? ? foo : bar}"` it compiles just fine ---------------------------------------------------------------------------------------------------- [23:50:43] CJ Lazell(@cj):I'll dig into it more and open a ticket ---------------------------------------------------------------------------------------------------- [23:51:12] CJ Lazell(@cj):seems like it can't parse any `??` ---------------------------------------------------------------------------------------------------- ############################## [2016-04-12] ############################## [00:01:44] CJ Lazell(@cj):@elia https://github.com/opal/opal/issues/1428 ---------------------------------------------------------------------------------------------------- ############################## [2016-04-13] ############################## [17:21:24] CJ Lazell(@cj):I just replied, but probably easier to talk in real time :) ---------------------------------------------------------------------------------------------------- [17:22:00] Ilya Bylich(@iliabylich):Could you share your 'broken' file? It's hard to find out where the problem comes from ---------------------------------------------------------------------------------------------------- [17:22:16] CJ Lazell(@cj):added to the issue ---------------------------------------------------------------------------------------------------- [17:26:25] CJ Lazell(@cj):0.8.0 compiles it just fine ---------------------------------------------------------------------------------------------------- [17:30:05] Ilya Bylich(@iliabylich):I know what's wrong, there's an issue with a token called tLBRACE_ARG. `tr.add_class (new_is_read == '1' ? 'read' : 'unread')` - try to remove here the space after `add_class` ---------------------------------------------------------------------------------------------------- [17:31:25] Ilya Bylich(@iliabylich):This thing is one of my reasons to hate Ruby :smile: ``` ruby def m(*args) p args end m (1) # => 1 m (2, 3) # => SyntaxError ``` ---------------------------------------------------------------------------------------------------- [17:32:53] Ilya Bylich(@iliabylich):This magical space is super weird. By calling a method using `method_name (arg)` you have to pass exactly one argument. If you don't pass any arguments (`m ()`) Ruby automagically passes `nil` to the method. ---------------------------------------------------------------------------------------------------- [17:33:25] Ilya Bylich(@iliabylich):And this feature doesn't work properly on 0.10 ---------------------------------------------------------------------------------------------------- [17:36:14] Ilya Bylich(@iliabylich):But your example clarifies it. It was made exactly for cases like yours, when you call a method without parentheses and provide a single complex argument wrapped with `()` ---------------------------------------------------------------------------------------------------- [17:36:52] Ilya Bylich(@iliabylich):Time to fix it! :smile: ---------------------------------------------------------------------------------------------------- [17:42:32] Ilya Bylich(@iliabylich):`tLPAREN_ARG`, not `tLBRACE_ARG` ---------------------------------------------------------------------------------------------------- [17:46:13] CJ Lazell(@cj)::D ---------------------------------------------------------------------------------------------------- [18:35:50] Guillaume Grossetie(@Mogztter):Hi ---------------------------------------------------------------------------------------------------- [18:36:44] Guillaume Grossetie(@Mogztter):I'm trying to update from Opal 0.9.0.beta2 to Opal 0.9.2 ---------------------------------------------------------------------------------------------------- [18:38:52] Guillaume Grossetie(@Mogztter):Some Hash methods were renamed: ---------------------------------------------------------------------------------------------------- [18:39:08] Guillaume Grossetie(@Mogztter):```Hash.keys => Hash.$$keys Hash.map => Hash.$$map Hash.smap => Hash.$$smap``` ---------------------------------------------------------------------------------------------------- [18:40:31] Guillaume Grossetie(@Mogztter):Is there an "easy" way to create an alias between old and new name ? ---------------------------------------------------------------------------------------------------- [18:41:21] Guillaume Grossetie(@Mogztter):Yes we do have users that rely heavily on `smap` :cry: ---------------------------------------------------------------------------------------------------- [18:42:12] Guillaume Grossetie(@Mogztter):@fkchang work is in progress, I'm making good progress :wink: ---------------------------------------------------------------------------------------------------- [18:50:08] Ilya Bylich(@iliabylich):@Mogztter it was renamed because `object.property` is an instance variable ---------------------------------------------------------------------------------------------------- [18:50:25] Ilya Bylich(@iliabylich):`$$prop` is an internal Opal property ---------------------------------------------------------------------------------------------------- [19:05:48] Guillaume Grossetie(@Mogztter):I'm sure there's a good reason for this renaming ---------------------------------------------------------------------------------------------------- [19:06:28] Guillaume Grossetie(@Mogztter):but I want to be backward compatible (even if this is a bad practice to use internal property) ---------------------------------------------------------------------------------------------------- [19:07:32] Guillaume Grossetie(@Mogztter):any idea how to achieve this ? ---------------------------------------------------------------------------------------------------- [19:11:02] Ilya Bylich(@iliabylich):@Mogztter No, I think it's impossible ---------------------------------------------------------------------------------------------------- [19:11:27] Ilya Bylich(@iliabylich):You can just use public methods :smile: ---------------------------------------------------------------------------------------------------- [19:22:12] Guillaume Grossetie(@Mogztter):Ok thanks ---------------------------------------------------------------------------------------------------- [22:35:13] Forrest Chang(@fkchang):@wied03 hmm, that's not quite what I saw, but might be related, ```/\s*([A-Z]\w*::(?:[A-Z]+\w*(?:::)?)*)+$/``` acts different in 0.8 and 0.9, in 0.9 it does what I expect, but in 0.8 it's not "greedy enough" if I were to describe it in 2 words ---------------------------------------------------------------------------------------------------- [22:36:35] Forrest Chang(@fkchang):@Mogztter I'd love updates on the progress as well as what you are doing or planning to be doing with it. I suspect server side opal on node could be quite useful in getting opal more widespread ---------------------------------------------------------------------------------------------------- [05:44:18] Forrest Chang(@fkchang):@elia are regex's slightly different in 0.8 and 0.9 ? ---------------------------------------------------------------------------------------------------- [05:53:54] Forrest Chang(@fkchang):apparently they are, upgraded to 0.9 and the regex in question behaves more like I think it should ---------------------------------------------------------------------------------------------------- [06:04:25] Elia Schito(@elia):@fkchang Tbh don't remember :) ---------------------------------------------------------------------------------------------------- [13:08:09] Brady Wied(@wied03):@fkchang - I did make some regex fixes for treating `.` the same in JS as Ruby. ---------------------------------------------------------------------------------------------------- [16:59:50] CJ Lazell(@cj):@elia @iliabylich https://github.com/opal/opal/issues/1428 ---------------------------------------------------------------------------------------------------- [17:20:23] CJ Lazell(@cj):@iliabylich are you around? ---------------------------------------------------------------------------------------------------- [17:21:07] Ilya Bylich(@iliabylich):@cj Yes ---------------------------------------------------------------------------------------------------- ############################## [2016-04-14] ############################## [15:26:05] Brady Wied(@wied03):@iliabylich @elia - You guys know how to keep Opal from adding stubs to non Opal classes/methods? https://gist.github.com/wied03/940e70dcf9da0f3095326e2dfb912381 ---------------------------------------------------------------------------------------------------- [15:27:17] Ilya Bylich(@iliabylich):@weid03 Function is a proc :smile: That's an Opal class ---------------------------------------------------------------------------------------------------- [15:28:05] Brady Wied(@wied03):yep, but any way to be more selective about how we apply it ? ---------------------------------------------------------------------------------------------------- [15:28:25] Brady Wied(@wied03):i have some code that's pure JS that uses `$inject` as a function name and it's getting overwritten ---------------------------------------------------------------------------------------------------- [15:28:52] Brady Wied(@wied03):I suppose I could save off the function before requiring opal and restore it, but was curious if there is a better way ---------------------------------------------------------------------------------------------------- [15:29:17] Brady Wied(@wied03):I don't really want to turn off method_missing entirely either :( ---------------------------------------------------------------------------------------------------- [15:34:32] Ilya Bylich(@iliabylich):Actually don't even know what to say. That's a common problem of conflicting libraries ---------------------------------------------------------------------------------------------------- [15:35:18] Ilya Bylich(@iliabylich):Probably the easiest way here is to save and restore your original function ---------------------------------------------------------------------------------------------------- [15:36:10] Ilya Bylich(@iliabylich):Or you can try to add some code to `Opal.add_stubs` that applies a stub only if it wasn't registered in some global pool of exceptional methods ---------------------------------------------------------------------------------------------------- [15:36:32] Ilya Bylich(@iliabylich):But I'd say it also looks bad :smile: ---------------------------------------------------------------------------------------------------- [15:37:46] Brady Wied(@wied03):exceptional methods. they're so good they can't be stubbed ;) ---------------------------------------------------------------------------------------------------- [15:37:58] Brady Wied(@wied03):so many cheesy puns that can be done there, I'll spare you ---------------------------------------------------------------------------------------------------- [16:03:59] Brady Wied(@wied03):@iliabylich is not even laughing. can't say I blame you. lame jokes. anyways, thanks for being a sounding board ---------------------------------------------------------------------------------------------------- [16:25:21] Ilya Bylich(@iliabylich):@wied03 :+1: ---------------------------------------------------------------------------------------------------- [20:01:17] Elia Schito(@elia):@wied03 you can disable method missing if that's viable ---------------------------------------------------------------------------------------------------- [20:02:32] Elia Schito(@elia):@wied03 is it angular, I remember it used to use properties starting with `$` ---------------------------------------------------------------------------------------------------- [20:04:46] Brady Wied(@wied03):yeah, but that's all or none, and i don't want to do that ---------------------------------------------------------------------------------------------------- [20:05:15] Brady Wied(@wied03):and the opal compiler, which is the code that's "overwriting", relies on method_missing in a few spots I think ---------------------------------------------------------------------------------------------------- [20:06:00] Brady Wied(@wied03):not angular. it's Karma. and since Karma with this webpack loader loads the opal compiler in node, the method gets overwritten ---------------------------------------------------------------------------------------------------- [20:08:25] Brady Wied(@wied03):I might just have to monkey patch `Compiler#method_calls` to exclude `inject` from its list ---------------------------------------------------------------------------------------------------- [20:10:15] Elia Schito(@elia):you can also `var original_add_stubs = Opal.add_stubs; Opal.add_stubs = function(args){/*exclude stuff from args*/; original_add_stubs(args) };` ---------------------------------------------------------------------------------------------------- [20:10:46] Elia Schito(@elia):that patch should go after requiring `corelib/runtime.js` ---------------------------------------------------------------------------------------------------- [20:21:11] Brady Wied(@wied03):that's a good idea ---------------------------------------------------------------------------------------------------- ############################## [2016-04-16] ############################## [01:14:47] Forrest Chang(@fkchang):For anyone interested a react.rb, here's slides from an OCRuby talk I did in January. Thrown together fairly quickly, and w/o all the demos and conversation, but the fact that gitter renders this inline made me want to share it here ---------------------------------------------------------------------------------------------------- [01:14:48] Forrest Chang(@fkchang):http://www.slideshare.net/fkchang/reactrb-all-the-power-of-reactjs-with-all-the-joy-of-ruby ---------------------------------------------------------------------------------------------------- [07:21:13] Barrie Hadfield(@barriehadfield):@fkchang well done, this is an excellent predentation - thank you! ---------------------------------------------------------------------------------------------------- ############################## [2016-04-18] ############################## [20:50:28] Mitch VanDuyn(@catmando):I was just thinking I could block.source -> generate AST -> send 3rd child directly to Opal::CompileAST ---------------------------------------------------------------------------------------------------- [20:51:01] Mitch VanDuyn(@catmando):one less dependency, but as pointed out it depends on the two AST's being compatible. ---------------------------------------------------------------------------------------------------- [20:52:19] Mitch VanDuyn(@catmando):@wied03 -> yeah so I looked at adding AR / reactive-record to opal-factory-girl, and decided it would be both easier and more powerful to simply be able to drive the unit tests directly from the server passing the already built models to the components. ---------------------------------------------------------------------------------------------------- [20:54:33] Mitch VanDuyn(@catmando):the whole mount_component and associated code is less than 200 lines of code. I doubt I could get opal-factory-girl to work with active-record in any where near that (perhaps not.) But in addition it simplifies so much. ---------------------------------------------------------------------------------------------------- [20:59:18] Brady Wied(@wied03):another option is to make the timeout a prop that you can pass down from the server more easily ---------------------------------------------------------------------------------------------------- [20:59:44] Brady Wied(@wied03):i tend to use that instead of constants anyways because it's easier to test from a unit testing standpoint ---------------------------------------------------------------------------------------------------- [20:59:49] Brady Wied(@wied03):but it could help this as well ---------------------------------------------------------------------------------------------------- [21:01:38] Mitch VanDuyn(@catmando):@iliabylich - thanks for the answer BTW... I don't know if you followed all the chatter but I am as you suggest using Opal to just statically compile stuff. I just happen to know that the string I am giving to opal, came from an AST, so rather than turn it back into source, then reparse it, I thought it might be nice to send the AST directly to opal (which I will try fun grins anyway.) ---------------------------------------------------------------------------------------------------- [21:02:26] Mitch VanDuyn(@catmando):@wied03 - a couple of reasons why this want to be a constant. ---------------------------------------------------------------------------------------------------- [21:04:08] Mitch VanDuyn(@catmando):There is an underlying polling loop that updates the UI when chat is availability changes state. Each component is just reflecting the state of that *store*, and so there is only one polling interval. ---------------------------------------------------------------------------------------------------- [21:04:54] Mitch VanDuyn(@catmando):If the chat component was not so small anyway, you could seperate the polling into its own store, and then the mount_component would be just providing an alternative store. ---------------------------------------------------------------------------------------------------- [21:57:03] Elia Schito(@elia):@/all releasing beta3, probably the last beta before a release candidate and a final release ---------------------------------------------------------------------------------------------------- [21:57:44] Elia Schito(@elia):https://twitter.com/rubygems/status/722182273664172033 ---------------------------------------------------------------------------------------------------- [22:35:24] Brady Wied(@wied03):@elia - :+1: - opal-rspec passes fine with beta 3 ---------------------------------------------------------------------------------------------------- [22:58:19] Elia Schito(@elia):@wied03 w00t! :D ---------------------------------------------------------------------------------------------------- [23:33:19] CJ Lazell(@cj):@elia shouldn't Opal.append_path return true? ---------------------------------------------------------------------------------------------------- [17:22:31] Mitch VanDuyn(@catmando):Can I feed ruby AST to the opal compiler? ---------------------------------------------------------------------------------------------------- [17:22:51] Mitch VanDuyn(@catmando):In otherwords I want to do something like this: ---------------------------------------------------------------------------------------------------- [17:23:39] Mitch VanDuyn(@catmando):Opal::CompileAST(Parser::CurrentRuby.parse(some_block.source)) ---------------------------------------------------------------------------------------------------- [17:23:57] Mitch VanDuyn(@catmando):so it will compile existing server code to opal. ---------------------------------------------------------------------------------------------------- [17:25:03] Mitch VanDuyn(@catmando):I am doing this now by just passing some_block.source directly to Opal, but I now want to do some tweaks to the AST before passing to opal, and rather than translate the AST back to source, then back to ruby I thought i would save a step. ---------------------------------------------------------------------------------------------------- [17:25:06] Mitch VanDuyn(@catmando):possible? ---------------------------------------------------------------------------------------------------- [17:54:12] Ilya Bylich(@iliabylich):Opal compiler has a method `process` that takes s expression. You can get this sexp from `Parser#parse` ---------------------------------------------------------------------------------------------------- [17:54:45] Ilya Bylich(@iliabylich):Just don't forget to wrap sexp to `s(:top, parsed_sexp)` ---------------------------------------------------------------------------------------------------- [17:55:02] Ilya Bylich(@iliabylich):(this is what Opal compiler does internally) ---------------------------------------------------------------------------------------------------- [17:58:31] Ilya Bylich(@iliabylich):May I ask you why do you need it? Usually we call `Kernel#eval` for dynamic source code. If your code is static, just require a compiled version. If you code is dynamic - then its AST is also dynamic and you can't partially pre-compile it. Most probably I'm missing something :smile: ---------------------------------------------------------------------------------------------------- [19:31:47] Brady Wied(@wied03):@catmando - I'm wondering the same thing. It also might break fairly easily since the compiler nodes are not necessarily an interface that people avoid changing ---------------------------------------------------------------------------------------------------- [20:26:27] Mitch VanDuyn(@catmando):@wied03 its for my server side test driver. So I can say: ---------------------------------------------------------------------------------------------------- [20:27:52] Mitch VanDuyn(@catmando):```ruby it "will run this test in opal", :opal => true do expect(true).to be_truthy end ``` ---------------------------------------------------------------------------------------------------- [20:28:12] Mitch VanDuyn(@catmando):and the expectation will run in opal-rspec ---------------------------------------------------------------------------------------------------- [20:28:26] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [20:28:57] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [20:31:18] Elia Schito(@elia):@rubys came up (years ago?) with a nice trick to compile to opal using the method_source gem, this looks like a very nice application for it ---------------------------------------------------------------------------------------------------- [20:31:57] Elia Schito(@elia):https://rubygems.org/gems/method_source ---------------------------------------------------------------------------------------------------- [20:32:15] Mitch VanDuyn(@catmando):```ruby it "does some fun isomorphic stuff", :js => true do mount_component "Price", job: my_job = FactoryGirl.create(:job, :valid_job) do class Price < React::Component::Base ... modify internal behavior of price for testing end end find(".the-price").text.should eq(my_job.price) end ``` ---------------------------------------------------------------------------------------------------- [20:34:19] Brady Wied(@wied03):@catmando - Don't you really just want to use mocks then (e.g. RSpec mocks) ? ---------------------------------------------------------------------------------------------------- [20:34:47] Mitch VanDuyn(@catmando):@wied03 - I could but we already have the factories set up. ---------------------------------------------------------------------------------------------------- [20:35:05] Brady Wied(@wied03):your example seems to indicate you want to modify the React component (not the factory) ---------------------------------------------------------------------------------------------------- [20:35:19] Mitch VanDuyn(@catmando):kind of a dumb example ---------------------------------------------------------------------------------------------------- [20:36:06] Mitch VanDuyn(@catmando):here is a real one (I think I have given before) ---------------------------------------------------------------------------------------------------- [20:36:08] Brady Wied(@wied03):i do RSpec tests all the time that I run on both sides and I just surround some of my `describe` calls, etc. with RUBY_ENGINE guards ---------------------------------------------------------------------------------------------------- [20:37:42] Mitch VanDuyn(@catmando):```ruby require 'spec_helper' describe 'chat component', :js => true, group: 2 do before(:each) do @agents_online = 0 stub_request(:get, "support.catprint.com/customer/agent_online_check"). to_return { {body: "{\"online_agents\":#{@agents_online},\"routing_agents\":#{@agents_online}}"} } FactoryGirl.create :production_center, domain: "127.0.0.1", code: "US" end it "switches from offline to online" do mount("Chat", online_text: "ONLINE", offline_text: "OFFLINE") do class Components::Chat < React::Component::Base POLL_INTERVAL = 1 # override default of 5 minutes end end page.should have_content('OFFLINE') wait_for_ajax @agents_online = 2 Rails.cache.delete('desk_agents_online') page.should have_content('ONLINE') end ``` ---------------------------------------------------------------------------------------------------- [20:39:00] Brady Wied(@wied03):@catmando - Much easier to do with unit tests in JS. beating a dead horse? ;) ---------------------------------------------------------------------------------------------------- [20:39:19] Brady Wied(@wied03):Anyways, why not do what they said earlier and use `eval` ? ---------------------------------------------------------------------------------------------------- [20:40:39] Mitch VanDuyn(@catmando):@wied03 - I would very much like to see how this could be done easier than the above... ---------------------------------------------------------------------------------------------------- [20:40:53] Brady Wied(@wied03):what about eval ? ---------------------------------------------------------------------------------------------------- [20:41:18] Brady Wied(@wied03):If you humor my unit test stuff though, that's much easier. You just monkey patch or mock that poll interval and you're done ---------------------------------------------------------------------------------------------------- [20:41:34] Brady Wied(@wied03):because your tests are ruby/opal code running alongside the react component ---------------------------------------------------------------------------------------------------- [20:41:42] Mitch VanDuyn(@catmando):not quite - that component needs the production_center to work ---------------------------------------------------------------------------------------------------- [20:42:31] Brady Wied(@wied03):you could use factory girl on the opal side to avoid re-doing the work of constructing a production_center ---------------------------------------------------------------------------------------------------- [20:42:46] Brady Wied(@wied03):or some support code that builds one manually ---------------------------------------------------------------------------------------------------- [20:43:22] Mitch VanDuyn(@catmando):@wied03 - and so we come full circle. You might remember our first conversation was about getting factory-girl opal to work with active-record ---------------------------------------------------------------------------------------------------- [20:43:36] Elia Schito(@elia):@catmando I think method_source is a viable option to collect the block source code, compile and run it with opal ---------------------------------------------------------------------------------------------------- [20:44:56] Brady Wied(@wied03):@catmando - Sounds like what @elia is mentioning + eval could help. seems like a lot of work just to test this though ---------------------------------------------------------------------------------------------------- [20:46:01] Mitch VanDuyn(@catmando):RE: eval... that is essentially what I am doing now... however the problem is if you have code like this: ```ruby mount_component "Foo" do puts "hello" end ``` the block.source for the do, includes the line "mount_component" which we don't want so I just use the AST tree to get the actual block ---------------------------------------------------------------------------------------------------- [20:46:52] Brady Wied(@wied03):what if you did `def mount_component; yield; end` somewhere else that wasn't dynamic ---------------------------------------------------------------------------------------------------- [20:47:13] Brady Wied(@wied03):inject it (compiled via opal) in some place before the other stuff runs ---------------------------------------------------------------------------------------------------- [20:47:30] Brady Wied(@wied03):or more like instance_eval(&block) but you get the idea ---------------------------------------------------------------------------------------------------- [20:47:45] Brady Wied(@wied03):then you'd avoid coupling to compiler nodes ---------------------------------------------------------------------------------------------------- [20:48:10] Brady Wied(@wied03):@catmando - as to AR. I have no problem with a PR for opal-factory-girl to work with the AR stuff as long as it doesn't require a bunch of additional stuff in there. ---------------------------------------------------------------------------------------------------- [20:49:36] Mitch VanDuyn(@catmando):@wied03 - at any rate this is all working today (and has been for sometime) I was just thinking it might be nice to git rid of the extra step. Right now it works like this block.source -> generate AST -> convert 3rd child back to source -> send to Opal to compile. ---------------------------------------------------------------------------------------------------- ############################## [2016-04-19] ############################## [00:08:41] Elia Schito(@elia):@cj no, the return value is not guaranteed to be anything particular ---------------------------------------------------------------------------------------------------- ############################## [2016-04-21] ############################## [16:12:25] Forrest Chang(@fkchang): I wanna pimp @elia 's talk from wrocloverb -- Thought it was a good intro overview of what opal is and why Rubyists should try it (still shocked at how largely unknown it is to the Ruby community at large), I liked the slides themselves quite a bit https://www.youtube.com/watch?v=vhIrrlcWphU ---------------------------------------------------------------------------------------------------- [17:28:38] George Plymale II(@ylluminarious):@elia nice talk! your tetris port was really interesting; reminds me of [things](https://github.com/ylluminarious/opal_pong) [that](https://github.com/ylluminarious/js_pong) [i've](https://github.com/orbitalimpact/flutterjump) [done](https://github.com/orbitalimpact/opal-phaser-examples) with opal games and ports. i have to say, developing games with opal is a pretty fun process :D ---------------------------------------------------------------------------------------------------- [17:30:45] Elia Schito(@elia):@ylluminarious you should write about that! send them to peter cooper for rubyweekly and stuff! ---------------------------------------------------------------------------------------------------- [17:31:16] Elia Schito(@elia):@fkchang hey thanks! didn't know the video was up untill now! :D ---------------------------------------------------------------------------------------------------- [17:31:34] George Plymale II(@ylluminarious):@elia not a bad idea, thanks for the tip :) ---------------------------------------------------------------------------------------------------- ############################## [2016-04-22] ############################## [00:24:57] Brady Wied(@wied03):@elia @catmando - You guys might find this useful - https://github.com/wied03/opal-require-dep ---------------------------------------------------------------------------------------------------- [01:11:37] Mitch VanDuyn(@catmando):@wied03 - I kid you not... I just needed this a few hours ago, and so hacked up a mess. I'll use this instead! ---------------------------------------------------------------------------------------------------- [02:48:38] Brady Wied(@wied03):glad it can help ---------------------------------------------------------------------------------------------------- [02:55:20] Brady Wied(@wied03):@catmando - just published a GEM as well ---------------------------------------------------------------------------------------------------- ############################## [2016-04-23] ############################## [23:27:45] Austin Erlandson(@erlandsona):But oh it sounds so sweet... ---------------------------------------------------------------------------------------------------- [23:30:02] Brady Wied(@wied03):I'm sorry I can't be of more help. Just finished a bunch of open source work and have to get back to real work and life ---------------------------------------------------------------------------------------------------- [23:30:27] Brady Wied(@wied03):but @elia or maybe other uses like @fkchang might be able to speak to opal-rails more. I tried. :( ---------------------------------------------------------------------------------------------------- [23:31:59] Austin Erlandson(@erlandsona):No worries @wied03 always fun to collaborate with strangers :stuck_out_tongue: ---------------------------------------------------------------------------------------------------- [23:32:10] Austin Erlandson(@erlandsona):Thanks for your time, always much appreciated! ---------------------------------------------------------------------------------------------------- [12:38:17] Martin Becker(@Thermatix):I was wondering, is there a specific opal/sinatra integration gem? if not I was thinking of releasing my integration module as a gem ---------------------------------------------------------------------------------------------------- [12:39:04] Martin Becker(@Thermatix):by integration, I mean running sprockets/opal as a part of the main sinatra app instead of running the sprockets service that opal naturally provides ---------------------------------------------------------------------------------------------------- [21:32:47] Austin Erlandson(@erlandsona):Anyone here know how to set up opal-rspec? I’ve got a Trailblazer application and I translated an infinite-scroll.coffee into an opal class but I can’t get opal-rspec to work so testing it is still a noop for me. Thoughts? ---------------------------------------------------------------------------------------------------- [21:44:05] Brady Wied(@wied03):Sure. can you be more specific about what's not working ? ---------------------------------------------------------------------------------------------------- [21:45:19] Brady Wied(@wied03):@erlandsona ---------------------------------------------------------------------------------------------------- [21:50:44] Austin Erlandson(@erlandsona):Absolutely, I’ve got opal-rails in the gem file added the configs from the opal-rails README Followed the setup for a “legacy rails app” from here… http://rubyist.jaredwhite.com/2015/07/22/how-to-introduce-opal-gently-into-a-legacy-rails-app/ And I rewrote / debugged a handrolled jQuery infinite-scroll in Opal which was such a refreshing experience, BTW! Next step was to get some specs running so I could test the InfiniteScroll class I’d just sparked. But first thing I ran into was where do I put the _spec.opal file… Then once I as able to get the browser route /opal_spec working at this point I noticed in the console it showed that Opal was not defined for the spec file. I added a require to the file and then describe was an undefined method so I added `require ‘opal-rspec’` and the console errors went away but the specs still aren’t executing. I’ve tried both opal-rails with opal 0.8 and opal 0.9+ and I much prefer the spec runner template for 0.9+ obviously but specs still aren’t executing… ---------------------------------------------------------------------------------------------------- [22:01:14] Austin Erlandson(@erlandsona):```ruby # require 'opal' # require 'opal-rspec' describe 'a spec' do it 'has successful examples' do expect('I run').to =~ /run/ end end ``` ---------------------------------------------------------------------------------------------------- [22:04:50] Brady Wied(@wied03):hmm. I'm an opal-rspec maintainer, but I don't use opal-rails but I'll take a quick look. You're using opal-rspec-rails, right ? ---------------------------------------------------------------------------------------------------- [22:06:52] Brady Wied(@wied03):opal-rails is now meant to be test framework agnostic, but I guess from looking further that @elia hasn't released opal-rspec-rails yet ---------------------------------------------------------------------------------------------------- [22:09:15] Brady Wied(@wied03):spec-opal is where he puts them in the 0.8.1 opal-rails test app ---------------------------------------------------------------------------------------------------- [22:10:11] Austin Erlandson(@erlandsona):So I’ve tried both the opal 0.8 implementation of opal-rails and the opal 0.9+ implementation of opal-rails with the extra opal-rspec-rails gem and in both cases I can get to the browser spec template… the whole /opal_spec (0.8) or /spec-opal (0.9) and it shows the spec file I want it to run but it doesn’t actually run any specs… My main thought is that I must not have phantomjs setup properly? My assumption is that phantom comes pre built into the spec gem but I also did an `npm install -g phantomjs` just to be safe… I also found the opal-rspec documentation about how to run the specs with a rake task but not sure about where in my stack that code should go. ---------------------------------------------------------------------------------------------------- [22:11:27] Austin Erlandson(@erlandsona):I’m happy to screenshare if it would help? I’m in Nashville, TN. ---------------------------------------------------------------------------------------------------- [22:12:26] Brady Wied(@wied03):Phantom is not bundled in there, that's separate. I'm trying to get up to speed. elia is out of town this weekend as well ---------------------------------------------------------------------------------------------------- [22:12:50] Brady Wied(@wied03):but when you hit that browser page, the browser is what should run them, not phantom ---------------------------------------------------------------------------------------------------- [22:15:14] Brady Wied(@wied03):I think I know what might be missing from the docs ---------------------------------------------------------------------------------------------------- [22:15:41] Austin Erlandson(@erlandsona):Hmmm… yeah that’s what I was thinking too. I thought it was odd that the Opal object wasn’t available to the spec file. I’ve also moved the spec file to a number of different directory locations. I’ve tried putting it in the following locations… app/assets/javascripts/spec/browser_spec.opal spec/solutions/search/browser_spec.opal spec/browser_spec.opal etc... ---------------------------------------------------------------------------------------------------- [22:17:55] Brady Wied(@wied03):opal-rails uses a different mechanism to run than core opal-rspec does, but I think the approach he was leaning towards with opal-rails is that you'd need to do something like this in your spec_helper ---------------------------------------------------------------------------------------------------- [22:17:56] Brady Wied(@wied03):```ruby ---------------------------------------------------------------------------------------------------- [22:18:08] Brady Wied(@wied03):```ruby at_exit { RSpec::Core::Runner.autorun } ``` ---------------------------------------------------------------------------------------------------- [22:18:56] Brady Wied(@wied03):I can't say for sure what direction he's going with opal-rails, but you might want to do that because it sounds like your opal-rails install scans your app for spec files but the thing to make RSpec actually run isn't present in your code (or opal-rails 0.8.1 code) ---------------------------------------------------------------------------------------------------- [22:19:38] Brady Wied(@wied03):As to opal itself, latest is always best, so I'd recommend Opal 0.9.2 (should work fine with opal-rails, including 0.8.1) ---------------------------------------------------------------------------------------------------- [22:22:27] Austin Erlandson(@erlandsona):Yeah just installed 0.9.2 again, I’ve been switching back and forth between them wondering if either was a more stable version that might just work out of the box but no luck with either. Regardless gitter has completely changed my life in Open Source being able to communicate with the authors of this code that I use on a daily basis is so powerful! Anyways, So something like… ```ruby require 'rubygems' require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' ENV['CLOUDINARY_CLOUD_NAME'] = 'test' ENV['VERSION_TOKEN'] = 'test_version_token' require File.expand_path("../../config/environment", __FILE__) require 'avocado/rspec' require 'rspec/rails' WebMock.disable_net_connect! allow: [ ENV['ELASTICSEARCH_URL'] ], allow_localhost: true ActiveRecord::Migration.maintain_test_schema! # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } RSpec.configure do |config| config.order = :random config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = false config.infer_spec_type_from_file_location! config.render_views = true config.global_fixtures = :all config.fixture_path = Rails.root.join('spec', 'fixtures') config.include Capybara::DSL config.include Devise::TestHelpers, type: :controller config.include ActiveJob::TestHelper config.include Warden::Test::Helpers config.before :suite do Warden.test_mode! end Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end # Blacklist any HTTP calls that might be made during JS tests, such # as hard-coded image URLs, Google fonts, etc Capybara::Webkit.configure do |config| config.block_unknown_urls end # config.before :each, js: true do # page.driver.browser.url_blacklist = %w() # end # config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true expectations.syntax = :expect end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true mocks.syntax = :expect end end at_exit { RSpec::Core::Runner.autorun } ``` The key line being ^ ---------------------------------------------------------------------------------------------------- [22:22:29] Brady Wied(@wied03):the test app @ https://github.com/opal/opal-rails/blob/v0.8.1/test_app/spec-opal/spec_helper.rb has some code like that, but unless you can guarantee the autorun statement runs last after opal-rails 'requires' all of your specs, then you'll miss some, thus I think you need that ---------------------------------------------------------------------------------------------------- [22:23:23] Brady Wied(@wied03):Yes, except you need a separate spec_helper in the `spec_opal` directory where you put your tests. you can't/shouldn't use the same one that you have in `spec` for your typical MRI based tests ---------------------------------------------------------------------------------------------------- [22:25:01] Brady Wied(@wied03):How RSpec works (which is different that say test-unit) but similar to Mocha or Jasmine is that requiring the specs (which I think opal-rails does for you and opal-rspec's standalone stuff also does) just tells RSpec about which tests (examples) and example groups you have. It doesn't run them though until it sees that 1 line. ---------------------------------------------------------------------------------------------------- [22:26:39] Brady Wied(@wied03):If some of this could be easier, feel free to document some of it in a github issue on the opal-rails project. Some of this might be that elia is a busy guy and he hasn't got a chance to release his current opal-rails/opal-rspec-rails work that make this clearer ---------------------------------------------------------------------------------------------------- [22:28:54] Austin Erlandson(@erlandsona):Just tried it out… I’ve currently got my browser_spec.opal file under app/concepts/solutions/search/browser.opal app/concepts/solutions/search/browser_spec.opal And in my config/application.rb I set the `config.opal.spec_location = “app/concepts”` ---------------------------------------------------------------------------------------------------- [22:29:15] Austin Erlandson(@erlandsona):Here’s what I’ve got… ---------------------------------------------------------------------------------------------------- [22:29:20] Austin Erlandson(@erlandsona):[![Screen Shot 2016-04-23 at 5.26.56 PM.png](https://files.gitter.im/opal/opal/Dg89/thumb/Screen-Shot-2016-04-23-at-5.26.56-PM.png)](https://files.gitter.im/opal/opal/Dg89/Screen-Shot-2016-04-23-at-5.26.56-PM.png) ---------------------------------------------------------------------------------------------------- [22:31:45] Austin Erlandson(@erlandsona):Ideally I’d eventually like to put my tests in the same directory as my source given that most of the code I’m writing at this point is all component based. EG: Trailblazer, and eventually probably React.rb. Not sure how to get there though. ---------------------------------------------------------------------------------------------------- [22:33:34] Brady Wied(@wied03):I'm not sure why you'd want tests in the same dir as the source, but that's another conversation ---------------------------------------------------------------------------------------------------- [22:33:56] Brady Wied(@wied03)::) ---------------------------------------------------------------------------------------------------- [22:33:57] Brady Wied(@wied03):I never use the Opal suffix, I use _spec.rb as the suffix, not sure if that is the issue or not ---------------------------------------------------------------------------------------------------- [22:36:00] Brady Wied(@wied03):that should work though (after looking @ the code) ---------------------------------------------------------------------------------------------------- [22:37:06] Brady Wied(@wied03):are you requiring a spec_helper.opal file that's located inside app/concepts from within browser_spec.opal ? ---------------------------------------------------------------------------------------------------- [22:37:20] Brady Wied(@wied03):name is immaterial, is long as you require it and it has the at_exit code above in it ---------------------------------------------------------------------------------------------------- [22:37:49] Brady Wied(@wied03):might want to check your browser's console as well and see what errors are showing up there if any ---------------------------------------------------------------------------------------------------- [22:38:34] Austin Erlandson(@erlandsona):Component based file organization, helps me to keep the business domain and isolate dependencies, enabling faster and more stable refactoring of code. When it’s all in different directories based on file type it can be hard to keep in your head which code touches which parts of the app. It’s also a best practice in most front-end frameworks at this point. RE: http://www.johnpapa.net/angular-app-structuring-guidelines/ Oh and you mean requiring the spec_helper from the manifest file right?! How could I forget! Freaking dependencies man! I love it! ---------------------------------------------------------------------------------------------------- [22:39:14] Brady Wied(@wied03):I'm not sure what you mean by manifest file ---------------------------------------------------------------------------------------------------- [22:39:33] Brady Wied(@wied03):I think that's an Angular habit I'm happy to not adopt ---------------------------------------------------------------------------------------------------- [22:40:01] Brady Wied(@wied03):habit/practice ---------------------------------------------------------------------------------------------------- [22:41:04] Brady Wied(@wied03):I do agree that separation of concerns is a problem in the Rails world. I usually would go a different route to achieve that. ---------------------------------------------------------------------------------------------------- [22:42:04] Austin Erlandson(@erlandsona):It’s actually a React concept that Angular adopted and now being adopted by more and more frameworks like Ember in their V2’s… Added the require to app/concepts/browser_manifest.opal ---------------------------------------------------------------------------------------------------- [22:45:21] Austin Erlandson(@erlandsona):Here’s my dependency tree to make opal work with the current setup it’s a bit to follow but here goes… app/assets/javascripts/app_js_manifest.js ```javascript //= require jquery.smartWizard //= require lodash //= require slick //= require survey-responses //= require selectize //= require login/email-matcher //= require login/organizations-input //= require javascripts //= require project_boards ``` app/assets/javascripts/application.opal ```ruby require 'jquery' require 'jquery_ujs' require 'opal' require 'opal_ujs' # 0.9.2 is required # require 'console' require 'app_js_manifest' require 'browser_manifest' ``` app/concepts/browser_manifest.opal ```ruby require 'spec_helper' require 'solutions/search/browser' ``` Here’s the actual opal source for the infinite scroll app/concepts/solutions/search/browser.opal ```ruby module Solutions module Search class InfiniteScroll def initialize(elem, pixels = 400) @scrollable_element = elem @loading_next_page = false @pixels_from_bottom = pixels # pixels above the bottom @page = 2 @image = Element.parse "
" @back_to_top = Element.parse "
Top
" @more_results = true end def load_next_page return if @loading_next_page start_loading_next_page current_params = `window.location.href.split("?")[1]` HTTP.get "/solutions/more?#{current_params}&page=#{@page}" do |response| result = response.json[:html] unless result.empty? @scrollable_element.append(result) @page += 1 else @more_results = false @scrollable_element.append(@back_to_top) end stop_loading_next_page end end def approaching_bottom_of_page elem = `this.scrollable_element[0]` view_port_height = `elem.scrollHeight` - `elem.clientHeight` `elem.scrollTop` > view_port_height - @pixels_from_bottom end def start_loading_next_page @loading_next_page = true @scrollable_element.append(@image) end def stop_loading_next_page @image.remove() @loading_next_page = false end def register_listeners # `debugger` @back_to_top.on :click do @scrollable_element.scroll_top = 0 end @scrollable_element.on :scroll do if approaching_bottom_of_page and @more_results load_next_page end end end end end end Document.ready? do el = Solutions::Search::InfiniteScroll.new(Element['.solution-searches']) el.register_listeners end ``` ---------------------------------------------------------------------------------------------------- [22:52:24] Austin Erlandson(@erlandsona):I just moved the spec related things to spec_browser/ we’ll see if that fairs better. I think separating specs from app is okay but not really because I just end up duplicating the component structure anyways. It would just be really nice to have everything I need for a feature, from the controller, the viewmodel, the services, template, styles, poro’s whatever all in one directory per feature. ---------------------------------------------------------------------------------------------------- [22:54:16] Brady Wied(@wied03):Understandable ---------------------------------------------------------------------------------------------------- [22:54:39] Austin Erlandson(@erlandsona):Alright moved everything into browser_spec/browser_spec.opal still no execution? ---------------------------------------------------------------------------------------------------- [22:55:04] Brady Wied(@wied03):did you look at your browser console (See above) ? ---------------------------------------------------------------------------------------------------- [22:55:43] Austin Erlandson(@erlandsona):Yeah only thing I’m getting is a warning stating … Object freezing is not supported by Opal ---------------------------------------------------------------------------------------------------- [22:56:43] Austin Erlandson(@erlandsona):Are you available to do a quick hangout by any chance? ---------------------------------------------------------------------------------------------------- [22:58:59] Brady Wied(@wied03):not right now ---------------------------------------------------------------------------------------------------- [22:59:14] Austin Erlandson(@erlandsona):No biggie ---------------------------------------------------------------------------------------------------- [22:59:21] Brady Wied(@wied03):can you put a "puts 'hello 123'" in your at_exit block and see if you see that ---------------------------------------------------------------------------------------------------- [23:00:18] Austin Erlandson(@erlandsona):… ---------------------------------------------------------------------------------------------------- [23:02:12] Austin Erlandson(@erlandsona):Nope still a no op… ---------------------------------------------------------------------------------------------------- [23:06:10] Brady Wied(@wied03):you're checking the browser console ? ---------------------------------------------------------------------------------------------------- [23:06:16] Austin Erlandson(@erlandsona):Yup. ---------------------------------------------------------------------------------------------------- [23:06:36] Brady Wied(@wied03):what about putting the puts statement outside the at_exit block ---------------------------------------------------------------------------------------------------- [23:09:46] Austin Erlandson(@erlandsona):Still nothing… which means the spec_helper isn’t being required anywhere. So I’ve got config/application.rb with ```ruby ############### # Opal configs. ######### # Compiler options config.opal.method_missing = true config.opal.optimized_operators = true config.opal.arity_check = false config.opal.const_missing = true config.opal.dynamic_require_severity = :ignore # Enable/disable /opal_specs route config.opal.enable_specs = true # The path to opal specs from Rails.root config.opal.spec_location = 'browser_spec' ``` I have spec_browser/browser_spec.opal with the spec. spec_browser/spec_helper.opal with ```ruby require 'opal' require 'opal-rspec' puts 'hello 123' at_exit do Opal::RSpec::Runner.autorun end ``` ---------------------------------------------------------------------------------------------------- [23:11:52] Austin Erlandson(@erlandsona):I also tried `require`ing the spec_helper from my app/assets/javascripts/application.opal file which also didn’t work :/ ---------------------------------------------------------------------------------------------------- [23:15:45] Brady Wied(@wied03):Honestly I'm not sure what it is. It's been months since I even looked at opal-rails. The opal community probably owes you a better answer than that thoguh ---------------------------------------------------------------------------------------------------- [23:15:46] Brady Wied(@wied03):though ---------------------------------------------------------------------------------------------------- [23:17:13] Austin Erlandson(@erlandsona):Haha. No biggie I also tried a simple rails new —javascripts=opal to see if I could get specs working on a sample project and same story… Do you have a working example with specs I could check out somewhere? ---------------------------------------------------------------------------------------------------- [23:17:16] Brady Wied(@wied03):@fkchang - You know what the issue might be ? ---------------------------------------------------------------------------------------------------- [23:18:51] Brady Wied(@wied03):@erlandsona - I use opal-rspec all the time and I use with Rails, just not with opal-rails specifically. If you look at the opal-rspec source, you'll see a Rake task that invokes a bunch of specs in 'spec/opal' ---------------------------------------------------------------------------------------------------- [23:20:39] Austin Erlandson(@erlandsona):Yeah I looked at the opal-rspec source and figured opal-rails was somehow doing a lot of this configuration. But it may just not be very flexible currently? I’m cool with setting up opal-rspec myself just not sure where to put the rake task in my setup? ---------------------------------------------------------------------------------------------------- [23:21:01] Brady Wied(@wied03):That's not a Rails app of course. If you like using Karma, there is a Rails integration test here https://github.com/wied03/karma-opal-rspec/tree/master/spec/integration/rails_case ---------------------------------------------------------------------------------------------------- [23:22:44] Brady Wied(@wied03):In that case, Karma auto requires opal and opal-rspec and handles the test running for you. If you want to run opal-rspec standalone, you can have an opal initializer file similar to what's in that Opal test case, then just declare a task in lib/whatever.task in your Rails app like this: ```ruby Opal::RSpec::RakeTask.new('opal:spec_in_env' => :environment) do |server, task| app = Rails.application task.files = FileList[ app.root.join('spec/javascripts/**/*_spec{,.js}.{rb,opal}'), app.root.join('spec/shared/**/*_spec{,.js}.{rb,opal}') ] task.default_path = 'spec/javascripts' app.assets.paths.each { |p| server.append_path p } %w(spec/javascripts spec/shared).each { |p| server.append_path p } end ``` ---------------------------------------------------------------------------------------------------- [23:23:48] Brady Wied(@wied03):There's nothing special about Rails there except for the dependency on environment and the fact that it adds Rails' sprockets load paths to the Opal Rake Task with the `app.assets` line ---------------------------------------------------------------------------------------------------- [23:25:15] Austin Erlandson(@erlandsona):Hmm… nice! Yeah so that part is the part I’m a bit timid about… Mainly just because I’m not as familiar with Sprockets as I should be, Grunt, Gulp, Brunch, I can configure to do my bidding but haven’t had the week or two I’d need to really dig into tinkering with the sprockets source / config to really understand how it works. ---------------------------------------------------------------------------------------------------- [23:25:45] Brady Wied(@wied03):And you don't have to require opal or opal-rspec in your specs/spec helper when you use its Rack helper (see the opal rspec homepage) or the Rake task ---------------------------------------------------------------------------------------------------- [23:26:10] Brady Wied(@wied03):And it's not an official Opal project, but some of us are tinkering around with this if you like webpack: https://github.com/cj/opal-webpack ---------------------------------------------------------------------------------------------------- [23:26:40] Brady Wied(@wied03):the latest (under dev) version of karma-opal-rspec uses that instead of Sprockets ---------------------------------------------------------------------------------------------------- [23:27:33] Austin Erlandson(@erlandsona):I’m drooling. Unfortunately I also haven’t had the week or two to dig into Webpack. :/ This is where I’d need a walkthrough or something. ---------------------------------------------------------------------------------------------------- ############################## [2016-04-25] ############################## [16:10:04] Forrest Chang(@fkchang):@erlandsona I'll see if I can duplicate ---------------------------------------------------------------------------------------------------- [16:10:27] Forrest Chang(@fkchang):but I think @elia is the real source of knowledge on this ---------------------------------------------------------------------------------------------------- [16:11:41] Austin Erlandson(@erlandsona):Thanks a ton @fkchang! If I do need to get ahold of @elia what's the best time ? ---------------------------------------------------------------------------------------------------- [16:13:20] Forrest Chang(@fkchang):@erlandsona do you have a preferred target opal and rails versions? I'll try from scratch ---------------------------------------------------------------------------------------------------- [16:14:06] Brady Wied(@wied03):@erlandsona - elia will be back in a couple days. I think he's aware of what you're asking about. It's a busy time for him with the upcoming Opal 0.10 release. ---------------------------------------------------------------------------------------------------- [16:14:14] Forrest Chang(@fkchang):I think @elia would normally be on right now, but he's normally on Italy time, but I dunno if he's elsewhere @wied03 mentioned something of him not being around for the weekend ---------------------------------------------------------------------------------------------------- [16:14:26] Austin Erlandson(@erlandsona):Ruby 2.2.0 ---------------------------------------------------------------------------------------------------- [16:14:43] Austin Erlandson(@erlandsona):Rails ~> 4.2 ---------------------------------------------------------------------------------------------------- [16:14:55] Austin Erlandson(@erlandsona):Opal ~> 9.2 ---------------------------------------------------------------------------------------------------- [18:11:53] Forrest Chang(@fkchang):@erlandsona take a look at https://github.com/fkchang/opal-rails-rspec-test ---------------------------------------------------------------------------------------------------- [18:13:37] Forrest Chang(@fkchang):I realize as I commit this, it's using opal 0.8.1 - sorry, I haven't really used 0.9 yet, so I imagine there might be some differences. This one works w/both hitting /opal_spec and rake opal:spec -- you'll notice a trick in spec-opal/spec_helper.rb that supports both in rails and phantomjs ---------------------------------------------------------------------------------------------------- [18:14:39] Forrest Chang(@fkchang):I went with the conventions of opal code in app/assets/javascripts and specs in spec-opal - which I believe to be the conventions of opal-rails, though it may not be explicitly stated as such ---------------------------------------------------------------------------------------------------- [18:14:52] Forrest Chang(@fkchang):@elia to correct if not ---------------------------------------------------------------------------------------------------- [18:20:11] Austin Erlandson(@erlandsona):Yeah I noticed that… Thanks a ton! Pulling it down now to try out. ---------------------------------------------------------------------------------------------------- [19:05:07] Austin Erlandson(@erlandsona):Pulled it down specs ran and are passing. Learning... Thanks a ton @fkchang ---------------------------------------------------------------------------------------------------- [19:09:49] Forrest Chang(@fkchang):@erlandsona cool, let me know what was wrong w/your project exactly, maybe we can document it better ---------------------------------------------------------------------------------------------------- [19:10:16] Austin Erlandson(@erlandsona):Yeah definitely. ---------------------------------------------------------------------------------------------------- [19:12:04] Zsolt Rozsnyai(@zsolt-rozsnyai):Hi, I'm trying to bring up opal with rails 5, and when I add a haml template into the sprockets load path, I get "couldn't find file 'test.haml' under 'app/templates' with type 'application/javascript' " . I have opal-rails 0.9.0.dev and opal 0.9.2 with rails 5.0.0.beta3 . ---------------------------------------------------------------------------------------------------- [19:14:36] Zsolt Rozsnyai(@zsolt-rozsnyai):I'm trying to do sthing upon the readme, but I'm stuck with this. Anybody could help? ---------------------------------------------------------------------------------------------------- [20:33:47] Forrest Chang(@fkchang):@zsolt-rozsnyai I don't believe rails 5 support is ready yet. My last collection is that @elia is still working on it. Anyone else know any different? ---------------------------------------------------------------------------------------------------- [20:36:25] Brady Wied(@wied03):I believe elia was working on the new sprockets version which is the main issue there ---------------------------------------------------------------------------------------------------- [20:57:02] Zsolt Rozsnyai(@zsolt-rozsnyai):thank you for the replies, I check if I can patch it ---------------------------------------------------------------------------------------------------- ############################## [2016-04-26] ############################## [14:57:02] Elia Schito(@elia):@zsolt-rozsnyai yes, there's a sprockets-4 branch on opal/opal ---------------------------------------------------------------------------------------------------- [14:57:08] Elia Schito(@elia):still WIP tho ---------------------------------------------------------------------------------------------------- [20:48:28] Zsolt Rozsnyai(@zsolt-rozsnyai):@elia there is no sprockets-4 branch on opal/opal, maybe you haven't pushed it. If you do, I may contribute while playing around ---------------------------------------------------------------------------------------------------- [20:50:45] Elia Schito(@elia):@zsolt-rozsnyai sorry, wrote by memory, will send you the right branch name or push it when i access a keyboard :) ---------------------------------------------------------------------------------------------------- [20:51:48] Zsolt Rozsnyai(@zsolt-rozsnyai):@elia thanks, that would be awesome ---------------------------------------------------------------------------------------------------- [22:22:00] Elia Schito(@elia):@zsolt-rozsnyai (still AFK) but quite sure it's just on my local machine, on the other hand some work is being done here to make Opal::Sprockets.load_asset obsolete and starting to work with the new `.call` based sprockets API: https://github.com/opal/opal/tree/elia/main-processor?files=1 ---------------------------------------------------------------------------------------------------- [22:25:21] Elia Schito(@elia):@zsolt-rozsnyai it's also my intention to extract sprockets support from the main Opal gem in order to allow older sprockets setups to work with the improved Opal core, PRs and feedback (as always) are very welcome ;) ---------------------------------------------------------------------------------------------------- ############################## [2016-04-28] ############################## [23:58:42] Austin Erlandson(@erlandsona):@elia So I really want to be able to replace our coffee script with Opal and I think if I get to it early enough in this app it might be do able. I can’t figure out how to get the specs set up in my project though… Are you available to help? I’ve been working through @fkchang ’s example. Is there a way to configure opal-rspec to run the specs located inside an app/concepts/feature directory? I’m using Trailblazer to organize the backend into a component based architecture and it would be really nice if I could get all the specs inside the feature directories as well. ---------------------------------------------------------------------------------------------------- ############################## [2016-04-29] ############################## [00:28:38] Austin Erlandson(@erlandsona):Nvmnd! I got it! I just had to add config.opal_spec.spec_location and modify the opal-rspec-rails gem locally so that I could use the .opal naming convention which is important if I want to eventually put regular rspec’s in the same directory as well… eg: feature/controller_spec.rb vs feature/browser_spec.opal I would want the opal runner to run opal specs for now and rspec to run regular specs. ---------------------------------------------------------------------------------------------------- [00:30:18] Austin Erlandson(@erlandsona):@fkchang ^ Yay! ---------------------------------------------------------------------------------------------------- [00:54:22] Austin Erlandson(@erlandsona):Well sort of… I got a single spec to run but I’m trying to get some actual tests to run and I can’t instantiate the object I’m trying to test… :/ ---------------------------------------------------------------------------------------------------- [08:26:56] Elia Schito(@elia):@erlandsona I'm not really familiar with trailblazer, having some example code to look at would make it easier ---------------------------------------------------------------------------------------------------- [09:23:27] Barrie Hadfield(@barriehadfield):@erlandsona have a look at http://reactrb.org/ as react components map very nicely to TRB cells (conceptually as view models). I am also using TRB concepts for the back end and have replaced my entire UI from Cells to React components using react.rb and I am never looking back! ---------------------------------------------------------------------------------------------------- [13:07:51] Austin Erlandson(@erlandsona):@barriehadfield do you have an example app with TRB and React.rb I could look at? I'm dying to try out React.rb but I can't seem to get the ecosystem set up. Is React.rb pretty easy to write opal-rspecs for? ---------------------------------------------------------------------------------------------------- [14:12:16] Brady Wied(@wied03): @erlandsona - It's not hard to write RSpec tests for React components. I have 500 of them. To my knowledge, there isn't a shared approach yet but it's not hard using the wrappers react.rb already has for React test utils ---------------------------------------------------------------------------------------------------- [14:12:35] Brady Wied(@wied03):it can be trickier if you use a lot of stateful components (as opposed to the Redux/Grand Central way) ---------------------------------------------------------------------------------------------------- [14:14:27] Brady Wied(@wied03):@erlandsona - example - https://gist.github.com/wied03/a6b198a6d8820e8328037183e7b5c6f1 ---------------------------------------------------------------------------------------------------- [14:18:58] Barrie Hadfield(@barriehadfield):@erlandsona I will publish a sample app over the weekend for you. It did take some time to get the echosystem all working but I have eventually settled on using a combination of some gems (with Sprockets) and most of the front end assets beling delivered by Webpack. I would love to get 100% Webpack for the FE and am eagerly watching Opal progress here. ---------------------------------------------------------------------------------------------------- [14:20:39] Brady Wied(@wied03):@barriehadfield - https://github.com/cj/opal-webpack ---------------------------------------------------------------------------------------------------- [14:22:52] Barrie Hadfield(@barriehadfield):yes, I am very excited about that. I have not tried it yet and wondered if it would play nicely with the react.rb approach? ---------------------------------------------------------------------------------------------------- [14:24:01] Brady Wied(@wied03):I can't speak to Reactive record and all that stuff, but the core React.rb should work fine ---------------------------------------------------------------------------------------------------- [14:25:13] Barrie Hadfield(@barriehadfield):would there be any special considerations? (I had been thinking I would have to remove the react.rb gem and go 100% webpack). ---------------------------------------------------------------------------------------------------- [14:27:24] Brady Wied(@wied03):no. if you did that, you'd have to write React components the JS way ---------------------------------------------------------------------------------------------------- [14:27:50] Brady Wied(@wied03):React.rb GEM and opal webpack do not do the same thing. Webpack, if you use it a runtime, is more of a replacement for sprockets than it is React.rb ---------------------------------------------------------------------------------------------------- [14:28:09] Brady Wied(@wied03):I only use it to run tests with Karma right now ---------------------------------------------------------------------------------------------------- [14:28:10] Barrie Hadfield(@barriehadfield):excellent news ---------------------------------------------------------------------------------------------------- [14:51:16] Austin Erlandson(@erlandsona):@barriehadfield are you available to do like a hangout and take a look at the system by any chance? ---------------------------------------------------------------------------------------------------- [14:57:50] Barrie Hadfield(@barriehadfield):@erlandsona sure - happy to do that. message me privatly and we can set it up ---------------------------------------------------------------------------------------------------- [16:21:41] Austin Erlandson(@erlandsona):So @barriehadfield and I were not able to get the specs to run… anyone else want to jump on a hangout with me and try to figure it out? @wied03 I’m super close just can’t quite get the spec to recognize the file I’m trying to test and I’ve tried requiring but no luck... ---------------------------------------------------------------------------------------------------- [16:25:00] Austin Erlandson(@erlandsona):I’ve got `config.opal_spec.spec_location = 'app/concepts’` in config/application.rb I bundle opened opal-rspec-rails and patched the opal/opal-rspec-rails-runner.rb.erb file to recognize `**/*_spec.opal` instead of `**/*_spec.rb` files… which works well. And that config works without a spec_helper. But this is the part where I think I need a spec_helper to load all the opal source so I can test it from my _spec.opal files as currently the classes I have defined in my source files are not available in the _spec scope. Thoughts? ---------------------------------------------------------------------------------------------------- [16:31:06] Brady Wied(@wied03):@erlandsona - you have to `require` what you're testing from your specs no matter what. that's true for anything outside of Rails autoload ---------------------------------------------------------------------------------------------------- [16:31:25] Brady Wied(@wied03):now if that doesn't throw a sprockets error, then sprockets is including your impl ---------------------------------------------------------------------------------------------------- [16:31:41] Austin Erlandson(@erlandsona):yeah I’m getting the sprockets error page when I add the `require ‘infinite_scroll’` at the top of the infinite_scroll_spec.opal file ---------------------------------------------------------------------------------------------------- [16:36:34] Brady Wied(@wied03):is infinite_scroll in your Opal load path ? ---------------------------------------------------------------------------------------------------- [16:38:18] Austin Erlandson(@erlandsona):Not exactly sure how to answer that. The code for the infinite scroll works EG: the page infinitely scrolls and there’s no JS that would make that happen… But it may not be in the load path for the specs… Stupid question but how do I determine the load path? ---------------------------------------------------------------------------------------------------- [16:38:21] Brady Wied(@wied03):```ruby # config/initializers/opal.rb Rails.application.config.assets.paths << Rails.root.join('app', 'views', 'shared').to_s ``` ---------------------------------------------------------------------------------------------------- [16:38:39] Brady Wied(@wied03):you would need to have something like that ---------------------------------------------------------------------------------------------------- [16:38:46] Brady Wied(@wied03):this is from the opal-rails site ---------------------------------------------------------------------------------------------------- [16:39:24] Brady Wied(@wied03):in opal-rails case, the Opal load paths all end up in sprockets' load path, which is what Rails.application.config.assets.paths is ---------------------------------------------------------------------------------------------------- [16:39:47] Brady Wied(@wied03):one of the directories in that load path needs to contain 'infinite_scroll' for this to work ---------------------------------------------------------------------------------------------------- [16:40:16] Austin Erlandson(@erlandsona):It should… Let me double check though... ---------------------------------------------------------------------------------------------------- [16:40:29] Brady Wied(@wied03):and it can't be in a subdirectory or what not unless that subdirectory is in your load path or you require it differently than you are ---------------------------------------------------------------------------------------------------- [16:41:02] Brady Wied(@wied03):this may be working differently at runtime if you're using sprockets //=require stuff and relative stuff in something like application.js ---------------------------------------------------------------------------------------------------- [16:41:16] Austin Erlandson(@erlandsona):I’m assuming you don’t have a second to screenshare? ---------------------------------------------------------------------------------------------------- [16:42:39] Brady Wied(@wied03):correct, i'm working :( ---------------------------------------------------------------------------------------------------- [16:43:07] Brady Wied(@wied03):I could look without audio though ---------------------------------------------------------------------------------------------------- [16:43:25] Austin Erlandson(@erlandsona):Haha hey me too! :+1: for $. Alright that could work. ---------------------------------------------------------------------------------------------------- [17:31:11] Austin Erlandson(@erlandsona):Yay! @wied03 is the bomb! Turned out it the specs didn’t have jQuery available… I think we just need to add documentation that iterates on this http://rubyist.jaredwhite.com/2015/07/22/how-to-introduce-opal-gently-into-a-legacy-rails-app/ But that also explains the responsibility of the spec_helper. EG: It’s supposed to add the necessary require statements for dependencies that will be used by all you’re specs. And that also you need to require the spec_helper and whatever file you’re testing at the top of your spec file. At least initially until there’s a good solution for meta-programming those import statements that could be built into the opal-rspec-rails gem. Those are my thoughts. ---------------------------------------------------------------------------------------------------- [17:33:06] Brady Wied(@wied03):To follow up on what @erlandsona said, I created an issue here - https://github.com/opal/opal-rspec-rails/issues/2 ---------------------------------------------------------------------------------------------------- [17:45:58] Austin Erlandson(@erlandsona):@wied03 what’s the rake task for running opal specs? Or will they just run as rspecs? ---------------------------------------------------------------------------------------------------- [17:46:30] Austin Erlandson(@erlandsona):EG: right now I run `bundle exec rspec` to run my specs… is there something specific I should do for opal? ---------------------------------------------------------------------------------------------------- [17:52:46] Brady Wied(@wied03):they will not run as rspecs ---------------------------------------------------------------------------------------------------- [17:52:54] Brady Wied(@wied03):bundle exec rake opal:spec usually ---------------------------------------------------------------------------------------------------- [17:54:17] Brady Wied(@wied03):i'm not sure if opal-rails or opal-rspec-rails still include the rake task ---------------------------------------------------------------------------------------------------- [17:54:22] Austin Erlandson(@erlandsona):But since it’s not the spec directory would that matter? ---------------------------------------------------------------------------------------------------- [17:56:15] Austin Erlandson(@erlandsona):Also does opal have a require_tree equivalent? ---------------------------------------------------------------------------------------------------- [17:56:36] Brady Wied(@wied03):maybe elia is still working on that for opal-rspec-rails. in any case, you can just declare your own inside lib/tasks/some_fille.rake like this: ```ruby Opal::RSpec::RakeTask.new('opal:spec' => :environment) do |server, task| app = Rails.application task.files = FileList[ app.root.join('spec/javascripts/**/*_spec{,.js}.{rb,opal}') ] task.default_path = 'spec/javascripts' app.assets.paths.each { |p| server.append_path p } %w(spec/javascripts).each { |p| server.append_path p } end ``` ---------------------------------------------------------------------------------------------------- [17:57:24] Austin Erlandson(@erlandsona):Sweet! ---------------------------------------------------------------------------------------------------- [17:57:51] Brady Wied(@wied03):this is following the same stuff that's on the opal-rspec page. only difference with rails is the dependency on the environment task and `app.assets.paths.each { |p| server.append_path p }` ---------------------------------------------------------------------------------------------------- [17:58:15] Brady Wied(@wied03):yes, `require_tree` works in opal ---------------------------------------------------------------------------------------------------- [17:59:15] Brady Wied(@wied03):http://opalrb.org/docs/guides/v0.9.2/compiler_directives.html ---------------------------------------------------------------------------------------------------- [17:59:27] Austin Erlandson(@erlandsona):Alright working it out now! Got 8 green specs so far! WooooHooo!!! ---------------------------------------------------------------------------------------------------- [18:10:54] Austin Erlandson(@erlandsona):So I’m getting uninitialized constant Opal::RSpec::RakeTask? Thoughts? ---------------------------------------------------------------------------------------------------- [19:11:29] Brady Wied(@wied03):require the rake task first ---------------------------------------------------------------------------------------------------- [19:11:41] Brady Wied(@wied03):see opal-rspec page ---------------------------------------------------------------------------------------------------- [19:41:02] Austin Erlandson(@erlandsona):Got it. Thanks! ---------------------------------------------------------------------------------------------------- [19:43:02] Austin Erlandson(@erlandsona):It worked! Yay! ---------------------------------------------------------------------------------------------------- ############################## [2016-05-01] ############################## [21:35:48] Jamie Gaskins(@jgaskins):Is there a way to get `Opal::Builder` to use a file cache? ---------------------------------------------------------------------------------------------------- [21:41:29] Jamie Gaskins(@jgaskins):Well, that or something similar. I'm using `rerun` to reload a Roda app in development and I don't want to have to wait for my entire app to recompile each time, so I need something to let it reuse whatever hasn't changed since the last reload. ---------------------------------------------------------------------------------------------------- [22:56:05] Brady Wied(@wied03):@jgaskins - Only places I've used cache with Opal are the Sprockets route or with the webpack loader, which uses Builder, I borrowed the babel loader cache ---------------------------------------------------------------------------------------------------- ############################## [2016-05-02] ############################## [18:37:50] Jamie Gaskins(@jgaskins):@wied03 In Roda, [this](https://github.com/jeremyevans/roda-opal-example/blob/abb63538ffaa0087b530cb5ed7e64cf4b1d19b0f/config.ru#L4-L7 ) is the only way I know of to get an Opal app working: ```ruby class App < Roda plugin :assets, js: ['test.rb'], js_opts: { builder: Opal::Builder.new } compile_assets # This only runs once, at app startup end ``` ---------------------------------------------------------------------------------------------------- [18:41:49] Brady Wied(@wied03):@jgaskins - @cj has done work with Roda and Opal. Perhaps he can shed some light on what he does ---------------------------------------------------------------------------------------------------- [19:35:35] CJ Lazell(@cj):@jgaskins I just use webpack with roda :) ---------------------------------------------------------------------------------------------------- [02:38:26] Jamie Gaskins(@jgaskins):@wied03 Yeah, I was hoping for something like the `Sprockets::FileCache`. Looking at the code for `Opal::Builder`, though, it doesn't look like it supports it. ---------------------------------------------------------------------------------------------------- [11:14:26] Elia Schito(@elia):@jgaskins there's an old cache-related PR from adam, maybe you can give it a try (if it merges cleanly with master), if it works well it can be merged in master I guess… ---------------------------------------------------------------------------------------------------- [14:55:33] Brady Wied(@wied03):@jgaskins - Why would you want to cache directly with Builder without some higher level code doing it ? ---------------------------------------------------------------------------------------------------- ############################## [2016-05-03] ############################## [17:34:29] Forrest Chang(@fkchang):I'm coining the term "Node fatigue" unless it's already been coined https://twitter.com/fkchang2000/status/727551409151840256 ---------------------------------------------------------------------------------------------------- [17:34:41] Forrest Chang(@fkchang):I do see opal helping to remedy such ---------------------------------------------------------------------------------------------------- [20:21:47] Mitch VanDuyn(@catmando):Cool I just put a comment on that... a hidden item in all this is why go to node in the first place? Probably because of the beauty of one language everywhere. So opalrb gives a better solution to the same root problem. ---------------------------------------------------------------------------------------------------- ############################## [2016-05-04] ############################## [00:50:51] Forrest Chang(@fkchang):What versions of opal are people using? Wondering if it's worth the effort to add some features to opal-irb supporting 0.8 ---------------------------------------------------------------------------------------------------- [00:50:58] Forrest Chang(@fkchang):or just do 0.9? ---------------------------------------------------------------------------------------------------- [02:24:06] Brady Wied(@wied03):Since it moves so fast, I pretty much use the latest version ---------------------------------------------------------------------------------------------------- [02:24:17] Brady Wied(@wied03):the version of opal-rspec that will come out when 0.10 does only supports 0.10 ---------------------------------------------------------------------------------------------------- [02:24:51] Brady Wied(@wied03):I think when it gets closer to a 1.0 release, slowing down and supporting lots of versions will probably get more important ---------------------------------------------------------------------------------------------------- [02:24:57] Brady Wied(@wied03):as in lib maintainers slowing down ---------------------------------------------------------------------------------------------------- [08:05:20] Elia Schito(@elia):agree ---------------------------------------------------------------------------------------------------- [15:20:35] Jared White(@jaredcwhite):Hi all -- I've been playing around with adding some interactive elements to my personal Jekyll-based blog using Opal and my Polished-Knockout gem. Had a weird issue come up, this is with Opal 0.9.2. I got an error with my built code because the compiled JS was trying to call Opal.to_a and failed. I looked and saw that in the JS context there's an Opal.to_ary but no Opal.to_a. On a whim, I added a script tag and did Opal.to_a = Opal.to_ary. Then my stuff ran just fine. Is this some kind of compilation bug perhaps? Or do I need to do something different with how I'm building my Opal files. Thanks! ---------------------------------------------------------------------------------------------------- [15:25:06] Elia Schito(@elia):@jaredcwhite it's a bug, if you can find which code is producing the `.to_a` please file an issue and we'll fix it ---------------------------------------------------------------------------------------------------- [15:25:40] Elia Schito(@elia):of course if it's 3rd party stuff it's a matter of updating the 3rd party code :) ---------------------------------------------------------------------------------------------------- [15:33:31] Jared White(@jaredcwhite):@elia I think I pinpointed the problem. Issue filed: https://github.com/opal/opal/issues/1466 ---------------------------------------------------------------------------------------------------- [15:37:54] Elia Schito(@elia)::+1: thx ---------------------------------------------------------------------------------------------------- [17:33:32] CJ Lazell(@cj):I know opal has no public/private methods. but shouldn't #public_methods(false) work? or even #methods(false) ? ---------------------------------------------------------------------------------------------------- [17:58:25] CJ Lazell(@cj):dajvu https://github.com/opal/opal/pull/909 :) ---------------------------------------------------------------------------------------------------- [21:41:18] Elia Schito(@elia):@cj the question is: given there's no public/private, what should public_methods and methods should return? all methods? no methods? ---------------------------------------------------------------------------------------------------- ############################## [2016-05-05] ############################## [19:07:02] CJ Lazell(@cj):@elia well with false it should be user defined methods at least. like mri ---------------------------------------------------------------------------------------------------- ############################## [2016-05-06] ############################## [04:17:25] Jamie Gaskins(@jgaskins):@elia Instead of going with the `Opal::Builder` approach to compile the assets for my Roda app, I tried mounting an `Opal::Server` to handle anything coming into `/assets`. Figured it might help by not having to restart the entire app when I'm only modifying front-end stuff. But that doesn't seem to be working, either. I think it might be the fact that it uses its own middleware. ---------------------------------------------------------------------------------------------------- [04:22:01] Jamie Gaskins(@jgaskins): ---------------------------------------------------------------------------------------------------- [04:24:09] Jamie Gaskins(@jgaskins): ---------------------------------------------------------------------------------------------------- [04:26:22] Jamie Gaskins(@jgaskins): ---------------------------------------------------------------------------------------------------- [04:29:38] Jamie Gaskins(@jgaskins):Deleting messages because I realized a problem I'm having with Rack apps is due to something I've already reported that @elia already told me how to solve. ---------------------------------------------------------------------------------------------------- [04:38:30] Jamie Gaskins(@jgaskins):@elia Does it seem reasonable to rework `Opal::Server` to delegate asset compilation to some smaller, more focused `Opal::AssetServer` Rack app? I ended up having to write my own asset-compiling Rack app to delegate to in this app. :-) ---------------------------------------------------------------------------------------------------- [05:58:08] Elia Schito(@elia):@jgaskins sounds interesting, anything cleaner or more manageable is welcome, it's ok if you wanna open a PR with your current code just to start the conversation ---------------------------------------------------------------------------------------------------- [13:29:37] Jamie Gaskins(@jgaskins)::+1: ---------------------------------------------------------------------------------------------------- [21:25:52] roupen(@roupen):hi guys, I was checking out the opal docs and was trying out some of the code for accessing the native window object and for some reason it's returning null for me. I'm pretty sure I copied and pasted the code exactly as you have it written in the docs: http://goo.gl/lZar8s ---------------------------------------------------------------------------------------------------- [21:48:58] Elia Schito(@elia):For some reason I think the window var is conflicting with the window global object, using win instead makes it work ---------------------------------------------------------------------------------------------------- [21:48:59] Elia Schito(@elia):http://opalrb.org/try/?code:require%20'native'%0A%0Awin%20%3D%20Native(%60window%60)%0Aputs%20%22location%20href%3A%22%0Aputs%20win%5B%3Alocation%5D%5B%3Ahref%5D ---------------------------------------------------------------------------------------------------- [21:49:20] Elia Schito(@elia):@roupen the would be if you caould send a PR to fix the docs ---------------------------------------------------------------------------------------------------- ############################## [2016-05-07] ############################## [23:41:58] Martin Becker(@Thermatix):can some one link me front end testing suites? ---------------------------------------------------------------------------------------------------- [23:42:15] Martin Becker(@Thermatix):I've decided it's time I got around to adding spec test's to my Ruta library ---------------------------------------------------------------------------------------------------- ############################## [2016-05-08] ############################## [13:17:55] Austin Erlandson(@erlandsona):Just use RSpec! That's the beauty of Opal!!! Yay! ---------------------------------------------------------------------------------------------------- [14:20:38] Austin Erlandson(@erlandsona):Anyone here who's using the React.rb stuff using Relay / GraphQL ruby as well? ---------------------------------------------------------------------------------------------------- [14:22:15] Austin Erlandson(@erlandsona):I got the server piece of the GraphQL Ruby stuff working... Haven't opened up an endpoint for it yet but I'm trying to figure out how I would go about creating a React.rb Todo app with GraphQL / Relay / RSpec!!! ---------------------------------------------------------------------------------------------------- [14:35:00] Martin Becker(@Thermatix):to be blunt, I'm not a fan of rspec to be honest, I prefer minitest ---------------------------------------------------------------------------------------------------- [14:35:27] Martin Becker(@Thermatix):but I don't know what test libs are available ---------------------------------------------------------------------------------------------------- [14:42:00] Brock Wilcox(@awwaiid):@Thermatix https://github.com/aost/opal-minitest suggests you might have your wish ---------------------------------------------------------------------------------------------------- [14:42:09] Brock Wilcox(@awwaiid):(worth a try) ---------------------------------------------------------------------------------------------------- [16:25:28] Martin Becker(@Thermatix):Noice! ---------------------------------------------------------------------------------------------------- [16:39:45] Austin Erlandson(@erlandsona):@Thermatix I think I'm starting to get annoyed with RSpec / Rails too! I want to put my spec files next to their corresponding source files and RSpec is behaving very weird! ---------------------------------------------------------------------------------------------------- [17:44:28] Martin Becker(@Thermatix):@erlandsona you don't like having a separate spec folder? ---------------------------------------------------------------------------------------------------- [17:46:59] Austin Erlandson(@erlandsona):Nope, I prefer keeping all the files necessary for a feature under the same directory. ---------------------------------------------------------------------------------------------------- [17:48:37] Martin Becker(@Thermatix):fair do's ---------------------------------------------------------------------------------------------------- [17:48:45] Martin Becker(@Thermatix):I prefer keeping them in a spec folder ---------------------------------------------------------------------------------------------------- [17:48:56] Martin Becker(@Thermatix):personally I just like how minitest is well, mini ---------------------------------------------------------------------------------------------------- [17:49:00] Martin Becker(@Thermatix):it's like 300 lines ---------------------------------------------------------------------------------------------------- [17:49:13] Martin Becker(@Thermatix):compaired to rspec, that's tiny ---------------------------------------------------------------------------------------------------- [17:50:47] Austin Erlandson(@erlandsona):I mean yes, granted at the cost of being a more verbose syntax… Or if you disagree I would argue it’s certainly less expressive than RSpec. But then again as I mentioned I’m rather annoyed with RSpec at the moment as well so don’t take these comments as praise either... ---------------------------------------------------------------------------------------------------- [17:51:26] Martin Becker(@Thermatix):more verbose? ---------------------------------------------------------------------------------------------------- [19:33:20] Austin Erlandson(@erlandsona):I'm just really used to the describe/context syntax... ---------------------------------------------------------------------------------------------------- [22:57:39] Martin Becker(@Thermatix):you realise that minitest uses describe, it and so on and that you don't need context becuase you can nest describe blocks? ---------------------------------------------------------------------------------------------------- [22:57:53] Martin Becker(@Thermatix):like this: ---------------------------------------------------------------------------------------------------- [22:58:47] Austin Erlandson(@erlandsona):Didn’t realize MiniTest had describe! Noice! Saweet! ---------------------------------------------------------------------------------------------------- [22:59:09] Martin Becker(@Thermatix):```ruby describe :Some_Class do describe '#some_function' do it 'does somthing' do end it 'does somthing else' do end end end ``` ---------------------------------------------------------------------------------------------------- [22:59:31] Martin Becker(@Thermatix):how are you using it? ---------------------------------------------------------------------------------------------------- [22:59:33] Martin Becker(@Thermatix): ---------------------------------------------------------------------------------------------------- [23:00:23] Brock Wilcox(@awwaiid):minitest can be used with either the 'spec' style or a more junity style ---------------------------------------------------------------------------------------------------- [23:01:08] Martin Becker(@Thermatix):junity? ---------------------------------------------------------------------------------------------------- [23:03:39] Martin Becker(@Thermatix):what's that? ---------------------------------------------------------------------------------------------------- [23:07:26] Brady Wied(@wied03):I don't think describe vs. context is much of a differentiator. context is just an alias for describe in RSpec anyways. It mainly is for who's reading the test ---------------------------------------------------------------------------------------------------- [23:08:45] Brady Wied(@wied03):the 'let' stuff, matchers, all of that I think is more what RSpec brings to the table ---------------------------------------------------------------------------------------------------- [23:08:58] Brady Wied(@wied03):and not everyone needs or cares about that ---------------------------------------------------------------------------------------------------- [23:09:32] Brady Wied(@wied03):@Thermatix - junity means a more junit-like syntax I bet ---------------------------------------------------------------------------------------------------- [23:30:00] Austin Erlandson(@erlandsona):@wied03 is correct, I do use let statements quite a bit. But I could do without those in favor of being able to have my spec files under my feature directory?! ---------------------------------------------------------------------------------------------------- ############################## [2016-05-09] ############################## [00:53:49] Martin Becker(@Thermatix):let(:subject) { some object stuff} ---------------------------------------------------------------------------------------------------- [00:54:01] Martin Becker(@Thermatix):at least in minitest ---------------------------------------------------------------------------------------------------- [00:54:14] Martin Becker(@Thermatix):it's basically a pre-defined let ---------------------------------------------------------------------------------------------------- [00:54:41] Austin Erlandson(@erlandsona):```ruby describe SomeClass do subject { described_class.new(let_variable) } let(:let_variable) { “some initial value” } it { is_expected.to be_some_initial_value } describe “#method” do let(:let_variable) { “some other value” } it { is_expected.to be_some_other_value } end end ``` ---------------------------------------------------------------------------------------------------- [00:55:17] Martin Becker(@Thermatix):I didn't know you could do that ---------------------------------------------------------------------------------------------------- [00:55:27] Martin Becker(@Thermatix):I wonder if that works minitest ---------------------------------------------------------------------------------------------------- [00:56:15] Austin Erlandson(@erlandsona):Yup. that’s why they’re called late binding. It uses laziness so that the variable doesn’t get set except in the context it’s needed… It’s very Haskell-like. ---------------------------------------------------------------------------------------------------- [00:56:28] Martin Becker(@Thermatix):I see I see ---------------------------------------------------------------------------------------------------- [00:56:35] Martin Becker(@Thermatix):that's dry and more expressive ---------------------------------------------------------------------------------------------------- [00:56:36] Martin Becker(@Thermatix):I like it ---------------------------------------------------------------------------------------------------- [00:56:50] Martin Becker(@Thermatix):but does it work in minitest? ---------------------------------------------------------------------------------------------------- [00:58:02] Austin Erlandson(@erlandsona):In case you’re into it betterspecs.org is a great resource for learning how to write better specs… LOL No pun intended but for real I learned a ton about writting good specs from there… Let me know if it does work in MiniTest because I’m really pissed off trying to get rspec to not run my specs twice when I’ve got them in the app directory. Any thoughts? ---------------------------------------------------------------------------------------------------- [01:01:01] Martin Becker(@Thermatix):one moment ---------------------------------------------------------------------------------------------------- [01:01:31] Martin Becker(@Thermatix):it does work ---------------------------------------------------------------------------------------------------- [01:01:39] Martin Becker(@Thermatix):had to add some context's though ---------------------------------------------------------------------------------------------------- [01:02:00] Martin Becker(@Thermatix):```ruby describe :test_data do subject {Differentiator.new(input).result } describe :first_test do let(:input){[3,2,1]} it "expects result to be 6x+2" do subject.must_equal "6x+2" end end describe :second_test do let(:input){[4,3,2,1]} it "expects result to be 12x^2+6x+2" do subject.must_equal "12x^2+6x+2" end end describe :third_test do let(:input){[4,-5,0,1]} it "expects result to be 12x^2#{-10}x" do subject.must_equal "12x^2#{-10}x" end end end ``` ---------------------------------------------------------------------------------------------------- [01:03:27] Austin Erlandson(@erlandsona):Yeauh yeauh!!! Wait, those are MiniTest specs? Dude!!! I’m totally switching! Holy crap! Wait does MiniTest have Shoulda-Matchers? ---------------------------------------------------------------------------------------------------- [01:03:32] Martin Becker(@Thermatix):yes ---------------------------------------------------------------------------------------------------- [01:03:38] Martin Becker(@Thermatix):no idea ---------------------------------------------------------------------------------------------------- [01:03:47] Martin Becker(@Thermatix):but maybe? ---------------------------------------------------------------------------------------------------- [01:04:14] Austin Erlandson(@erlandsona):Wait i’m stupid… https://github.com/thoughtbot/shoulda-matchers#shoulda-matchers--- ---------------------------------------------------------------------------------------------------- [01:04:56] Austin Erlandson(@erlandsona):of course shoulda supports “you’re testing framework of choice.” Like most good gems would right?! Wait a second… why on earth am I using Rspec then? ---------------------------------------------------------------------------------------------------- [01:05:09] Martin Becker(@Thermatix):lol ---------------------------------------------------------------------------------------------------- [01:05:17] Martin Becker(@Thermatix):becuase some one told you ---------------------------------------------------------------------------------------------------- [01:05:31] Martin Becker(@Thermatix):"Evyer oen using rspec" ---------------------------------------------------------------------------------------------------- [01:06:03] Martin Becker(@Thermatix):so you thought ---------------------------------------------------------------------------------------------------- [01:06:22] Austin Erlandson(@erlandsona):I hate the world right now. Freaking “Rails way” is the most absurd thing I’m coming to realize! Good God Ruby peeps, why?! ---------------------------------------------------------------------------------------------------- [01:06:26] Martin Becker(@Thermatix):"Ok I'm going to use rspec too, just like every one else" ---------------------------------------------------------------------------------------------------- [01:06:35] Martin Becker(@Thermatix):this is why I like sinatra ---------------------------------------------------------------------------------------------------- [01:06:40] Martin Becker(@Thermatix):YES you have to set it up yourself ---------------------------------------------------------------------------------------------------- [01:06:44] Martin Becker(@Thermatix):but as a result ---------------------------------------------------------------------------------------------------- [01:06:46] Martin Becker(@Thermatix):you know it ---------------------------------------------------------------------------------------------------- [01:06:47] Martin Becker(@Thermatix):inside ---------------------------------------------------------------------------------------------------- [01:06:49] Martin Becker(@Thermatix):and out ---------------------------------------------------------------------------------------------------- [01:06:56] Martin Becker(@Thermatix):I can intergrate sprockets into sinatra now easioly ---------------------------------------------------------------------------------------------------- [01:06:58] Martin Becker(@Thermatix):and with opal ---------------------------------------------------------------------------------------------------- [01:07:04] Martin Becker(@Thermatix):and anything else I might want ---------------------------------------------------------------------------------------------------- [01:07:30] Martin Becker(@Thermatix):I even worked out how to do a rails style separate route to symbol mapper ---------------------------------------------------------------------------------------------------- [01:07:57] Martin Becker(@Thermatix):then you could just reference the symbol in sinatra and it would automatically map to it when you called it ---------------------------------------------------------------------------------------------------- [01:08:10] Austin Erlandson(@erlandsona):I really want to work on whatever project you’re working on @Thermatix. I need to learns and I feel like even the most Sr. Dev’s at my company can’t answer these questions… Ugh… ---------------------------------------------------------------------------------------------------- [01:09:03] Martin Becker(@Thermatix):lol that I did for fun ---------------------------------------------------------------------------------------------------- [01:09:15] Martin Becker(@Thermatix):now I have to add spec's to my ruta library before I continue ---------------------------------------------------------------------------------------------------- [01:09:33] Martin Becker(@Thermatix):I want to add some features but with everything added I risk the chance of breaking it ---------------------------------------------------------------------------------------------------- [01:09:37] Martin Becker(@Thermatix):so good test coverages is needed ---------------------------------------------------------------------------------------------------- [01:10:01] Martin Becker(@Thermatix):but at the moment I'm not working on any projects besides personal stuff ---------------------------------------------------------------------------------------------------- [01:10:05] Martin Becker(@Thermatix):out of a job at the moment :( ---------------------------------------------------------------------------------------------------- [01:10:23] Martin Becker(@Thermatix):and almost every company I've interviewed at have cheated me ---------------------------------------------------------------------------------------------------- [01:10:31] Martin Becker(@Thermatix):I'm looking for junior-midlevel ---------------------------------------------------------------------------------------------------- [01:10:44] Martin Becker(@Thermatix):what they want is a midlevel willing to work for the pay of a junior ---------------------------------------------------------------------------------------------------- [01:10:50] Martin Becker(@Thermatix):but they can't say that ---------------------------------------------------------------------------------------------------- [01:10:53] Martin Becker(@Thermatix):so they go ---------------------------------------------------------------------------------------------------- [01:10:56] Martin Becker(@Thermatix):OH you're not senior enough ---------------------------------------------------------------------------------------------------- [01:10:57] Martin Becker(@Thermatix):... ---------------------------------------------------------------------------------------------------- [01:11:09] Martin Becker(@Thermatix):senior enough for a junior-ish role? ---------------------------------------------------------------------------------------------------- [01:11:10] Martin Becker(@Thermatix):really? ---------------------------------------------------------------------------------------------------- [01:11:25] Martin Becker(@Thermatix):but yeah I know how that feels ---------------------------------------------------------------------------------------------------- [01:11:42] Martin Becker(@Thermatix):when I Was at just giving I was the most knowledgeable at ruby ---------------------------------------------------------------------------------------------------- [01:11:51] Martin Becker(@Thermatix):so I had to figure everything out my-self ---------------------------------------------------------------------------------------------------- [01:11:57] Martin Becker(@Thermatix):wasn't easy ---------------------------------------------------------------------------------------------------- [01:12:02] Martin Becker(@Thermatix):but I learnt a lot doing it ---------------------------------------------------------------------------------------------------- [01:12:10] Martin Becker(@Thermatix):but I probably picked up a lot of bad habbits probably ---------------------------------------------------------------------------------------------------- [01:12:35] Martin Becker(@Thermatix):sorry ---------------------------------------------------------------------------------------------------- [01:12:36] Martin Becker(@Thermatix):rambling ---------------------------------------------------------------------------------------------------- [01:14:44] Austin Erlandson(@erlandsona):Naw I feel the same. Granted I'm very fortunate and great ful for my Salary at the moment. Hoping to get a bit of a raise soon? We'll see. ---------------------------------------------------------------------------------------------------- [01:15:50] Martin Becker(@Thermatix):good lucj ---------------------------------------------------------------------------------------------------- [01:15:54] Martin Becker(@Thermatix):luck* ---------------------------------------------------------------------------------------------------- [16:05:06] Brady Wied(@wied03):@erlandsona - I think it's bless black and white than that re: the Rails way ---------------------------------------------------------------------------------------------------- [16:05:51] Brady Wied(@wied03):and sometimes the quest for simplicity can be as blinding as the Rails colored glasses ---------------------------------------------------------------------------------------------------- [16:23:44] Austin Erlandson(@erlandsona):Fair enough @wied03 agreed. ---------------------------------------------------------------------------------------------------- [22:03:02] Jamie Gaskins(@jgaskins):@wied03 And not even everyone defines simplicity the same. Some think less code is simpler. Some think less magic is simpler. :-) ---------------------------------------------------------------------------------------------------- [22:36:32] Austin Erlandson(@erlandsona):Truths ---------------------------------------------------------------------------------------------------- [23:07:10] Mitch VanDuyn(@catmando):@/all setting up a small gem that has some configuration that is needed on both the server and client... ---------------------------------------------------------------------------------------------------- [23:07:18] Mitch VanDuyn(@catmando):what is the best approach for doing this. ---------------------------------------------------------------------------------------------------- [23:07:53] Mitch VanDuyn(@catmando):say for example I have a config variable Foo.key that is set in an initializer on the server... ---------------------------------------------------------------------------------------------------- [23:08:05] Mitch VanDuyn(@catmando):I want the same value of key to be accessible on the client. ---------------------------------------------------------------------------------------------------- [23:08:40] Mitch VanDuyn(@catmando):If I was sure I was in rails I would so a <%= Foo.key %> but not sure if that is guaranteed to work in all situations? ---------------------------------------------------------------------------------------------------- [00:44:22] Brock Wilcox(@awwaiid):@Thermatix ya, what @wied03 said -- https://github.com/seattlerb/minitest#unit-tests is an example of this style ---------------------------------------------------------------------------------------------------- [00:47:04] Martin Becker(@Thermatix):I actually have a problem against the let or subject mechanism ---------------------------------------------------------------------------------------------------- [00:47:21] Martin Becker(@Thermatix):becuase you can't pass a value into it ---------------------------------------------------------------------------------------------------- [00:47:45] Martin Becker(@Thermatix):you have to do somthing like this: ---------------------------------------------------------------------------------------------------- [00:47:53] Martin Becker(@Thermatix):```ruby subject { proc {|input| Differentiator.new(input).result }} ``` ---------------------------------------------------------------------------------------------------- [00:48:01] Brock Wilcox(@awwaiid):Where does the input come from? ---------------------------------------------------------------------------------------------------- [00:48:08] Martin Becker(@Thermatix):and then use it like this ---------------------------------------------------------------------------------------------------- [00:48:14] Martin Becker(@Thermatix):```ruby subject.([3,2,1]).must_equal "6x+2" ``` ---------------------------------------------------------------------------------------------------- [00:48:21] Brock Wilcox(@awwaiid):hmm ---------------------------------------------------------------------------------------------------- [00:48:30] Martin Becker(@Thermatix):it's a proc that returns a proc ---------------------------------------------------------------------------------------------------- [00:48:36] Martin Becker(@Thermatix):so you have to call it ---------------------------------------------------------------------------------------------------- [00:48:40] Martin Becker(@Thermatix):in reality ---------------------------------------------------------------------------------------------------- [00:48:45] Martin Becker(@Thermatix):you should be able to do this: ---------------------------------------------------------------------------------------------------- [00:49:04] Brock Wilcox(@awwaiid):Interesting. I think I typically just have one subject for a describe block, and maybe have a nested block with an override subject/let if needed ---------------------------------------------------------------------------------------------------- [00:49:08] Martin Becker(@Thermatix):```ruby subject {|input| Differentiator.new(input).result } ``` ---------------------------------------------------------------------------------------------------- [00:49:19] Martin Becker(@Thermatix):and then use it like this: ---------------------------------------------------------------------------------------------------- [00:49:29] Martin Becker(@Thermatix):```ruby subject([3,2,1]).must_equal "6x+2" ``` ---------------------------------------------------------------------------------------------------- [00:49:47] Martin Becker(@Thermatix):basicly I used it for this test data: ---------------------------------------------------------------------------------------------------- [00:49:52] Martin Becker(@Thermatix):```ruby describe :test_data do # a proc that returns a proc, not how I want it but only way to get this to be dry subject { proc {|input| Differentiator.new(input).result }} it "expects result to be 6x+2" do subject.([3,2,1]).must_equal "6x+2" end it "expects result to be 12x^2+6x+2" do subject.([4,3,2,1]).must_equal "12x^2+6x+2" end it "expects result to be 12x^2#{-10}x" do subject.([4,-5,0,1]).must_equal "12x^2#{-10}x" end end ``` ---------------------------------------------------------------------------------------------------- [00:50:26] Brock Wilcox(@awwaiid):but `subject` is, if I understand correctly, basically equivalent to: before_each do @subject = { ... }() end ---------------------------------------------------------------------------------------------------- [00:50:33] Brock Wilcox(@awwaiid):hm. I should learn how to use this chat ---------------------------------------------------------------------------------------------------- [00:50:54] Austin Erlandson(@erlandsona):@Thermatix isn’t that the whole point of “Late binding” though? for example… Usually what I’ll do is define a subject then pass it a let variable that I update in a spec later… EG: ---------------------------------------------------------------------------------------------------- [00:51:06] Martin Becker(@Thermatix):also junity style <- I don't like this for tests ---------------------------------------------------------------------------------------------------- [00:51:24] Martin Becker(@Thermatix):but it's not very dry ---------------------------------------------------------------------------------------------------- [00:51:37] Martin Becker(@Thermatix):doing it this means you define the code you want to test once ---------------------------------------------------------------------------------------------------- [00:51:38] Brock Wilcox(@awwaiid):though not quite like a before_each since it is upon the first usage ---------------------------------------------------------------------------------------------------- [00:51:52] Martin Becker(@Thermatix):and the values that are being used for each test remain inside the blocks for that test ---------------------------------------------------------------------------------------------------- [00:52:13] Martin Becker(@Thermatix):and it's DRY ---------------------------------------------------------------------------------------------------- [00:52:34] Martin Becker(@Thermatix):pass it a let variable? ---------------------------------------------------------------------------------------------------- [00:53:03] Martin Becker(@Thermatix):ah by the way subject is just the same as doing ---------------------------------------------------------------------------------------------------- [00:53:14] Brock Wilcox(@awwaiid):ya, a let ---------------------------------------------------------------------------------------------------- ############################## [2016-05-10] ############################## [15:15:10] Mitch VanDuyn(@catmando):gon? ---------------------------------------------------------------------------------------------------- [15:15:27] Brady Wied(@wied03):https://github.com/gazay/gon ---------------------------------------------------------------------------------------------------- [15:21:01] Elia Schito(@elia):well gon does more or less the same we do in opal-rails: https://github.com/opal/opal-rails#as-a-template ---------------------------------------------------------------------------------------------------- [15:21:18] Elia Schito(@elia):note the `@post` ivar being available on both sides ---------------------------------------------------------------------------------------------------- [21:57:22] Mitch VanDuyn(@catmando):@elia / @wied03 - thanks for the help... I tried using the ERB in the gem, and it works, BUT, when you change the config file in rails and restart, it does not take the change in the config... Is there some way I can force the file to get blown away on server start? ---------------------------------------------------------------------------------------------------- [22:06:34] Elia Schito(@elia):@catmando you can use sprockets directive to link that file to another so its refreshed whenever the first one is ---------------------------------------------------------------------------------------------------- [22:06:47] Elia Schito(@elia):which version of sprockets are you running? ---------------------------------------------------------------------------------------------------- [22:07:07] Mitch VanDuyn(@catmando):3.0? ---------------------------------------------------------------------------------------------------- [22:07:07] Mitch VanDuyn(@catmando):yes ---------------------------------------------------------------------------------------------------- [22:07:50] Elia Schito(@elia):https://github.com/rails/sprockets/tree/3.x#the-directive-processor ---------------------------------------------------------------------------------------------------- [22:08:57] Elia Schito(@elia):https://github.com/rails/sprockets/tree/3.x#the-depend_on-directive ---------------------------------------------------------------------------------------------------- [22:09:01] Elia Schito(@elia):this should do ---------------------------------------------------------------------------------------------------- [14:53:56] Mitch VanDuyn(@catmando):@fkchang @elia @jgaskins @ajjahn @wied03 any ideas on the above? Sorry to be a pest, I have this presentation tomorrow night, and I was hoping to clean up one of the gems before then... ---------------------------------------------------------------------------------------------------- [14:56:41] Elia Schito(@elia):@catmando in opal-rails data is transformed to json and then back to ruby so its all primitive types ---------------------------------------------------------------------------------------------------- [14:56:51] Brady Wied(@wied03):@catmando - if it's React, why not pass in via props ? ---------------------------------------------------------------------------------------------------- [14:58:32] Mitch VanDuyn(@catmando):@wied03 its for an API key that you have to have on the client and server. The key is set in an config file on the server, so it would just be nice to have the gem get it down to the client without any extra coding. ---------------------------------------------------------------------------------------------------- [14:58:52] Mitch VanDuyn(@catmando):Specifically this is to enable pusher.com integration with reactive-record FYI ---------------------------------------------------------------------------------------------------- [15:00:08] Brady Wied(@wied03):well, if you're OK using what could be considered a hack by modern Sprockets standards, you could create a config class that's in an ERB file ---------------------------------------------------------------------------------------------------- [15:00:29] Brady Wied(@wied03):and ERB would drop in the API key, sprockets would compile it and you'd have a constant in an Opal class ---------------------------------------------------------------------------------------------------- [15:00:55] Mitch VanDuyn(@catmando):yeah that is where I was going. Can I assume ERB is there if sprockets is there? ---------------------------------------------------------------------------------------------------- [15:01:10] Brady Wied(@wied03):historically yes, but they are discouraging that I think ---------------------------------------------------------------------------------------------------- [15:01:26] Brady Wied(@wied03):might be better to create a Rake task that code gens that for you ---------------------------------------------------------------------------------------------------- [15:01:27] Mitch VanDuyn(@catmando):soooo what is the proposed alternative, I guess that is what I am asking ---------------------------------------------------------------------------------------------------- [15:01:54] Brady Wied(@wied03):the rails js routes project hooks that in with their railtie such that it generates an asset fairly automatically ---------------------------------------------------------------------------------------------------- [15:01:56] Mitch VanDuyn(@catmando):but then the user has to remember to run this rake task when ever they change the config ---------------------------------------------------------------------------------------------------- [15:02:06] Elia Schito(@elia):@catmando also dumping stuff as json in data-attributes or meta tags ---------------------------------------------------------------------------------------------------- [15:02:30] Brady Wied(@wied03):@elia - he wants it to be automatic without extra coding ---------------------------------------------------------------------------------------------------- [15:02:52] Mitch VanDuyn(@catmando):yeah - I know how to send values between client and server :-) ---------------------------------------------------------------------------------------------------- [15:03:07] Mitch VanDuyn(@catmando):but @wied03 has it right. ---------------------------------------------------------------------------------------------------- [15:03:18] Mitch VanDuyn(@catmando):currently I would do something like this in the gem ---------------------------------------------------------------------------------------------------- [15:04:02] Elia Schito(@elia):sorry, kinda skimmed the question and thrown stuff at the wall in the hope something sticked :smile: ---------------------------------------------------------------------------------------------------- [15:04:54] Brady Wied(@wied03):@catmando - maybe https://github.com/railsware/js-routes has a good way they do that ---------------------------------------------------------------------------------------------------- [15:05:24] Mitch VanDuyn(@catmando):```ruby #config.rb.erb module MyGemConfig def value '<%= MyGemConfig.value %>' end end ``` ---------------------------------------------------------------------------------------------------- [15:06:58] Mitch VanDuyn(@catmando):looks like ERB is the way to go.. (I was just kidding @elia appreciate the help always!) ---------------------------------------------------------------------------------------------------- [15:07:38] Elia Schito(@elia):(no worries :wink:) ---------------------------------------------------------------------------------------------------- [15:09:51] Brady Wied(@wied03):You could also use gon to set some of that in a JS global and then pick it up that way ---------------------------------------------------------------------------------------------------- ############################## [2016-05-11] ############################## [06:34:57] John Munyi(@wolfieorama):hello guys ..new here .... hoping to solve all my js problems ---------------------------------------------------------------------------------------------------- [07:09:11] Martin Becker(@Thermatix):@catmando there is a better way ---------------------------------------------------------------------------------------------------- [07:09:31] Martin Becker(@Thermatix):have a single ERB file that has the following: ---------------------------------------------------------------------------------------------------- [07:10:04] Martin Becker(@Thermatix):```ruby <%= MyGemConfig.render %> ``` ---------------------------------------------------------------------------------------------------- [07:10:12] Martin Becker(@Thermatix):and then have a class like this: ---------------------------------------------------------------------------------------------------- [07:25:40] Martin Becker(@Thermatix):```ruby class MyGemConfig class << self def set_config_class_name_to value @class_name = value end def add_value value @values||= [] @values << value end def render @rendered||= @values.map {|value| "#{ get_class_name }.value = #{render_value(value)}" }.join("\n") end private def get_class_name @class_name || 'MyGemConfig' end def render_value value if value.is_a? String '"value"' elsif value.is_a? Array "[#{value.map{|v|"#{render_value(v)}"}.join(',')}]" else value.is_a? Hash "{}#{value.map{|k,v|"'#{k}' => #{render_value(v)}"}.join(',')}}" else value end end end end ``` ---------------------------------------------------------------------------------------------------- [07:26:03] Martin Becker(@Thermatix):it should re-render every time the server is booted ---------------------------------------------------------------------------------------------------- [07:47:07] Martin Becker(@Thermatix):btw, is there an opal-electron package? ---------------------------------------------------------------------------------------------------- [14:26:00] Jamie Gaskins(@jgaskins):@Thermatix This might help get you started: https://github.com/johnsusi/electron-clearwater ---------------------------------------------------------------------------------------------------- [16:46:34] Martin Becker(@Thermatix):AH, an example app, interesting ---------------------------------------------------------------------------------------------------- [16:47:25] Martin Becker(@Thermatix):second question, is there a link to some documentation that properly explains`Native`? ---------------------------------------------------------------------------------------------------- [16:52:12] Martin Becker(@Thermatix):@catmando the main point is to have it re-render every time the application is booted, ofc it's re-rendered every time the file is pulled so My suggestion would be to instead render and store an ERB fragment in memory and then some out point to that instead of an actual file. ---------------------------------------------------------------------------------------------------- [17:38:35] Martin Becker(@Thermatix):oh and thanks @jgaskins , it gave me a lot to think about ---------------------------------------------------------------------------------------------------- [22:56:11] Zak Storer(@zacts):How well does opal work for writing plugins for the atom.io text editor? ---------------------------------------------------------------------------------------------------- [22:56:45] Zak Storer(@zacts):https://gist.github.com/edubkendo/9363111 <-- this is what I've found thus far ---------------------------------------------------------------------------------------------------- [22:57:29] Zak Storer(@zacts):My apologies for the gist on channel, I only meant to link to it. ---------------------------------------------------------------------------------------------------- [22:57:37] Zak Storer(@zacts):(I'm still getting used to Gitter) ---------------------------------------------------------------------------------------------------- [23:04:24] Brady Wied(@wied03):@zacts - Probably relates to the functionality that the `--no-opal-exit` command line flag to the `opal` binary controls ---------------------------------------------------------------------------------------------------- [23:05:09] Brady Wied(@wied03):@zacts - FYI, we're talking about extracting a single, bootstrap friendly NPM package for opal here https://github.com/anthonny/opal-npm-wrapper/issues/11#issuecomment-214813258 - have been too busy to act on it ---------------------------------------------------------------------------------------------------- [23:06:54] Brady Wied(@wied03):@zacts - re: no opal exit, I actually looked at your gist and it might be as simple as missing `require 'opal'` ---------------------------------------------------------------------------------------------------- ############################## [2016-05-12] ############################## [11:49:56] Mitch VanDuyn(@catmando):@Thermatix nice! tx ---------------------------------------------------------------------------------------------------- [15:12:22] Zak Storer(@zacts):@wied03 thanks, I'll check it out ---------------------------------------------------------------------------------------------------- [18:19:02] Forrest Chang(@fkchang): @/all what version of Ruby are people using, trying to pick a gem version that serves the most opal users ---------------------------------------------------------------------------------------------------- [19:12:41] Austin Erlandson(@erlandsona):2.2.2 / 2.2.3 ---------------------------------------------------------------------------------------------------- [19:14:34] Steve Tuckner(@boberetezeke):2.2.3-2.30 ---------------------------------------------------------------------------------------------------- ############################## [2016-05-13] ############################## [15:15:39] Jared White(@jaredcwhite):hey all - in case anyone notices in the next little while, opalist.co is down -- I'm moving off of Squarespace and onto a Jekyll-based site. Probably will host it on GitHub as an open source project so that would allow anyone to contribute! ---------------------------------------------------------------------------------------------------- [15:24:42] Martin Becker(@Thermatix):@catmando just make sure to check the code it generates, I might have made a mistake. ---------------------------------------------------------------------------------------------------- [15:59:37] Hassan Alin(@superalin98):Does anyone know how to convert an entire project using opal in an easier way than compiling every file? ---------------------------------------------------------------------------------------------------- [16:22:55] Mitch VanDuyn(@catmando):Ol ---------------------------------------------------------------------------------------------------- [16:26:49] Brady Wied(@wied03):@superalin98 - Can't think of any reason why you'd ever need to manually compile a file in a real project ---------------------------------------------------------------------------------------------------- [16:27:06] Brady Wied(@wied03):whether you use opal-webpack or sprockets via Rails/etc., that all happens automatically ---------------------------------------------------------------------------------------------------- [16:29:03] Brady Wied(@wied03):only time I manually compile something is when I'm testing/POCing/developing on opal itself ---------------------------------------------------------------------------------------------------- [17:02:27] Jared White(@jaredcwhite):All right, http://opalist.co is back up and running on GitHub Pages. Repo is here: https://github.com/polished-rb/opalist.co -- feel free to contribute however you like! ---------------------------------------------------------------------------------------------------- ############################## [2016-05-16] ############################## [14:36:35] Mitch VanDuyn(@catmando):@wied03 (or anybody else) ---------------------------------------------------------------------------------------------------- [14:37:08] Mitch VanDuyn(@catmando):trying to restrict which rspecs run based on tags. ---------------------------------------------------------------------------------------------------- [14:37:16] Mitch VanDuyn(@catmando):normal rspec I can do this: ---------------------------------------------------------------------------------------------------- [14:38:09] Mitch VanDuyn(@catmando):```ruby RSpec::Core::RakeTask.new('ruby:rspec') do |s| s.rspec_opts = "--tag ruby" end ``` but opal-rspec seems to only allow these things to get set via the command line, and I am not sure I can even set tags? ---------------------------------------------------------------------------------------------------- [14:38:15] Mitch VanDuyn(@catmando): ---------------------------------------------------------------------------------------------------- [14:39:35] Brady Wied(@wied03):@catmando - ```ruby RSpec.configure do |config| config.filter_run_including focus: true config.run_all_when_everything_filtered = true end ``` ---------------------------------------------------------------------------------------------------- [14:39:40] Mitch VanDuyn(@catmando):The problem I am trying to solve is allowing specs to simply have a `:ruby` or `:opal` tag on them (instead of adding the extra `if opal?` around them. Just a minor thing, but... ---------------------------------------------------------------------------------------------------- [14:40:05] Brady Wied(@wied03):you can do something like that ---------------------------------------------------------------------------------------------------- [14:40:15] Mitch VanDuyn(@catmando):in opal rspec? ---------------------------------------------------------------------------------------------------- [14:40:39] Brady Wied(@wied03):yep, I use that to focus in on tests but you could use it for that purpose as well ---------------------------------------------------------------------------------------------------- [14:41:23] Mitch VanDuyn(@catmando):not sure I see how that filters *out* anything... ---------------------------------------------------------------------------------------------------- [14:41:28] Brady Wied(@wied03):I'm pretty sure fit, fdescribe, fcontext, which I use that for that, just add an implicit focus: true tag on their respective examples/example groups ---------------------------------------------------------------------------------------------------- [14:41:29] Mitch VanDuyn(@catmando):but I tried this already: ---------------------------------------------------------------------------------------------------- [14:41:40] Mitch VanDuyn(@catmando):```ruby RSpec.configure do |config| config.include React::SpecHelpers config.filter_run_excluding :ruby => true end ``` ---------------------------------------------------------------------------------------------------- [14:41:53] Mitch VanDuyn(@catmando):and that does not work... (it just runs everything) ---------------------------------------------------------------------------------------------------- [14:43:19] Mitch VanDuyn(@catmando):@wied03 there is no way just to set the tag in the rake config block? ---------------------------------------------------------------------------------------------------- [14:43:48] Mitch VanDuyn(@catmando):```ruby RSpec::Core::RakeTask.new('ruby:rspec') do |s| s.rspec_opts = "--tag ruby" end ``` ---------------------------------------------------------------------------------------------------- [14:43:49] Brady Wied(@wied03):there are certain options that I've implemented, but they have to be dealt with 1 by 1 right now ---------------------------------------------------------------------------------------------------- [14:44:00] Brady Wied(@wied03):https://github.com/opal/opal-rspec/issues/41 ---------------------------------------------------------------------------------------------------- [14:44:21] Mitch VanDuyn(@catmando):gotcha, so in the meantime? ---------------------------------------------------------------------------------------------------- [14:44:42] Brady Wied(@wied03):what you're doing should work, but the RSpec specs that test some of that can't run very easily ---------------------------------------------------------------------------------------------------- [14:45:19] Brady Wied(@wied03):can you do me a favor and replicate the filter_run_excluding problem in a simple test case outside your project, then I can have a look at it ? ---------------------------------------------------------------------------------------------------- [14:46:20] Mitch VanDuyn(@catmando):yes no problem... ---------------------------------------------------------------------------------------------------- [14:51:22] Brady Wied(@wied03):cool. if you could just throw it up as an opal-rspec defect when you're done then ---------------------------------------------------------------------------------------------------- [14:51:29] Brady Wied(@wied03):that would be great ---------------------------------------------------------------------------------------------------- [14:59:01] Mitch VanDuyn(@catmando):@wied03 I don't know why I am being so dumb today, but I can't find the specs in opal-rspec... I was just going to create a test spec for you. ---------------------------------------------------------------------------------------------------- [14:59:13] Mitch VanDuyn(@catmando):at any rate here is project that reproduces: ---------------------------------------------------------------------------------------------------- [14:59:36] Mitch VanDuyn(@catmando):https://github.com/catprintlabs/reactor-router/tree/filter-excluding-demo ---------------------------------------------------------------------------------------------------- [14:59:53] Mitch VanDuyn(@catmando):I was just starting to add specs to this, so its nice and simple... ---------------------------------------------------------------------------------------------------- [15:03:35] Mitch VanDuyn(@catmando):clone that branch, run `bundle exec rake`. ---------------------------------------------------------------------------------------------------- [15:14:06] Mitch VanDuyn(@catmando):@wied03 Deepest apologies.. I was just being pants-on-head backwards... exclude is working fine... ---------------------------------------------------------------------------------------------------- [21:56:27] Mitch VanDuyn(@catmando):if I compile this string: ---------------------------------------------------------------------------------------------------- [21:56:35] Mitch VanDuyn(@catmando):"require 'foobar'" ---------------------------------------------------------------------------------------------------- [21:57:26] Mitch VanDuyn(@catmando):is there someway to get what the required file list is? ---------------------------------------------------------------------------------------------------- [22:00:59] Elia Schito(@elia):``` >> require 'opal' => true >> c = Opal::Compiler.new('require "foobar"') => # >> c.compile; c.requires => ["foobar"] >> ``` ---------------------------------------------------------------------------------------------------- [22:01:04] Elia Schito(@elia):@catmando ^ ---------------------------------------------------------------------------------------------------- [22:01:40] Mitch VanDuyn(@catmando):thank you! ---------------------------------------------------------------------------------------------------- [22:02:29] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- ############################## [2016-05-17] ############################## [08:23:39] Forrest Chang(@fkchang):@/all a quick demo of https://github.com/fkchang/opal-hot-reloader https://youtu.be/NQbzL7fNOks ---------------------------------------------------------------------------------------------------- [08:25:42] Forrest Chang(@fkchang):thanks to @awwaiid for the app and the basic approach ---------------------------------------------------------------------------------------------------- [14:09:58] Steve Tuckner(@boberetezeke):Very cool. ---------------------------------------------------------------------------------------------------- [18:37:15] Forrest Chang(@fkchang):@boberetezeke if u get a chance to try it out, lemme know how it goes ---------------------------------------------------------------------------------------------------- [18:37:56] Forrest Chang(@fkchang):How much are people wanting sass/scss hot reloading, looks like it's not that hard, but if no one wants it, might put it off until later ---------------------------------------------------------------------------------------------------- [18:38:14] Forrest Chang(@fkchang):@/all ^^ ---------------------------------------------------------------------------------------------------- [19:53:54] CJ Lazell(@cj):@fkchang very cool. I'll give it a try. I think CSS hot reloading would be good, let the compilers handle making it css. (I wouldn't make it compiler specific) ---------------------------------------------------------------------------------------------------- [21:29:25] Forrest Chang(@fkchang):@cj for sass I'd probably target rails, because I'll know what the convention is, I'll expect the asset pipeline to server up the compiled css files - for non rails, I'm not sure what I'd do ---------------------------------------------------------------------------------------------------- [21:30:54] Brady Wied(@wied03):@fkchang - Does this reinvent the wheel since webpack/other bundlers do this kind of thing ? ---------------------------------------------------------------------------------------------------- [21:32:26] CJ Lazell(@cj):webpack dev server does it, but I found it adds 1 minute onto the startup compile time. I personally switched to livereload, but for the video demo hotreloading would be better ---------------------------------------------------------------------------------------------------- [21:35:08] Forrest Chang(@fkchang):@wied03 yes and no, it is an all ruby/opal, self contained thing, so if you're doing any kind of opal/ruby webserver, it should be able to just drop in and you won't have to do anything w/webpack or similar. I do believe we will want to straddle the hybrid approach w/opal and rails, w/sprockets serving up all the things the normal Rails ecosystem, and webpack or similar for being a "1st class JS citizen". While I do favor moving as much js to webpack, I see an "all webpack solution" being only one of a few permutations, and not particularly appealing to most Rails programmers (who I think is the largest demographic likely to want to do opal programming) ---------------------------------------------------------------------------------------------------- [21:36:03] Brady Wied(@wied03):fair enough, maybe add that content to your repo as an FYI/vision for the project ? ---------------------------------------------------------------------------------------------------- [21:36:47] Forrest Chang(@fkchang):And the other thing is it works here and now for sinatra, rails and reactrb - I definitely feel getting the word out that we have modern web development tools like react.js does, right now, is useful for getting some attention to the assorted opal projects, as hopefully some momentum ---------------------------------------------------------------------------------------------------- [21:37:15] Forrest Chang(@fkchang):@wied03 I'm up for that, I'll see what I can do ---------------------------------------------------------------------------------------------------- [21:37:37] Brady Wied(@wied03):nothing fancy, just that way in your README people can see how you envision this ---------------------------------------------------------------------------------------------------- [21:52:12] Forrest Chang(@fkchang):@wied03 how's this https://github.com/fkchang/opal-hot-reloader#vision ---------------------------------------------------------------------------------------------------- [21:53:42] Brady Wied(@wied03)::+1: ---------------------------------------------------------------------------------------------------- ############################## [2016-05-18] ############################## [01:50:14] Barrie Hadfield(@barriehadfield):@fkchang I really like your hybrid vision with gems and sprockets for all things rails related and NPM/webpack for FE assets. This talks to the strengths of both groups and there is ample help available when you ask the right questions. So many traditional JS libs are being repackaged as React Components which are easily installable via NPM. Best of both worlds! ---------------------------------------------------------------------------------------------------- ############################## [2016-05-21] ############################## [16:47:52] Martin Becker(@Thermatix): o/ ---------------------------------------------------------------------------------------------------- [16:48:00] Martin Becker(@Thermatix):I'm having a little trouble getting opal-minitest to run ---------------------------------------------------------------------------------------------------- [16:48:06] Martin Becker(@Thermatix):and the readme for it doesn't help ---------------------------------------------------------------------------------------------------- [16:48:48] Martin Becker(@Thermatix):anyone got an example I can see to show how to set it up and get it to run ---------------------------------------------------------------------------------------------------- [16:51:39] Martin Becker(@Thermatix):any tips? ---------------------------------------------------------------------------------------------------- ############################## [2016-05-23] ############################## [08:54:15] Elia Schito(@elia):@Thermatix try using original minitest instructions, but replace `ruby` with `opal` in CLI examples ---------------------------------------------------------------------------------------------------- [21:40:25] Forrest Chang(@fkchang):@/all anyone stub/mock out document ? I suspect if anyone @wied03 has -- anyways want to write a unit test and want to pass in a double for document rather than manipulate the DOM directly, if possible ---------------------------------------------------------------------------------------------------- [23:15:16] Jamie Gaskins(@jgaskins):@fkchang I stub native JS objects all the time. Usually, something like this is all you need: ```ruby foo_called = false stubbed = `{ foo: function() { foo_called = true } }` do_thing(stubbed) expect(foo_called).to be_truthy ``` ---------------------------------------------------------------------------------------------------- ############################## [2016-05-24] ############################## [12:04:39] Martin Becker(@Thermatix):@elia I'm still not having much luck, I get the feeling I'm just gonna have to use rspec ---------------------------------------------------------------------------------------------------- [12:17:05] Elia Schito(@elia):@Thermatix a modified copy of minitest is also present in the opal repo and used to run some MRI tests, you can't use it directly because it's there just as an internal tool, but you can definitely look at it and see what it takes to fix the upstream opal-minitest gem ---------------------------------------------------------------------------------------------------- [12:24:10] Martin Becker(@Thermatix):AH ---------------------------------------------------------------------------------------------------- [12:24:26] Martin Becker(@Thermatix):when I get back I'll look into that, thanks! ---------------------------------------------------------------------------------------------------- [12:26:08] Elia Schito(@elia):@Thermatix a quick way is to run `rake cruby_tests` from the opal repo and look at the generated command ---------------------------------------------------------------------------------------------------- [17:19:33] Forrest Chang(@fkchang):@jgaskins thanks, I was going to resort to something like that, maybe I'll end up extracting a JsMock type lib out of it where I can create JS doubles but w/opal ---------------------------------------------------------------------------------------------------- [17:35:06] Jamie Gaskins(@jgaskins):@fkchang As much as I do that, I've been thinking of gemifying it, too. :+1: ---------------------------------------------------------------------------------------------------- [18:31:07] Forrest Chang(@fkchang):@jgaskins well if you do it first, lemme know and I'll use yours ---------------------------------------------------------------------------------------------------- ############################## [2016-05-25] ############################## [10:03:49] Elia Schito(@elia):@/all https://twitter.com/elia/status/735410602873655296 ---------------------------------------------------------------------------------------------------- ############################## [2016-05-26] ############################## [01:30:58] Mitch VanDuyn(@catmando):@elia any clever way to conditionally require something that is in a gem ---------------------------------------------------------------------------------------------------- [01:31:02] Mitch VanDuyn(@catmando):I tried ---------------------------------------------------------------------------------------------------- [01:32:11] Mitch VanDuyn(@catmando):```ruby require 'sources/react' unless defined? NOREACTJS ``` and then previous to the require of the gem I did a ```ruby NOREACTJS = true ``` did not work... any other way to do this? ---------------------------------------------------------------------------------------------------- [05:05:05] Jamie Gaskins(@jgaskins):Conditional requires are awkward because a require is done at compile time. I think a workaround was tried, but I don't think it did well. ---------------------------------------------------------------------------------------------------- [11:42:41] Bernhard Weichel(@bwl21):Is the digest module available in opal? ---------------------------------------------------------------------------------------------------- [16:05:05] Forrest Chang(@fkchang):@jgaskins hmm, how about some kind of dynamic_require that goes back to the app's server and pulls the file as appropriate ---------------------------------------------------------------------------------------------------- [16:17:56] Brady Wied(@wied03):@jgaskins @elia - Maybe Travis isn't being honest about timing but some of these dup things would appear to have dramatically improved opal-rspec runtime. As in 13 min to 4 min. - https://travis-ci.org/opal/opal-rspec/builds/124591999 ---------------------------------------------------------------------------------------------------- [16:31:15] Brady Wied(@wied03):@bwl21 - Not yet. the stdlibs that are there are @ https://github.com/opal/opal/tree/master/stdlib ---------------------------------------------------------------------------------------------------- [23:03:21] Jamie Gaskins(@jgaskins):@fkchang I've wondered about that, too, but making it work async is probably tricky. ---------------------------------------------------------------------------------------------------- [23:05:16] Jamie Gaskins(@jgaskins):For example, what would happen in this scenario: ```ruby dynamic_require 'foo' f = Foo.new ``` Making `dynamic_require` work async would mean that the following line is most likely executed before the request returns. Making it work synchronously means it locks the UI. :-\ ---------------------------------------------------------------------------------------------------- [23:55:19] Forrest Chang(@fkchang):@jgaskins ---------------------------------------------------------------------------------------------------- [23:55:41] Forrest Chang(@fkchang):how about ```ruby dynamic_require 'foo' do f = Foo.new end ``` ---------------------------------------------------------------------------------------------------- [23:55:56] Forrest Chang(@fkchang):then promisify it ---------------------------------------------------------------------------------------------------- [23:56:22] Forrest Chang(@fkchang):still could have issues in sequencing, but at least some sort of way to wait for the load ---------------------------------------------------------------------------------------------------- ############################## [2016-05-27] ############################## [01:05:36] Jamie Gaskins(@jgaskins):@fkchang That was my thought, too. :-) There's a bit more to it than that, though. For example, if `foo.rb` requires `bar.rb`, which dynamic_requires `baz.rb`, this code causes a problem: ```ruby # foo.rb require 'bar' Bar.new.call ``` ```ruby # bar.rb dynamic_require('baz').then do class Bar def call Baz.new(self) end end end ``` So you'd have to know if not only your direct dependencies, but also your _indirect_ dependencies, have any async requires. ---------------------------------------------------------------------------------------------------- [09:05:01] Earl Balai Jr(@earlbalai):Anyone else having this issue on Rails 5.0.0.rc1 "activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- rack/showexceptions (LoadError)" ---------------------------------------------------------------------------------------------------- [09:10:04] Alexandr Smirnov(@JelF):я fixed it in opal-rails ---------------------------------------------------------------------------------------------------- [09:10:22] Alexandr Smirnov(@JelF):in january as far as i remember ---------------------------------------------------------------------------------------------------- [15:53:29] Mitch VanDuyn(@catmando):For react.rb I would like to include a directory inside of the react.rb gem, that would contain sources for each react.js major version. ---------------------------------------------------------------------------------------------------- [15:54:28] Mitch VanDuyn(@catmando):I thought I would do it like opal-browser, where some of the files (like interval.rb) are NOT included in the base browser require, and you can then explicitly require them. ---------------------------------------------------------------------------------------------------- [15:54:41] Mitch VanDuyn(@catmando):But I can't seem to get it to work. ---------------------------------------------------------------------------------------------------- [15:54:46] Mitch VanDuyn(@catmando):I have the following structure: ---------------------------------------------------------------------------------------------------- [15:58:02] Mitch VanDuyn(@catmando):```text |-lib |-reactive-ruby |- etc |-sources |-react_v13.js |-react_v14.js |-react_v15.js |-reactive-ruby.rb ``` And reactive-ruby.rb looks like this ```ruby if RUBY_ENGINE == 'opal' #require 'sources/react_v13.js' #comment this out for release, leave in for testing with which ever version you like require 'react/top_level' require 'react/observable' require 'react/component' require 'react/component/base' require 'react/element' require 'react/event' require 'react/api' require 'react/validator' require 'react/rendering_context' require 'react/state' require 'reactive-ruby/isomorphic_helpers' require 'rails-helpers/top_level_rails_component' require 'reactive-ruby/version' else require 'opal' require 'opal-browser' require 'opal-activesupport' require 'reactive-ruby/version' require 'reactive-ruby/rails' if defined?(Rails) require 'reactive-ruby/isomorphic_helpers' require 'reactive-ruby/serializers' Opal.append_path File.expand_path('../', __FILE__).untaint Opal.append_path File.expand_path('../sources', __FILE__).untaint # I tried this to see if fixes anything end ``` ``` ---------------------------------------------------------------------------------------------------- [15:59:00] Mitch VanDuyn(@catmando):but when I do a `require 'reactive-record/sources/react_v13.js'` i get: ---------------------------------------------------------------------------------------------------- [15:59:16] Mitch VanDuyn(@catmando):Sprockets::FileNotFound at / couldn't find file 'reactive-ruby/sources/react_v13' with type 'application/javascript' ---------------------------------------------------------------------------------------------------- [16:00:02] Mitch VanDuyn(@catmando):As far as I can see I am following the exact structure of opal-browser, but yet can't get it to work... ---------------------------------------------------------------------------------------------------- [16:00:26] Mitch VanDuyn(@catmando):any help appreciated @elia any ideas? ---------------------------------------------------------------------------------------------------- ############################## [2016-05-28] ############################## [16:24:27] Martin Becker(@Thermatix):umm try changing ```ruby Opal.append_path File.expand_path('../sources', __FILE__).untaint ``` ---------------------------------------------------------------------------------------------------- [16:24:34] Martin Becker(@Thermatix):to: ---------------------------------------------------------------------------------------------------- [16:24:45] Martin Becker(@Thermatix):```ruby Opal.append_path File.expand_path('./sources', __FILE__).untaint ``` ---------------------------------------------------------------------------------------------------- [16:25:35] Martin Becker(@Thermatix):Maybe? it's becuase with `../sources` it's looking for a folder called sources in the lib directory, you want it relative to the file, not to the current dir. ---------------------------------------------------------------------------------------------------- ############################## [2016-05-30] ############################## [15:14:18] Mitch VanDuyn(@catmando):Let's discuss on ---------------------------------------------------------------------------------------------------- [15:14:59] Mitch VanDuyn(@catmando):The zetachang/reactrb ---------------------------------------------------------------------------------------------------- [15:15:16] Mitch VanDuyn(@catmando):Room ---------------------------------------------------------------------------------------------------- [15:17:07] Mitch VanDuyn(@catmando):Search for react.rb in the gitter app ---------------------------------------------------------------------------------------------------- [15:17:19] Mitch VanDuyn(@catmando):K ---------------------------------------------------------------------------------------------------- [15:17:31] chewedon(@chewedon):Missing the .rb ---------------------------------------------------------------------------------------------------- [15:17:36] chewedon(@chewedon):zetachang/react.rb ---------------------------------------------------------------------------------------------------- [20:15:43] Doug Orleans(@dougo):Hi all! Has anyone made a Rails engine that uses Opal? Currently I'm having trouble getting it to use OpalHelper#javascript_include_tag from opal-rails (0.8.1) ---------------------------------------------------------------------------------------------------- [20:15:57] Doug Orleans(@dougo):which is what it uses when it's an app. ---------------------------------------------------------------------------------------------------- [21:01:05] Doug Orleans(@dougo):hm, when I use rails console, `helper.method(:javascript_include_tag)` gets it from OpalHelper. But from inside my application layout, it's getting the one from Sprockets::Rails::Helper. ---------------------------------------------------------------------------------------------------- [21:04:58] Jamie Gaskins(@jgaskins):@dougo Is there a reason you want to get it to invoke the `OpalHelper` one specifically? ---------------------------------------------------------------------------------------------------- [21:05:41] Doug Orleans(@dougo):Yes, because that's the one that generates the code to actually call my application code. Otherwise it just defines a bunch of modules but never starts the app. ---------------------------------------------------------------------------------------------------- [21:06:23] Jamie Gaskins(@jgaskins):What version of Rails are you on? ---------------------------------------------------------------------------------------------------- [21:06:25] Doug Orleans(@dougo):specifically, it calls `Opal::Processor.load_asset_code(sprockets, source)` ---------------------------------------------------------------------------------------------------- [21:06:35] Doug Orleans(@dougo):rails 4.2.6 ---------------------------------------------------------------------------------------------------- [21:07:31] Jamie Gaskins(@jgaskins):That's really weird. I use the stock `javascript_include_tag` in my application layout all the time and it loads right up. ---------------------------------------------------------------------------------------------------- [21:07:50] Doug Orleans(@dougo):yeah, I think it's something about how Rails engines are different from applications. ---------------------------------------------------------------------------------------------------- [21:07:57] Jamie Gaskins(@jgaskins):Oh, right, engines ---------------------------------------------------------------------------------------------------- [21:08:40] Doug Orleans(@dougo):I've been running into a few gotchas. Like, it doesn't auto-require all the gems it depends on, you have to require them all manually. ---------------------------------------------------------------------------------------------------- [21:08:50] Doug Orleans(@dougo):took me a while to track that down... ---------------------------------------------------------------------------------------------------- [21:09:50] Doug Orleans(@dougo):@jgaskins, I assume the "stock" `javascript_include_tag`in your app is actually coming from opal-rails. At least that's what I determined from my app (before I converted it to an engine) ---------------------------------------------------------------------------------------------------- [21:18:13] Jamie Gaskins(@jgaskins):Huh, weird. Opal registers itself with Sprockets as the handler for `.rb` and `.opal` files, so it shouldn't need to do that. It might be to paper over inconsistencies between Sprockets versions, though. ---------------------------------------------------------------------------------------------------- [21:49:38] Doug Orleans(@dougo):hm, seems to be a consequence of using `isolate_namespace` in the engine. ---------------------------------------------------------------------------------------------------- [21:50:33] Doug Orleans(@dougo):I get that that prevents helpers from the engine from polluting the app, but in this case it seems to be preventing a helper from the engine's dependencies from being visible in the engine. ---------------------------------------------------------------------------------------------------- [22:00:00] Doug Orleans(@dougo):aha! found this hint: http://api.rubyonrails.org/classes/Rails/Engine.html#class-Rails::Engine-label-Isolated+engine-27s+helpers ---------------------------------------------------------------------------------------------------- [22:00:17] Doug Orleans(@dougo):adding `helper OpalHelper` into my engine's ApplicationController did the trick. whew! ---------------------------------------------------------------------------------------------------- [22:09:27] Jamie Gaskins(@jgaskins):@dougo Nice! :+1: ---------------------------------------------------------------------------------------------------- [14:12:11] chewedon(@chewedon):Hi... ---------------------------------------------------------------------------------------------------- [14:12:48] chewedon(@chewedon):So...Opal is a compiler for Ruby to Javascript ? ---------------------------------------------------------------------------------------------------- [14:14:24] Austin Erlandson(@erlandsona):@chewedon yup! ---------------------------------------------------------------------------------------------------- [14:14:48] chewedon(@chewedon):Do people use it to build SPA using Ruby? ---------------------------------------------------------------------------------------------------- [14:14:56] chewedon(@chewedon):because I don't really like Javascript ---------------------------------------------------------------------------------------------------- [14:19:49] Elia Schito(@elia):@chewedon yes, that's what it's for ---------------------------------------------------------------------------------------------------- [14:20:50] chewedon(@chewedon):I'm kinda expecting some sort of framework to generate project, arrange files into folders, models, views, controllers... ---------------------------------------------------------------------------------------------------- [14:21:28] Elia Schito(@elia):Opal is more like ruby the language, if you want something like, say, rails or sinatra for JS ---------------------------------------------------------------------------------------------------- [14:21:50] Elia Schito(@elia):that have a look at react.rb / clearwaterrb / inesita / lissio ---------------------------------------------------------------------------------------------------- [14:21:56] chewedon(@chewedon):Threre is Volt framework but that's isomorphic. ---------------------------------------------------------------------------------------------------- [14:21:58] Elia Schito(@elia):and voltframwork ---------------------------------------------------------------------------------------------------- [14:22:05] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [14:22:10] chewedon(@chewedon):React.rb aye? haven't heard of that. ---------------------------------------------------------------------------------------------------- [14:22:39] Elia Schito(@elia):http://reactrb.org ---------------------------------------------------------------------------------------------------- [14:22:47] Elia Schito(@elia):http://inesita-rb.github.io ---------------------------------------------------------------------------------------------------- [14:22:53] Elia Schito(@elia):enjoy :) ---------------------------------------------------------------------------------------------------- [14:23:42] chewedon(@chewedon):Hey hey hey :) ---------------------------------------------------------------------------------------------------- [14:23:47] chewedon(@chewedon):And they all use Opal aye? ---------------------------------------------------------------------------------------------------- [14:23:57] Elia Schito(@elia):yep ---------------------------------------------------------------------------------------------------- [14:24:12] chewedon(@chewedon):I like it!. ---------------------------------------------------------------------------------------------------- [14:24:16] chewedon(@chewedon)::D ---------------------------------------------------------------------------------------------------- [14:25:48] chewedon(@chewedon):Aye...does React Ruby need Rails to work? ---------------------------------------------------------------------------------------------------- [14:25:52] chewedon(@chewedon):I thought it was standalone frontend thing ? ---------------------------------------------------------------------------------------------------- [14:26:12] chewedon(@chewedon):I'm using Rails 5 API mode to build a REST API for mobile applications. ---------------------------------------------------------------------------------------------------- [14:27:45] Elia Schito(@elia):@chewedon I'm not using it on any project so far, so I'm not sure cc @catmando @fkchang @jgaskins ---------------------------------------------------------------------------------------------------- [14:30:06] Mitch VanDuyn(@catmando):@chewedon nope ---------------------------------------------------------------------------------------------------- [14:31:04] chewedon(@chewedon):@catmando the Opal documentation seems to suggest adding React Ruby as part of the rails gem. ---------------------------------------------------------------------------------------------------- [14:31:39] Mitch VanDuyn(@catmando):React.rb can go anywhere from a cdn download with no frame work at all all the way to full rails integration with isomorphic models using the reactive-record gem ---------------------------------------------------------------------------------------------------- [14:34:11] Mitch VanDuyn(@catmando):In the docs of reactrb.org there is a complete chat example with no framework ---------------------------------------------------------------------------------------------------- [14:34:12] chewedon(@chewedon):@elia Inesita looks cool :D ---------------------------------------------------------------------------------------------------- [14:35:53] chewedon(@chewedon):@elia oh, you made Vienna ? :D ---------------------------------------------------------------------------------------------------- [14:36:13] Elia Schito(@elia):no, it's by the original opal author: Adam Beynon ---------------------------------------------------------------------------------------------------- [14:36:13] chewedon(@chewedon):oh no...my mistake ---------------------------------------------------------------------------------------------------- [14:36:17] Elia Schito(@elia):np ---------------------------------------------------------------------------------------------------- [14:36:17] Elia Schito(@elia):: ) ---------------------------------------------------------------------------------------------------- [14:36:18] chewedon(@chewedon):you contributed :P ---------------------------------------------------------------------------------------------------- [14:36:50] Mitch VanDuyn(@catmando):React.rb provides the client side view logic - no HTML or js needed. Any server side logic can be made with whatever framework you like, rails, Sinatra, etc. ---------------------------------------------------------------------------------------------------- [14:37:17] Mitch VanDuyn(@catmando):By design it integrates nicely with rails is all ---------------------------------------------------------------------------------------------------- [14:37:26] chewedon(@chewedon):Do I need to learn React before I can use it? ---------------------------------------------------------------------------------------------------- [14:41:42] Mitch VanDuyn(@catmando):No ---------------------------------------------------------------------------------------------------- [14:42:47] Mitch VanDuyn(@catmando):Do one of the tutorials and you will have the basics. One if beauties if react is its simplicity. ---------------------------------------------------------------------------------------------------- [14:45:28] Mitch VanDuyn(@catmando):Play with the simple examples on the reactrb.org landing page ---------------------------------------------------------------------------------------------------- [14:45:47] Mitch VanDuyn(@catmando):Then do the tutorial at http://reactrb.org/docs/tutorial.html ---------------------------------------------------------------------------------------------------- [14:46:23] Mitch VanDuyn(@catmando):Should take just a couple of hours and you will have most of what u need to know ---------------------------------------------------------------------------------------------------- [14:46:36] chewedon(@chewedon):Okay. ---------------------------------------------------------------------------------------------------- [15:01:17] chewedon(@chewedon):Seems like this guy shoves everything into 1 file. ---------------------------------------------------------------------------------------------------- [15:01:46] chewedon(@chewedon):I can only assume there is a way to create folders and subfiles ---------------------------------------------------------------------------------------------------- [15:02:00] chewedon(@chewedon):To separate the logic from the HTML. ---------------------------------------------------------------------------------------------------- [15:12:53] Mitch VanDuyn(@catmando):Sure that is just to keep the tutorial simple ---------------------------------------------------------------------------------------------------- [15:13:26] chewedon(@chewedon):If React is just the view component...what about the routing etc ? ---------------------------------------------------------------------------------------------------- [15:13:51] chewedon(@chewedon):Making HTTP POST and GET request to a REST API, local database storage ? ---------------------------------------------------------------------------------------------------- ############################## [2016-05-31] ############################## [22:54:44] Forrest Chang(@fkchang):@/all if anyone was waiting for it, I added support for rails asset pipeline css hot reloading (tested against 4.2.4 ) in https://github.com/fkchang/opal-hot-reloader ---------------------------------------------------------------------------------------------------- ############################## [2016-06-01] ############################## [18:58:16] Mitch VanDuyn(@catmando):@adamcreekroad you said you had a problem with opal 9.0 and reactrb ? ---------------------------------------------------------------------------------------------------- [19:02:49] Adam(@adamcreekroad):@catmando Yeah, the problem seems to be in stdlib/native.rb in the initialize method of Hash. in 0.9 is does ```if (defaults !== undefined && defaults.constructor === Object) {``` which raises the error ```TypeError: Cannot read property 'constructor' of null``` in 0.8 it checks ``` if (defaults != null) { if (defaults.constructor === Object) { ``` so switching it to ```if (defaults != null && defaults.constructor === Object) {``` makes everything (to my knowledge) work fine again. ---------------------------------------------------------------------------------------------------- [19:03:41] Mitch VanDuyn(@catmando):can you paste the bigger context? ---------------------------------------------------------------------------------------------------- [19:05:14] Adam(@adamcreekroad):Opal 0.9 (broken) ``` def initialize(defaults = undefined, &block) %x{ if (defaults !== undefined && defaults.constructor === Object) { var smap = self.$$smap, keys = self.$$keys, key, value; for (key in defaults) { value = defaults[key]; if (value && value.constructor === Object) { smap[key] = #{Hash.new(`value`)}; } else if (value && value.$$is_array) { value = value.map(function(item) { if (item && item.constructor === Object) { return #{Hash.new(`item`)}; } return item; }); smap[key] = value } else { smap[key] = #{Native(`value`)}; } keys.push(key); } return self; } return #{_initialize(defaults, &block)}; } end ``` Opal 0.9 (what is working for me ``` def initialize(defaults = undefined, &block) %x{ if (defaults != null && defaults.constructor === Object) { var smap = self.$$smap, keys = self.$$keys, key, value; for (key in defaults) { value = defaults[key]; if (value && value.constructor === Object) { smap[key] = #{Hash.new(`value`)}; } else if (value && value.$$is_array) { value = value.map(function(item) { if (item && item.constructor === Object) { return #{Hash.new(`item`)}; } return item; }); smap[key] = value } else { smap[key] = #{Native(`value`)}; } keys.push(key); } return self; } return #{_initialize(defaults, &block)}; } end ``` ---------------------------------------------------------------------------------------------------- [19:08:16] Mitch VanDuyn(@catmando):so where is this called from in reactrb? ---------------------------------------------------------------------------------------------------- [19:13:04] Adam(@adamcreekroad):``` module React class StateWrapper < BasicObject def initialize(native, from) @state_hash = Hash.new(`#{native}.state`) @from = from end ... end end ``` ---------------------------------------------------------------------------------------------------- [19:13:49] Adam(@adamcreekroad):at ```Hash.new``` ---------------------------------------------------------------------------------------------------- [19:14:56] Mitch VanDuyn(@catmando):Does anybody know why the above changed (Hash.new(...)) in Opal 0.9??? ---------------------------------------------------------------------------------------------------- [19:15:58] Mitch VanDuyn(@catmando):looks like what you want is: ---------------------------------------------------------------------------------------------------- [19:16:33] Mitch VanDuyn(@catmando):`defaults !== undefined && defaults != null && defaults.constructor === Object` ---------------------------------------------------------------------------------------------------- [19:17:51] Mitch VanDuyn(@catmando):Can you do a PR for that for opal? ---------------------------------------------------------------------------------------------------- [19:18:27] Mitch VanDuyn(@catmando):meanwhile I will put a monkey patch in the reactrb branch that works with 0.9 ---------------------------------------------------------------------------------------------------- [19:18:31] Mitch VanDuyn(@catmando):deal? ---------------------------------------------------------------------------------------------------- [19:47:12] Adam(@adamcreekroad):yeah I can do that ---------------------------------------------------------------------------------------------------- [20:10:27] Mitch VanDuyn(@catmando):@vais - we just hit a problem with opal 0.9 (see above discussion)... We are counting on ---------------------------------------------------------------------------------------------------- [20:10:56] Mitch VanDuyn(@catmando):```ruby Hash.new(`null`) ``` ---------------------------------------------------------------------------------------------------- [20:12:30] Mitch VanDuyn(@catmando):but since your recent commit only checks `defaults` for `undefined` are you okay with updating to check `null` and `undefined` ? ---------------------------------------------------------------------------------------------------- ############################## [2016-06-02] ############################## [01:28:59] Doug Orleans(@dougo):I'm having a problem using opal-vienna in production mode, it dies when I try to `require 'vienna'`. Is opal-vienna still supported? seems inactive for a couple years ---------------------------------------------------------------------------------------------------- [01:29:56] Doug Orleans(@dougo):I think it's because lib/opal/vienna.rb is adding ../../opal to the Opal path, but not the Ruby load path. ---------------------------------------------------------------------------------------------------- [01:30:57] meh.(@meh):dougo, it was adambeynon's, whom disappeared, pretty sure you're out of luck there ---------------------------------------------------------------------------------------------------- [01:31:41] Colin Gunn(@balmoral): ---------------------------------------------------------------------------------------------------- [01:35:29] Doug Orleans(@dougo):bummer ---------------------------------------------------------------------------------------------------- [01:35:59] Doug Orleans(@dougo):hm, looks like adding it to the Ruby path won't work because then it tries to require 'native'. ---------------------------------------------------------------------------------------------------- [01:40:39] Doug Orleans(@dougo):well actually I don't know why it can't require 'native', seems like it should be able to. ---------------------------------------------------------------------------------------------------- [01:41:32] Doug Orleans(@dougo):I don't know why this works fine in development and test but breaks in production. Kind of annoying... ---------------------------------------------------------------------------------------------------- [15:02:15] Doug Orleans(@dougo):Er wait, why is it even trying to run my Opal code in Ruby at all?? ---------------------------------------------------------------------------------------------------- [15:13:11] Doug Orleans(@dougo):Aha, for some reason app/assets is on the eager_load_paths of my engine. ---------------------------------------------------------------------------------------------------- [17:52:36] ylluminate(@ylluminate):you guys might want to chime in here: https://www.reddit.com/r/ruby/comments/4m2mra/thoughts_on_opal/ ---------------------------------------------------------------------------------------------------- [18:54:54] ylluminate(@ylluminate):can't believe the controversy going on there right now! ---------------------------------------------------------------------------------------------------- [18:55:07] ylluminate(@ylluminate):you can literally keep refreshing the page and watch the votes pop up and down ---------------------------------------------------------------------------------------------------- [18:58:28] Jamie Gaskins(@jgaskins):Dat top comment, tho ---------------------------------------------------------------------------------------------------- [19:02:58] ylluminate(@ylluminate):lol, [this one](https://www.reddit.com/r/ruby/comments/4m2mra/thoughts_on_opal/d3sbgtx) has been jumping up and down like a friggin' trampoline. i've seen it go from 10 down to 3 and then back up to 8, now down to 6. Crazy how polarizing Opal is! ---------------------------------------------------------------------------------------------------- [19:07:47] ylluminate(@ylluminate):i know you're holding back @ylluminarious, but really appreciated [your remark](https://www.reddit.com/r/ruby/comments/4m2mra/thoughts_on_opal/d3tfqvf). ---------------------------------------------------------------------------------------------------- [20:50:34] Doug Orleans(@dougo):What's the status of opal-rails? any schedule for when it will support Opal 0.9 and Rails 5? ---------------------------------------------------------------------------------------------------- [20:57:10] Mitch VanDuyn(@catmando):I think it does :-) ---------------------------------------------------------------------------------------------------- [20:57:22] Mitch VanDuyn(@catmando):@adamcreekroad is using it... ---------------------------------------------------------------------------------------------------- [22:25:29] Doug Orleans(@dougo):but not the latest gem release. ---------------------------------------------------------------------------------------------------- [23:05:59] Mitch VanDuyn(@catmando):yeah maybe your right... ---------------------------------------------------------------------------------------------------- [23:23:48] Jamie Gaskins(@jgaskins):Yeah, i have to keep using the GitHub repo in my Gemfiles ---------------------------------------------------------------------------------------------------- ############################## [2016-06-03] ############################## [01:02:20] Forrest Chang(@fkchang): This might be of some interest for people trying to put tests on some javascript they're trying to incorporate w/their opal code http://funkworks.blogspot.com/2016/06/wewljcio-working-effectively-with.html ---------------------------------------------------------------------------------------------------- [13:01:30] Adam(@adamcreekroad):Yeah I have to use the master branch of the opal-rails repo to work with Opal 0.9 and Rails 5. ---------------------------------------------------------------------------------------------------- [23:08:15] Doug Orleans(@dougo):so why did Adam Beynon leave Opal? Was it because of OpalGate, or something else? ---------------------------------------------------------------------------------------------------- ############################## [2016-06-04] ############################## [00:25:55] Brady Wied(@wied03):@dougo - I'm not sure anyone here knows. I've never been given an explanation. ---------------------------------------------------------------------------------------------------- [01:15:03] Doug Orleans(@dougo):Anyone know the status of opal-minitest-rails (referred to in the opal-rails README)? I'm tempted to update opal-minitest to use Opal::CLI but maybe someone is already working on that... ---------------------------------------------------------------------------------------------------- ############################## [2016-06-05] ############################## [18:09:52] Martin Becker(@Thermatix):Opalgate? is now customary to attach 'gate' to scandal? also what happened? ---------------------------------------------------------------------------------------------------- [19:54:18] Brock Wilcox(@awwaiid):@Thermatix Opalgate is a now-completely-resolved incident ultimately leading to a Code-of-Conduct being adopted for Opal. Google will give you TONS of gory and nasty details (in all directions) -- but basically a huge fight broke out on a github issue request asking to kick people off of the project for behavior outside of the project (which is quite rude, in my opinion, and unsurprising that it led to a fight). It has been an unfortunately notable incident in ongoing debates about social responsibility in open source projects, especially because it's hard for folks to realize that it has been resolved -- there is no ongoing issue in the Opal project that I know of. ---------------------------------------------------------------------------------------------------- [19:56:25] Brock Wilcox(@awwaiid):Adam Beynon, as I understand it, was a bit part of the resolution. I guess dougo's hypothesis was that it was still stressful enough to run Adam out. But I've only been hanging out here a few weeks, so don't know ---------------------------------------------------------------------------------------------------- [19:57:10] George Plymale II(@ylluminarious):@Thermatix apparently it is customary to attach "gate" to a given scandal topic: https://en.wiktionary.org/wiki/-gate#Suffix ---------------------------------------------------------------------------------------------------- [21:59:53] Martin Becker(@Thermatix):@ylluminarious huh, so that's an actual thing, go figure. ---------------------------------------------------------------------------------------------------- ############################## [2016-06-06] ############################## [05:57:04] Jared White(@jaredcwhite):Hey all, I've been meaning to ask -- I thought at some point I had heard chatter about being able to choose to load a much smaller subset of Opal/stdlib/corelib, but I can't seem to find any docs about how to do that. Not sure if that ever actually got off the ground. I'm looking at creating an official JS library for a tool I'm building (nothing specifically related to Opal), and my current code is mostly Opal-based. I might try the crazy route of actually releasing it as a compiled Ruby-to-JS file if it could include only a small subset of the Opal runtime. Otherwise I'm just going to rewrite it in JS (probably ES6 + Babel). ---------------------------------------------------------------------------------------------------- [11:53:13] Elia Schito(@elia):@jaredcwhite `require 'opal/mini'` instead of `opal` should do the trick, not sure if it's suitable for a general purpose library tho ---------------------------------------------------------------------------------------------------- [11:53:37] Elia Schito(@elia):https://github.com/opal/opal/blob/master/opal/opal/mini.rb ---------------------------------------------------------------------------------------------------- [14:31:55] Jamie Gaskins(@jgaskins):@elia Well, for a library, it's a good idea not to load Opal at all (on the front end, at least). ;-) The app using the library should decide how to load Opal. If an app loads it from a CDN but a lib loads it from the gem, you load the runtime twice. ---------------------------------------------------------------------------------------------------- [14:35:32] Elia Schito(@elia):indeed that's my general opinion too, but then you have stuff like asciidoctor.js and looks like a legit use case :D ---------------------------------------------------------------------------------------------------- [15:09:16] Vais Salikhov(@vais):@catmando in reference to https://github.com/opal/opal/pull/1474 I have no objections to the PR as it stands at https://github.com/opal/opal/pull/1474/commits/ad833a3e86ed95e6ac640f6ba7d63cd249db4a1a. I have been out of the loop for a while, so counting on @elia to merge :wink: ---------------------------------------------------------------------------------------------------- [15:10:29] Mitch VanDuyn(@catmando):@vais - @adamcreekroad did that PR :-) ---------------------------------------------------------------------------------------------------- [15:11:31] Jamie Gaskins(@jgaskins):The PR seems to break a lot of specs related to keyword args. ---------------------------------------------------------------------------------------------------- [16:19:22] Brady Wied(@wied03):@jaredcwhite - When one of us gets around to it, the intent was to create a common NPM package that opal-webpack and the asciidoctor stuff can use - https://github.com/cj/opal-webpack/issues/33 ---------------------------------------------------------------------------------------------------- [16:19:39] Forrest Chang(@fkchang):@vais welcome back, hadn't seen u in a while (or at least that's my recollection) ---------------------------------------------------------------------------------------------------- [18:07:15] Mitch VanDuyn(@catmando):@elia - latest opal-rails-rspec doesn't have the nice list of spec links so you can rerun tests by clicking a link... any way to turn it back on in a config or something? ---------------------------------------------------------------------------------------------------- [18:08:15] Mitch VanDuyn(@catmando):@jgaskins which pr were you referring to? ---------------------------------------------------------------------------------------------------- [20:29:52] Jamie Gaskins(@jgaskins):@catmando #1474 Looks like it was unrelated breakage. I thought the change to allow `null` had broken specs for kwargs (since kwargs are implemented with hashes), but @elia said it was caused by an incompatibility with mspec. So, never mind. :-) ---------------------------------------------------------------------------------------------------- [23:22:59] Jared White(@jaredcwhite):@elia Sweet! I'll definitely check that out. @jgaskins I could probably provide a variant of the library not including any of the Opal code itself, if the app wanted to load Opal separately. Yes? ---------------------------------------------------------------------------------------------------- [23:23:43] Jared White(@jaredcwhite):Also, FWIW, I added my 2c in that Reddit thread on Opal. :clap: ---------------------------------------------------------------------------------------------------- ############################## [2016-06-07] ############################## [00:02:23] Elia Schito(@elia):@/all I'm about to release 0.9.3 which contains just a minute fix, but given the recent problems rubygems had with symlinks if someone can confirm http://cl.ly/0E0l1D0U0X3x gets installed without errors? Please try on as many versions of ruby as you can (thanks!) ---------------------------------------------------------------------------------------------------- [00:05:32] Mitch VanDuyn(@catmando):@jaredcwhite - nice post on Reddit :beers: ---------------------------------------------------------------------------------------------------- [00:54:16] Mitch VanDuyn(@catmando):Nice post @fkchang https://medium.com/@fkchang2000/wewljcio-working-effectively-with-legacy-javascript-code-in-opal-4fd624693de4#.dn0fymuzd ---------------------------------------------------------------------------------------------------- [06:43:12] Jonathan Simpson(@jsimpson):big thanks to @jaredcwhite and @fkchang, using their various blog posts i was able to introduce opal to a legacy rails app with specs (!!).. extra big thanks to @fkchang for helping me find the motivaton to do it in the first place :smile: ---------------------------------------------------------------------------------------------------- [16:06:34] Forrest Chang(@fkchang):@catmando thanks for the kudos, same article I posted last week but reposted to medium, I'm trying that "dual publishing" thing that some ppl recommend ---------------------------------------------------------------------------------------------------- [16:06:54] Forrest Chang(@fkchang):@jsimpson your welcome! Might I ask which posts you found the most helpful? ---------------------------------------------------------------------------------------------------- [16:14:24] Jared White(@jaredcwhite):@jsimpson awesome! Glad to hear. @catmando sure thing! :beer: ---------------------------------------------------------------------------------------------------- [16:18:49] Jamie Gaskins(@jgaskins):@jaredcwhite You could, but is there any value in making an assumption about how the app using your library is loading Opal? In general, I'm all for loading all dependencies of your code in the same file, and the runtime is definitely a dependency. :-) However, I kinda consider it similarly to running MRI or RSpec on the server. You can safely assume the Ruby runtime is loaded. Similarly, specs generally only load the code they're specifying; RSpec is assumed to be loaded elsewhere. ---------------------------------------------------------------------------------------------------- ############################## [2016-06-08] ############################## [01:20:46] Jonathan Simpson(@jsimpson):@fkchang honestly, most of them, but your most recent post about refactoring opal-hot-reloader helped me sort out some confusion I had about rspec and writing specs ---------------------------------------------------------------------------------------------------- [09:47:57] Vais Salikhov(@vais):@fkchang thanks :smile: Day job and family been keeping me busy ---------------------------------------------------------------------------------------------------- [17:36:16] Brady Wied(@wied03):FYI, i toyed around with React Native and Opal, https://github.com/wied03/react_native_sample, still some decent obstacles there ---------------------------------------------------------------------------------------------------- [17:38:23] Brady Wied(@wied03):and things w/ React native have changed a lot since zetachang's original sample ---------------------------------------------------------------------------------------------------- [17:57:36] Mitch VanDuyn(@catmando):@wied03 cool! ---------------------------------------------------------------------------------------------------- [21:23:52] Mitch VanDuyn(@catmando):opal-rails depends on opal-rspec 0.4.3 ??? so there is no way to run opal-rspec 0.5 with opal rails unless you take latest opal-rails from master? ---------------------------------------------------------------------------------------------------- [22:01:30] Brady Wied(@wied03):all roads run through elia :) ---------------------------------------------------------------------------------------------------- [23:52:15] Elia Schito(@elia):heyhey :D ---------------------------------------------------------------------------------------------------- [23:54:00] Elia Schito(@elia):@wied03 the new opal-rails has no direct opal-rspec bound, and I started som work around opal-rspec-rails, but I'm kinda stuck on that for lack of time (surprise!) could definitely use some help there ---------------------------------------------------------------------------------------------------- [23:54:05] Elia Schito(@elia)::) ---------------------------------------------------------------------------------------------------- ############################## [2016-06-09] ############################## [13:05:48] Mitch VanDuyn(@catmando):@elia do u know if there r any barriers to getting opal-rails on master running with opal 0.8? If not I will give it a whirl ---------------------------------------------------------------------------------------------------- [13:42:58] Elia Schito(@elia):@catmando it's possible that some APIs changed ---------------------------------------------------------------------------------------------------- [13:44:08] Elia Schito(@elia):> @elia - latest opal-rails-rspec doesn't have the nice list of spec links so you can rerun tests by clicking a link... any way to turn it back on in a config or something? @catmando it's still WIP, except for the Progress :D ---------------------------------------------------------------------------------------------------- [14:25:35] Mitch VanDuyn(@catmando):@elia - looks like you just did a commit to explicitly make opal-rspec-rails depend on 0.9 ??? ---------------------------------------------------------------------------------------------------- [14:26:37] Brady Wied(@wied03):@catmando - I probably should stay out of this and I know you're trying to ensure compatibility since you have a lib, but I think it's OK to track opal aggressively until it hits 1.0ish stage ---------------------------------------------------------------------------------------------------- [14:27:54] Brady Wied(@wied03):@elia - you did mention needing some help w/ opal-rspec-rails, I can if you can document some of what you want done in an issue ---------------------------------------------------------------------------------------------------- [14:30:08] Elia Schito(@elia):@catmando yes, I started working on it before releasing 0.9, definitely need to update the gemspec ---------------------------------------------------------------------------------------------------- [14:30:40] Elia Schito(@elia):@wied03 thanks very much, I'll try to do that tonight ---------------------------------------------------------------------------------------------------- [14:31:11] Elia Schito(@elia):(~7h) ---------------------------------------------------------------------------------------------------- [14:31:15] Mitch VanDuyn(@catmando):@elia - I dont' udnerstand.... you just updated the gem spec to lock it 0.9 ---------------------------------------------------------------------------------------------------- [14:32:32] Mitch VanDuyn(@catmando):@wied03 there are changes in 0.9 that while being bug fixes, they are also breaking changes, so I think its important to allow the reactrb gems to work with 0.8 and 0.9 ---------------------------------------------------------------------------------------------------- [14:32:59] Mitch VanDuyn(@catmando):I mean this is a real pain, so i would love to be persuaded I don't need to worry about it. ---------------------------------------------------------------------------------------------------- [14:33:02] Elia Schito(@elia):@catmando "just" means days ago right? ---------------------------------------------------------------------------------------------------- [14:33:11] Mitch VanDuyn(@catmando):11 days ago I think ---------------------------------------------------------------------------------------------------- [14:34:09] Elia Schito(@elia):yeah, probably didn't want to support 0.8 on the new version because of API changes ---------------------------------------------------------------------------------------------------- [14:34:28] Mitch VanDuyn(@catmando):well I see the commit was actually Jan 18, but it got pushed 11 days ago ---------------------------------------------------------------------------------------------------- [14:36:07] Elia Schito(@elia):ah ok, I guess 11 days ago I realized I had accumulated stuff local to my machine :) ---------------------------------------------------------------------------------------------------- [14:36:41] Mitch VanDuyn(@catmando):okay well I am going to try pulling back to 0.8 and see what happens ---------------------------------------------------------------------------------------------------- [14:36:51] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [15:47:23] Mitch VanDuyn(@catmando):@elia / @wied03 got things sort of working with opal-rspec-rails and opal 0.8. The problem is it runs all the specs, then loops back and begins running them all again... any clues as to why? ---------------------------------------------------------------------------------------------------- [15:48:15] Brady Wied(@wied03):infinite or just twice ? ---------------------------------------------------------------------------------------------------- [15:53:41] Mitch VanDuyn(@catmando):@elia / @wied03 - its specific to opal-rspec-rails... there is a monkey patch that looks like this: ---------------------------------------------------------------------------------------------------- [15:54:08] Mitch VanDuyn(@catmando):```ruby # Patch the RSpec runner to work with Kernel.exit RSpec::Core::Runner.class_eval do def self.autorun at_exit do # see NoCarriageReturnIO source for why this is being done (not on Node though) err, out = get_opal_closed_tty_io # Have to do this in 2 places. This will ensure the default formatter gets the right IO, but need to do this in config for custom formatters # that will be constructed BEFORE this runs, see rspec.rb run(ARGV, err, out).then do |status| exit 0 end end end def self.exit_with_code(code) exit(code) end end ``` ---------------------------------------------------------------------------------------------------- [15:55:06] Mitch VanDuyn(@catmando):no idea what exit, at_exit, and exit_with_code are all about... ---------------------------------------------------------------------------------------------------- [15:55:12] Mitch VanDuyn(@catmando):removing that patch fixes the problem ---------------------------------------------------------------------------------------------------- [15:56:18] Brady Wied(@wied03):@elia - As you know, I was never a fan of the at_exit stuff. Now that opal-rspec-rails is separate anyways, can a more stock (as in out of the box opal-rspec) approach be used? ---------------------------------------------------------------------------------------------------- [15:58:18] Mitch VanDuyn(@catmando):what is this supposed to do anyway? ---------------------------------------------------------------------------------------------------- [15:59:35] Brady Wied(@wied03):@catmando - these are various techniques for running specs and getting the results back without having to litter spec files/spec helpers with rspec code ---------------------------------------------------------------------------------------------------- [16:00:02] Brady Wied(@wied03):opal-rspec out of the box basically includes all your specs first and then the last line tells RSpec to run them ---------------------------------------------------------------------------------------------------- [16:00:29] Mitch VanDuyn(@catmando):right ---------------------------------------------------------------------------------------------------- [16:00:35] Brady Wied(@wied03):a different way of doing it is to put at_exit anywhere in the code such that Kernel#exit will run it last without having to guarantee code placement ---------------------------------------------------------------------------------------------------- [16:04:02] Mitch VanDuyn(@catmando):so this is providing a feature so that you can call RSpec::Core::Runner.exit_with_code ? ---------------------------------------------------------------------------------------------------- [16:04:48] Brady Wied(@wied03):sort of. out of the box, the opal-rspec rake task does that for you ---------------------------------------------------------------------------------------------------- [16:04:58] Brady Wied(@wied03):for a while opal-rails was providing its own task, etc. ---------------------------------------------------------------------------------------------------- [16:05:05] Brady Wied(@wied03):meeting, bbbl ---------------------------------------------------------------------------------------------------- [16:10:05] Elia Schito(@elia):> @elia - As you know, I was never a fan of the at_exit stuff. Now that opal-rspec-rails is separate anyways, can a more stock (as in out of the box opal-rspec) approach be used? I'm fine with it, the main requirement for opal-rspec-rails is that it uses the Rails sprockets env instance because of paths and processors. An other important feature is running in the browser and possibly a CLI as in bin/opal-rails. ---------------------------------------------------------------------------------------------------- [16:25:54] Mitch VanDuyn(@catmando):so i'm going to do a PR removing the 0.9 restriction, and I will pull out the exit_with_code patch okay? ---------------------------------------------------------------------------------------------------- [16:26:14] Mitch VanDuyn(@catmando):I notice the tests are not all passing, so I will also try to get them fixed if I can... ---------------------------------------------------------------------------------------------------- [16:27:20] Mitch VanDuyn(@catmando):FYI all reactive-record specs (which uses opal-rspec-rails) are passing with opal 0.8 as well. ---------------------------------------------------------------------------------------------------- [16:31:32] Mitch VanDuyn(@catmando):also I had to remove the require to stdlib console and platform, I can but rescues around them, but they don't seem to be used.... ---------------------------------------------------------------------------------------------------- [21:24:44] Forrest Chang(@fkchang):I really like this, think I should base a code of conduct off of this https://twitter.com/fkchang2000/status/741013016242573312 ---------------------------------------------------------------------------------------------------- ############################## [2016-06-10] ############################## [00:28:50] Austin Erlandson(@erlandsona):What are people's thoughts here about Polymer / Web Components in general? ---------------------------------------------------------------------------------------------------- [18:02:37] Forrest Chang(@fkchang):@erlandsona I liked the general notion of web components, and if that's where we eventually end it'll probably be good. I read an article where react is kind of superceding web components, because it works now, and have read some things of trying to get react and web components to be compatibale. I will say that I do like the ability to do it all in Ruby w/ react.rb and liked even better that lissio let you write css in ruby ---------------------------------------------------------------------------------------------------- ############################## [2016-06-11] ############################## [15:45:37] ylluminate(@ylluminate):@fkchang that article sounds very much like LDS doctrine; almost simply a restatement. Of course that is Matz's religion (and mine as well). Very interesting article, thanks for sharing! ---------------------------------------------------------------------------------------------------- ############################## [2016-06-13] ############################## [03:27:01] Jared White(@jaredcwhite):@fkchang Yes, thanks for sharing. Much there to appreciate as well from my perspective as a Christian. @ylluminate wow, I had no idea. Very interesting. ---------------------------------------------------------------------------------------------------- ############################## [2016-06-16] ############################## [21:01:47] Elia Schito(@elia):@/all 0.10.0.rc1 and 0.9.3 are out! ---------------------------------------------------------------------------------------------------- [21:01:49] Elia Schito(@elia):https://twitter.com/rubygems/status/743548658512183296 ---------------------------------------------------------------------------------------------------- [21:02:01] Elia Schito(@elia):https://twitter.com/rubygems/status/743544539986665472 ---------------------------------------------------------------------------------------------------- [21:02:38] Guillaume Grossetie(@Mogztter):\o/ ---------------------------------------------------------------------------------------------------- [21:03:06] Mitch VanDuyn(@catmando)::beers: ---------------------------------------------------------------------------------------------------- [21:10:54] George Plymale II(@ylluminarious)::clap: ---------------------------------------------------------------------------------------------------- [22:19:50] Jared White(@jaredcwhite):awesome! :sparkles: ---------------------------------------------------------------------------------------------------- ############################## [2016-06-20] ############################## [17:58:30] Jared White(@jaredcwhite):@elia I'll plan to send out another Opalist issue when 0.10 officially comes out... been so busy lately with work I haven't had much time to devote to anything Opal-related but it'd be good to get something out soon. All the best -J ---------------------------------------------------------------------------------------------------- [20:21:29] Elia Schito(@elia):@jaredcwhite would you do a guest post on opalrb.org with a super simple introduction to the new release? It's ok to have just a couple of highlights and then a link to the changelog ---------------------------------------------------------------------------------------------------- ############################## [2016-06-21] ############################## [10:14:26] Jikku Jose(@JikkuJose):Trying Opal with webpack, seem to be stuck with an error. ---------------------------------------------------------------------------------------------------- [10:14:45] Jikku Jose(@JikkuJose):Any idea what this is: `ERROR in ./~/imports-loader!/Users/jikkujose/.gem/ruby/2.2.2/gems/opal-0.9.4/opal/corelib/runtime.js Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/jikkujose/.gem/ruby/2.2.2/gems/opal-0.9.4/opal/corelib"` ---------------------------------------------------------------------------------------------------- [10:23:15] Elia Schito(@elia):looks something webpack specific, cc @fkchang ---------------------------------------------------------------------------------------------------- [16:57:50] Forrest Chang(@fkchang):@JikkuJose what's your setup. The error msg seems to be pretty clear, es2015 preset can't be referenced however it's being specified ---------------------------------------------------------------------------------------------------- [17:03:53] Jared White(@jaredcwhite):@elia Sure, sign me up (doing guest post) ---------------------------------------------------------------------------------------------------- [17:20:40] Forrest Chang(@fkchang):@/all I think this might be useful for setting up tests suites and supporting multiple versions of rails https://github.com/ageweke/oop_rails_server ---------------------------------------------------------------------------------------------------- [21:23:42] Elia Schito(@elia):@jaredcwhite 👍🏼 great! ---------------------------------------------------------------------------------------------------- [21:23:44] Elia Schito(@elia):https://twitter.com/rubygems/status/745365925004705792 ---------------------------------------------------------------------------------------------------- [23:27:16] Mitch VanDuyn(@catmando):@/all cleaning up reactrb code: Does anybody have any ideas why @zetachang originally used "method_missing" to handle calls to tag method? i.e. div(...) is handled as method missing rather than being defined a normal method. Effeciency? I am assuming that if did a ---------------------------------------------------------------------------------------------------- [23:28:20] Mitch VanDuyn(@catmando):```ruby include HtmlTags ``` it would be better in all respects than handling every call to a tag, as a method missing that then looks the tag up???? ---------------------------------------------------------------------------------------------------- ############################## [2016-06-22] ############################## [20:29:23] Dino Maric(@dixpac):```Uncaught NoMethodError: undefined method `use_gem' for undefined``` ---------------------------------------------------------------------------------------------------- [20:29:26] Dino Maric(@dixpac):in console ---------------------------------------------------------------------------------------------------- [20:30:18] Jamie Gaskins(@jgaskins):You don't run `use_gem` on the client app ---------------------------------------------------------------------------------------------------- [20:30:49] Jamie Gaskins(@jgaskins):Run that on the server. Run the second code block in your client app. ---------------------------------------------------------------------------------------------------- [20:31:36] Dino Maric(@dixpac):yea...when I run second I get `sprockets error` :( ---------------------------------------------------------------------------------------------------- [20:32:08] Jamie Gaskins(@jgaskins):Same: ``` Sprockets::FileNotFound at / couldn't find file 'uri' with type 'application/javascript' ``` ---------------------------------------------------------------------------------------------------- [20:32:21] Jamie Gaskins(@jgaskins):Opal doesn't support the `uri` library yet. ---------------------------------------------------------------------------------------------------- [20:33:16] Jamie Gaskins(@jgaskins):But that's a different error than you got ---------------------------------------------------------------------------------------------------- [20:33:28] Jamie Gaskins(@jgaskins):Or at least a different one than you posted ---------------------------------------------------------------------------------------------------- [20:33:40] Dino Maric(@dixpac):i get this error ---------------------------------------------------------------------------------------------------- [20:34:02] Dino Maric(@dixpac):```couldn't find file 'browser' with type 'application/javascript'``` ---------------------------------------------------------------------------------------------------- [20:34:21] Dino Maric(@dixpac):looks like similar kind of error to me...:) ---------------------------------------------------------------------------------------------------- [20:34:55] Jamie Gaskins(@jgaskins):It's the same error, but different library. Yours means that your server process hasn't run `Opal.use_gem 'browser'`. If you added it, you need to restart your server. ---------------------------------------------------------------------------------------------------- [20:35:20] Christian Käser(@dfyx):Is there any (good) documentation for the `Browser::Canvas` class? I've started playing around with it but its API appears to be quite different from the native one ---------------------------------------------------------------------------------------------------- [20:52:18] Christian Käser(@dfyx):Or at least a usage example? (paging @meh ) ---------------------------------------------------------------------------------------------------- [00:26:04] meh.(@meh):catmando, performance wise? there isn't a difference from some benchmarks I made ages ago, and I doubt things got worse ---------------------------------------------------------------------------------------------------- [02:25:21] Jamie Gaskins(@jgaskins):Yeah, it's not like in MRI where method lookup is very expensive — it uses a method cache internally, but that's unnecessary in a JS VM. My guess as to his motive is that metaprogramming is fun. ;-) @catmando In your example, `div` points to the same function in the VM as `method_missing`, wired up at compile time. The only extra cost is inside `method_missing`, which is probably reduced to almost 0 after a couple executions of it when the JIT gets ahold of it. Would be best not to conjecture and run benchmarks instead. :-) ---------------------------------------------------------------------------------------------------- [18:56:17] Jikku Jose(@JikkuJose):@fkchang Hey, thanks for replying! This is my setup: https://github.com/JikkuJose/react-lab/tree/feature-opal_support I am trying to _import_ a simple Ruby class to a typical React project. ---------------------------------------------------------------------------------------------------- [18:58:15] Jikku Jose(@JikkuJose):This is the Ruby file: https://github.com/JikkuJose/react-lab/blob/feature-opal_support/src/js/app/para.rb This is how I am hoping to us it: https://github.com/JikkuJose/react-lab/blob/feature-opal_support/src/js/app.jsx#L9 Note: Now, I am referring to the _jsx_ file instead of the .rb file. But didn't work when I was using it. ---------------------------------------------------------------------------------------------------- [18:58:42] Jikku Jose(@JikkuJose):Quick question: Opal compiles to es5? ---------------------------------------------------------------------------------------------------- [19:05:39] Jikku Jose(@JikkuJose):Also, shouldn't `opalrb-loader` be listed in `devDependencies`? (https://github.com/zetachang/opalrb-loader/blob/5fe749e062678e61e5f78cf44ecf8d5a3b22eedb/examples/simple/package.json#L8) ---------------------------------------------------------------------------------------------------- [19:07:10] Jikku Jose(@JikkuJose):Is there any equivalent for specifying the Ruby class as the one thats being exported? I think everything is getting compiled well, but I am unable to refer to the class I am creating. ---------------------------------------------------------------------------------------------------- [19:14:18] Ilya Bylich(@iliabylich):To get a Ruby class form JS you need to call `Opal.YourClass`. To create its instance use `.$new()`, to call your own method call `.$your_method()`. For your code it should be `Opal.Paragraph.$new().$text()`. ---------------------------------------------------------------------------------------------------- [19:14:33] Ilya Bylich(@iliabylich):No, opal doesn't support ES5 ---------------------------------------------------------------------------------------------------- [19:19:01] Ilya Bylich(@iliabylich):And ideally you should use your Ruby classes from your Ruby code, it can be really painful to use compiled JS directly (talking about things like Ruby blocks). ---------------------------------------------------------------------------------------------------- [19:29:10] Jikku Jose(@JikkuJose):Wow! Thats great help! ---------------------------------------------------------------------------------------------------- [19:32:55] Jikku Jose(@JikkuJose):@iliabylich I was able to use the Ruby class like you mentioned. I understand its not very pretty, but I was just trying to see if it was possible. It definitely looks awful to write `Opal.Paragraph.$new().$text()`; but the capability to do Ruby along side JS feels cool. Certainly not for production, but to see the value of webpack. Loud Thought: If Ruby classes could have been addressed like normal es6 classes this would have been a great way to use Opal along side, so that we could code in either Ruby or es6. ---------------------------------------------------------------------------------------------------- [20:12:21] Dino Maric(@dixpac):Hi all! One quick question I'm new to Opal....can I use any ruby gems with opal...i want to require "browser" gem in open file(`app/application.rb`)...is that possible ? ---------------------------------------------------------------------------------------------------- [20:12:43] Dino Maric(@dixpac):https://github.com/fnando/browser ---------------------------------------------------------------------------------------------------- [20:16:29] Jamie Gaskins(@jgaskins):@dixpac It might work. If you run this in Ruby, do you get any errors? ```ruby require 'opal' require 'browser' # This may not be necessary Opal.use_gem 'browser' ``` ---------------------------------------------------------------------------------------------------- [20:19:43] Dino Maric(@dixpac):hey when i run it i get this ---------------------------------------------------------------------------------------------------- [20:20:11] Dino Maric(@dixpac):[![Screen Shot 2016-06-22 at 22.19.12.png](https://files.gitter.im/opal/opal/rPAM/thumb/Screen-Shot-2016-06-22-at-22.19.12.png)](https://files.gitter.im/opal/opal/rPAM/Screen-Shot-2016-06-22-at-22.19.12.png) ---------------------------------------------------------------------------------------------------- [20:20:36] Jamie Gaskins(@jgaskins):Sorry, I mean run that on MRI ---------------------------------------------------------------------------------------------------- [20:20:55] Jamie Gaskins(@jgaskins):And then in your Opal app: ```ruby require 'opal' require 'browser' ``` ---------------------------------------------------------------------------------------------------- [20:23:32] Dino Maric(@dixpac):yap...work fine using MRI ---------------------------------------------------------------------------------------------------- [20:25:34] Dino Maric(@dixpac):but when I rack it up :) ....I it is not working ---------------------------------------------------------------------------------------------------- [20:25:52] Jamie Gaskins(@jgaskins):What's the error? ---------------------------------------------------------------------------------------------------- [20:26:31] Dino Maric(@dixpac):can you see screenshot i attached 3 comments up ? ---------------------------------------------------------------------------------------------------- [20:28:09] Dino Maric(@dixpac):when i require gems like this ---------------------------------------------------------------------------------------------------- [20:28:34] Dino Maric(@dixpac):```require 'opal' Opal.use_gem 'browser'``` ---------------------------------------------------------------------------------------------------- [20:29:01] Dino Maric(@dixpac):no sprockets error but ---------------------------------------------------------------------------------------------------- ############################## [2016-06-23] ############################## [04:20:17] Sean Scally(@scally):Is it possible to use `module.exports` in opal? I've tried backticking it like `module.exports = MyRubyView` but that throws an error in the compiled js: "import and export may only appear at the top level". Googling various opal/export/modules failed, so I thought I might ask here :) ---------------------------------------------------------------------------------------------------- [14:36:54] Jamie Gaskins(@jgaskins):@scally I don't think so. The entire file gets wrapped in a closure by the compiler. ---------------------------------------------------------------------------------------------------- [14:53:58] Jared White(@jaredcwhite):@elia Blog post is ready to roll for 0.10 final release https://github.com/opal/opal.github.io/pull/37 ---------------------------------------------------------------------------------------------------- [17:22:19] Sean Scally(@scally):@jgaskins thanks for the response; is there any alternative approach I could use if I wanted to write something in opal that I could easily import from JS without having to wrap everything in `$`'s? ---------------------------------------------------------------------------------------------------- [17:30:04] Jamie Gaskins(@jgaskins):@scally Ah, I think I see what you mean. You want to be able to do something like this? ```ruby class Foo def bar end end `module.exports = #{Foo}` ``` And then elsewhere in JS: ```javascript import Foo from './foo'; var f = Foo.new(); foo.bar(); ``` ---------------------------------------------------------------------------------------------------- [17:34:58] Forrest Chang(@fkchang):@scally help me understand the situation, so isn't ```module.exports``` common.js/node modules -- i.e. it doesn't make sense outside of node - I'm not sure how code like that gets compiled to work on the client via browerify/webpack, etc.. I guess u want to do something like what @jgaskins posted? ---------------------------------------------------------------------------------------------------- [17:39:25] Jamie Gaskins(@jgaskins):@fkchang I figured he wanted to convert the compiled Ruby to a JS-like object because of this: > wanted to write something in opal that I could easily import from JS without having to wrap everything in `$`'s ---------------------------------------------------------------------------------------------------- [17:49:12] Sean Scally(@scally):@jgaskins Yes, you got it in your example ---------------------------------------------------------------------------------------------------- [17:56:41] Jamie Gaskins(@jgaskins):@scally Currently, there's no way to convert a Ruby class into an object without `$` method prefixes. AFAIK, the `$` prefix exists purely so you can have methods and ivars with the same names (like `attr_reader`s). That might be the biggest obstacle to getting something like this working. ---------------------------------------------------------------------------------------------------- [18:02:09] Sean Scally(@scally):OK, got it. Appreciate your response. :) ---------------------------------------------------------------------------------------------------- [18:03:37] Sean Scally(@scally):FWIW, my use case is React Native; I've been building a RN app with ES6 and added a gulp task to convert Coffeescript/CJSX to JS, using the backticks in Coffeescript to import/export as needed to emit JS that Coffeescript didn't support, and was hoping I could extend the same methodology to use RN with Opal. ---------------------------------------------------------------------------------------------------- [18:03:56] Jamie Gaskins(@jgaskins):No worries. I like to make stuff usable easily and I think it would be a lot of fun to be able to use something like that. Right now, it's easy to call out to JS from Ruby, but going the other direction still has a fair bit of friction. ---------------------------------------------------------------------------------------------------- [18:05:01] Sean Scally(@scally):I saw there's a Github sample project for RN/Opal but it seems outdated & I have some concerns that the methodology it used (skipping the npm ecosystem) made it harder to update as RN changed or interop with the rest of the npm ecosystem ---------------------------------------------------------------------------------------------------- [18:05:36] Sean Scally(@scally):I was looking for a way to approach RN/Opal in a way that still used the npm infrastructure instead of rake/bundler ---------------------------------------------------------------------------------------------------- [18:05:56] Jamie Gaskins(@jgaskins):The one @wied03 posted? ---------------------------------------------------------------------------------------------------- [18:06:24] Sean Scally(@scally):This is the one I meant: https://github.com/zetachang/opal-native ---------------------------------------------------------------------------------------------------- [18:10:01] Sean Scally(@scally):Looking over the https://github.com/wied03/react_native_sample one now... This might be closer to what I'm looking to do, thanks for pointing me in that direction. Looks like using a webpack server approach with opal-webpack? ---------------------------------------------------------------------------------------------------- [20:01:28] Forrest Chang(@fkchang):@jgaskins I'm thinking maybe a library that converts opal classes/objects into something that looks more native Javascript like could be in order, it would be limitd where one couldn't have a property and method w/the same name. That could be a good too for publicity, if we made a kick but opal lib that was easily usuable by JS. I think that was a selling point of coffeescript, easily usuable by JS because it's just syntactic sugar ---------------------------------------------------------------------------------------------------- [20:21:57] Yehonathan Sharvit(@viebel):@dixpac were you able to require a gem with opal, compile to javascript and run the javascript? ---------------------------------------------------------------------------------------------------- [20:53:19] Mitch VanDuyn(@catmando):@viebel - i have done that... ---------------------------------------------------------------------------------------------------- ############################## [2016-06-24] ############################## [03:10:41] Yehonathan Sharvit(@viebel):@catmando how did you do that? ---------------------------------------------------------------------------------------------------- [03:11:45] Mitch VanDuyn(@catmando):I think instructions are in opal readme ---------------------------------------------------------------------------------------------------- [03:12:09] Mitch VanDuyn(@catmando):I'm about to go to bed. I'll po ---------------------------------------------------------------------------------------------------- [03:12:15] Mitch VanDuyn(@catmando):. ---------------------------------------------------------------------------------------------------- [03:13:16] Mitch VanDuyn(@catmando):Meantime look at SNOBOL gem. It's isomorphic. But I agree it's a bit tricky ---------------------------------------------------------------------------------------------------- [11:59:05] Drew Hamlett(@drewhamlett):Hello. I'm not able to see any output with Opal 0.9.4. I just started a project with Opal server and everything is getting compiled but the module isn't running ---------------------------------------------------------------------------------------------------- [11:59:07] Drew Hamlett(@drewhamlett):```rb Opal.modules["application"] = function(Opal) { Opal.dynamic_require_severity = "error"; var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true }; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require', '$puts']); self.$require("opal"); return self.$puts("hello"); }; ``` ---------------------------------------------------------------------------------------------------- [11:59:53] Drew Hamlett(@drewhamlett):i see that but it's not running the code ---------------------------------------------------------------------------------------------------- [12:02:23] Drew Hamlett(@drewhamlett):I dont' remember having an issue with this before ---------------------------------------------------------------------------------------------------- [12:04:11] Drew Hamlett(@drewhamlett):```js ``` If it put that everything is working. so not sure what's happening ---------------------------------------------------------------------------------------------------- [12:25:32] Elia Schito(@elia):@drewhamlett sprockets compiles files only to modules, that's after 0.8 iirc, to allow require order to be respected ---------------------------------------------------------------------------------------------------- [12:26:03] Elia Schito(@elia):the solution you're using is correct, the official API is `Opal.load('application')` ---------------------------------------------------------------------------------------------------- [12:26:21] Elia Schito(@elia):I have a solution for that in the works but it's not released yet : ) ---------------------------------------------------------------------------------------------------- [14:10:18] Bernhard Weichel(@bwl21):what is the best way to capture keyboard events. E.g. if one enters ctrl-R (or cmd-R) I would like to do a refresh in my application, not in the browser window, ---------------------------------------------------------------------------------------------------- [14:11:48] Bernhard Weichel(@bwl21):tried to use ```ruby Browser::EventSource.new '/events' do |es| es.on :message do |e| alert e.data end es.on :keydown do |e| alert "keydown #{e.data}" end es.on :customs: do |e| alert "custom #{e.data}" end end ``` ---------------------------------------------------------------------------------------------------- [14:39:12] Ilya Bylich(@iliabylich):@bwl21 I think you are using a wrong class :smile: ---------------------------------------------------------------------------------------------------- [14:40:50] Ilya Bylich(@iliabylich):EventSource is not for keyboard events, it's for server-side events ---------------------------------------------------------------------------------------------------- [16:48:39] Jamie Gaskins(@jgaskins):@bwl21 Assuming you're using `opal-browser`, you might be able to do it like this: ```ruby $window.on :keydown do |e| if (e.meta? || e.ctrl?) && e.code == 82 # Ctrl/Cmd + R e.prevent refresh_app end end ``` ---------------------------------------------------------------------------------------------------- [16:50:03] Jamie Gaskins(@jgaskins):`refresh_app` would be your own defined behavior ---------------------------------------------------------------------------------------------------- [18:01:49] Bernhard Weichel(@bwl21):@jgaskins: you brought me to the right track. Thanks. Eventually this code works: ```ruby $window.on :keydown do |e| if (e.meta_key || e.ctrl_key) && (e.key_code == 82) # Ctrl/Cmd + R e.prevent render_previews(); end end ``` Is there somwhere a documentation wehre I could have find this: is ```$window```equivalent to ```Element.find(`window`)``` ? Where is this global set? How to avoid name conflicts with an application global named $window? I found the name of e.meta_key etc. by debugger. ---------------------------------------------------------------------------------------------------- ############################## [2016-06-25] ############################## [04:20:59] Jamie Gaskins(@jgaskins):`e.meta?` is an alias for `e.meta_key` :-) ---------------------------------------------------------------------------------------------------- [09:32:12] Bernhard Weichel(@bwl21):maybe I have an older version, but it did not work :-( Im am on opal (0.9.0) hike (~> 1.2) sourcemap (~> 0.1.0) sprockets (~> 3.1) tilt (>= 1.4) ---------------------------------------------------------------------------------------------------- [16:32:12] Jamie Gaskins(@jgaskins):Weird. What version of `opal-browser` are you using? ---------------------------------------------------------------------------------------------------- ############################## [2016-06-26] ############################## [16:40:07] Guillaume Grossetie(@Mogztter):[![opal-6000.PNG](https://files.gitter.im/opal/opal/P5KV/thumb/opal-6000.png)](https://files.gitter.im/opal/opal/P5KV/opal-6000.PNG) ---------------------------------------------------------------------------------------------------- [16:40:27] Guillaume Grossetie(@Mogztter):6000 commits ! ---------------------------------------------------------------------------------------------------- [16:59:09] Yehonathan Sharvit(@viebel):@catmando could you share information about how to execute gems in the browser? ---------------------------------------------------------------------------------------------------- [17:42:19] Mitch VanDuyn(@catmando):Will try to get something to u later today or tomorrow @viebel ---------------------------------------------------------------------------------------------------- [17:43:20] Mitch VanDuyn(@catmando):There is an article I wrote that is buried in the opal docs... perhaps someone knows where it ended up ---------------------------------------------------------------------------------------------------- [18:08:01] Yehonathan Sharvit(@viebel):It will be very helpful if you send me material @catmando ---------------------------------------------------------------------------------------------------- [18:09:40] Mitch VanDuyn(@catmando):@viebel just to make sure I answer the right question... what r u trying to do :-) ---------------------------------------------------------------------------------------------------- [19:14:58] Yehonathan Sharvit(@viebel):@catmando I'm trying to run a ruby piece of code that requires a ruby gem e.g. https://github.com/hamstergem/hamster ---------------------------------------------------------------------------------------------------- [19:19:07] Jamie Gaskins(@jgaskins):@viebel The `hamster` gem doesn't run on Opal. :-( I fixed the syntax errors it generated, but it turns out it also depends on `concurrent-ruby`, which depends on a native (C/Java) extension. ---------------------------------------------------------------------------------------------------- [19:22:02] Jamie Gaskins(@jgaskins):I wanted it because I use a lot of immutability in my Clearwater apps (with `grand_central` as my data store), so I put a lot of effort into making it work, but `concurrent-ruby` isn't something Opal can run. ---------------------------------------------------------------------------------------------------- [19:23:04] Jamie Gaskins(@jgaskins):I was actually surprised when it relied on that gem because I thought persistent data structures were innately thread-safe. ---------------------------------------------------------------------------------------------------- [19:24:02] Yehonathan Sharvit(@viebel):@jgaskins can you share an example of a gem that works in Opal + how to make it work inside the browser? ---------------------------------------------------------------------------------------------------- [19:41:25] Mitch VanDuyn(@catmando):Did u look at canonbol gem? ---------------------------------------------------------------------------------------------------- [19:42:20] Mitch VanDuyn(@catmando):Also https://github.com/catprintlabs/opal-aasm ---------------------------------------------------------------------------------------------------- [19:44:48] Mitch VanDuyn(@catmando):@viebel found the article http://opalrb.org/docs/guides/v0.9.2/configuring_gems.html ---------------------------------------------------------------------------------------------------- [19:45:26] Mitch VanDuyn(@catmando):Let me know if what u need ---------------------------------------------------------------------------------------------------- [19:45:52] Mitch VanDuyn(@catmando):If that's what u need ---------------------------------------------------------------------------------------------------- [19:46:47] Yehonathan Sharvit(@viebel):Thanks @catmando. Where is the lists of all the gems that are compatible with opal? ---------------------------------------------------------------------------------------------------- [19:47:36] Mitch VanDuyn(@catmando):I don't think anyone has published one. Great idea though ---------------------------------------------------------------------------------------------------- [20:00:33] Mitch VanDuyn(@catmando):I converted a couple of gems as long as they don't depend on obvious problem areas things seem to work ---------------------------------------------------------------------------------------------------- [20:02:07] Yehonathan Sharvit(@viebel):Could you share the converted gems, somehow? I'd like to have a repository of gems in javascript. Does it make sense? ---------------------------------------------------------------------------------------------------- [20:18:09] Yehonathan Sharvit(@viebel):@catmando does it make sense? ---------------------------------------------------------------------------------------------------- [21:59:30] Mitch VanDuyn(@catmando):The couple I mentioned are released as standard gems ---------------------------------------------------------------------------------------------------- [22:00:29] Mitch VanDuyn(@catmando):A good start would be to propose a list of gems to be converted. It would make an excellent beginner project to do the conversion ---------------------------------------------------------------------------------------------------- [22:23:40] Jamie Gaskins(@jgaskins):@viebel Some gems that aren't Opal-aware can be used directly by calling `Opal.use_gem(gem_name)` on the server side. This adds their require paths to Opal's list of require paths. Then you can `require` them in your client-side app as normal Ruby libraries. Unfortunately, for it to work, those gems can't use anything Opal doesn't support, like threads, files (in the browser), native extensions, POSIX stuff (`fork`, processes), `Net::HTTP`, and other things that can't be done in the browser (at least, not the way Ruby does it). ---------------------------------------------------------------------------------------------------- ############################## [2016-06-27] ############################## [15:02:06] Martin Becker(@Thermatix):for the things that the browser does support, why not monkey-patch in interfaces so that when the gems make calls to those things, it simply-redirects any calls to the correct classes/methods ---------------------------------------------------------------------------------------------------- [15:02:22] Martin Becker(@Thermatix):and for the things that don't, error with somthing helpfull? ---------------------------------------------------------------------------------------------------- [20:24:07] Mitch VanDuyn(@catmando):@wied03 @elia not sure where to report this, but I just down graded from opal 9x to opal 8x, and neither opal-rspec or opal-rails reported an issue, but stayed at version 0.9. As a result I had one test spec failing due to this error: ---------------------------------------------------------------------------------------------------- [20:24:32] Mitch VanDuyn(@catmando):ActionView::Template::Error: undefined method `load_asset' for Opal::Sprockets:Module ---------------------------------------------------------------------------------------------------- [20:25:49] Mitch VanDuyn(@catmando):once I forced forced opal-rails back to 0.8.1 everything was fine... seems like or both gems requires opal >= 0.8?? ---------------------------------------------------------------------------------------------------- [20:26:07] Mitch VanDuyn(@catmando):I'm reporting here, because I'm not sure when gem should get the issue... ---------------------------------------------------------------------------------------------------- ############################## [2016-06-28] ############################## [11:31:23] Mehmet Beydogan(@beydogan): ---------------------------------------------------------------------------------------------------- [11:39:07] Mehmet Beydogan(@beydogan):Hi, I'm using opal-rails and upgraded from 0.8.1 to 0.9.0. I have a global variable defined js. ``` gon.events ``` On opal side, I access it by; ``` events = $$.gon.events ``` problem is; when using opal rails 0.9.0 it changes the structure of objects as following; in 0.8.1; ![8](http://i.imgur.com/oJxF3FJ.png) in 0.9.0 or any version above 0.8.1 ![9](http://i.imgur.com/3YWxYru.png) how can i fix this issue? ---------------------------------------------------------------------------------------------------- [14:23:50] Ilya Bylich(@iliabylich):@beydogan Could you try `$$.gon.events.to_n` ? ---------------------------------------------------------------------------------------------------- [21:09:24] Mitch VanDuyn(@catmando):i've got the following question up on StackOverflow: http://stackoverflow.com/questions/38085165/ruby-const-get-that-searches-lexical-scope ---------------------------------------------------------------------------------------------------- [21:09:44] Mitch VanDuyn(@catmando):I'm pretty sure the answer is going to come back to be use `eval` ---------------------------------------------------------------------------------------------------- [21:11:31] Mitch VanDuyn(@catmando):I'm looking at the js code generated by opal, and I see something like $scope.get('Foo') that seems to lookup component Foo. Is there a reasonable way to use this to look up 'Foo' in the current module/class lexical hierarchy? ---------------------------------------------------------------------------------------------------- [21:11:40] Mitch VanDuyn(@catmando):instead of just rewriting a method? ---------------------------------------------------------------------------------------------------- [23:53:08] Jamie Gaskins(@jgaskins):I don't think you can get lexical scope programmatically, because that's defined in the parser. If you rewrote that code instead like this: ```ruby module Foo end class Foo::Whack end module Foo::Bar end class Foo::Bar::Baz def self.test(s) const_get s.to_s end def self.test1 test(Whack) end end ``` Both of your test methods would fail, but your lookup method would still work. ---------------------------------------------------------------------------------------------------- ############################## [2016-06-29] ############################## [08:17:11] Mehmet Beydogan(@beydogan):@iliabylich I will try that, thanks ---------------------------------------------------------------------------------------------------- ############################## [2016-07-01] ############################## [16:46:55] Doug Orleans(@dougo):I mean the actual array you get from `Exception#backtrace` ---------------------------------------------------------------------------------------------------- [16:47:29] Doug Orleans(@dougo):would be nice if there were a way to tell it to use source maps, or else a way to translate it afterward ---------------------------------------------------------------------------------------------------- [16:47:51] Elia Schito(@elia):I see, I think it's possible but not easy, and would involve dealing with source maps and doing the mapping manually ---------------------------------------------------------------------------------------------------- [16:48:06] Doug Orleans(@dougo):Yep. ---------------------------------------------------------------------------------------------------- [16:48:16] Elia Schito(@elia):would probably be cool if browser offered an api to do that… ---------------------------------------------------------------------------------------------------- [16:48:30] Doug Orleans(@dougo):I started going down that road and decided I'd ask if someone already did this... ---------------------------------------------------------------------------------------------------- [16:44:34] Doug Orleans(@dougo):Is there a way to have exception backtraces use source maps? ---------------------------------------------------------------------------------------------------- [16:46:02] Elia Schito(@elia):@dougo on browser should already be the case, certainly on Safari (which I use most of the time) ---------------------------------------------------------------------------------------------------- ############################## [2016-07-02] ############################## [00:45:52] Forrest Chang(@fkchang):@dougo if u figure out a way, I'd be interested ---------------------------------------------------------------------------------------------------- [05:37:05] Forrest Chang(@fkchang):@/all per @catmando 's suggestion, I've made the 1st release of opal-console devtools https://chrome.google.com/webstore/detail/opal-console/bloiggoenjaanceeabeipidehkahdcam ---------------------------------------------------------------------------------------------------- [07:57:44] Elia Schito(@elia):@catmando about the 0.9 -> 0.8 downgrade the right place to report is opal-rails ---------------------------------------------------------------------------------------------------- ############################## [2016-07-03] ############################## [20:47:03] Forrest Chang(@fkchang):@/all just found out that opal-console also works on opera! ---------------------------------------------------------------------------------------------------- [21:02:53] Jamie Gaskins(@jgaskins)::+1: ---------------------------------------------------------------------------------------------------- ############################## [2016-07-04] ############################## [03:12:12] Doug Orleans(@dougo):@fkchang I hacked together this for opal-minitest: https://github.com/aostrega/opal-minitest/pull/11/files#diff-f217b36f75562cb1130e401df1660c89 ---------------------------------------------------------------------------------------------------- [03:12:52] Doug Orleans(@dougo):it only works because it uses Opal::Server though. It would be nice to expose source maps to non-sprockets apps but I didn't get that far... ---------------------------------------------------------------------------------------------------- [03:15:03] Doug Orleans(@dougo):how come `Exception#backtrace` only includes 15 frames? ---------------------------------------------------------------------------------------------------- [03:18:19] Doug Orleans(@dougo):looks like Adam Beynon added that limitation in 0.3.27, I wonder why? https://github.com/opal/opal/commit/bb397a562f07936c23421c256f6c27fef5e75c16#diff-ad27246b27179828e86fbf1ec7785691 ---------------------------------------------------------------------------------------------------- [03:21:20] Jamie Gaskins(@jgaskins):@dougo What are you using for building assets if not Sprockets? Honest question, I just use Sprockets for everything. :-) ---------------------------------------------------------------------------------------------------- [03:21:43] Doug Orleans(@dougo):I was thinking for the CLI, for example ---------------------------------------------------------------------------------------------------- [03:22:05] Jamie Gaskins(@jgaskins):Ah, right, makes sense. ---------------------------------------------------------------------------------------------------- [03:25:09] Doug Orleans(@dougo):I have no idea if anyone uses that, though. But, in theory opal-minitest shouldn't need to run sprockets, it could just compile the source directly and run it in node or phantomjs. ---------------------------------------------------------------------------------------------------- [03:54:35] Doug Orleans(@dougo):Hm, what is the deal with `Encoding.default_external`? It doesn't seem to be set anywhere. In MRI it seems to come from the environment locale, or default to US-ASCII. ---------------------------------------------------------------------------------------------------- [20:50:39] Elia Schito(@elia):@/all https://twitter.com/rubygems/status/750068468662300674, blog post is coming too, courtesy of @jaredcwhite <3 ---------------------------------------------------------------------------------------------------- ############################## [2016-07-05] ############################## [20:32:11] Elia Schito(@elia):@/all is anyone using zepto these days? ---------------------------------------------------------------------------------------------------- [20:32:33] Elia Schito(@elia):(pondering to remove support for it from opal-jquery) ---------------------------------------------------------------------------------------------------- [20:35:50] Elia Schito(@elia):https://twitter.com/rubygems/status/750427480830386177 ---------------------------------------------------------------------------------------------------- [20:36:07] Elia Schito(@elia):(updated to allow for opal 0.10.0) ---------------------------------------------------------------------------------------------------- ############################## [2016-07-06] ############################## [10:34:52] Bernhard Weichel(@bwl21):@elia imho zepzo support can be droppef if it makes maintenace easier ---------------------------------------------------------------------------------------------------- [10:37:10] Bernhard Weichel(@bwl21): ---------------------------------------------------------------------------------------------------- [10:39:02] Bernhard Weichel(@bwl21):I am looking for an api which allows to list, create, read files on cloud services such as dropboc owncloud etc. Is there any hint, even for one which already has an opal wrapper ---------------------------------------------------------------------------------------------------- [14:56:31] Mitch VanDuyn(@catmando)::-( opal 0.10 not working with reactrb prerendering... very odd error ---------------------------------------------------------------------------------------------------- [15:04:28] Mitch VanDuyn(@catmando):looks like this line no longer works as it did: ---------------------------------------------------------------------------------------------------- [15:05:33] Mitch VanDuyn(@catmando):```ruby Opal::Processor.load_asset_code(::Rails.application.assets, 'components') ``` ---------------------------------------------------------------------------------------------------- [15:14:11] Mitch VanDuyn(@catmando):I see its deprecated! Thanks for the good documentation!! ---------------------------------------------------------------------------------------------------- [15:25:04] Mitch VanDuyn(@catmando):however there seems to be a change in semantics? ---------------------------------------------------------------------------------------------------- [15:36:44] Mitch VanDuyn(@catmando):well not there, but someplace else... load_asset returns the same thing, but... ---------------------------------------------------------------------------------------------------- [15:57:01] Mitch VanDuyn(@catmando):okay so when I do load_asset, i get this string back: ---------------------------------------------------------------------------------------------------- [15:59:30] Mitch VanDuyn(@catmando):```javascript "if (typeof(Opal) !== 'undefined') { Opal.loaded([\"opal\",\"corelib/runtime.self\",\"development/react.self\"]); Opal.load(\"components\"); }" ``` regardless of whether i am in opal 9, or opal 10 this is then sent to the ruby racer for evaluation. everything works fine but in opal 10, on the top level module "React" seems to be defined... like wise only the the top level Component module is defined. ---------------------------------------------------------------------------------------------------- [16:11:52] Mitch VanDuyn(@catmando):So the problem was I have some "hardcoded javascript" like this: ---------------------------------------------------------------------------------------------------- [16:15:53] Mitch VanDuyn(@catmando):```ruby @ctx.eval("Opal.React.IsomorphicMethods.$some_method...") ``` which now wants to look like this: ```ruby @ctx.eval("Opal.React.$$scope.get('IsomorphicMethods').$some_method...") ``` Is there a better way of dynamically decided which to use other than doing this: ```ruby if @ctx.eval("Opal.React.IsomorphicMethods") ... old way else ... new way end ``` How far back was $$scope.get defined (I want to stay compatible with Opal 0.8 +) ---------------------------------------------------------------------------------------------------- [19:47:36] Elia Schito(@elia):@catmando I'm quite sure `$$scope.get` works back to 0.8, but trying is the right way to find out :P ---------------------------------------------------------------------------------------------------- [19:48:49] Elia Schito(@elia):@catmando also would probably be better to use `Module#const_get` if it's implemented on older versions… that way you use a ruby API instead of an internal Opal behavior ---------------------------------------------------------------------------------------------------- [20:21:59] Doug Orleans(@dougo):This page seems a few versions out of date: http://opalrb.org/docs/ ---------------------------------------------------------------------------------------------------- [20:22:12] Doug Orleans(@dougo):v0.9.2 stable ---------------------------------------------------------------------------------------------------- [21:18:02] Elia Schito(@elia):@dougo yeah, I'm in the process of updating all the things, when all it's done I'll publish the blog post on the site and start sharing that around ---------------------------------------------------------------------------------------------------- ############################## [2016-07-07] ############################## [15:10:15] Mitch VanDuyn(@catmando):@elia - opal-rspec-rails and 0.10.x? ---------------------------------------------------------------------------------------------------- [16:38:44] Elia Schito(@elia):@catmando yeah, that's next, probably it will be based on the upcoming opal-rspec 0.6.0 ---------------------------------------------------------------------------------------------------- [16:41:47] Mitch VanDuyn(@catmando):sooo any suggestions for testing against 0.10.x in themean time? ---------------------------------------------------------------------------------------------------- [16:42:43] Elia Schito(@elia):@catmando the first 0.6 beta should be out very soon (cc @wied03) in the meanwhile it should work using opal-rspec@master ---------------------------------------------------------------------------------------------------- [16:43:46] Mitch VanDuyn(@catmando):thanks I'll give it a whirl ---------------------------------------------------------------------------------------------------- [16:49:34] Mitch VanDuyn(@catmando):@elia - is eval throwing a different error in 0.10? ---------------------------------------------------------------------------------------------------- [17:10:27] Mitch VanDuyn(@catmando):seems like its changed behavior... ---------------------------------------------------------------------------------------------------- [21:49:43] Elia Schito(@elia):@catmando no idea but possible, can you be more specific? ---------------------------------------------------------------------------------------------------- [21:50:55] Mitch VanDuyn(@catmando):yeah, I confirmed... previous it looks like it raised StandardError if something goes wrong, now its raising Exception... no biggie. ---------------------------------------------------------------------------------------------------- [21:51:49] Elia Schito(@elia):@catmando let me know if you have any consideration on that, is that a kind of runtime error? ---------------------------------------------------------------------------------------------------- [21:53:22] Mitch VanDuyn(@catmando):for example: ---------------------------------------------------------------------------------------------------- [21:54:01] Mitch VanDuyn(@catmando):```ruby begin `eval('Fred')` # Fred aint defined rescue puts 'hi' end ``` works < 0.10, fails in 0.10 ---------------------------------------------------------------------------------------------------- [21:54:25] Mitch VanDuyn(@catmando):`rescue` has to change to `rescue Exception` ---------------------------------------------------------------------------------------------------- [21:54:44] Elia Schito(@elia):you mean `rescue Exception`? ---------------------------------------------------------------------------------------------------- [21:55:00] Elia Schito(@elia):so it's JS eval right? ---------------------------------------------------------------------------------------------------- [21:55:27] Mitch VanDuyn(@catmando):yes rescue Exception, and yes js eval ---------------------------------------------------------------------------------------------------- [21:56:22] Elia Schito(@elia):I see, yeah, something has changed wrt rescuing native JS exceptions due to some edge case ---------------------------------------------------------------------------------------------------- [21:57:11] Mitch VanDuyn(@catmando):sure... wouldn't have noticed, except I was being a good boy, and cleaning up these RuboCop errors, (i.e. don't rescue Exception :-) ---------------------------------------------------------------------------------------------------- [22:01:43] Elia Schito(@elia):heheheh, yeah ---------------------------------------------------------------------------------------------------- [22:02:33] Elia Schito(@elia):actually we should come up with a way to rescue any JS error, like an arbitrary object and that stuff without resorting to x-strings… ---------------------------------------------------------------------------------------------------- [22:03:05] Brady Wied(@wied03):@elia @catmando - https://github.com/opal/opal/issues/1280 ---------------------------------------------------------------------------------------------------- [22:06:04] Elia Schito(@elia):ha! yeah, I guess it wasn't just a memory from hyperuranion :D ---------------------------------------------------------------------------------------------------- [22:13:52] Brady Wied(@wied03):@/all - https://twitter.com/rubygems/status/751177002472865794 ---------------------------------------------------------------------------------------------------- [22:19:08] Elia Schito(@elia)::tada: ---------------------------------------------------------------------------------------------------- ############################## [2016-07-08] ############################## [13:07:47] Zak Storer(@zacts):can opal extend http://electron.atom.io ? ---------------------------------------------------------------------------------------------------- [13:08:11] Zak Storer(@zacts):(for the JavaScript bits) ---------------------------------------------------------------------------------------------------- [17:16:18] Forrest Chang(@fkchang): @zacts @edubkendo wrote this a while back https://gist.github.com/edubkendo/9363111 ---------------------------------------------------------------------------------------------------- ############################## [2016-07-10] ############################## [16:41:37] Elia Schito(@elia):@/all updated the libraries page getting its contents from the awesome-opal page by @fazibear, check it out here: http://opalrb.org/libraries/ 🕶 ---------------------------------------------------------------------------------------------------- ############################## [2016-07-12] ############################## [19:46:33] Doug Orleans(@dougo)::clap: ---------------------------------------------------------------------------------------------------- [20:58:39] George Plymale II(@ylluminarious):@elia :+1: ---------------------------------------------------------------------------------------------------- [21:31:05] Doug Orleans(@dougo):I noticed that running with `ruby -w` gives a lot of warnings in the opal compiler. Is that something anyone cares about? ---------------------------------------------------------------------------------------------------- ############################## [2016-07-13] ############################## [18:51:04] Brady Wied(@wied03):@dougo - Ideally, yes. These are the same sort of things that Rubocop would pick up if we had that as part of the build. I think most of us have our hands full with unit tests and rubyspecs ---------------------------------------------------------------------------------------------------- [20:01:14] Doug Orleans(@dougo):Yeah I wasn't complaining, just wondering if I were to work on it if a PR would be accepted ---------------------------------------------------------------------------------------------------- [20:01:28] Doug Orleans(@dougo):I know some people are hostile to the idea of complying with linters ---------------------------------------------------------------------------------------------------- [20:02:29] Doug Orleans(@dougo):I only noticed because Rake::TestTask in v11 turns on warnings by default. ---------------------------------------------------------------------------------------------------- [20:38:45] Brady Wied(@wied03):I can't speak for the Opal team per se since I only run opal-rspec. I personally wouldn't mind it. I used to hate linters too until I embraced the notion of putting exclusions into source control. At least then you have consistent standards to your liking ---------------------------------------------------------------------------------------------------- [20:57:16] meh.(@meh):@dougo as far as I'm concerned it depends on the kind of lint ---------------------------------------------------------------------------------------------------- ############################## [2016-07-14] ############################## [02:59:08] Biarity(@Biarity):Hi, I just found out about Opal & I love Ruby. One thing though, is it being maintained & considered production-ready? I have an existing JS app (MERN stack) & plan on converting it into Opal/Reactrb. I know this is a broad question, & I would appreaciate any opinions on the matter! ---------------------------------------------------------------------------------------------------- [03:06:24] meh.(@meh):Qudware, it's maintained, and people use it in production ---------------------------------------------------------------------------------------------------- [03:08:19] hayley(@hayley):@Qudware I'm just some random, but I'd say it's production ready. I've been following Opal's development since 2014 or so and I'd definitely say it's in active development. I have a few projects that have been using it for awhile (none open source unfortunately), and it's definitely made JS more pleasant to work with. And if you're specifically interested in reactrb, there's an active gitter chat here for that too. ---------------------------------------------------------------------------------------------------- [04:31:25] Jamie Gaskins(@jgaskins):@Qudware One of my [Clearwater](https://github.com/clearwater-rb/clearwater) apps has been in production since last year, around 3k LOC and monitors the status of food deliveries in real time across 55 markets all over the country. It'll be fine for whatever ya need. ;-) ---------------------------------------------------------------------------------------------------- [19:19:19] Mitch VanDuyn(@catmando):trying to get opal working with middleman does anybody know any tricks (@hayley, @fkchang) ? ---------------------------------------------------------------------------------------------------- [19:20:58] Mitch VanDuyn(@catmando):@Qudware - We are using it all fairly large app (about 18K sloc of opal code I think) its in beta test. It uses opal + reactrb. Opal is very stable, and I can remember only finding one very obscure bug in the last couple of years. ---------------------------------------------------------------------------------------------------- [19:32:17] hayley(@hayley):@catmando what version of middleman? Where are you getting stuck? If you're using v3, it's stuck at Opal 0.7.X I believe, due to sprockets compatibility. I actually have a v3 project where I set up something external so that I could use a modern version of opal, but I was never quite thrilled with it. And I'll post some example projects in a bit. ---------------------------------------------------------------------------------------------------- [19:33:26] Mitch VanDuyn(@catmando):i;m trying to use latest and greatest (v4) I found your blog post, but as you said that's v3... ---------------------------------------------------------------------------------------------------- [19:35:06] hayley(@hayley):@catmando yeah, I actually feel bad that that ranks since it's years old at this point. Time for an update... ---------------------------------------------------------------------------------------------------- [19:38:04] hayley(@hayley):here's a couple of sample projects: https://github.com/opal/opal.github.io/tree/source (make sure you're on the source branch) and https://github.com/fkchang/opal-playground - both are v4. And I'll see if I can put together quick instructions in the next 15 minutes or so (and write a more current blog post at some point too) ---------------------------------------------------------------------------------------------------- [19:49:10] hayley(@hayley):Here's half the instructions for now: sprockets is no longer a default part of the middleman install, add this to your `Gemfile`: ``` gem 'middleman-sprockets', '4.0.0' ``` You will also need to then make the following changes to your `config.rb`: ``` activate :sprockets after_configuration do Opal.paths.each do |p| sprockets.append_path p end end set :js_dir, 'app' # for instance if your ruby code is in /source/app ``` The huge thing I haven't figured out is source maps support. Anyone here know how to add opal source maps support to middleman? ---------------------------------------------------------------------------------------------------- [20:07:06] Mitch VanDuyn(@catmando):hmmm... I also had to do this in the top level js file `Opal.load('test')` (assuming I have a single ruby file called test) ---------------------------------------------------------------------------------------------------- [20:11:14] hayley(@hayley):yeah, sorry, the actual JS stuff was the *other* half of the instructions I didn't include. But yeah, as I understand it, as of 0.8 and greater, opal code does not auto-execute just because it got pulled in with sprockets (meaning you'd see its source in your compiled js file, but it wouldn't be running). This does give you the flexibility of not having to worry about what order sprockets pulls your files in, but then (if you're using a .js file as an entry point), you'll need to do `Opal.load('FILENAME')` to make sure it executes. ---------------------------------------------------------------------------------------------------- [20:22:04] Mitch VanDuyn(@catmando):yeah - great... with your old blog post, etc, I have it all working pretty nice... ---------------------------------------------------------------------------------------------------- [20:58:03] Mitch VanDuyn(@catmando):My plan is to have a separate ruby directory so you will have ``` source ├── images │   └── middleman-logo.svg ├── index.html.erb ├── javascripts │   ├── all.js │   └── some_js_code.js ├── layouts │   └── layout.erb ├── ruby │   ├── application.rb │   ├── components │   │   └── clock.rb │   └── ruby.rb └── stylesheets ├── _normalize.scss └── site.css.scss ``` ---------------------------------------------------------------------------------------------------- [20:58:50] Mitch VanDuyn(@catmando):BUT... that said I just discovered middleman-react, so I am off the play with that before going farther... ---------------------------------------------------------------------------------------------------- [21:06:25] hayley(@hayley):yeah, I have something similar with my v3 project. I have an opal directory with its own Gemfile and then a Rakefile that will build what's in the opal directory. Then I have a Procfile in the main middleman directory that runs middleman at the same time as the Rake rebuilder. What I want to do though is experiment with getting webpack going both for JS dependencies and building opal files, especially given that the middleman devs seem so intent on divorcing the project from sprockets and using the external pipeline instead (external pipeline is v4 only though). ---------------------------------------------------------------------------------------------------- [22:08:03] Forrest Chang(@fkchang): @Qudware we have a public facing app in production and several internal facing apps. ---------------------------------------------------------------------------------------------------- ############################## [2016-07-16] ############################## [17:48:41] Elia Schito(@elia):@hayley wrt jsonp I think jquery has support for it (via $.ajax options), otherwise you can still add functions to window: `require 'native'; $$[:callback_123] = -> data { p Hash.new(data) }` (don't trust this code 100%, didn't test it) ---------------------------------------------------------------------------------------------------- [19:06:21] hayley(@hayley):@elia I didn't even know that was a possibility until @catmando mentioned that he's apparently working on a reactrb extension for middleman. For me though, after many happy years with middleman, I am shopping around for a new static site generator for a lot of reasons, but one huge one being that there's a bug that prevents me from safely upgrading some of my sites to v4 (and middleman v3 is stuck on opal 0.7.x unless you add something outside of middleman to handle the transpiling). And yeah, jquery definitely has support for jsonp. And I'll have to look into your sample code. I vaguely remember writing some really hackish coffeescript/jquery thing that would send the jsonp data back to opal. ---------------------------------------------------------------------------------------------------- [19:32:29] Elia Schito(@elia):@hayley during the last update to the opal site I almost rewrote a subset of middleman using actionview, maybe that's a path worth exploring more. The greatest appeal middleman had for was its similarity with rails ---------------------------------------------------------------------------------------------------- [19:49:33] Mitch VanDuyn(@catmando):@elia I'm almost done with reactrb-middleman ---------------------------------------------------------------------------------------------------- [19:50:09] Mitch VanDuyn(@catmando):It includes reactrb, but will work with poo as well plain old opal ---------------------------------------------------------------------------------------------------- [19:51:29] Elia Schito(@elia):Nice! And LOLS for POO! ---------------------------------------------------------------------------------------------------- [22:09:31] hayley(@hayley):@elia I'm actually one of those 'unicorns' who calls Ruby their programming language of choice but doesn't actually know Rails so I know very little about actionview. @catmando PlainOldOpal. Hahaha. ---------------------------------------------------------------------------------------------------- [22:28:23] hayley(@hayley):Anyone with experience with opal-webpack, want to take a stab at something I'm attempting? I opened issue cj/opal-webpack#36 but I'm new to the webpack world, so I'm kinda lost as to where to go from here. In a sentence, I'm trying to integrate reactrb into the react.js-based static site generator gatsby. I just wrote up a bunch of instructions in the README: https://github.com/hayley/hayley.io I kinda feel that, given the direction I seem to be headed (writing SPAs), that a static site generator oriented towards doing exactly that kind of site would be the best fit for me going forward. But only if I can get proper opal/reactrb support. Love Opal. Can't stand JS. ---------------------------------------------------------------------------------------------------- [03:29:15] hayley(@hayley):hey, for those of you who are using Opal to hit json on 3rd party sites where they *don't* have `Access-Control-Allow-Origin: *`, how are you handling it? I've generally handled it by finding free proxies (e.g. https://crossorigin.me/) but they seem to disappear/crash quite frequently. And is there an official way to handle jsonp with opal? ---------------------------------------------------------------------------------------------------- [17:46:26] Elia Schito(@elia):@hayley not sure if it's worth it, but maybe creating a middleman-opal gem is easier than the blogpost :) ---------------------------------------------------------------------------------------------------- ############################## [2016-07-17] ############################## [03:43:13] Biarity(@Biarity):I posted a while back asking for feedback on Opal's state. Thanks for your responses & I was able to persuade my team to make the switch! We're trying firebase + opal but still evaluating options. ---------------------------------------------------------------------------------------------------- ############################## [2016-07-18] ############################## [09:19:14] Guillaume Grossetie(@Mogztter):Hello ---------------------------------------------------------------------------------------------------- [09:19:58] Guillaume Grossetie(@Mogztter):I'm frequently hitting an error when running `mspec_ruby_nodejs`: `The rescue keyword parses 'a += b rescue c' as 'a += (b rescue c)' ERROR` ---------------------------------------------------------------------------------------------------- [09:20:57] Guillaume Grossetie(@Mogztter):does anyone have a clue about this error ? ---------------------------------------------------------------------------------------------------- [11:01:46] Ilya Bylich(@iliabylich):@Mogztter Are you getting this error on master? ---------------------------------------------------------------------------------------------------- [11:02:08] Ilya Bylich(@iliabylich):And do you run the full rubyspec test suite? ---------------------------------------------------------------------------------------------------- [15:10:59] Guillaume Grossetie(@Mogztter):@iliabylich yes and I'm running `bundle exec rake mspec_ruby_nodejs` ---------------------------------------------------------------------------------------------------- [22:44:23] Doug Orleans(@dougo):What's the status of adding `optparse` to stdlib? Has anyone started working on it? Is there any expectation that it wouldn't just run as-is from MRI source? ---------------------------------------------------------------------------------------------------- ############################## [2016-07-19] ############################## [17:06:45] Forrest Chang(@fkchang):So then I guess my thought of customers must be wrong? The rank and file (or even people of prominence) in the Ruby/Rails community largely don't care, so maybe I should stop trying to speak to that crowd. Why opal? For me, in 1 sentence, bringing the Joy of Ruby to everywhere that that Javascript exists. I guess it's still JDD (Joy driven development). I've been evolving towards that as my main message, maybe that's the unifying theme among "customers" ---------------------------------------------------------------------------------------------------- [18:34:25] Torsten Rüger(@dancinglightning):@fkchang just 2 cent: I guess you can count me in as one of the handful :-) (i would think it's more but to the point) I think the customer is a rails developer. And so the product should be well integrated into rails, and one that provides benefit. Ie does more than one can do without feeling the pain of coffee script, but without abandoning rails. It seems to me there is lots of experimenting with pure client going on, which is great for play, but no use in production. And very real efforts for frameworks (clearwater, volt) just miss the customer imho, ie lack integration. ---------------------------------------------------------------------------------------------------- [18:51:50] Torsten Rüger(@dancinglightning):@elia ok i had a look. Up to fazibear if he wants a table layout. ---------------------------------------------------------------------------------------------------- [19:28:53] Doug Orleans(@dougo):@iliabylich I was asking about optparse because it's used by Minitest, but opal-minitest has option handling disabled because of the lack of optparse in Opal. It uses phantomjs, not Node, but it's still a command-line use case. But, I just realized I could parse the command-line options in the Rake task (in plain Ruby), and pass them as a pre-parsed hash to Minitest inside Opal. ---------------------------------------------------------------------------------------------------- [19:30:04] Doug Orleans(@dougo):But tying this into @fkchang's topic, I think "Opal is mostly for browser" is maybe not the best stance to take. ---------------------------------------------------------------------------------------------------- [19:30:59] Doug Orleans(@dougo):or maybe it is... as long as that includes headless browsers. :) ---------------------------------------------------------------------------------------------------- [19:31:44] Doug Orleans(@dougo):I'll admit that the only reason I use opal-minitest is for unit testing my code that is intended to run in the browser. ---------------------------------------------------------------------------------------------------- [19:34:41] hayley(@hayley):@fkchang for me, the whole JDD is a big thing. Coffeescript was a decent improvement to the syntax, but I always missed the power of Ruby's standard library. Before, I switched to opal, I had started using http://sugarjs.com/ (which now seems abandoned), but it wasn't the same. I feel like half of my love of ruby is simply all of the useful things that are built-in to the language. I kinda mentioned this once on the reactrb channel, but maybe opal itself could use something like https://react.rocks/ - I know that site has been hugely influential about getting me inspired about react in general. awesome-opal is a great start, but for someone like me, the "gallery" style (screenshots, etc) is what I really like to see since you can get more of a feel of something from a screenshot than from a text description. ---------------------------------------------------------------------------------------------------- [19:55:13] Mitch VanDuyn(@catmando):https://docs.google.com/a/catprint.com/presentation/d/1TcUgYu5Od8Q6PH_P76j8fGiAKawpoootZXmWOpIL5jw/pub?start=true&loop=false&delayms=3000 ---------------------------------------------------------------------------------------------------- [19:56:49] Mitch VanDuyn(@catmando):My answer above... in 1 year we have reduced our code size by almost half, we have a much better UI, maintenance is easier, and we are not done yet... by end of year I expect this to be almost 100% ruby. ---------------------------------------------------------------------------------------------------- [19:57:16] hayley(@hayley):@catmando "You need permission to access this published document." :D ---------------------------------------------------------------------------------------------------- [19:57:27] Mitch VanDuyn(@catmando):rats... ---------------------------------------------------------------------------------------------------- [19:58:27] hayley(@hayley):As a shortcut, anytime I'm posting something where I feel permissions might be a problem, I try loading the page in Chrome's incognito mode to see what happens. ---------------------------------------------------------------------------------------------------- [20:08:54] Mitch VanDuyn(@catmando):https://slides.com/mitchvanduyn/deck-6/live ---------------------------------------------------------------------------------------------------- [20:09:21] Mitch VanDuyn(@catmando):try that :-) Thanks @hayley ---------------------------------------------------------------------------------------------------- [20:18:34] hayley(@hayley):@catmando Nice. I have a random thought just for the heck of it: how hard would it be to *show* the difference? Like, not just as a chart, but something along the line's of atom's minimap (which obfuscates the actual text too) where you'd concatenate the entire v3 and v4 codebases into two tiny images that you could show side by side. ---------------------------------------------------------------------------------------------------- [20:23:11] Mitch VanDuyn(@catmando):that chart is about as close as you are going to get to that... there are just to many file changes if I understand what you are suggesting ---------------------------------------------------------------------------------------------------- [20:28:58] hayley(@hayley):@catmando it's just kind of an out there idea to begin with, but if you were using git and could easily check out the last version of v3 versus what you have now, that's what I'd use... I might actually try to build a visualizer for myself if it doesn't already exist, but how I'm imagining it would work is that you'd point this image generator script at a project directory. And then it would go through and then produce one really long image à la atom's minimap (see the right side of the image in the screenshot on https://atom.io/packages/minimap). I don't know, I'm thinking this counts more so as "fun" than useful, but it could be interesting as a before/after comparison tool. ---------------------------------------------------------------------------------------------------- [20:36:22] Forrest Chang(@fkchang): @dancinglightning regardless of whether the rank and file Rails dev is the target audience, I definitely think that better Rails integration benefits, simply because most Rubyists, and I'm assuming most opalists use Rails, so there's a lot of JDD to be exploited there. ---------------------------------------------------------------------------------------------------- [20:38:49] Forrest Chang(@fkchang):@dougo I think a big thing for me is really "joy of Ruby everywhere there is JS", that's what is a big draw to reactrb (aside from the fact that react's component based framework is the 1st JS framework that sat well w/my way of thinking), is that if you can do reactrb (via react.js of course), then you can web, mobile (react native), and desktop (electron and friends), as well as some of the other fringe rendering platforms that react has reached (u can write terminal console apps w/react for example, flipboard made a react-canvas for performance, etc.) ---------------------------------------------------------------------------------------------------- [20:39:03] Forrest Chang(@fkchang):but there are other options because JS is literally everywhere ---------------------------------------------------------------------------------------------------- [20:40:02] Forrest Chang(@fkchang):@hayley a react rocks equivalent would be nice, not certain there is enough content yet for such, I guess the next best thing is the awesome-opal page ---------------------------------------------------------------------------------------------------- [20:43:58] Doug Orleans(@dougo):JS is everywhere, but Ruby is also most places too, so it's hard to see a case for Opal where MRI works just fine. ---------------------------------------------------------------------------------------------------- [20:44:57] Doug Orleans(@dougo):which is what I assume @iliabylich was getting at with "Opal is mostly for browser". ---------------------------------------------------------------------------------------------------- [20:45:42] meh.(@meh):dougo, yeah I don't get the point of running Opal on Node.js, other than helping with running tests or whatever ---------------------------------------------------------------------------------------------------- [20:46:23] Doug Orleans(@dougo):maybe if you need better threading, but then why not go to Elixir... ---------------------------------------------------------------------------------------------------- [20:47:22] Forrest Chang(@fkchang):@dougo in the case of reactrb, it's not just 1 language, but 1 way to write apps for desktop, web, mobile ---------------------------------------------------------------------------------------------------- [20:48:39] Doug Orleans(@dougo):sure, but that's basically the same as "for browser". it's just that the brower is also on desktop and mobile. ---------------------------------------------------------------------------------------------------- [20:48:56] Forrest Chang(@fkchang):u could do mri/jruby server, opal web, rubymotion ios, etc... but 1 language (sorta), and 3 ways (arguably still a diff in web front vs back, but reactrb lets you do server rendered views w/the same views you have on the front end, though opal lets u do that too w/erb and haml) ---------------------------------------------------------------------------------------------------- [20:50:04] Forrest Chang(@fkchang):node.js vs MRI, I don't have a compelling need for it at the time, but I could imagine that it might better if you wanted truly the same language on both sides vs close to the same langauge w/MRI and opal, and for the same perf reasons that ppl dropped MRI for node, would apply except that you can write ruby on node via opal ---------------------------------------------------------------------------------------------------- [20:51:42] Forrest Chang(@fkchang):JRuby brought "joy of ruby wherever the JVM is" for the most part, though I continue to see issues w/resources and start time. They continue to get better, but it affects the speed cycle, lessoning the JDD for me. Also, there are a number of gems which are neglected for JRuby. Still feels like JRuby and JRuby on Rails is a 2nd class citizen, despite JRuby being the most performant of Ruby implmentations ---------------------------------------------------------------------------------------------------- [20:51:46] meh.(@meh):dougo, but Node.js is not multi-threaded ---------------------------------------------------------------------------------------------------- [20:52:50] Doug Orleans(@dougo):good point :) ---------------------------------------------------------------------------------------------------- [20:52:55] Forrest Chang(@fkchang):It does seem that JS will have greater reach than the JVM, esp. in new horizons, for example IOT seems to be embracing JS, and you can dev for Windows 10 desktop and Mobile via js/HTML etc... ---------------------------------------------------------------------------------------------------- [20:53:20] Forrest Chang(@fkchang):I'm back to "Joy of Ruby everywhere JS is", in some cases, where better integrated the JDD is there ---------------------------------------------------------------------------------------------------- [20:54:18] Forrest Chang(@fkchang):Ride the JS train, after all, why not? ---------------------------------------------------------------------------------------------------- [20:54:44] Forrest Chang(@fkchang):@catmando I'm gonna tweet that slide ---------------------------------------------------------------------------------------------------- [20:54:53] Doug Orleans(@dougo):so far the MRI train still services most of the stops I want to visit :) ---------------------------------------------------------------------------------------------------- [21:00:14] Forrest Chang(@fkchang):@dougo no problem with that. I think similar to @hayley's notion of having something like react rocks, until a good example of how awesome it IS (vs could be), it'll be a hard sell. One of these days, I'll get one of my startup ideas up with an "all ruby stack" and then I can show it ---------------------------------------------------------------------------------------------------- [21:04:49] Mitch VanDuyn(@catmando):@fkchang yeah you should... ---------------------------------------------------------------------------------------------------- [21:04:54] Mitch VanDuyn(@catmando):I will on reactrb as well ---------------------------------------------------------------------------------------------------- [21:34:52] hayley(@hayley):re a react.rocks type of site, I'd actually be willing to come up with something at some point both opal/reactrb related (could be the same site and just filterable by specific technologies used), but I'd probably say my big concern is I don't want to get in a position where I feel like I'm stepping on toes. Like from watching some of the "awesome" lists and their pull requests, some of them are taking curation seriously and rejecting pull requests if they don't think something is awesome enough. Granted, that would be a problem with a text-only list: if it grows too large, it's hard to find the best of the best since there's zero filtering. Whereas a web page could kind of skirt around that via a voting/rating system or taking things like github stars into account. Personally, I feel like there shouldn't necessarily be curation (because likely every project is going to be of interest to someone), but obviously there needs to be a way for the most useful things to be easily findable. ---------------------------------------------------------------------------------------------------- [23:13:55] Mitch VanDuyn(@catmando):Seems like `rescue Exception => e` no longer has a backtrace on e... does anybody know why? ---------------------------------------------------------------------------------------------------- [23:35:51] Mitch VanDuyn(@catmando):NVM firefox issue (I guess) works fine in chrome as always... ---------------------------------------------------------------------------------------------------- [00:33:32] Ilya Bylich(@iliabylich):@dougo Opal doesn't have `optparse` (because Opal is mostly for browser). It could be used with Node but its implementation is quite complex - https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb. I didn't check but I'm quite sure that Opal can't properly compile it. That code is quite complex, at least stuff like `do_something or return` and those ruby-specific regexpes are not completely supported by Opal yet. ---------------------------------------------------------------------------------------------------- [00:34:46] Ilya Bylich(@iliabylich):Probably it's possible to implement a minimal simplified subset of `optparse` ---------------------------------------------------------------------------------------------------- [00:35:52] Ilya Bylich(@iliabylich):I guess if you want to use it with Node you should use Node libraries ---------------------------------------------------------------------------------------------------- [05:33:04] Forrest Chang(@fkchang): ---------------------------------------------------------------------------------------------------- [11:28:14] Torsten Rüger(@dancinglightning):@elia Just saw the libraries compilation, great work! It says contribution and suggestions welcome at the bottom. If you make that a link or a mail, people might know where to put those suggestions. My suggestion would be to make a table or something, so the right column would be easier to scan. Another one would be to included liveliness, as that can be an issue with some of them. That would obviously only work if the list is generated. ---------------------------------------------------------------------------------------------------- [11:50:59] Mitch VanDuyn(@catmando):@qudware I don't know anything about firebase, let us know how it goes... ---------------------------------------------------------------------------------------------------- [12:35:40] Guillaume Grossetie(@Mogztter):@iliabylich I think this a "concurrent" issue. I can reproduce this issue when saving the whole javascript file produced. If I delete everything but "rescue_spec" then I get no error ---------------------------------------------------------------------------------------------------- [12:37:05] Ilya Bylich(@iliabylich):@Mogztter Then it can be some shared state between tests ---------------------------------------------------------------------------------------------------- [12:38:05] Ilya Bylich(@iliabylich):And you are the only one who can catch it :smile: ---------------------------------------------------------------------------------------------------- [12:38:06] Guillaume Grossetie(@Mogztter):@iliabylich indeed, I will dig a bit further and let you know ---------------------------------------------------------------------------------------------------- [12:38:25] Guillaume Grossetie(@Mogztter):lucky me :smile: ---------------------------------------------------------------------------------------------------- [12:44:56] Guillaume Grossetie(@Mogztter):seems like return_spec and rescue_spec are conflicting ---------------------------------------------------------------------------------------------------- [12:46:23] Guillaume Grossetie(@Mogztter):ScratchPad is a good suspect ---------------------------------------------------------------------------------------------------- [12:55:55] Guillaume Grossetie(@Mogztter):The compiled code is: ``` (a = $rb_plus(a, (function() { try { console.log("self.$b()", self.$b()); return self.$b() } catch ($err) { console.log("err", $err); if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return c } finally { Opal.pop_exception() } } else { throw $err; } }})())); ``` When `return_spec` and `rescue_spec` are enabled, `self.$b() 1` ---------------------------------------------------------------------------------------------------- [12:56:43] Guillaume Grossetie(@Mogztter):But when `return_spec` is disabled, an exception is thrown and rescue is working ---------------------------------------------------------------------------------------------------- [12:57:10] Guillaume Grossetie(@Mogztter):so something is mocking `self.$b()` function in `return_spec` ---------------------------------------------------------------------------------------------------- [12:58:43] Guillaume Grossetie(@Mogztter):``` describe "downstream from a lambda" do it "returns to its own return-capturing lexical enclosure" do def a ->{ yield }.call return 2 end def b a { return 1 } end b.should == 1 end end ``` ---------------------------------------------------------------------------------------------------- [12:58:57] Guillaume Grossetie(@Mogztter):hm hm ---------------------------------------------------------------------------------------------------- [12:59:31] Ilya Bylich(@iliabylich):Yeah, it can be the issue ---------------------------------------------------------------------------------------------------- [13:00:16] Guillaume Grossetie(@Mogztter):but why am I the only one to reproduce this issue ? ---------------------------------------------------------------------------------------------------- [13:01:20] Guillaume Grossetie(@Mogztter):I can confirm that the full test suites is working for me if I comment out `downstream from a lambda` spec ---------------------------------------------------------------------------------------------------- [13:03:30] Ilya Bylich(@iliabylich):usually rubyspec uses `eval` to evaluate the code directly in the context of the current example ---------------------------------------------------------------------------------------------------- [13:03:32] Guillaume Grossetie(@Mogztter):we can also rename `b` function to something less generic. Do you know why "inner" functions is visible outside ? ---------------------------------------------------------------------------------------------------- [13:04:16] Ilya Bylich(@iliabylich):For me `rescue_spec` gets executed before `return_spec` ---------------------------------------------------------------------------------------------------- [13:04:23] Ilya Bylich(@iliabylich):That's why there's no conflict ---------------------------------------------------------------------------------------------------- [13:05:02] Guillaume Grossetie(@Mogztter):lol ---------------------------------------------------------------------------------------------------- [13:05:19] Ilya Bylich(@iliabylich):``` ruby proc do def m p 'm called' end end.call self.m ``` ---------------------------------------------------------------------------------------------------- [13:05:58] Ilya Bylich(@iliabylich):Because blocks are evaluates in the outer context ---------------------------------------------------------------------------------------------------- [13:06:10] Ilya Bylich(@iliabylich):And there's no `private` in opal ---------------------------------------------------------------------------------------------------- [13:06:19] Guillaume Grossetie(@Mogztter):got it ---------------------------------------------------------------------------------------------------- [13:07:49] Ilya Bylich(@iliabylich):Rubyspec defines method `:b` on the `Object` ---------------------------------------------------------------------------------------------------- [13:08:01] Ilya Bylich(@iliabylich):And it makes it available everywhere ---------------------------------------------------------------------------------------------------- [13:08:34] Guillaume Grossetie(@Mogztter):> For me `rescue_spec` gets executed before `return_spec` Even with a french locale, `return_spec` should come after `rescue_spec` if sorted by filenames :wink: ---------------------------------------------------------------------------------------------------- [13:09:30] Guillaume Grossetie(@Mogztter):but I guess we are not explicitly sorting files ---------------------------------------------------------------------------------------------------- [13:09:37] Ilya Bylich(@iliabylich):Could you check an output of `tmp/mspec_nodejs.rb`? ---------------------------------------------------------------------------------------------------- [13:10:02] Guillaume Grossetie(@Mogztter):I have one ---------------------------------------------------------------------------------------------------- [13:10:13] Ilya Bylich(@iliabylich):Yes, `testing.rake` has all the code for compiling rubyspec. It simply uses `Dir['spec/ruby']` ---------------------------------------------------------------------------------------------------- [13:11:18] Guillaume Grossetie(@Mogztter):what do you want to know about my `tmp/mspec_nodejs.rb` ? ---------------------------------------------------------------------------------------------------- [13:12:21] Ilya Bylich(@iliabylich):The order of `require 'ruby/language/rescue_spec.rb'` and `require 'ruby/language/return_spec'` ---------------------------------------------------------------------------------------------------- [13:12:58] Guillaume Grossetie(@Mogztter):``` self.$require("ruby/language/return_spec.rb"); self.$require("ruby/language/def_spec.rb"); self.$require("ruby/language/throw_spec.rb"); self.$require("ruby/language/rescue_spec.rb"); ``` ---------------------------------------------------------------------------------------------------- [13:14:14] Guillaume Grossetie(@Mogztter):seems pretty "random" ---------------------------------------------------------------------------------------------------- [13:15:03] Guillaume Grossetie(@Mogztter):but each time I'm running the order is the same ---------------------------------------------------------------------------------------------------- [13:17:47] Guillaume Grossetie(@Mogztter):> Rubyspec defines method `:b` on the `Object` > And it makes it available everywhere So the only way to fix this issue is to rename `b` function ? ---------------------------------------------------------------------------------------------------- [13:46:16] Ilya Bylich(@iliabylich):No, it should be changed from `def b; ...; end` to `eval('def b; ... end')` ---------------------------------------------------------------------------------------------------- [13:47:56] Ilya Bylich(@iliabylich):Sorry, `evaluate('def b; end')` - https://github.com/ruby/mspec/blob/8c048530d53879c825ffb4588f65289e22e1ea77/lib/mspec/runner/evaluate.rb#L38-L54 ---------------------------------------------------------------------------------------------------- [13:49:03] Ilya Bylich(@iliabylich):Here's an example of how it should be - https://github.com/ruby/spec/blob/master/language/method_spec.rb#L4-L11 ---------------------------------------------------------------------------------------------------- [14:23:42] Guillaume Grossetie(@Mogztter):Ok thanks for your help, I will create a pull request ---------------------------------------------------------------------------------------------------- [14:30:27] Ilya Bylich(@iliabylich):Wait, looks like it's a bug in Opal ---------------------------------------------------------------------------------------------------- [14:31:09] Ilya Bylich(@iliabylich):When you explicitly define a method in `it ...` it doesn't appear on every object ---------------------------------------------------------------------------------------------------- [14:31:34] Ilya Bylich(@iliabylich):(At least this is how it works with MRI) ---------------------------------------------------------------------------------------------------- [14:33:05] Ilya Bylich(@iliabylich):But this method becomes available in other examples ---------------------------------------------------------------------------------------------------- [14:33:50] Ilya Bylich(@iliabylich):Because `mspec` invokes all examples on the same object `@env` - https://github.com/ruby/mspec/blob/8c048530d53879c825ffb4588f65289e22e1ea77/lib/mspec/runner/mspec.rb#L68-L79 ---------------------------------------------------------------------------------------------------- [14:34:06] Ilya Bylich(@iliabylich):(Which means that it should be fixed in rubyspec :smile: ) ---------------------------------------------------------------------------------------------------- [14:36:30] Guillaume Grossetie(@Mogztter):Ugh! That's beyond my skill set :worried: ---------------------------------------------------------------------------------------------------- [14:49:22] Ilya Bylich(@iliabylich):This example shows the difference between explicit `def` and `def` in `evaluate`: ``` ruby describe "Description" do evaluate <<-ruby, "Test 1" do def m1 123 end ruby m1.should == 123 end it "Test 2" do def m2 456 end m2.should == 456 end it "Test 3" do lambda { self.m1 }.should raise_error(NoMethodError) lambda { self.m2 }.should_not raise_error(NoMethodError) end end ``` ---------------------------------------------------------------------------------------------------- [14:51:41] Ilya Bylich(@iliabylich):And it passes on MRI (didn't check on Opal yet). We need to modify rubyspec to have only examples like "Test 1". Tests like the second one are polluting global MSpec environment ---------------------------------------------------------------------------------------------------- [14:56:51] Guillaume Grossetie(@Mogztter):Yep I understand and you don't want to modify `ruby/spec` to surround every declarations with `evaluate` ---------------------------------------------------------------------------------------------------- [14:58:57] Guillaume Grossetie(@Mogztter):I read again your message ---------------------------------------------------------------------------------------------------- [14:59:18] Guillaume Grossetie(@Mogztter):you don't want to modify mspec runner ? ---------------------------------------------------------------------------------------------------- [14:59:36] Guillaume Grossetie(@Mogztter):to invoke test on a new `@env` object ? ---------------------------------------------------------------------------------------------------- [15:00:24] Guillaume Grossetie(@Mogztter):I can certainly add `evaluate` blocks on rubyspec :smile: ---------------------------------------------------------------------------------------------------- [15:01:38] Ilya Bylich(@iliabylich):Yes, we should replace every occurrence of explicit `def` in rubyspec to `evaluate("def ...", &block)` ---------------------------------------------------------------------------------------------------- [15:12:20] Ilya Bylich(@iliabylich):@Mogztter https://github.com/ruby/spec/issues/275 ---------------------------------------------------------------------------------------------------- [15:12:56] Guillaume Grossetie(@Mogztter):Thanks :+1: ---------------------------------------------------------------------------------------------------- [15:14:22] Guillaume Grossetie(@Mogztter):I'm experimenting with `evaluate`, but maybe the maintainer (@eregon ?) has a better idea ---------------------------------------------------------------------------------------------------- [16:07:33] Forrest Chang(@fkchang):@/all I have a weird bug working with opal 0.10.1. When I compile the static file I get weird characters in front of methods names ```javascript Opal.defn(self, '$attr_reader', TMP_14 = function ːattr_reader($a_rest) { ``` See the character in front of attr_reader? Anyone seen this or have an idea. I have with both ruby 2.3.0 and 2.2.1 against opal 0.10.1 ---------------------------------------------------------------------------------------------------- [16:11:14] Forrest Chang(@fkchang):@wied03 good job on http://opalrb.org/blog/2016/07/19/opal-rspec-0.5/ ---------------------------------------------------------------------------------------------------- [16:31:16] Elia Schito(@elia):@fkchang you're probably missing the utf8 meta tag in the html head tag… ---------------------------------------------------------------------------------------------------- [16:32:51] Elia Schito(@elia):@iliabylich what node version are you using to run the ruby spec? ---------------------------------------------------------------------------------------------------- [16:34:32] Elia Schito(@elia):> @elia Just saw the libraries compilation, great work! It says contribution and suggestions welcome at the bottom. If you make that a link or a mail, people might know where to put those suggestions. My suggestion would be to make a table or something, so the right column would be easier to scan. Another one would be to included liveliness, as that can be an issue with some of them. That would obviously only work if the list is generated. @dancinglightning they're taken from @fazibear's awesome opal page (link is at the top of the page) ---------------------------------------------------------------------------------------------------- [16:36:02] Torsten Rüger(@dancinglightning):@elia yes i understood that, my suggestion was mostly formatting, and asking if they are manually taken or by script ---------------------------------------------------------------------------------------------------- [16:37:23] Ilya Bylich(@iliabylich):@elia 0.10.25 ---------------------------------------------------------------------------------------------------- [16:37:35] Ilya Bylich(@iliabylich):I guess it's quite old :smile: ---------------------------------------------------------------------------------------------------- [16:37:58] Elia Schito(@elia):@iliabylich got some regexp errors on node 6 last night ---------------------------------------------------------------------------------------------------- [16:38:14] Elia Schito(@elia):but wanted to check with you to ensure it was that ---------------------------------------------------------------------------------------------------- [16:39:18] Elia Schito(@elia):@dancinglightning sure, sorry for the short reply. the content is taken by a script to preserve the attribution etc. let me grab the link of the rake task ---------------------------------------------------------------------------------------------------- [16:39:53] Elia Schito(@elia):@dancinglightning https://github.com/opal/opal.github.io/blob/14f3af880859c99d687a0b85cf963db9d1179dfb/Rakefile#L64-L82 ---------------------------------------------------------------------------------------------------- [16:40:22] Ilya Bylich(@iliabylich):@elia What is your version? I could try it locally ---------------------------------------------------------------------------------------------------- [16:40:34] Elia Schito(@elia):v6.2.2 ---------------------------------------------------------------------------------------------------- [16:40:43] Torsten Rüger(@dancinglightning):@elia ok, i'll check it out, thanks ---------------------------------------------------------------------------------------------------- [16:41:20] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [17:01:37] Forrest Chang(@fkchang):This is not opal related, but it's inspiring to me https://medium.com/radical-ux/nobody-hires-steve-jobs-bcc94fdf7acb#.u1p7mfld8 ---------------------------------------------------------------------------------------------------- [17:01:44] Forrest Chang(@fkchang):I was thinking the key to opal ---------------------------------------------------------------------------------------------------- [17:04:25] Forrest Chang(@fkchang):'s success would be to fit in better w/JS and other things to be popular in the Ruby community. Perhaps that's the wrong approach. In years of evangelizing, I've reached what, a handful of people? For myself, and I think I've been leaning that way for a while, maybe it's just "forget the rest of them, let's just make something 'insanely great' for my fellow opalists", but I suppose if we are to do a Steve Jobs approach, it' s not just focus on the product, but also the customers. ---------------------------------------------------------------------------------------------------- ############################## [2016-07-20] ############################## [03:32:21] Doug Orleans(@dougo):I finally dived in and made a fork of opal. When I run the specs I get one failure: ---------------------------------------------------------------------------------------------------- [03:32:30] Doug Orleans(@dougo):>The rescue keyword parses 'a += b rescue c' as 'a += (b rescue c)' ERROR ---------------------------------------------------------------------------------------------------- [04:05:11] Doug Orleans(@dougo):bah, the optparse test uses `String#<<`. ---------------------------------------------------------------------------------------------------- [06:12:27] Doug Orleans(@dougo):hm, any chance of getting the conflicts in https://github.com/opal/opal/pull/657 resolved? (better `rand` and `srand`) ---------------------------------------------------------------------------------------------------- [06:13:02] Doug Orleans(@dougo):Minitest `--seed` is kind of useless without it... ---------------------------------------------------------------------------------------------------- [09:25:19] Guillaume Grossetie(@Mogztter):@iliabylich https://github.com/ruby/spec/issues/275#issuecomment-233697425 ---------------------------------------------------------------------------------------------------- [09:27:47] Guillaume Grossetie(@Mogztter):Everything is compiled in a single file but can we create a new `@env` in `mspec-opal/runner` https://github.com/opal/opal/blob/master/spec/mspec-opal/runner.rb#L87-L88 ? ---------------------------------------------------------------------------------------------------- [11:21:21] Ilya Bylich(@iliabylich):@Mogztter The idea is to replace explicit `require`-s in the generated `tmp/mspec_nodejs.rb` to just register running files using `MSpec.register_files`. Later we should call `MSpec.files` - https://github.com/ruby/mspec/blob/master/lib/mspec/runner/mspec.rb#L48-L61 - which iterates over registered files, loads them one by one, and executes in a separate `@env`. I'll send a PR soon ---------------------------------------------------------------------------------------------------- [11:21:59] Ilya Bylich(@iliabylich):Probably we can even use the original MSpec's method that runs the whole test suite - `MSpec.process` - https://github.com/ruby/mspec/blob/master/lib/mspec/runner/mspec.rb#L42-L46 ---------------------------------------------------------------------------------------------------- [19:11:13] Mitch VanDuyn(@catmando):hey all, trying to get execjs to evaluate opal code for middleman prerendering. Stole the code from react-rails. Problem is everytime I do a `puts` it blows up. its as if "puts" is some how emitting something into the execjs output buffer??? this is with opal 0.9.4... same version of execjs, and ruby-racer work fine for me in react-rails. Any ideas appreciated! ---------------------------------------------------------------------------------------------------- [19:12:02] Mitch VanDuyn(@catmando):for example if I do this: ---------------------------------------------------------------------------------------------------- [19:12:12] Mitch VanDuyn(@catmando):`@context.eval("Opal.top.$puts('hi')")` ---------------------------------------------------------------------------------------------------- [19:12:29] Mitch VanDuyn(@catmando):exec-js sends this string to be the json parser! ---------------------------------------------------------------------------------------------------- [19:13:03] Mitch VanDuyn(@catmando): `"hi\n[\"ok\",{\"$$id\":4}]"` ---------------------------------------------------------------------------------------------------- [19:31:20] Mitch VanDuyn(@catmando):for example: ---------------------------------------------------------------------------------------------------- [19:31:50] Ilya Bylich(@iliabylich):Nil has id=4 in opal ---------------------------------------------------------------------------------------------------- [19:32:26] Ilya Bylich(@iliabylich):looks like it merges output and returning value ---------------------------------------------------------------------------------------------------- [19:32:34] Ilya Bylich(@iliabylich):puts always returns nil ---------------------------------------------------------------------------------------------------- [19:33:32] Mitch VanDuyn(@catmando):```ruby @context.eval("(function() {console.log('hi'); return console.history})()") # returns [{"level"=>"log", "arguments"=>["hi"]}] @context.eval("(function() {Opal.top.$puts('hi'); return console.history})()") # throws an error because the above string is sent to be parsed ``` ---------------------------------------------------------------------------------------------------- [19:34:25] Mitch VanDuyn(@catmando):somehow I've managed to get Opal puts to squirt crap into V8s output buffer. ---------------------------------------------------------------------------------------------------- [19:35:04] Ilya Bylich(@iliabylich):This is what Opal uses in `puts` - https://github.com/opal/opal/blob/master/opal/corelib/io.rb#L72 ---------------------------------------------------------------------------------------------------- [19:35:45] Ilya Bylich(@iliabylich):`console.log` works in your example, could you try `process.stdout.write(s)`? ---------------------------------------------------------------------------------------------------- [19:36:02] Mitch VanDuyn(@catmando):sure... what is process? ---------------------------------------------------------------------------------------------------- [19:36:26] Ilya Bylich(@iliabylich):A property on the global object I guess ---------------------------------------------------------------------------------------------------- [19:37:33] Ilya Bylich(@iliabylich):Call chain is the following: `Kernel.puts` -> `$stdout.puts` -> `$stdout.write` -> `STDOUT.write_proc` ---------------------------------------------------------------------------------------------------- [19:38:03] Mitch VanDuyn(@catmando):okay... yes that seems to be the problem. process.stdout is defined ---------------------------------------------------------------------------------------------------- [19:38:15] Mitch VanDuyn(@catmando):not sure who or what is defining it! ---------------------------------------------------------------------------------------------------- [19:39:09] Ilya Bylich(@iliabylich):libv8/node - https://nodejs.org/api/process.html#process_process_stdout ---------------------------------------------------------------------------------------------------- [19:39:36] Mitch VanDuyn(@catmando):hah: ---------------------------------------------------------------------------------------------------- [19:39:38] Mitch VanDuyn(@catmando): @context.eval("typeof(process) === 'object'") => true ---------------------------------------------------------------------------------------------------- [19:39:42] Mitch VanDuyn(@catmando):you were right ---------------------------------------------------------------------------------------------------- [19:40:43] Ilya Bylich(@iliabylich):Looks like `execjs` works as some kind of output interceptor (which is actually very weird) ---------------------------------------------------------------------------------------------------- [19:47:27] Ilya Bylich(@iliabylich):I don't understand. `console.log` works, but `process.stdout.write` doesn't. But Nodejs documentation says that `console.log` internally invokes `process.stdout.write` - https://nodejs.org/api/console.html#console_new_console_stdout_stderr ---------------------------------------------------------------------------------------------------- [20:06:58] Mitch VanDuyn(@catmando):Its true, but react-rails (and my hack) overrides console.log to put the output into a "history" array. ---------------------------------------------------------------------------------------------------- [20:07:18] Mitch VanDuyn(@catmando):So in fact console.log and process.stdout.write are again different.. ---------------------------------------------------------------------------------------------------- [20:08:02] Mitch VanDuyn(@catmando):but Opal doesn't know that... and is using process.stdout.write, which I believe is what execjs assumes will hold the output data ---------------------------------------------------------------------------------------------------- [20:08:57] Mitch VanDuyn(@catmando):so the only thing I have to figure out how to do is redefine the way STDOUT.write_proc works. But I can't make it stick... ---------------------------------------------------------------------------------------------------- [20:55:24] Forrest Chang(@fkchang):Related to discussion yesterday https://twitter.com/fkchang2000/status/755868489982676992 ---------------------------------------------------------------------------------------------------- ############################## [2016-07-21] ############################## [01:40:20] Zak Storer(@zacts):hello ---------------------------------------------------------------------------------------------------- [01:45:47] Mitch VanDuyn(@catmando): Hello ---------------------------------------------------------------------------------------------------- [18:09:31] Mitch VanDuyn(@catmando):I just opened #1539 - would appreciate any help to getting a work around... ---------------------------------------------------------------------------------------------------- [18:09:37] Mitch VanDuyn(@catmando):I thought I could do this: ---------------------------------------------------------------------------------------------------- [18:13:04] Mitch VanDuyn(@catmando):```ruby #application.rb require 'opal' STDOUT.write_proc = `console.log` ``` but I can't seem to get it to "stick" - In otherwords by the time opal is actually executing STDOUT has still got its original definition... I feel like the short term solution would be to issue a separate require file as part of the opal package so you could do: ```ruby require 'opal' require 'opal/console-output' ``` which would force STDOUT to use the console... ---------------------------------------------------------------------------------------------------- [18:14:26] Mitch VanDuyn(@catmando):@fkchang - I would really to understand @searls reasoning... ---------------------------------------------------------------------------------------------------- [18:15:27] Mitch VanDuyn(@catmando):If I didn't have opal, I would certainly think JS everywhere was less mad than having to constantly switch languages, and/or divide my development skills artificially along some boundry determined strictly by 1990's internet capabilities... ---------------------------------------------------------------------------------------------------- [18:16:30] Mitch VanDuyn(@catmando):So my order from bad to good would be: multiple domain specific languages -> JS everywhere -> Ruby Everywhere -> vacation anywhere! ---------------------------------------------------------------------------------------------------- ############################## [2016-07-22] ############################## [18:18:46] Doug Orleans(@dougo):Awesome, thanks @iliabylich for fixing `rand` and `srand`! ---------------------------------------------------------------------------------------------------- [18:20:34] Doug Orleans(@dougo):I guess #657 can be closed? ---------------------------------------------------------------------------------------------------- [18:23:17] Doug Orleans(@dougo):Is there a roadmap/schedule for 0.11.0? ---------------------------------------------------------------------------------------------------- [18:48:53] Doug Orleans(@dougo):hm, getting deprecation warnings from sprockets 3.7.0 ---------------------------------------------------------------------------------------------------- [19:04:42] Doug Orleans(@dougo):``` DEPRECATION WARNING: Sprockets method `register_engine` is deprecated. Please register a mime type using `register_mime_type` then use `register_compressor` or `register_transformer`. https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (called from at /home/dougo/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/opal-0c91c71e3b75/lib/opal/sprockets/processor.rb:144) ``` ---------------------------------------------------------------------------------------------------- [19:07:00] Doug Orleans(@dougo):and a few other places, including opal-haml ---------------------------------------------------------------------------------------------------- ############################## [2016-07-23] ############################## [21:19:11] Keenan Brock(@kbrock):@jgaskins Is there an easy to start tutorial? ---------------------------------------------------------------------------------------------------- [21:19:17] Keenan Brock(@kbrock):all the tutorials I find are for v5.0 ---------------------------------------------------------------------------------------------------- [21:19:20] Jamie Gaskins(@jgaskins):It is indeed a faq. I've run into it myself several times. :-) ---------------------------------------------------------------------------------------------------- [21:19:39] Keenan Brock(@kbrock):thanks ---------------------------------------------------------------------------------------------------- [21:19:40] Jamie Gaskins(@jgaskins):Tutorial for Opal? ---------------------------------------------------------------------------------------------------- [21:19:45] Keenan Brock(@kbrock):yea ---------------------------------------------------------------------------------------------------- [21:19:51] Keenan Brock(@kbrock):I'm JUST starting out ---------------------------------------------------------------------------------------------------- [21:20:10] Keenan Brock(@kbrock):(have been with ruby since rails 0.9) ---------------------------------------------------------------------------------------------------- [21:20:27] Keenan Brock(@kbrock):sorry. should say since ruby 1.8.5 (ruby != rails ;) ) ---------------------------------------------------------------------------------------------------- [21:21:07] Jamie Gaskins(@jgaskins):@kbrock Have you done much front-end dev? ---------------------------------------------------------------------------------------------------- [21:21:19] Keenan Brock(@kbrock):minimal ---------------------------------------------------------------------------------------------------- [21:21:31] Keenan Brock(@kbrock):my js is ugly, and my css looks like 1990's ---------------------------------------------------------------------------------------------------- [21:21:34] Jamie Gaskins(@jgaskins):lol ---------------------------------------------------------------------------------------------------- [21:21:52] Keenan Brock(@kbrock):everything has changed since I've done js (~2002) ---------------------------------------------------------------------------------------------------- [21:22:12] Keenan Brock(@kbrock):tried the awesome opal, and resources ---------------------------------------------------------------------------------------------------- [21:22:17] Keenan Brock(@kbrock):but there are so many examples and all seem outdated (opal 0.5.0-0.6.0) ---------------------------------------------------------------------------------------------------- [21:22:35] Keenan Brock(@kbrock):not sure if I should got the precompile route (all the rakefile/guard examples break - but not too hard to fix) ---------------------------------------------------------------------------------------------------- [21:23:05] Keenan Brock(@kbrock):or try a sprockets - the world of js/nodejs/react/... too many possibilities. you know? ---------------------------------------------------------------------------------------------------- [21:24:20] Jamie Gaskins(@jgaskins):You can get started pretty easily with [Clearwater](https://github.com/clearwater-rb/clearwater#installing) and Rails, so Rails will manage the asset compilation for you. There's even a [starter kit](https://github.com/clearwater-rb/clearwater_rails_starter_kit) specifically for that. ---------------------------------------------------------------------------------------------------- [21:24:36] Keenan Brock(@kbrock):thanks. heard about clearwater on ruby rogues ---------------------------------------------------------------------------------------------------- [21:24:40] Keenan Brock(@kbrock):it is what brought me back ---------------------------------------------------------------------------------------------------- [21:24:46] Keenan Brock(@kbrock):volt is slick, but the world is a rails world ---------------------------------------------------------------------------------------------------- [21:25:13] Keenan Brock(@kbrock):cool - I'll do that - thanks so much ---------------------------------------------------------------------------------------------------- [21:25:24] Keenan Brock(@kbrock):ooh, is opal-browser recent? ---------------------------------------------------------------------------------------------------- [21:25:25] Jamie Gaskins(@jgaskins):ha! Nice. That was me on with the Rogues. ;-) ---------------------------------------------------------------------------------------------------- [21:25:34] Keenan Brock(@kbrock):or do most people do the opal-jquery ---------------------------------------------------------------------------------------------------- [21:25:35] Keenan Brock(@kbrock):NICE ---------------------------------------------------------------------------------------------------- [21:25:43] Keenan Brock(@kbrock):your enthuiasm came over well. ---------------------------------------------------------------------------------------------------- [21:25:49] Jamie Gaskins(@jgaskins):Thanks! ---------------------------------------------------------------------------------------------------- [21:25:51] Keenan Brock(@kbrock):I tend not to listen to rogues much anymore ---------------------------------------------------------------------------------------------------- [21:26:05] Keenan Brock(@kbrock):but that episode was too enticing to skip ---------------------------------------------------------------------------------------------------- [21:26:10] Keenan Brock(@kbrock):I mean virtual dom ---------------------------------------------------------------------------------------------------- [21:26:14] Keenan Brock(@kbrock):opal ---------------------------------------------------------------------------------------------------- [21:26:22] Keenan Brock(@kbrock):come on. who could skip that? ---------------------------------------------------------------------------------------------------- [21:26:40] Jamie Gaskins(@jgaskins):I've really enjoyed working with it. ---------------------------------------------------------------------------------------------------- [21:26:57] Keenan Brock(@kbrock):do you play much with websockets? ---------------------------------------------------------------------------------------------------- [21:27:07] Jamie Gaskins(@jgaskins):Yep ---------------------------------------------------------------------------------------------------- [21:27:13] Keenan Brock(@kbrock):with rails? ---------------------------------------------------------------------------------------------------- [21:27:23] Keenan Brock(@kbrock):you go action cable, or faye? ---------------------------------------------------------------------------------------------------- [21:27:30] Keenan Brock(@kbrock):anything special with clearwater to keep in mind? ---------------------------------------------------------------------------------------------------- [21:27:36] Keenan Brock(@kbrock):I did notice an opal-channel thing ---------------------------------------------------------------------------------------------------- [21:27:40] Jamie Gaskins(@jgaskins):Faye, I haven't tried anything with Rails 5/ActionCable yet. ---------------------------------------------------------------------------------------------------- [21:28:03] Keenan Brock(@kbrock):do I need to get into opal-browser? ---------------------------------------------------------------------------------------------------- [21:28:10] Keenan Brock(@kbrock):or does clearwater kinda get rid of that? ---------------------------------------------------------------------------------------------------- [21:28:11] Jamie Gaskins(@jgaskins):There's also [`opal-pusher`](https://github.com/jgaskins/opal-pusher). ---------------------------------------------------------------------------------------------------- [21:28:14] Keenan Brock(@kbrock):oooh ---------------------------------------------------------------------------------------------------- [21:28:36] Keenan Brock(@kbrock):pusher-api is a 3rd party service. right? ---------------------------------------------------------------------------------------------------- [21:29:22] Jamie Gaskins(@jgaskins):`opal-browser` and `bowser` are both Ruby bindings to browser APIs. Clearwater uses `bowser` under the hood because it's got a very small payload. ---------------------------------------------------------------------------------------------------- [21:29:48] Jamie Gaskins(@jgaskins):But you can use either one. If you're using WebSockets, you'll definitely want to use one of them. ---------------------------------------------------------------------------------------------------- [21:29:57] Jamie Gaskins(@jgaskins):Yeah, Pusher is 3rd-party. ---------------------------------------------------------------------------------------------------- [21:30:10] Keenan Brock(@kbrock):I came across https://www.sitepoint.com/opal-ruby-browser-game-life/ ---------------------------------------------------------------------------------------------------- [21:30:26] Keenan Brock(@kbrock):but can't get it running on a recent version ---------------------------------------------------------------------------------------------------- [21:30:32] Keenan Brock(@kbrock):and to tell you the truth ---------------------------------------------------------------------------------------------------- [21:30:44] Keenan Brock(@kbrock):felt like they were writing their own bowser (I like the size of that one) ---------------------------------------------------------------------------------------------------- [21:31:02] Keenan Brock(@kbrock):so I wanted to upgrade and run it - but just felt dead in the water ---------------------------------------------------------------------------------------------------- [21:31:15] Keenan Brock(@kbrock):also the code had too many backticks. wasn't separated well. ---------------------------------------------------------------------------------------------------- [21:32:05] Keenan Brock(@kbrock):So I gave up and started looking at https://github.com/4r2r/opal-robots close to my end goal (I'm starting too big...) but I want the brains to be running on server + websockets ---------------------------------------------------------------------------------------------------- [21:32:08] Jamie Gaskins(@jgaskins):Yeah, if you're writing a lot of backticks, you probably want to encapsulate that :-) ---------------------------------------------------------------------------------------------------- [21:32:50] Keenan Brock(@kbrock):when you write apps, do you `require 'opal'` - or do you tend to create `opal.js` and html include that? ---------------------------------------------------------------------------------------------------- [21:33:24] Jamie Gaskins(@jgaskins):The first two lines of my apps are almost always: ```ruby require 'opal' require 'clearwater' ``` ---------------------------------------------------------------------------------------------------- [21:33:38] Keenan Brock(@kbrock):so your application.js is BIG ---------------------------------------------------------------------------------------------------- [21:33:59] Jamie Gaskins(@jgaskins):Nah, a little over 100KB minified/gzipped. ---------------------------------------------------------------------------------------------------- [21:34:13] Keenan Brock(@kbrock):heh ---------------------------------------------------------------------------------------------------- [21:34:24] Keenan Brock(@kbrock):I'm still confused by js so I was hoping for 100 lines ;) ---------------------------------------------------------------------------------------------------- [21:34:35] Jamie Gaskins(@jgaskins):It's about the same JS payload size as an equivalent Ember app. ---------------------------------------------------------------------------------------------------- [21:35:01] Keenan Brock(@kbrock):well. I'm selling myself short. I hack / fix bugs in js in the open source community a lot. but there is a difference between hacking / improving and speaking a language natively ---------------------------------------------------------------------------------------------------- [21:35:52] Keenan Brock(@kbrock):yea. not complaining about payload size. just hard to keep that all in my brain ---------------------------------------------------------------------------------------------------- [21:37:24] Keenan Brock(@kbrock):@jgaskins cool. the starter kit is just a rails app with `application.rb` swapped and a hello controller. thanks. this is great ---------------------------------------------------------------------------------------------------- [21:38:37] Jamie Gaskins(@jgaskins):If you're loading Opal from a CDN (like `cdn.opalrb.org`), you can omit that require line from your app: https://github.com/opal/opal-cdn ---------------------------------------------------------------------------------------------------- [21:38:50] Jamie Gaskins(@jgaskins):@kbrock No worries. :-) ---------------------------------------------------------------------------------------------------- [21:39:02] Keenan Brock(@kbrock):last one - I promise ;) ---------------------------------------------------------------------------------------------------- [21:39:07] Keenan Brock(@kbrock):have you played with games? ---------------------------------------------------------------------------------------------------- [21:39:08] Jamie Gaskins(@jgaskins):You can also hop into the Clearwater channel if you like: https://gitter.im/clearwater-rb/clearwater ---------------------------------------------------------------------------------------------------- [21:39:10] Keenan Brock(@kbrock):like phaser? ---------------------------------------------------------------------------------------------------- [21:39:12] Keenan Brock(@kbrock):thanks ---------------------------------------------------------------------------------------------------- [21:40:31] Jamie Gaskins(@jgaskins):I haven't checked out Phaser, but @ylluminarious made Ruby bindings to it: http://opalphaser.com ---------------------------------------------------------------------------------------------------- [21:41:02] Keenan Brock(@kbrock):yea - phaser looked sweet. I got a few screens in but then... well... it was javascript. so opal phaser is very tempting ---------------------------------------------------------------------------------------------------- [22:00:38] Keenan Brock(@kbrock):Have people tried opal-rails with rails 5.0? ---------------------------------------------------------------------------------------------------- [22:30:11] Elia Schito(@elia):@dougo @kbrock re sprockets: I'm in the process of decoupling sprockets support, opal 0.11 will ship without sprockets as a dependency and `opal-sprockets` will be needed; it will support for multiple sprockets versions ---------------------------------------------------------------------------------------------------- [22:31:46] Keenan Brock(@kbrock):@elia thanks ---------------------------------------------------------------------------------------------------- [22:31:48] Keenan Brock(@kbrock):very cool ---------------------------------------------------------------------------------------------------- [23:03:17] George Plymale II(@ylluminarious):@kbrock you're welcome to our gitter channel if you have any questions about opal-phaser: https://gitter.im/orbitalimpact/opal-phaser ---------------------------------------------------------------------------------------------------- [23:03:32] Keenan Brock(@kbrock):thanks @ylluminarious ---------------------------------------------------------------------------------------------------- [23:05:29] George Plymale II(@ylluminarious):np ---------------------------------------------------------------------------------------------------- [18:54:02] Keenan Brock(@kbrock):I hardcoded: ```ruby gem "sprockets", "~> 3.6.x" ``` and it went away. if you need a temporary fix ---------------------------------------------------------------------------------------------------- [20:56:55] Keenan Brock(@kbrock):I hope this is a faq but... I'm having all sorts of problems getting code up and running. It often seems to complain when it hits `Ë` characters - that are all over the generated code. Any suggestions? ---------------------------------------------------------------------------------------------------- [21:18:40] Jamie Gaskins(@jgaskins):@kbrock Add this `meta` tag: `` ---------------------------------------------------------------------------------------------------- [21:18:48] Keenan Brock(@kbrock):aah - thanks ---------------------------------------------------------------------------------------------------- ############################## [2016-07-24] ############################## [21:17:22] Keenan Brock(@kbrock):I'll try and come up with a simpler example ---------------------------------------------------------------------------------------------------- [21:17:25] Keenan Brock(@kbrock):(so I can understand too) ---------------------------------------------------------------------------------------------------- [21:17:39] Keenan Brock(@kbrock):but in the end, I'm pretty sure it is the `import Robots` line that is the problem ---------------------------------------------------------------------------------------------------- [21:17:58] Keenan Brock(@kbrock):maybe I'll step through opal versions to see where it works and breaks ---------------------------------------------------------------------------------------------------- [21:18:04] Keenan Brock(@kbrock):@jgaskins thanks for all the help ---------------------------------------------------------------------------------------------------- [21:18:54] Jamie Gaskins(@jgaskins):I know I've used `include X` before in evaled code, but that was a version or two ago. ---------------------------------------------------------------------------------------------------- [21:19:13] Jamie Gaskins(@jgaskins):No worries ---------------------------------------------------------------------------------------------------- [21:19:15] Keenan Brock(@kbrock):I'm pretty sure `include ::Robots` works ---------------------------------------------------------------------------------------------------- [21:19:25] Keenan Brock(@kbrock):it is as if it doesn't do scopes correctly ---------------------------------------------------------------------------------------------------- [21:19:58] Jamie Gaskins(@jgaskins):Yeah, that's what makes me wonder if the eval is broken. I'm wondering if the lexical scoping is messed up somehow. ---------------------------------------------------------------------------------------------------- [21:22:26] Keenan Brock(@kbrock):perfect, I'll see if I can get a 20 liner working. ---------------------------------------------------------------------------------------------------- [21:24:31] Elia Schito(@elia):@kbrock at some point `require` transitioned from preprocessor (similar to sprockets requires) where a require was translated into a direct file inclusion at the top, to a full-fledged module system that allowed for semantics nearly identical to MRI – dunno if this info helps, let me know if you want more deatils, I think the change happened between 0.6 and 0.7 ---------------------------------------------------------------------------------------------------- [21:25:31] Elia Schito(@elia):also eval scoping ain't perfect yet :) ---------------------------------------------------------------------------------------------------- [21:27:48] Elia Schito(@elia):@/all anyone ever used `yaml` from the stdlib? – I think I'll remove it from there, the change will require to go from `require 'yaml'` to `require 'nodejs/yaml'` ---------------------------------------------------------------------------------------------------- [21:28:37] Elia Schito(@elia):(the reason is this jshint bug: https://github.com/jshint/jshint/issues/2949 :sweat_smile:) ---------------------------------------------------------------------------------------------------- [21:38:22] Guillaume Grossetie(@Mogztter):I think I've never used `yaml` ---------------------------------------------------------------------------------------------------- [21:48:44] Elia Schito(@elia):yeah, I added that a while ago when I did some experiments with nwjs and the electron predecessor ---------------------------------------------------------------------------------------------------- [20:10:43] Keenan Brock(@kbrock):Is it possible that `requre` has slightly different scoping between the various versions? I'm trying to upgarde someone else's opal ruby robot project, and I noticed that I now am requiring a `include ::Robot`when the old code worked fine with `include Robot` (a global scope symbol) [[ref]](https://github.com/kbrock/opal-robots/blob/master/app/rrobots/ducks/NervousDuck.rb#L2) ---------------------------------------------------------------------------------------------------- [20:58:58] Jamie Gaskins(@jgaskins):@kbrock Looks like it might be some weirdness in scoped constant lookup. Is [this](https://github.com/kbrock/opal-robots/blob/56705d642b3d8f3c1579a18417e1d754428d99e5/Gemfile#L3) the git ref for the Opal version you're using? ---------------------------------------------------------------------------------------------------- [20:59:27] Keenan Brock(@kbrock):yes, that version looks up `Robot` correctly ---------------------------------------------------------------------------------------------------- [20:59:37] Keenan Brock(@kbrock):my end goal is to bring this up to date with opal ---------------------------------------------------------------------------------------------------- [20:59:42] Keenan Brock(@kbrock):use it as a learning exercise ---------------------------------------------------------------------------------------------------- [20:59:46] Keenan Brock(@kbrock):... clearwater ... ---------------------------------------------------------------------------------------------------- [20:59:49] Keenan Brock(@kbrock):anyway ---------------------------------------------------------------------------------------------------- [21:00:25] Jamie Gaskins(@jgaskins):lol Cool, lemme have a look ---------------------------------------------------------------------------------------------------- [21:00:34] Keenan Brock(@kbrock):@jgaskins yes, that version works correctly, when I go to master, it says `import Robots` ==> `NervousDuck::Robots` not found ---------------------------------------------------------------------------------------------------- [21:00:55] Keenan Brock(@kbrock):I tried to tear everything out (including ugly `Native` calls) to get this as minimal use of browser as possible ---------------------------------------------------------------------------------------------------- [21:00:59] Keenan Brock(@kbrock):want to transistion to bowser ---------------------------------------------------------------------------------------------------- [21:01:20] Keenan Brock(@kbrock):this code base is probably too complex for a starter project. I should go back to conway or something ;) ---------------------------------------------------------------------------------------------------- [21:14:01] Jamie Gaskins(@jgaskins):It looks like it's fetching gists, compiling them to JS, and then evaling that. I'm not sure what could be going wrong, but I have a feeling it's the eval that's causing trouble. ---------------------------------------------------------------------------------------------------- [21:16:25] Jamie Gaskins(@jgaskins):[![Screen Shot 2016-07-24 at 5.14.20 PM.png](https://files.gitter.im/opal/opal/BA7c/thumb/Screen-Shot-2016-07-24-at-5.14.20-PM.png)](https://files.gitter.im/opal/opal/BA7c/Screen-Shot-2016-07-24-at-5.14.20-PM.png) ---------------------------------------------------------------------------------------------------- [21:17:05] Jamie Gaskins(@jgaskins):I mean, it's obvious from the stack trace that the problem is within the eval, but I mean I think the eval itself may be problematic. ---------------------------------------------------------------------------------------------------- [21:17:13] Keenan Brock(@kbrock):aah ---------------------------------------------------------------------------------------------------- ############################## [2016-07-26] ############################## [16:58:53] Forrest Chang(@fkchang):@elia haven't used yaml from opal -- not certain I'd want to, figuring that json config (or the opal equivalent) is preferred in the browser. Not really sure how popular yaml is these days, seems like JSON has become the lingua franca for that type of data config going forward ---------------------------------------------------------------------------------------------------- [17:00:03] Forrest Chang(@fkchang):@/all wondering if making some that "wraps" opal classes to make it easier to consume via JS would be something that would be either useful for opal, or help make it more popular. In wrapping, making something that could drop all the $'s in the methods from the JS side. ---------------------------------------------------------------------------------------------------- [20:56:10] Jared White(@jaredcwhite):@/all Hey...coming up for air here and ready to send out an Opalist issue tomorrow morning (US Pacific TZ). If there's any news, gems, updates, whatever you'd like to see in it, let me know. (email is best - jared@jaredwhite.com) ---------------------------------------------------------------------------------------------------- [23:21:27] Doug Orleans(@dougo):What's the difference between `Module#alias_native` and `Native::Helpers#alias_native`? ---------------------------------------------------------------------------------------------------- [23:29:01] Doug Orleans(@dougo):seems like the latter converts its arguments to native while the former doesn't. ---------------------------------------------------------------------------------------------------- [23:29:57] Ilya Bylich(@iliabylich):@dougo Both of them take the name of the Ruby method and the name of JS property. `Module#alias_native(:rubyMethod, :jsProperty)` generates an alias to `self.jsProperty()`, `Native::Helpers#alias_native` generates a method that delegates `jsProperty` to its `@native`. It's all about delegation. ---------------------------------------------------------------------------------------------------- [23:30:49] Doug Orleans(@dougo):yes, but also what I said :) ---------------------------------------------------------------------------------------------------- [23:31:08] Doug Orleans(@dougo):but, thanks, I hadn't thought about that distinction also. ---------------------------------------------------------------------------------------------------- ############################## [2016-07-27] ############################## [22:31:34] Elia Schito(@elia):@fkchang http://dev.mikamai.com/post/99319315864/why-json-sucks-for-user-configuration :smile: although json is fine for communication ---------------------------------------------------------------------------------------------------- [22:32:58] Elia Schito(@elia):@fkchang this could be what you were looking for in terms of exposing methods to JS, be aware that you can't expose a method if u have an ivar with the same name https://github.com/opal/opal/blob/master/stdlib/native.rb#L597-L612 ---------------------------------------------------------------------------------------------------- ############################## [2016-07-28] ############################## [01:06:33] Doug Orleans(@dougo):Hm, just noticed that my Opal-generated js assets are not being uglified ---------------------------------------------------------------------------------------------------- [01:07:10] Doug Orleans(@dougo):I have this in my config/environments/production.rb: ` config.assets.js_compressor = :uglifier` ---------------------------------------------------------------------------------------------------- [01:07:31] Doug Orleans(@dougo):Is there something else I need to set? ---------------------------------------------------------------------------------------------------- [01:26:38] Doug Orleans(@dougo):oh, duh. I was precompiling assets in development, not production. ---------------------------------------------------------------------------------------------------- [14:04:17] Jamie Gaskins(@jgaskins):That's one of the weirdest things about `rake assets:precompile`. You have to specify explicitly that you're precompiling for production. Who precompiles for dev? I thought Rails intended to be pragmatic. :-) ---------------------------------------------------------------------------------------------------- ############################## [2016-07-29] ############################## [04:18:34] 深渊漫步(@CicholGricenchos):Hi all, I am following the example in https://github.com/opal/opal-sprockets, and my `application.rb` is: ```ruby require 'opal' puts "1" ``` but why is it compiled to `Opal.modules["application"] = function(Opal) {};`, not `(function(Opal){})(Opal)`? I am wondering how to run it. ---------------------------------------------------------------------------------------------------- ############################## [2016-08-01] ############################## [16:32:02] Mitch VanDuyn(@catmando):I have a file "foo.rb.erb". The erb values that need to be expanded are normally all set in an initializer . All works great, except I am trying to write some server side tests, that will go through various configuration options. The problem is once the foo.rb.erb is expanded to foo.rb I can't get it to "reexpand" during the testing.... I have tried setting the rails cache to null_cache, deleteting cache/tmp/* etc, etc... ---------------------------------------------------------------------------------------------------- [16:34:22] Mitch VanDuyn(@catmando):note that the file being expanded is inside a gem... perhaps that makes a difference? ---------------------------------------------------------------------------------------------------- [17:23:06] Jamie Gaskins(@jgaskins):@CicholGricenchos You should be able to run it with `Opal.load('application')` in JS after your `" end File.open("#{OUTFOLDER}/webserver/#{INDEXFILE}", "w") do |f| a = File.open(HTMLTEMPLATE).read f.puts ERB.new(a).result end ``` ---------------------------------------------------------------------------------------------------- [18:06:20] Elia Schito(@elia):@bwl21 that should still work (and be kept) ---------------------------------------------------------------------------------------------------- [18:06:31] Bernhard Weichel(@bwl21):Thanks, I will give it a try these days. I have to leave for a meeting now. ---------------------------------------------------------------------------------------------------- [18:06:38] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- ############################## [2017-02-22] ############################## [16:47:55] Elia Schito(@elia):@joseph-montanez if you can put together some steps/code to reproduce I'll have a look later ---------------------------------------------------------------------------------------------------- [17:04:39] Joseph Montanez(@joseph-montanez):@elia sure thing, so far because its wrapped in Opal's anon function exports ends up here: Opal.gvars.global.native.exports, I thought there was a way to compile code stripped of the Opal stuff `(function(Opal) { ... })(Opal);` ---------------------------------------------------------------------------------------------------- [17:10:33] Joseph Montanez(@joseph-montanez):@elia https://gist.github.com/joseph-montanez/d0a8df95f6632c92deb2e643024833d1 is the code I've used ---------------------------------------------------------------------------------------------------- [17:26:18] Elia Schito(@elia):@joseph-montanez _main-page.rb_ ```rb require 'native' require 'js' Native(`module`)[:exports] = {b: 2}.to_n `module`.JS[:exports] = {a: 1}.to_n ``` _run.sh_ ```bash opal -v opal -E -c main-page.rb > main-page.rb.js node -r ./main-page.rb.js -e "console.log(require('./main-page.rb.js'))" ``` ---------------------------------------------------------------------------------------------------- [17:26:30] Elia Schito(@elia):this works ---------------------------------------------------------------------------------------------------- [17:27:05] Elia Schito(@elia):the last 2 lines of main-page.rb are the two alternative ways you can access native stuff from opal ---------------------------------------------------------------------------------------------------- [17:27:44] Elia Schito(@elia):well, there's a third one: ```rb `module.exports = #{ {c:3}.to_n }` ``` ---------------------------------------------------------------------------------------------------- [17:29:14] Joseph Montanez(@joseph-montanez):@elia awesome stuff! thanks so much ---------------------------------------------------------------------------------------------------- [17:29:51] Elia Schito(@elia):glad we found the solution! :) ---------------------------------------------------------------------------------------------------- [13:32:51] Joseph Montanez(@joseph-montanez):I am struggling to figure out if this is possible. Right now I am using Opal with NativeScript and my general issue with the Opal CLI tool. It will compile in the libraries into the scripts I am working on. I can omit the Opal core, but not the libraries. This is causing an issue as I keep getting a ton of JavaScript included into every single file. I don't want Opal CLI to bundle everything into a single script. ---------------------------------------------------------------------------------------------------- [14:11:19] Elia Schito(@elia):@joseph-montanez alas this is not directly supported yet, but there's a workaround I think could do the job ---------------------------------------------------------------------------------------------------- [14:14:10] Elia Schito(@elia):if you compile with dynamic require level set to warning and you don't add your external libraries to the path you can get away with missing libraries that will be there at runtime ---------------------------------------------------------------------------------------------------- [16:28:13] Mitch VanDuyn(@catmando):@/all it doesn't look like end_of_day is in Opal activesupport. Any reason? Or just lack of time to implement. ---------------------------------------------------------------------------------------------------- [16:28:55] Elia Schito(@elia):@catmando yes :blush: ---------------------------------------------------------------------------------------------------- [16:29:30] Elia Schito(@elia):@catmando but we all know how fun working with time-related stuff can become, so be warned :wink: ---------------------------------------------------------------------------------------------------- [16:29:47] Mitch VanDuyn(@catmando):indeed indeed ---------------------------------------------------------------------------------------------------- [16:30:03] Mitch VanDuyn(@catmando):it all worked yesterday ---------------------------------------------------------------------------------------------------- [16:30:07] Mitch VanDuyn(@catmando):but not tomorrow ---------------------------------------------------------------------------------------------------- [16:30:53] Elia Schito(@elia):and of course yesterday and tomorrow and be actually now if you mix in TZs :tada: ---------------------------------------------------------------------------------------------------- [16:32:57] Joseph Montanez(@joseph-montanez):Is there an optimal way to deal with "exports" from node land? i.e is ```ruby require 'native' $exports = Native('exports') correct? ---------------------------------------------------------------------------------------------------- [16:33:32] Joseph Montanez(@joseph-montanez):or maybe I should use $$.exports? ---------------------------------------------------------------------------------------------------- [16:34:08] Elia Schito(@elia):@joseph-montanez they should both work if `exports` is a property of the global object, which AFAIK is ---------------------------------------------------------------------------------------------------- [16:34:56] Elia Schito(@elia):@joseph-montanez wait, I think the right syntax is `$$[:exports]` because it's a property and not a method ---------------------------------------------------------------------------------------------------- [16:45:19] Joseph Montanez(@joseph-montanez):hm... seems to cause issues. `$$[:exports] = { "pageLoaded" => 123 }` doesn't make it out with the module, I just get "Opal" and I require it from a node script. ---------------------------------------------------------------------------------------------------- [16:46:19] Elia Schito(@elia):@joseph-montanez so you don't see anything exported? ---------------------------------------------------------------------------------------------------- [16:46:42] Joseph Montanez(@joseph-montanez):@elia the Opal runtime library is exported, nothing else. ---------------------------------------------------------------------------------------------------- ############################## [2017-02-23] ############################## [21:22:21] Forrest Chang(@fkchang):@/all so DHH now proclaims Javascript Love for Rails http://weblog.rubyonrails.org/2017/2/23/Rails-5-1-beta1/ -- time to push opal into the spotlight again? ---------------------------------------------------------------------------------------------------- [22:31:04] Elia Schito(@elia):@fkchang I should publish an updated version of opal to npm (https://www.npmjs.com/package/opal) ---------------------------------------------------------------------------------------------------- [22:31:46] Elia Schito(@elia):and also I need to ship 0.11 ---------------------------------------------------------------------------------------------------- ############################## [2017-02-24] ############################## [08:21:44] Bernhard Weichel(@bwl21):@eilia I tried your proposal. rackup works. It stops woking if I append "." to the path. I do not know why. ```ruby # zupfnoter-server.rb SERVER= Opal::Server.new { |s| Opal.use_gem "vector2d" Opal::Config.source_map_enabled = true Opal.paths.each { |p| s.append_path(p) } s.append_path 'public' s.append_path 'src' s.append_path 'vendor' # s.append_path "." uncommenting this line, it does not work s.source_map = true s.main = 'application' s.index_path = 'index_opal.html.erb' } # config.ru require 'bundler' Bundler.require require_relative './zupfnoter-server' run SERVER ``` But the static build does not work: (Rakefile:) ```ruby require_relative '../zupfnoter-server' File.open(ZUPFNOTER_JS, "w+") do |out| env = SERVER.sprockets out.puts env['application'].to_s end ``` If I compare the output, I can see the following difference at the very end of the generated Javascript file generated by env['application'].to_s - does not work: ```Javascript /* Generated by Opal 0.9.0 */ Opal.modules["application"] = function(Opal) { Opal.dynamic_require_severity = "error"; var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true }; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require', '$puts']); self.$require("opal"); self.$require("opal-jquery"); ... self.$require("snippet_editor"); self.$puts("now starting zupfnoter"); return self.$puts("zupfnoter is now running"); }; ``` Generated by out.puts(Opal::Builder::build("application").to_s) - this works ```Javascript /* Generated by Opal 0.9.0 */ (function(Opal) { Opal.dynamic_require_severity = "error"; var OPAL_CONFIG = { method_missing: true, arity_check: false, freezing: true, tainting: true }; var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require', '$puts']); self.$require("opal"); self.$require("opal-jquery"); ... self.$require("snippet_editor"); self.$puts("now starting zupfnoter"); return self.$puts("zupfnoter is now running"); })(Opal); ``` ---------------------------------------------------------------------------------------------------- [09:36:47] Elia Schito(@elia):@bwl21 you're right, as of now for buiding with sprockets you have to change this line: `out.puts env['application'].to_s + "\nOpal.load('application');\n"` ---------------------------------------------------------------------------------------------------- [09:46:28] Elia Schito(@elia):the additional makes opal do the initial load of the app ---------------------------------------------------------------------------------------------------- [11:50:14] Bernhard Weichel(@bwl21):@elia yes! this works. I somehow remember that we had that before ... So there are basically two ways to do a static build (http://opalrb.org/docs/guides/v0.10.3/static_applications.html) ---------------------------------------------------------------------------------------------------- [11:50:41] Bernhard Weichel(@bwl21):Do you have an Idea, why adding '.' to the path prevents the server from working? ---------------------------------------------------------------------------------------------------- [12:09:08] Elia Schito(@elia):@bwl21 not yet, need to try it locally to catch the problem ---------------------------------------------------------------------------------------------------- [12:31:19] Bernhard Weichel(@bwl21):ok i will investigate if there are conflicting files ---------------------------------------------------------------------------------------------------- ############################## [2017-02-25] ############################## [18:27:42] Guillaume Grossetie(@Mogztter):In Opal 0.10.x, `nodejs` was not automatically loaded (ie. it was define in a module `Opal.modules["nodejs"]`) but in Opal 0.11 (master) that's not the case anymore and the code is automatically loaded. Is this intended ? (see: [nodejs.js-0.10.2](https://github.com/Mogztter/opal-node-runtime/blob/v0.10.2/src/nodejs.js#L431) and [nodejs.js-0.11](https://github.com/Mogztter/opal-node-runtime/blob/v0.11.0-integration2/src/nodejs.js#L456)) ---------------------------------------------------------------------------------------------------- [23:15:26] Elia Schito(@elia):@Mogztter did you use `rake dist`? maybe the change is there ---------------------------------------------------------------------------------------------------- ############################## [2017-02-26] ############################## [09:44:03] Guillaume Grossetie(@Mogztter):@elia yes `bundle exec rake dist` ---------------------------------------------------------------------------------------------------- [15:17:20] dan-klasson(@dan-klasson):is it possible to get the opal-hot-reloader to reload css? ---------------------------------------------------------------------------------------------------- [17:14:41] Barrie Hadfield(@barriehadfield):@dan-klasson yes you can. Just add it to the list of watched folders. It works fantastically. ---------------------------------------------------------------------------------------------------- [17:27:11] dan-klasson(@dan-klasson):@barriehadfield Tried that. It says the CSS is being reloaded, but I see no changes. Saving a watched opal file after saving the CSS file, also does not reload the CSS for me ---------------------------------------------------------------------------------------------------- ############################## [2017-02-27] ############################## [09:43:30] Elia Schito(@elia):@Mogztter after the extraction of opal-sprockets `rake dist` went back to using Opal::Builder https://github.com/opal/opal/commit/ff3c5e8b ---------------------------------------------------------------------------------------------------- [09:44:59] Elia Schito(@elia):@Mogztter let me know if that's a problem or breaks anything, we can still get the old behavior with Opal::Builder ---------------------------------------------------------------------------------------------------- [13:54:41] Guillaume Grossetie(@Mogztter):@elia In my case yes because I was selectively loading `nodejs` module. If someone is using Asciidoctor.js with Webpack this is not working anymore because Webpack can't find `fs` module required in `nodejs` module. Previously `nodejs` was not loaded in a "Webpack environment". ---------------------------------------------------------------------------------------------------- [14:01:34] Elia Schito(@elia):@Mogztter I'll see if I can update that quickly ---------------------------------------------------------------------------------------------------- [14:12:30] Guillaume Grossetie(@Mogztter):@elia Thanks :) ---------------------------------------------------------------------------------------------------- [14:18:49] Elia Schito(@elia):@Mogztter here: https://github.com/opal/opal/commit/05ef58555af98c9ee8d4754e047282c5c2826531 :smiley: ---------------------------------------------------------------------------------------------------- [14:41:31] Guillaume Grossetie(@Mogztter):@elia Awesome, this is working great, thanks :+1: ---------------------------------------------------------------------------------------------------- [21:40:26] Forrest Chang(@fkchang):@dan-klasson need more details, maybe a repo and the paths you appened, I tested it against sinatra, rails, maybe roda, but that was a while ago ---------------------------------------------------------------------------------------------------- ############################## [2017-02-28] ############################## [03:29:23] dan-klasson(@dan-klasson):@fkchang My `Procfile` looks like this: ``` rails: bundle exec rails server -p 3000 hotloader: opal-hot-reloader -p 25222 -d app/views/components,app/assets/stylesheets ``` ---------------------------------------------------------------------------------------------------- [03:33:49] dan-klasson(@dan-klasson):repo: https://github.com/dan-klasson/hyperloop-crm ---------------------------------------------------------------------------------------------------- ############################## [2017-03-02] ############################## [05:34:19] Mitch VanDuyn(@catmando):help! ---------------------------------------------------------------------------------------------------- [05:34:58] Mitch VanDuyn(@catmando):I can't get any opal-rspec stuff to run. used to work fine, but I suspect upgrading gems has broken something. ---------------------------------------------------------------------------------------------------- [05:35:23] Mitch VanDuyn(@catmando):so I tried to start over, and went here: https://github.com/opal/opal-rspec-rails ---------------------------------------------------------------------------------------------------- [05:36:11] Mitch VanDuyn(@catmando):and i believe I followed all instructions, but it can neither find the rake task no can it run from the browser via spec-opal ---------------------------------------------------------------------------------------------------- [05:36:21] Mitch VanDuyn(@catmando):I'm on rails 5, does that matter? ---------------------------------------------------------------------------------------------------- [05:38:30] Mitch VanDuyn(@catmando):i get routing (can't find route) from browser, and no such task when trying rake ---------------------------------------------------------------------------------------------------- [05:41:42] Mitch VanDuyn(@catmando):when I try to set the config I get this error: ---------------------------------------------------------------------------------------------------- [05:41:43] Mitch VanDuyn(@catmando):... undefined method `opal_rspec' for # (NoMethodError) ---------------------------------------------------------------------------------------------------- [12:35:28] Mitch VanDuyn(@catmando):okay - so that was dumb had opal rspec in test not development, but now i get this: ---------------------------------------------------------------------------------------------------- [12:35:30] Mitch VanDuyn(@catmando):Uncaught SyntaxError: Invalid regular expression: /**/*_spec/: Nothing to repeat at new RegExp () at singleton_class_alloc.TMP_5 [as $new] (regexp.rb:76) at $QueryStringConfig.$$pattern_regexp [as $pattern_regexp] (opal-rspec-rails-runner.rb:22) at Opal.modules.opal-rspec-rails-runner (opal-rspec-rails-runner.rb:42) at Object.Opal.load (runtime.self.js?body=1:1957) at spec-opal:527 ---------------------------------------------------------------------------------------------------- [12:35:36] Mitch VanDuyn(@catmando):in the console ---------------------------------------------------------------------------------------------------- [12:37:54] Mitch VanDuyn(@catmando):and the same kind of thing when I run in the console: ---------------------------------------------------------------------------------------------------- [12:38:04] Mitch VanDuyn(@catmando):```text bundle exec rake opal:rspec Object freezing is not supported by Opal undefined: 5700:in `RegExp': SyntaxError: Invalid regular expression: nothing to repeat from undefined: 5700:in `TMP_5' from undefined: 128099:in `$$pattern_regexp' from undefined: 128131:in ~unknown~ from undefined: 1957:in `load' undefined: 54213:in ~unknown~: TypeError: null is not a valid argument for 'in' (evaluating ''textContent' in document.documentElement') from undefined: 52667:in `__webpack_require__' from undefined: 53143:in ~unknown~ from undefined: 53253:in ~unknown~ from undefined: 52667:in `__webpack_require__' from undefined: 53005:in ~unknown~ from undefined: 53118:in ~unknown~ from undefined: 52667:in `__webpack_require__' from undefined: 52777:in ~unknown~ from undefined: 52853:in ~unknown~ from undefined: 52667:in `__webpack_require__' from undefined: 52730:in ~unknown~ ``` ---------------------------------------------------------------------------------------------------- [13:23:17] Mitch VanDuyn(@catmando):same thing in rails 4 ---------------------------------------------------------------------------------------------------- [13:37:14] Mitch VanDuyn(@catmando):problem is reproducible here: https://github.com/ruby-hyperloop/hyper-mesh/tree/hyper-operation-integration/test-app-2 ---------------------------------------------------------------------------------------------------- [17:21:40] Forrest Chang(@fkchang):@/all I'm thinking we need some "official Opal way of having toll free bridged JS objects as limited hashes" - I've been mulling the idea for a while, but my latest go at wrapping indexedDB in opal kind of puts me there -- thought hyper-react params (props), getting converted to opal Hashes shows some of the pain. Basically, nearly every interaction w/a JS API, will typically return (and take as parameters) JS objects, I know in various places we are smart about converting, say jquery's ajax functions where response.json gets converted, but there's too much manual doing that can get consistent, in response, you also need to remember to add to_n to Opal Hashes you pass in to JS apis too. I think there is a 90% solution out there where we don't have to convert, but pretty much treat a JS object as a limited hash in opal, w/o having to do conversions. My 2 day ago pain came from I was storing json data in an indexedb field, and I had to search that, I'm dealing with 1000's of entries, so I don't want to have a loop that has to convert things, so I wrote all the filtering stuff in JS, which as we all know is decidely less pleasurable than writing opal, and call that via x-strings. Possibly native wrapping or .JS could address it (though I can't use .JS coz the app I'm doing it on is 0.8), but it still feels a bit piecemeal -- i.e. developers have to remember to do it. Ultimately I think this affects uptake of opal, where people will think, "Hey, if I have to remember to convert to and from (and sometimes that's rather complex, I get that problem with > 1 level deep nested objects in hyper-react all the time), then I may as well just do it all in JS". May we have a new class JsObject, maybe introduce a literal that thing we can use to define them? I dunno On the implementation side, @elia @meh @iliabylich, @jeremyevans @jgaskins may have some ideas, I suspect I'm not alone in feeling this "impedance mismatch with the primary way of moving data in JS", @catmando and some of the other hyper-react folks might have some insights -- there are solutions, but they can be intricate and hard to debug, If I could just handle nested js objects as if they were Opal Hash (a likes) w/o converting, that would pretty much do it. Sorry to ramble. Want to get this thought out while the pain is still fresh ---------------------------------------------------------------------------------------------------- [17:23:55] meh.(@meh):fkchang, the problem is they're plain objects, we can't add methods to them, so they can't behave like hashes in any way ---------------------------------------------------------------------------------------------------- [17:28:22] Forrest Chang(@fkchang):@meh we can't add to the proto? (or there is no proto) ---------------------------------------------------------------------------------------------------- [17:29:08] meh.(@meh):fkchang, it depends on how the code of the library deals with the object ---------------------------------------------------------------------------------------------------- [17:30:53] Forrest Chang(@fkchang):off the cuff, I think, the 80% need is to support [] and []= from the opal side on the js object w/o converting it. Is that possible, and what ramifications would it have on libs? ---------------------------------------------------------------------------------------------------- [17:32:07] Forrest Chang(@fkchang):that and iteration, keys() and values() ---------------------------------------------------------------------------------------------------- [17:35:29] meh.(@meh):fkchang, if we add methods to the prototype then EVERY object will have that method, it would be the same as adding the method to `BasicObject` ---------------------------------------------------------------------------------------------------- [17:37:25] meh.(@meh):the best solution is to just use .JS ---------------------------------------------------------------------------------------------------- [17:38:50] meh.(@meh):fkchang, and even if it were, if for some reason the underlying code uses a for loop instead of Object.* the method will show up ---------------------------------------------------------------------------------------------------- [17:42:41] Forrest Chang(@fkchang):@meh what if we clone the proto and make a new one? Got a quick .JS alike functionality for older opal's? ---------------------------------------------------------------------------------------------------- [17:43:13] meh.(@meh):fkchang, it wouldn't be an object, if the underlying code checks the passed value is a raw object it won't work ---------------------------------------------------------------------------------------------------- [17:43:37] meh.(@meh):there's just no way to work around that at runtime as far as I know ---------------------------------------------------------------------------------------------------- [17:46:14] Forrest Chang(@fkchang):hmm, so maybe we make something that takes a block, in the block, we wrap the js object with something that translates the hash funtionality and sets the values on the js object? A little weird, but it would meet the need to be able to manipulate like a Hash, but leave it a pure JS object ---------------------------------------------------------------------------------------------------- [17:46:21] Forrest Chang(@fkchang):I'll have to play w/that idea ---------------------------------------------------------------------------------------------------- [17:47:02] Forrest Chang(@fkchang):of course, this forces us to use, and remember to use blocks when dealing w/JS objects, but it might help, though .JS might meet most of that ---------------------------------------------------------------------------------------------------- [17:47:10] Forrest Chang(@fkchang):too bad I can't use .JS on most of my stuff ---------------------------------------------------------------------------------------------------- [17:48:02] meh.(@meh):fkchang, that's effectively the same as calling `#to_n` at the end, you still have to change your code ---------------------------------------------------------------------------------------------------- [17:48:13] meh.(@meh):and remember to do it ---------------------------------------------------------------------------------------------------- [18:40:00] Forrest Chang(@fkchang):u do have to remember, but to_n only works on creating, but not accessing ---------------------------------------------------------------------------------------------------- [18:40:12] Forrest Chang(@fkchang):and I can't use .JS on the project that needs it right now ---------------------------------------------------------------------------------------------------- [18:40:58] meh.(@meh):fkchang, don't you just need to wrap the incoming object in another `Hash`? ---------------------------------------------------------------------------------------------------- [18:41:07] meh.(@meh):I don't remember what stuff was in 0.8 ---------------------------------------------------------------------------------------------------- [18:44:44] Forrest Chang(@fkchang):My case atm is that that I store an array of JS objects in an indexedDB column (or equivalent of such), I need to filter out by certain values in the js objects, so I realize as I'm describing this, that my block approach doesn't work for this very situation, mabye I can universally wrap recursively. Anyways, I had to write JS code to be able to filter out the stuff. JS makes me cry sometimes ---------------------------------------------------------------------------------------------------- [20:47:35] Jamie Gaskins(@jgaskins):@fkchang If you're storing Ruby objects in IDB, and you know the type of object it was in Ruby, for example a `Person`, you can do: ```ruby # people is the raw JS array pulled from IDB people.map do |js_person| `Object.assign(#{Person.allocate}, js_person)` end ``` This should give you the object exactly as it existed before you persisted it to IDB. This may also include the `object_id`, but you might be able to strip that out. ---------------------------------------------------------------------------------------------------- [21:14:52] Forrest Chang(@fkchang):@jgaskins that's an interesting piece of info, I had decided to store it as the native js array of objects I pulled over opal-jquery ajax request, instead of the converted response.json, so maybe this could be used instead of doing it all in js ---------------------------------------------------------------------------------------------------- [21:19:24] Jamie Gaskins(@jgaskins):I think I've got some code on my machine at home to wrap the basics of IDB in Ruby, but I stopped messing with it once I realized it stripped all the proto/constructor metadata from the objects. I suppose it's not the end of the world. I'll see if I can post a Bowser PR for it tonight. ---------------------------------------------------------------------------------------------------- [21:27:04] Forrest Chang(@fkchang):yeah, I figure it's still best to just store js objects in indexdb, i.e. json compatible data ---------------------------------------------------------------------------------------------------- [21:27:23] Forrest Chang(@fkchang):but I'd be curious as to your indexedDB wrapper details ---------------------------------------------------------------------------------------------------- [23:38:15] Mitch VanDuyn(@catmando):@/all has anybody got opal-rspec-rails working??? I can't even get a basic thing to go... keeps saying Uncaught SyntaxError: Invalid regular expression: /*/_spec/: Nothing to repeat at new RegExp () ---------------------------------------------------------------------------------------------------- [23:38:23] Mitch VanDuyn(@catmando):in the console. ---------------------------------------------------------------------------------------------------- [23:38:32] Mitch VanDuyn(@catmando):have tried everything... ---------------------------------------------------------------------------------------------------- ############################## [2017-03-04] ############################## [10:20:45] Bernhard Weichel(@bwl21):@fkchang @meh @elia Regarding Opal Hash vs. JS object: I always stuggle and hack around this issue. the bridge has two directions: 1. getting an Object from JS and properly handle in Opal 2. having an Opal hash and properly handle it in JS I feel that the bridge should have clear entry points. for example I would really prefer if e.g. Hash has a to_JS which returns a JS object and can be passed to 3rd party JS libraries. And I would not consider that `{a:1, b:2}.to_js` yields a proper Opal object. It yields a JS object. I don't think that to_n provides this at the moment. I observe somtimes traces of Opal methods in the result. I recently had the trouble when I tried to use neatjson.js. Eventually I ended up going via JSON to get a `clean`JS object. ```ruby outputjs = %x{neatjson(JSON.parse(JSON.stringify(#{object.to_n})), #{opts.to_n})} ``` ---------------------------------------------------------------------------------------------------- [13:51:21] Guillaume Grossetie(@Mogztter):I'm using this function in a wrapper API to convert from plain JSON to `Opal.hash`: https://github.com/asciidoctor/asciidoctor.js/blob/0866d3335699f728f0a9197f8f01c51ce92525cc/src/asciidoctor-core-api.js#L1-L6 ---------------------------------------------------------------------------------------------------- [13:51:37] Guillaume Grossetie(@Mogztter):```javascript var toHash = function (object) { if (object && !object.smap) { return Opal.hash(object); } return object; }; ``` ---------------------------------------------------------------------------------------------------- [13:53:22] Guillaume Grossetie(@Mogztter):```diff -var options = Opal.hash({attributes: 'icons=font@ data-uri!'}); +var options = {attributes: 'icons=font@ data-uri!'}; var doc = asciidoctor.load('== Test', options); ``` ---------------------------------------------------------------------------------------------------- [13:54:43] Guillaume Grossetie(@Mogztter):This is at best "syntactic sugar" but at least`Opal.hash` is hidden :smile: ---------------------------------------------------------------------------------------------------- [21:27:18] Elia Schito(@elia):@/all having a look at opal-rspec-rails right now ---------------------------------------------------------------------------------------------------- [21:28:15] Elia Schito(@elia):I fear it's yak-shaving time :D ---------------------------------------------------------------------------------------------------- [23:21:26] Elia Schito(@elia):@catmando @jgaskins just pushed some changes that should have fixed the regexp error ---------------------------------------------------------------------------------------------------- [23:21:55] Elia Schito(@elia):do you mainly use it from the browser or from the terminal? ---------------------------------------------------------------------------------------------------- [23:22:22] Mitch VanDuyn(@catmando):Both. Terminal for debug ---------------------------------------------------------------------------------------------------- [23:24:45] Mitch VanDuyn(@catmando):Whoops browser for debug, terminal for CI ---------------------------------------------------------------------------------------------------- [23:28:03] Elia Schito(@elia):for now I only checked browser ---------------------------------------------------------------------------------------------------- ############################## [2017-03-05] ############################## [01:25:22] Elia Schito(@elia):@catmando ok, `bin/rake opal:rspec:run RUNNER=nodejs ` should run the specs from CLI, still WIP, any feedback very appreciated ---------------------------------------------------------------------------------------------------- [12:55:17] Mitch VanDuyn(@catmando):Okay! I'll give it a whirl but probably Monday ---------------------------------------------------------------------------------------------------- ############################## [2017-03-07] ############################## [05:36:18] dan-klasson(@dan-klasson): I'm trying to move some display a filter box logic out from a component to a store. And I am trying to change the state inside the store when a button is clicked. The problem is that the state isn't being changed. ``` class ToggleNavBarStore < Hyperloop::Store state display_filter_box: true, scope: :class, reader: true def self.toggle display = Element.find(:body).has_class? 'sidebar-collapse' self.mutate.display_filter_box(!display) LocalStorage['nav_bar_expanded'] = !display end def self.nav_bar_initial_state collapsed = LocalStorage['nav_bar_expanded'] == 'false' ? false : true display_filter_box(collapsed) Element.find(:body).add_class 'sidebar-collapse' unless collapsed end end ``` ---------------------------------------------------------------------------------------------------- [05:37:36] dan-klasson(@dan-klasson):so in my component i call `nav_bar_initial_state` like so: ``` before_mount do ToggleNavBarStore.nav_bar_initial_state end ``` ---------------------------------------------------------------------------------------------------- [05:38:28] dan-klasson(@dan-klasson):when the button is clicked: ``` end.on(:click) { ::ToggleNavBarStore.toggle } ``` ---------------------------------------------------------------------------------------------------- [05:38:54] dan-klasson(@dan-klasson):and whether to render the box div: ``` if ToggleNavBarStore.display_filter_box ``` ---------------------------------------------------------------------------------------------------- [07:12:58] dan-klasson(@dan-klasson):oops. wrong channel. sorry ---------------------------------------------------------------------------------------------------- ############################## [2017-03-13] ############################## [18:33:59] Forrest Chang(@fkchang):My next attempt to "advertise" opal, should follow this model -- totally delishable! https://www.youtube.com/watch?v=WPkMUU9tUqk ---------------------------------------------------------------------------------------------------- [19:52:20] Jared White(@jaredcwhite):@elia @meh and others...I'm very sorry to announce that the Opalist newsletter is closing down. I just haven't had time in a long time to work on it (or anything Opal-related, unfortunately), and it costs money for me to use the newsletter software it was running on. I have an exported CSV list of subscribers I can give to you (the Opal maintainers) if you want to set up your own thing on Mailchimp or whatever. The site and the signup form will be offline in the next day or so. Thanks again for all the encouragement and support when it first got up and running! ---------------------------------------------------------------------------------------------------- [21:03:54] Elia Schito(@elia):@jaredcwhite thanks what you've done, has been great to have a NL. I'll gladly take the list and hopefully reuse it at least at release time, maybe someone will come up with a new list. ---------------------------------------------------------------------------------------------------- [21:10:40] Elia Schito(@elia):@fkchang “hey this is a dinosaur!“ :joy_cat: :joy_cat: :joy_cat: ---------------------------------------------------------------------------------------------------- [21:38:49] Forrest Chang(@fkchang):@jaredcwhite Thanks for what you've done. I keep thinking that I should post a newsletter, but didn't get around it yet ---------------------------------------------------------------------------------------------------- [21:40:29] Forrest Chang(@fkchang):@elia I so want to write my pitches lie that, there's got to be something I can do with the "we'll fry anything" ---------------------------------------------------------------------------------------------------- [21:42:25] Elia Schito(@elia):@fkchang there's a place in Rome that sells "Fried stuff" ("Roba fritta") no one cares what's in it as long as it is fried 🍟 ---------------------------------------------------------------------------------------------------- [21:43:33] Elia Schito(@elia):@fkchang btw, slightly different style but Chuck Testa is still one of the great marketers of our time :bear: https://www.youtube.com/watch?v=LJP1DphOWPs ---------------------------------------------------------------------------------------------------- [21:57:16] Elia Schito(@elia):@/all I'm considering dropping support for ruby 2.0 to start using kwargs in library code, anyone still using Opal with 2.0? ---------------------------------------------------------------------------------------------------- [21:58:38] Mitch VanDuyn(@catmando):don't quite understand - do you opal on client and ruby 2.0 on server? ---------------------------------------------------------------------------------------------------- [21:59:43] Elia Schito(@elia):Yes I mean CRuby/MRI v2.0, by library code I mean the `lib/` dir inside the gem ---------------------------------------------------------------------------------------------------- ############################## [2017-03-16] ############################## [08:41:32] bradder555(@bradder555):Hi all, has anyone tried to use FileReader.readAsText method with opal? ---------------------------------------------------------------------------------------------------- [11:40:41] Mitch VanDuyn(@catmando):@bradder555 u r trying to read a file on the clients file system? ---------------------------------------------------------------------------------------------------- [21:38:05] Bernhard Weichel(@bwl21):@elia what does this mean in particular? 1. which ruby version will be needed to build opal apps (to compile) 2. which language version will be supported by Opal compiler? ---------------------------------------------------------------------------------------------------- [21:49:06] Elia Schito(@elia):@bwl21 it's 1, the version needed to build opal apps ---------------------------------------------------------------------------------------------------- ############################## [2017-03-17] ############################## [01:39:35] bradder555(@bradder555):Hi @catmando, what i was trying to do was read a csv file in a hyper-react component and store in local state, but i've basically written most of it in JS inside the ruby app, the issue that i'm having is running the ruby proc when for the onload callback ---------------------------------------------------------------------------------------------------- [01:41:36] Mitch VanDuyn(@catmando):@bradder555 a little context please... when you say read... are you reading it off the clients disk?... onload of what the page? the file? can you share a code slice? ---------------------------------------------------------------------------------------------------- [01:43:26] bradder555(@bradder555):i considered writing the react component in js and importing into opal so i started writing a proof of concept in pure JS react ```
``` ---------------------------------------------------------------------------------------------------- [01:44:17] Mitch VanDuyn(@catmando):reading... ---------------------------------------------------------------------------------------------------- [01:44:37] bradder555(@bradder555):so you can see, rand_id is type file on change calls file_changed ---------------------------------------------------------------------------------------------------- [01:44:57] bradder555(@bradder555):i'll let you read, there's a bit of additional noise.. ---------------------------------------------------------------------------------------------------- [01:46:34] Mitch VanDuyn(@catmando):okay so does this work? ---------------------------------------------------------------------------------------------------- [01:46:38] bradder555(@bradder555):yeah ---------------------------------------------------------------------------------------------------- [01:46:43] bradder555(@bradder555):no trouble ---------------------------------------------------------------------------------------------------- [01:46:59] bradder555(@bradder555):but achieving the same in opal is a headache ---------------------------------------------------------------------------------------------------- [01:47:01] Mitch VanDuyn(@catmando):gotcha... so you just want to get this converted over to pure ruby / hyperloop ---------------------------------------------------------------------------------------------------- [01:47:38] bradder555(@bradder555):this is my ruby ---------------------------------------------------------------------------------------------------- [01:47:53] bradder555(@bradder555):``` 10 label style:{width: "30em"} do 9 input(id:state.input_id, type:"file", accept:params.file_extensions, style:{width: "100%"}). 8 on(:change) do |e| 7 reader = `new FileReader()` 6 5 #{reader}.onload = 4 #function(){ 3 #var data = Papa.parse(this.result, {header:true}).data 2 #var pp = JSON.stringify(data, null, 2) 1 #} 35 i = Element.find("#" + state.input_id) 1 $global.console.log(i) 2 i.on(:change) do |ev| 3 puts ev 4 end 5 #var i = $("#" + #{state.input_id})[0] 6 #{reader}.readAsText(i.files[0]) 7 8 end # input change 9 end # label ``` ---------------------------------------------------------------------------------------------------- [01:47:54] Mitch VanDuyn(@catmando):(I realize that was your original question :-) just had to get some context ...) ---------------------------------------------------------------------------------------------------- [01:48:23] bradder555(@bradder555):sure, you can see where i've commented stuff out ---------------------------------------------------------------------------------------------------- [01:48:23] Mitch VanDuyn(@catmando):ahhh ---------------------------------------------------------------------------------------------------- [01:48:32] Mitch VanDuyn(@catmando):I see the issue (I think) ---------------------------------------------------------------------------------------------------- [01:48:44] bradder555(@bradder555):so i was using the backticks, but the issue was on the callback ---------------------------------------------------------------------------------------------------- [01:49:00] Mitch VanDuyn(@catmando):you have (reasonably) assumed you can do i.on(:change) to define a callback (actually that is a good idea) ---------------------------------------------------------------------------------------------------- [01:49:23] bradder555(@bradder555):it has undergone a number of permutations and changes ---------------------------------------------------------------------------------------------------- [01:49:24] Mitch VanDuyn(@catmando):but adding .on(:xxx) handlers is a Hyperloop feature ---------------------------------------------------------------------------------------------------- [01:49:40] Mitch VanDuyn(@catmando):but i is just a dom element ---------------------------------------------------------------------------------------------------- [01:49:46] Mitch VanDuyn(@catmando):so you need something like this: ---------------------------------------------------------------------------------------------------- [01:50:23] Mitch VanDuyn(@catmando):Element[i].on_load = lambda (...) { .... } ---------------------------------------------------------------------------------------------------- [01:50:38] Mitch VanDuyn(@catmando):(I think that is the syntax) ---------------------------------------------------------------------------------------------------- [01:50:48] Mitch VanDuyn(@catmando):I would put a `debugger` ---------------------------------------------------------------------------------------------------- [01:51:13] Mitch VanDuyn(@catmando):just before you do the Element[i].on_load = ... ---------------------------------------------------------------------------------------------------- [01:51:34] Mitch VanDuyn(@catmando):when it hits the breakpoint you can see the source generated and screw around in the console until it works ---------------------------------------------------------------------------------------------------- [01:52:05] bradder555(@bradder555):there has been plenty of screwing around lol ---------------------------------------------------------------------------------------------------- [01:52:15] bradder555(@bradder555):a more general question ---------------------------------------------------------------------------------------------------- [01:52:18] Mitch VanDuyn(@catmando):FYI i know this works as we do this in our code... @adamcreekroad is the guy that has done it ---------------------------------------------------------------------------------------------------- [01:52:56] Mitch VanDuyn(@catmando):so the specific Opal question is how to attach a on_load handler using the Element jquery wrapper. ---------------------------------------------------------------------------------------------------- [01:53:22] Mitch VanDuyn(@catmando):but I do like your idea that Hyperloop should add the .on feature to Element for consistency. ---------------------------------------------------------------------------------------------------- [01:53:31] Mitch VanDuyn(@catmando):sorry the general question? ---------------------------------------------------------------------------------------------------- [01:53:41] bradder555(@bradder555):if i have ``` x = lambda {|y| state.state_to_update! y} ``` how would i run it in ``` ` jscallback = function(){ #{x}(event.file[0]) // I'm lost here!! } ` ``` ---------------------------------------------------------------------------------------------------- [01:54:00] Mitch VanDuyn(@catmando):first off ---------------------------------------------------------------------------------------------------- [01:54:32] Mitch VanDuyn(@catmando):it will be `state.state_to_update! y` ---------------------------------------------------------------------------------------------------- [01:55:21] Mitch VanDuyn(@catmando):you code looks right ---------------------------------------------------------------------------------------------------- [01:55:22] bradder555(@bradder555):i noticed that just before you mentioned ---------------------------------------------------------------------------------------------------- [01:56:16] bradder555(@bradder555):no way ---------------------------------------------------------------------------------------------------- [01:56:17] bradder555(@bradder555):lol ---------------------------------------------------------------------------------------------------- [01:56:22] bradder555(@bradder555):i'll give it a try ---------------------------------------------------------------------------------------------------- [01:58:18] Mitch VanDuyn(@catmando):fyi have to sign off now... I know some guys in europe are pretty active on the hyperloop chat room if you ask questions there you will probably get somebody to answer in a few hours... https://gitter.im/ruby-hyperloop/chat ---------------------------------------------------------------------------------------------------- [01:58:38] bradder555(@bradder555):thanks for that Mitch ---------------------------------------------------------------------------------------------------- [01:58:48] bradder555(@bradder555):i'll post in here and let you know how i go ---------------------------------------------------------------------------------------------------- [01:59:00] bradder555(@bradder555):Night ---------------------------------------------------------------------------------------------------- [02:05:40] bradder555(@bradder555):@catmando I can't believe i spent all that time yesterday and it works! thanks for that! Here's what i ended up with: ``` def reader_to_state(content) state.file_contents! content end def render div do label style:{width: "30em"} do input(id:state.input_id, type:"file", accept:params.file_extensions, style:{width: "100%"}). on(:change) do |e| temp = lambda {|x| reader_to_state(x)} ` reader = new FileReader() reader.onload = function(){ var data = Papa.parse(this.result, {header:true}).data var pp = JSON.stringify(data, null, 2) #{temp}(pp) } var i = $("#" + #{state.input_id})[0] reader.readAsText(i.files[0]) ` end # input change end # label end # div end # render ``` ---------------------------------------------------------------------------------------------------- [02:06:47] bradder555(@bradder555):i was at 90% there for most of yesterday! it seems odd that i couldn't use reader_to_state directly and had to wrap up in a local lambda, but it works i think i'll leave it for now ---------------------------------------------------------------------------------------------------- [02:09:23] Mitch VanDuyn(@catmando):I would think this would work too: ---------------------------------------------------------------------------------------------------- [02:09:27] Mitch VanDuyn(@catmando): def reader_to_state(content) state.file_contents! content end def render div do label style:{width: "30em"} do input(id:state.input_id, type:"file", accept:params.file_extensions, style:{width: "100%"}). on(:change) do |e| temp = lambda {|x| reader_to_state(x)} ` reader = new FileReader() reader.onload = function(){ var data = Papa.parse(this.result, {header:true}).data var pp = JSON.stringify(data, null, 2) #{state.file_contents!}(pp) } var i = $("#" + #{state.input_id})[0] reader.readAsText(i.files[0]) ` end # input change end # label end # div end # render ---------------------------------------------------------------------------------------------------- [02:11:05] Mitch VanDuyn(@catmando):best tool I have found again is stick a debugger line just before and see what code is generated that usually gives good clues ---------------------------------------------------------------------------------------------------- [02:11:30] Mitch VanDuyn(@catmando):but glad you worked it out ---------------------------------------------------------------------------------------------------- ############################## [2017-03-20] ############################## [16:39:30] Mitch VanDuyn(@catmando):Any hints on precompiling / compressing Opal code in a gem? ---------------------------------------------------------------------------------------------------- [16:55:49] Ilya Bylich(@iliabylich):@catmando If your code is static you can simply put it on CDN ---------------------------------------------------------------------------------------------------- [17:05:11] Mitch VanDuyn(@catmando):@iliabylich thanks... what I am thinking is that I would precompile and pre-minify our hyperloop gems. That way when you used the gems during development you would not get this big payload. Understand that in production it happens automatically. I just want to pre-minify it. Also it would get rid of this annoying massive amounts of source maps which we can't get rid of. Also it would make initial boot time quicker. Right now it takes about 30 seconds for the first boot of the server as it compiles all that stuff. ---------------------------------------------------------------------------------------------------- [23:13:42] Forrest Chang(@fkchang):@catmando I'm assuming you have source maps turned off? I would like the ability to download one big sourcemap file - they're handy, instead of the gazillion that come out ---------------------------------------------------------------------------------------------------- [23:15:18] Mitch VanDuyn(@catmando):yes I have them turned off, but it still seems to want to generate them (perhaps just not download them?) I'm not sure. Perhaps its not source maps at all, but just the initial compile time. Either case precompiling gems would be a big help speed wise. ---------------------------------------------------------------------------------------------------- ############################## [2017-03-21] ############################## [18:37:03] Forrest Chang(@fkchang): @catmando u should use opal_hot_reloader - load time is only large at the beginning and then it's near instantaneous. Bear in mind certain practices are less hot reload friendly, but if you generally do good OO programming it's a good fit. One of these days, I'll write a blog post on that ---------------------------------------------------------------------------------------------------- [18:38:29] Forrest Chang(@fkchang):actually currently really enjoying the hot reloader on an older opal app that doesn't have hyper-react, which largely lends itself hot reload friendly code simply by nature of react's structure. That said, objects, methods go a long way to making reload friendly code ---------------------------------------------------------------------------------------------------- [21:34:19] Forrest Chang(@fkchang):On that note: I updated https://rubygems.org/gems/opal_hot_reloader to popup and alert window showing reload error. It'd be nice to know when the hot reload failed due to errors, w/o having to open the JS console ---------------------------------------------------------------------------------------------------- ############################## [2017-03-22] ############################## [00:23:02] Elia Schito(@elia):@catmando I have a file named `opal-collapsed.js.erb` with this content: ``` //= depend_on opal <%= Rails.application.assets['opal'].to_s %> ``` which does just that and it respects any configuration you might have set on Opal::Config. ---------------------------------------------------------------------------------------------------- [00:23:50] Mitch VanDuyn(@catmando):woah... so where would I stick that in a gem? ---------------------------------------------------------------------------------------------------- [00:24:06] Mitch VanDuyn(@catmando):okay ---------------------------------------------------------------------------------------------------- [00:24:28] Mitch VanDuyn(@catmando):so if in my gem I have a file like hyperloop-collapsed.js.erb ---------------------------------------------------------------------------------------------------- [00:24:30] Elia Schito(@elia):wouldn't solve the problem of the very first compilation, if you do precompile simething to js be sure to warn users on which configuration you're using ---------------------------------------------------------------------------------------------------- [00:24:52] Mitch VanDuyn(@catmando):<%= Rails.application.assets['... ---------------------------------------------------------------------------------------------------- [00:24:56] Mitch VanDuyn(@catmando):%> ---------------------------------------------------------------------------------------------------- [00:25:09] Elia Schito(@elia):@catmando that works in a Rails app, possibly can be adapted to a sprockets app of course ---------------------------------------------------------------------------------------------------- [00:26:38] Elia Schito(@elia):btw I pondered many times the possibility of shipping precompiled js of the core + single files for the stdlib with precompiled maps but always feared possible configuration conflicts ---------------------------------------------------------------------------------------------------- [00:26:59] Mitch VanDuyn(@catmando):okay... so I am figuring a rake task of some sort that you would run before releasing them gem ---------------------------------------------------------------------------------------------------- [00:27:12] Elia Schito(@elia):that would do ---------------------------------------------------------------------------------------------------- [00:27:32] Elia Schito(@elia):we have `rake dist` in the opal repo for producing CDN files ---------------------------------------------------------------------------------------------------- [00:28:04] Mitch VanDuyn(@catmando):yes. Same idea but you would before release of a gem... ---------------------------------------------------------------------------------------------------- [00:28:39] Mitch VanDuyn(@catmando):I'll have a look at that. Thanks! ---------------------------------------------------------------------------------------------------- [00:29:05] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- ############################## [2017-03-23] ############################## [18:11:58] Forrest Chang(@fkchang):I hand required what I think require_tree does and it works fine, so I have no idea what's broken and I only get a sprockets error that it can't find application.js ---------------------------------------------------------------------------------------------------- [18:12:32] Elia Schito(@elia):@fkchang I think in more recent versions of sprockets extensions cannot be chained arbitrarily anymore, I thinks that's true for sprockets 3+ ---------------------------------------------------------------------------------------------------- [18:13:09] Elia Schito(@elia):@fkchang also if you wanna share the application.js contents maybe I can identify the problem ---------------------------------------------------------------------------------------------------- [18:14:02] Elia Schito(@elia):> have any tips on how I can hand run an opal command to simulate what opal-rails does? From rails console you can try: `Rails.application.assets['application.js'].to_s` ---------------------------------------------------------------------------------------------------- [19:50:59] Forrest Chang(@fkchang):and there's my answer, nevermind ---------------------------------------------------------------------------------------------------- [19:54:29] Forrest Chang(@fkchang):Figured it out, had a bad file in the app/assets/javascripts dir that was not an rb file ---------------------------------------------------------------------------------------------------- [20:03:15] Forrest Chang(@fkchang):And my original assumption is correct application.js.rb.erb does "just work", I just broke my opal stuff in general w/the bad file ---------------------------------------------------------------------------------------------------- [01:52:37] Forrest Chang(@fkchang):@elia do you how to make opal-rails recognize an application.js.rb.erb ? Or whatever equivalent way. I want some opal code to run only in develpment ---------------------------------------------------------------------------------------------------- [11:08:22] Mitch VanDuyn(@catmando):U can certainly do it inside application.js ---------------------------------------------------------------------------------------------------- [11:08:53] Mitch VanDuyn(@catmando):I.e Foo.rb.erb ---------------------------------------------------------------------------------------------------- [14:08:50] Jamie Gaskins(@jgaskins):@fkchang It shouldn't be hitting Opal while it's in `.erb`. It should pipe it through ERB first, then output a `.rb` asset, which _then_ hits Opal. ---------------------------------------------------------------------------------------------------- [16:33:16] Forrest Chang(@fkchang):@catmando @jgaskins I was hoping application.js.rb.erb would "just work", it's possible it might and that I broke something else. I'm at a state now where my application.js.rb won't compile now, so I must've broken something somewhere, unfortunately I can't get a compile error, just a sprockets message saying it can't find application.js ---------------------------------------------------------------------------------------------------- [16:34:16] Forrest Chang(@fkchang):@elia have any tips on how I can hand run an opal command to simulate what opal-rails does? ---------------------------------------------------------------------------------------------------- [17:34:43] Forrest Chang(@fkchang):@/all anyone know how require_tree works? I hand required all the js.rb files to include require_tree on the subdirectories and it works, but going back to require_tree '.' and it won't compile ---------------------------------------------------------------------------------------------------- [17:53:10] Mitch VanDuyn(@catmando):it requires in order all the files in the current directory including the file you are in. ---------------------------------------------------------------------------------------------------- [17:53:39] Mitch VanDuyn(@catmando):can I ask what the bigger problem you are trying to solve is? ---------------------------------------------------------------------------------------------------- [18:11:30] Forrest Chang(@fkchang):I broke something, application.js won't get compiled ---------------------------------------------------------------------------------------------------- ############################## [2017-03-24] ############################## [21:47:42] Mitch VanDuyn(@catmando):Does anybody know of problems with Opal.use_gem in rails 5.1 ? ---------------------------------------------------------------------------------------------------- [21:48:25] Mitch VanDuyn(@catmando):I am getting ---------------------------------------------------------------------------------------------------- [21:48:53] Mitch VanDuyn(@catmando):```text Gem Load Error is: can't find gem activesupport Backtrace for gem load error is: /Users/rmitchellvanduyn/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/opal-0.10.3/lib/opal/paths.rb:48:in `require_paths_for_gem' /Users/rmitchellvanduyn/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/opal-0.10.3/lib/opal/paths.rb:51:in `block in require_paths_for_gem' /Users/rmitchellvanduyn/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/opal-0.10.3/lib/opal/paths.rb:50:in `each' /Users/rmitchellvanduyn/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/opal-0.10.3/lib/opal/paths.rb:50:in `require_paths_for_gem' /Users/rmitchellvanduyn/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/opal-0.10.3/lib/opal/paths.rb:39:in `use_gem' ``` when I do a Opal.use_gem('mutations') which worked fine in 5.0 ---------------------------------------------------------------------------------------------------- [21:50:49] Elia Schito(@elia):Same rubygem version? ---------------------------------------------------------------------------------------------------- [22:27:43] Mitch VanDuyn(@catmando):Yes ---------------------------------------------------------------------------------------------------- [22:27:58] Mitch VanDuyn(@catmando):Mutations 8.1 ---------------------------------------------------------------------------------------------------- [22:28:27] Elia Schito(@elia):Does `Opal.use_gem('activesupport')` works? ---------------------------------------------------------------------------------------------------- [22:30:04] Mitch VanDuyn(@catmando):I wonder if it's specific to activesupport. Hmmm I'll dig in tonight ---------------------------------------------------------------------------------------------------- [22:31:04] Mitch VanDuyn(@catmando):I will try that, but u know I'm using Opal active support to plug that hole. Maybe that's the problem ---------------------------------------------------------------------------------------------------- [22:32:38] Elia Schito(@elia):looks like it's looking for mutations' deps ---------------------------------------------------------------------------------------------------- ############################## [2017-03-28] ############################## [18:50:37] Forrest Chang(@fkchang):@elia or @/all need tips upgrading opal 0.8 to 0.10, I first had missing load_assets for Opal sprockets, added the opal-sprockets gem, now have uninitialized constant Opal::Config ---------------------------------------------------------------------------------------------------- [20:19:04] Elia Schito(@elia):@fkchang can you give some more context? `Opal::Config` is available in 0.10, maybe it's a missing require ---------------------------------------------------------------------------------------------------- [21:58:38] Forrest Chang(@fkchang):@elia I only changed gems to be more recent and added opal-sprockets, I didn't change any requires, do I need to add a require, though it's in opal-rails ---------------------------------------------------------------------------------------------------- [21:58:46] Forrest Chang(@fkchang):``` NameError: uninitialized constant Opal::Config ~/.rvm/gems/ruby-2.2.1@retail-data/gems/opal-rails-0.9.0/lib/opal/rails/engine.rb:35:in `block (2 levels) in ' ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-04-04] ############################## [21:09:33] Mitch VanDuyn(@catmando):@fkchang @elia @/all : how do i get eval to work in irb mode? ```ruby eval("x = 12") eval("x") ``` results in undefined x for main ---------------------------------------------------------------------------------------------------- [21:09:47] Mitch VanDuyn(@catmando):looks like there is a config setting or something that I might need? ---------------------------------------------------------------------------------------------------- [21:13:32] Elia Schito(@elia):@catmando I'm sure Opal::Compiler has a flag to enable irb mode, but am AFK right now and can't check ---------------------------------------------------------------------------------------------------- [21:17:24] Mitch VanDuyn(@catmando):yes the compiler does... ---------------------------------------------------------------------------------------------------- [21:17:48] Mitch VanDuyn(@catmando):just wondering if there is a way to do it from eval? I guess I can compile, and then run the js like eval would? ---------------------------------------------------------------------------------------------------- [21:40:11] Elia Schito(@elia):Yes eval uses the compiler internally, check its source in stdlib/opal-parser.rb ---------------------------------------------------------------------------------------------------- ############################## [2017-04-06] ############################## [12:34:31] Frederic ZINGG(@fzingg):Hi all, I have a question about Rails controller and Opal: When generating a controller with the command `rails g controller controllername` , an Opal file `controllername.js.rb` is generated in `app/assets/javascript`. is there an option to avoid the generation of this file ? ---------------------------------------------------------------------------------------------------- [17:11:59] Elia Schito(@elia):@fzingg you can either add `--skip-assets` to skip all generated assets or just `--skip-javascripts` to skip just that opal file (tested on rails 4.2) ---------------------------------------------------------------------------------------------------- [17:13:12] Frederic ZINGG(@fzingg):Ok, thanks, that was simple. i will test it on Rails 5. ---------------------------------------------------------------------------------------------------- [17:14:22] Elia Schito(@elia):@fzingg if you get the time would be great to document this on the readme, although it's a rails thing I think it could be useful to others as well 🙂 ---------------------------------------------------------------------------------------------------- [17:17:54] Frederic ZINGG(@fzingg):On opal or opal-rails ? ---------------------------------------------------------------------------------------------------- [17:18:03] Elia Schito(@elia):opal-rails 👍🏼 ---------------------------------------------------------------------------------------------------- ############################## [2017-04-07] ############################## [23:03:09] Forrest Chang(@fkchang):@catmando assuming u got ur eval thing taken care of ---------------------------------------------------------------------------------------------------- ############################## [2017-04-08] ############################## [18:41:29] Frederic ZINGG(@fzingg):HI, i'm trying to run a simple pure JS file example using `opal-browser`. i have included those 2 files: ``` ``` And my Opal component is : ``` But I always have the console error: `uninitialized constant Browser::Socket` Could you help me guys ? ---------------------------------------------------------------------------------------------------- [22:19:58] Elia Schito(@elia):@fzingg try adding a require for it at the top of the script ---------------------------------------------------------------------------------------------------- [22:24:47] Frederic ZINGG(@fzingg):Adding `require 'browser/socket'` at the top of script do not work for me. ---------------------------------------------------------------------------------------------------- [22:26:49] Elia Schito(@elia):@fzingg try with `require 'browser'` too ---------------------------------------------------------------------------------------------------- [22:28:45] Elia Schito(@elia):@fzingg nay, browser/socket is just not included in that bundle ---------------------------------------------------------------------------------------------------- [22:29:39] Elia Schito(@elia):http://cdn.opalrb.org/opal/0.10.1/external/opal-browser-0.2.0.js ---------------------------------------------------------------------------------------------------- [22:31:44] Frederic ZINGG(@fzingg):Even with switching the bundle still no result, maybe I do something wrong: ``` ``` ---------------------------------------------------------------------------------------------------- [22:32:20] Elia Schito(@elia):sorry, I just linked the file you were using :) ---------------------------------------------------------------------------------------------------- [22:35:36] Frederic ZINGG(@fzingg):ok, so when you find and have time could you tell me what is the correct bundle ? ---------------------------------------------------------------------------------------------------- [22:35:42] Elia Schito(@elia):if you want to build that file yourself: `env RUBYOPT="-ropal-browser" opal -l -rbrowser/socket > browser-socket.js ` ---------------------------------------------------------------------------------------------------- [22:36:17] Frederic ZINGG(@fzingg):ok, no problem, I will do that. Thanks. ---------------------------------------------------------------------------------------------------- [22:36:25] Elia Schito(@elia):👍🏼 ---------------------------------------------------------------------------------------------------- [23:04:14] Frederic ZINGG(@fzingg):in my rails ENV with the GEM `opal-browser (0.2.0)` I ran 2 commands: ``` env RUBYOPT="-ropal-browser" opal -l -rbrowser > opal-browser.js env RUBYOPT="-ropal-browser" opal -l -rbrowser/socket > opal-browser-socket.js ``` Then include the 2 JS files and add the `require 'browser'` and `require 'browser/socket` but I got in the console: ``` Uncaught $ {name: "inherited", message: "undefined method `inherited' for Native", args: Array(1), stack: "↵ at a [as $new] (https://rawgit.com/ruby-hyper…rloop/hyperloopJS-chatapp/opal-browser.js:7418:8)"} ``` ---------------------------------------------------------------------------------------------------- [23:05:03] Frederic ZINGG(@fzingg):And: ``` undefined method `name_for' for Browser::Event ``` Do you have an idea what i did wrong? ---------------------------------------------------------------------------------------------------- ############################## [2017-04-11] ############################## [20:37:06] Mitch VanDuyn(@catmando):I am trying to build ObjectSpace.each_object. I am successfully enumerating all js objects, and sorting them out in opal objects ---------------------------------------------------------------------------------------------------- [20:37:27] Mitch VanDuyn(@catmando):the only problem is for every class created I get what appears to be a dummy object ---------------------------------------------------------------------------------------------------- [20:37:38] Mitch VanDuyn(@catmando):it has an $$id value ---------------------------------------------------------------------------------------------------- [20:37:50] Mitch VanDuyn(@catmando):and a $$class value (key) ---------------------------------------------------------------------------------------------------- [20:38:01] Mitch VanDuyn(@catmando):but no instance variables or anything else ---------------------------------------------------------------------------------------------------- [20:38:25] Elia Schito(@elia):@catmando are you using some JS api? (this is the curious question :smile: ) ---------------------------------------------------------------------------------------------------- [20:38:37] Mitch VanDuyn(@catmando):is there some general way to filter out these "dummy guys" ---------------------------------------------------------------------------------------------------- [20:39:05] Elia Schito(@elia):wrt dummy obj those two are the only properties you've found on them? ---------------------------------------------------------------------------------------------------- [20:39:15] Mitch VanDuyn(@catmando):no I am following this SO ---------------------------------------------------------------------------------------------------- [20:39:26] Mitch VanDuyn(@catmando):http://stackoverflow.com/questions/8409577/get-all-the-objects-dom-or-otherwise-using-javascript ---------------------------------------------------------------------------------------------------- [20:39:51] Mitch VanDuyn(@catmando):here is code so far: ---------------------------------------------------------------------------------------------------- [20:39:57] Mitch VanDuyn(@catmando):```ruby module ObjectSpace def self.each_object(klass) objs = [] matching_objs = [] %x{ var walk_the_object = function(js_obj) { var keys = Object.keys(js_obj) //get all own property names of the object keys.forEach( function ( key ) { var value = js_obj[ key ]; // get property value // if the property value is an object... if ( value && typeof value === 'object' ) { // if we don't have this reference, and its an object of the class we want if ( #{objs}.indexOf( value ) < 0 ) { #{objs}.push( value ); // store the reference if ( Object.keys(value).indexOf('$$class') >= 0 && value.$$class == #{klass} ) { #{matching_objs}.push ( value ) } walk_the_object(value) // traverse all its own properties } } }) } walk_the_object(window) } matching_objs end end ``` ---------------------------------------------------------------------------------------------------- [20:41:13] Elia Schito(@elia):interesting, the only thing left out would be objects trapped in closure vars right? ---------------------------------------------------------------------------------------------------- [20:41:32] Mitch VanDuyn(@catmando):I guess so... and I guess that is a bit of problem :-( ---------------------------------------------------------------------------------------------------- [20:42:48] Elia Schito(@elia):don't tell me, yesterday I was struggling to find a way to have weak refs in javascript (and it's impossible) ---------------------------------------------------------------------------------------------------- [20:48:10] Mitch VanDuyn(@catmando):anyway @elia do you understand this odd dummy instances? ---------------------------------------------------------------------------------------------------- [20:48:20] Mitch VanDuyn(@catmando):they seem to be created when you create the class ---------------------------------------------------------------------------------------------------- [20:48:42] Mitch VanDuyn(@catmando):but without invoking the initializer ---------------------------------------------------------------------------------------------------- [20:49:01] Elia Schito(@elia):@catmando those two are the only properties you've found on them? ---------------------------------------------------------------------------------------------------- [20:50:09] Elia Schito(@elia):Also I have a dejavu… like they're related to scope and get those props by error and are not real objects ---------------------------------------------------------------------------------------------------- [20:50:24] Mitch VanDuyn(@catmando):n $$class : a $$id : 193364 constructor : $Foo() __proto__: t ---------------------------------------------------------------------------------------------------- [20:50:37] Mitch VanDuyn(@catmando):```text n $$class : a $$id : 193364 constructor : $Foo() __proto__: t ``` ---------------------------------------------------------------------------------------------------- [20:52:03] Elia Schito(@elia):`obj.$$class.$$name` ? ---------------------------------------------------------------------------------------------------- [20:52:48] Elia Schito(@elia):another way would be to walk up the `__proto__` to see if you find anything familiar ---------------------------------------------------------------------------------------------------- [20:54:12] Mitch VanDuyn(@catmando):"Foo" ---------------------------------------------------------------------------------------------------- [20:54:41] Mitch VanDuyn(@catmando):its basically an unitialized copy of Foo ---------------------------------------------------------------------------------------------------- [20:55:06] Elia Schito(@elia):looks more like an instance of Foo ---------------------------------------------------------------------------------------------------- [20:55:42] Elia Schito(@elia):or more likely its $$alloc property prototype ---------------------------------------------------------------------------------------------------- [20:56:11] Elia Schito(@elia):i.e. the JS constructor that's stored inside the $$alloc property of any class ---------------------------------------------------------------------------------------------------- [20:57:05] Elia Schito(@elia):klass.$new is basically `obj = new klass.$$alloc; obj.$initialize(); return obj;` ---------------------------------------------------------------------------------------------------- [21:01:06] Mitch VanDuyn(@catmando):right sorry, I meant instance ---------------------------------------------------------------------------------------------------- [21:01:26] Mitch VanDuyn(@catmando):so its like an klass.$$alloc was called, without calling initialize. ---------------------------------------------------------------------------------------------------- [21:01:45] Mitch VanDuyn(@catmando):its also displayed as "n" in the JS console ---------------------------------------------------------------------------------------------------- [21:02:11] Elia Schito(@elia):that could be due to minification ---------------------------------------------------------------------------------------------------- [21:02:46] Mitch VanDuyn(@catmando):where as a real Foo instance is displayed as "Foo" ---------------------------------------------------------------------------------------------------- [21:03:10] Mitch VanDuyn(@catmando):nope no minification... I am compiling these on the fly with a new "playground" type console I am building. ---------------------------------------------------------------------------------------------------- [21:03:39] Elia Schito(@elia):not even of the corelib? ---------------------------------------------------------------------------------------------------- [21:03:49] Mitch VanDuyn(@catmando):sure ---------------------------------------------------------------------------------------------------- [21:03:54] Mitch VanDuyn(@catmando):okay understand ---------------------------------------------------------------------------------------------------- [21:09:31] Mitch VanDuyn(@catmando):okay its the value of $$proto of the class.... ---------------------------------------------------------------------------------------------------- [21:09:54] Mitch VanDuyn(@catmando):in otherwords each class has a $$proto key which points to this "dummy" instance. ---------------------------------------------------------------------------------------------------- [21:10:00] Mitch VanDuyn(@catmando):I can deal with that ---------------------------------------------------------------------------------------------------- [21:10:08] Elia Schito(@elia):👍🏼 that is the same of $$alloc.prototype ---------------------------------------------------------------------------------------------------- [21:10:30] Elia Schito(@elia):it's the JS prototype of its instances ---------------------------------------------------------------------------------------------------- ############################## [2017-04-12] ############################## [01:36:14] VinceG3(@VinceG3):Hey, I'm trying to get `HTTP.post`calls working, it wants to send preflight OPTIONS calls, and Sinatra isn't set up to handle them. Has anyone figured out how to get opal-jquery to not send those? ---------------------------------------------------------------------------------------------------- [19:28:02] VinceG3(@VinceG3):easiest solution turned out to be doing this in Sinatra: ---------------------------------------------------------------------------------------------------- [19:28:06] VinceG3(@VinceG3):``` options '*' do response['Access-Control-Allow-Origin'] = '*' response['Access-Control-Allow-Methods'] = 'POST' response['Access-Control-Allow-Headers'] = 'Content-Type' '' end ``` ---------------------------------------------------------------------------------------------------- [23:37:32] Jamie Gaskins(@jgaskins):@VinceG3 Check out the `rack-cors` gem if you want to customize your CORS preflights. ---------------------------------------------------------------------------------------------------- [23:37:58] Jamie Gaskins(@jgaskins):We use it at work. Its DSL is pretty great. It works with any Rack app. ---------------------------------------------------------------------------------------------------- ############################## [2017-04-13] ############################## [02:41:19] VinceG3(@VinceG3):@jgaskins thanks! ---------------------------------------------------------------------------------------------------- ############################## [2017-04-19] ############################## [23:25:09] Elia Schito(@elia):@gisborne was replying to your mail just right now :smile: ---------------------------------------------------------------------------------------------------- [23:25:32] Guyren Howe(@gisborne):Give me good news… :-) ---------------------------------------------------------------------------------------------------- [23:25:59] Elia Schito(@elia):@gisborne the easiest thing you could try is: `opal -ropal -ropal-parser -cAL > /tmp/opal.js ` and then load the result into PG and see if anything brakes ---------------------------------------------------------------------------------------------------- [23:27:03] Guyren Howe(@gisborne):Right in the middle of deploying some code, but I'll try it tonight. What all are you thinking with the above? ---------------------------------------------------------------------------------------------------- [23:28:59] Elia Schito(@elia):@gisborne please let me know how it goes and how you load a js file into PG ---------------------------------------------------------------------------------------------------- [23:31:03] Elia Schito(@elia):Anyway once /tmp/opal.js is loaded you should be able to call `Opal.compile("puts 'hello pg!'")` ---------------------------------------------------------------------------------------------------- [23:24:38] Guyren Howe(@gisborne):Hi, I'm wondering if it's practical to use Opal to write Postgres stored procedures under PLV8? So Postgres has a (fairly bare-bones) V8 environment, but with no libraries or any such. Is it practical to get simple, even minimal Ruby compiling to run in that environment? ---------------------------------------------------------------------------------------------------- ############################## [2017-04-20] ############################## [00:33:13] Guyren Howe(@gisborne):Many failings. ---------------------------------------------------------------------------------------------------- [00:39:22] Guyren Howe(@gisborne):I think the quoting is mucking up. Stand by. ---------------------------------------------------------------------------------------------------- [00:56:16] Guyren Howe(@gisborne):Trying now to define a function that returns Opal, by adding return Opal; at the end, I can define the function but when I try to run it, I get "Opal is not defined" on line 2063: Opal.loaded(["corelib/runtime"]); ---------------------------------------------------------------------------------------------------- [03:22:35] Guyren Howe(@gisborne):I don't think this is going to work. Let me put the idea into your heads, though. PLV8 already supports several transpiler options. It would be amazing if you brought this option to Postgres. ---------------------------------------------------------------------------------------------------- [13:01:40] Ilya Bylich(@iliabylich):@gisborne I've changed the code of `plv8` a little bit locally and got a `plopal` PG language (just like `plcoffee` for coffeescript) that almost works. It looks like: ``` sql CREATE EXTENSION plopal; DO LANGUAGE plopal $$ foo = %w(f o o).join `plv8.elog(INFO, foo)` $$; ``` But its performance is really bad. `plv8` uses a compiler (`coffee-script.js` / `opal-parser.js`) internally when you declare a PG function. It assumes that produced JS has no dependencies, it's true for CoffeScript/LiveScript (`plv8` has both of them embedded by default), but not for Opal. Opal is not just a transpiler, it has a runtime and a corelib, both of them must be included into the execution context. Maybe it's possible to optimize it by having 2 separated V8 contexts: one for compiling to js (must have a runtime + corelib + parser inside) and one for js evaluation (requires only runtime + corelib). But atm `plv8` doesn't expect an external compiler to have any runtime dependencies. Rewritting seems possible, but it requires a lot of time. ---------------------------------------------------------------------------------------------------- [14:36:02] Guyren Howe(@gisborne):You, my friend, whoever you are, are amazing. ---------------------------------------------------------------------------------------------------- [14:36:36] Guyren Howe(@gisborne):Possibly relevant: http://adpgtech.blogspot.com/2013/03/loading-useful-modules-in-plv8.html ---------------------------------------------------------------------------------------------------- ############################## [2017-04-21] ############################## [00:37:35] Guyren Howe(@gisborne):I also considered trying to glom together a function that returned the compiled text, as the Postgres function-defining mechanism ultimately takes the text of the function as a string. ---------------------------------------------------------------------------------------------------- [01:58:25] Guyren Howe(@gisborne):That failed also. 🙃 ---------------------------------------------------------------------------------------------------- [08:14:33] Elia Schito(@elia):@gisborne compiling once and storing the resulting js looks like a better approach as the compilation is very costly ---------------------------------------------------------------------------------------------------- [13:36:47] Guyren Howe(@gisborne):Certainly. ---------------------------------------------------------------------------------------------------- [20:20:25] Mitch VanDuyn(@catmando):@gisborne not sure if this is relevant to your project but the ruby-hyperloop project compiles ahead in three places: The hyperloop-config gem precompiles all opal gems, and the hyperloop-js (standalone hyperloop in the browser) precompiles and minimizes all the the hyperloop gems into a single js file. The hyper-console gem also precompiles the console code into a single JS file. So if we can help let us know over at https://gitter.im/ruby-hyperloop/chat site or private IM me... ---------------------------------------------------------------------------------------------------- [21:46:06] Guyren Howe(@gisborne):Thanks for that. I don't see a hyperloop-config gem, but I'm about to try the minimized compiler. ---------------------------------------------------------------------------------------------------- [22:22:50] Guyren Howe(@gisborne):Yeah, that still doesn't quite work. I tried to change it from global.Opal to plv8.global and was able to get it to define a function. At the end of the function I put plv8.Opal.compile(src), but it complains that Opal has no such method. ---------------------------------------------------------------------------------------------------- ############################## [2017-04-22] ############################## [14:47:38] Elia Schito(@elia):@/all just released opal-rails v0.9.2 with support for the latest sprockets-rails which should make it easier to add it to a rails 5 app (previoudly a downgrade of sprockets-rails was needed) ---------------------------------------------------------------------------------------------------- [14:49:04] Elia Schito(@elia):https://github.com/opal/opal-rails/releases/tag/v0.9.2 ---------------------------------------------------------------------------------------------------- [14:59:23] Mitch VanDuyn(@catmando)::clap: ---------------------------------------------------------------------------------------------------- [15:01:38] Elia Schito(@elia):@catmando :smile: – please let me know if it works ok with hyperloop! ---------------------------------------------------------------------------------------------------- ############################## [2017-04-23] ############################## [20:06:15] Steve Tuckner(@boberetezeke)::clap: ---------------------------------------------------------------------------------------------------- ############################## [2017-05-01] ############################## [00:55:00] Elia Schito(@elia):@/all v0.11.0.rc1 is out! https://rubygems.org/gems/opal/versions/0.11.0.rc1 ---------------------------------------------------------------------------------------------------- [18:26:44] Forrest Chang(@fkchang):@meh are you there? I summon thee! ---------------------------------------------------------------------------------------------------- [19:36:47] Adam(@adamcreekroad):So I saw that opal-rails 0.9.2 was said to being working with sprockets-rails > 3, but for me it does not work with opal-rails in production mode. Been driving myself crazy for the past two days trying to figure out why I couldn't get stuff to precompile (a hyperloop project). The problem was traced down to `Rails.application.assets` was nil if `config.assets.precompile` is set to false. It seems a lot of stuff depends on that being there. ---------------------------------------------------------------------------------------------------- [19:50:16] Elia Schito(@elia):@adamcreekroad did you fix it somehow or is it still not working? Do you have steps or an app I can use to reproduce the problem? ---------------------------------------------------------------------------------------------------- [19:52:45] Adam(@adamcreekroad):@elia I had to revert back to sprockets-rails 2.3.3. All you need to do to reproduce is set `config.assets.precompile = false` in your environment and then do a `javascript_include_tag` and you should hit the problem. ---------------------------------------------------------------------------------------------------- [19:54:36] Elia Schito(@elia):thanks ---------------------------------------------------------------------------------------------------- [19:55:59] Adam(@adamcreekroad):no problem! ---------------------------------------------------------------------------------------------------- [19:56:40] Elia Schito(@elia):@adamcreekroad what's the point of setting precompile to nil? from what I see it starts as an array… ---------------------------------------------------------------------------------------------------- [19:57:41] Adam(@adamcreekroad):I'm sorry, I meant `config.assets.compile = false`. It's been a long day lol ---------------------------------------------------------------------------------------------------- [19:58:04] Elia Schito(@elia):no prob :) ---------------------------------------------------------------------------------------------------- ############################## [2017-05-03] ############################## [22:35:44] Elia Schito(@elia):this is a good news https://chromium.googlesource.com/chromium/src.git/+/550f56c09c04dc7d09f958d41e832d3c94069978 ---------------------------------------------------------------------------------------------------- [22:51:16] meh.(@meh):took them 3 years to notice it ---------------------------------------------------------------------------------------------------- [22:51:19] meh.(@meh):a week to fix ---------------------------------------------------------------------------------------------------- [22:51:45] Elia Schito(@elia):indeed ---------------------------------------------------------------------------------------------------- ############################## [2017-05-04] ############################## [12:10:30] Adam(@adamcreekroad):That is incredible news ---------------------------------------------------------------------------------------------------- [15:39:51] Mitch VanDuyn(@catmando):I can hardly wait! ---------------------------------------------------------------------------------------------------- [17:51:27] Elia Schito(@elia):Will be in the next release https://bugs.chromium.org/p/chromedriver/issues/detail?id=1114#c28 ---------------------------------------------------------------------------------------------------- [17:53:34] Elia Schito(@elia):@adamcreekroad the opal-rails fix is more difficult than expected, I'll probably yank that version or release a new version with a post install message that warns about the issue and suggests a downgrade ---------------------------------------------------------------------------------------------------- ############################## [2017-05-06] ############################## [15:33:54] Elia Schito(@elia):@/all I just yanked v0.9.2 of opal-rails, I think I need a major update on opal-sprockets before supporting sprockets-rails v3 ---------------------------------------------------------------------------------------------------- ############################## [2017-05-07] ############################## [10:53:37] Frederic ZINGG(@fzingg):@elia @adamcreekroad I updated Hyperloop in my Rails app, so now comes with Opal v0.9.1. But when tried to run my Rails app with RAILS_ENV=production still the same error. Just for my information, does this hyperloop issue linked to this sprockets-rails support ? ---------------------------------------------------------------------------------------------------- [11:41:19] Elia Schito(@elia):@fzingg is your sprockets-rails >= v3? if yes, they're linked ---------------------------------------------------------------------------------------------------- [11:42:08] Frederic ZINGG(@fzingg):@elia my sprocket-rails is 2.3.3 ---------------------------------------------------------------------------------------------------- [11:43:54] Elia Schito(@elia):No, then it should be something else, also opal 0.9 is kinda old… ---------------------------------------------------------------------------------------------------- [11:45:00] Frederic ZINGG(@fzingg):@elia My opal is 0.10.4 ---------------------------------------------------------------------------------------------------- ############################## [2017-05-08] ############################## [20:56:47] Elia Schito(@elia):@adamcreekroad opal-rails 0.9.3 is out :wink: please let me know if it fixes your issue ---------------------------------------------------------------------------------------------------- [21:20:48] Elia Schito(@elia):@/all new releases! opal 0.10.4 :white_check_mark: / opal-sprockets 0.4.1 :white_check_mark: / opal-rails 0.9.3 :white_check_mark: Most notable changes are: - added support for sprockets-rails v3 - in rails bootstrapping code is now loaded in the `onload` attribute making it possible to use `async` Please try the new versions on your apps and report anything that goes wrong 🤓 ---------------------------------------------------------------------------------------------------- [21:29:00] Adam(@adamcreekroad):Awesome! I'll test it out tomorrow ---------------------------------------------------------------------------------------------------- ############################## [2017-05-09] ############################## [09:24:10] Michael(@MichaelSp):Congratulations to everyone contributing to this version! Thanks @elia ---------------------------------------------------------------------------------------------------- ############################## [2017-05-10] ############################## [13:06:40] Nigel Rantor(@wiggly):Not entirely sure this is the right place - wondering if anyone has an opinion on whether opal-browser should be used or not? It seems like it hasn't been touched in a while and I am having problems getting AJAX requests to work using authentication. Should I be using the native objects instead? Is there a better library that I could be using? ---------------------------------------------------------------------------------------------------- [13:32:13] Adam(@adamcreekroad):@elia everything is working great with the new releases, thanks! ---------------------------------------------------------------------------------------------------- [13:32:58] Elia Schito(@elia):@adamcreekroad great to hear that! thanks, appreciate :smile: ---------------------------------------------------------------------------------------------------- [13:33:58] Elia Schito(@elia):@wiggly I'd try opening an issue, and see if @meh can address the problem ---------------------------------------------------------------------------------------------------- ############################## [2017-05-19] ############################## [13:14:49] Michał Kalbarczyk(@fazibear):Hey, tried opal 0.11rc and got problems with rspec. All tests passes, but got timeout. Here is an example: https://travis-ci.org/inesita-rb/inesita/builds/234001775 any ideas ? ---------------------------------------------------------------------------------------------------- [13:21:03] Elia Schito(@elia):@fazibear yes, RSpec needs an update which I didn't have time to bring to completion yet ---------------------------------------------------------------------------------------------------- [13:21:31] Elia Schito(@elia):@fazibear help as always is appreciated :wink: ---------------------------------------------------------------------------------------------------- ############################## [2017-05-20] ############################## [18:04:17] Mitch VanDuyn(@catmando):@fkchang - (or anybody else) trying to use opal-hot-reloader with cloud9. You access cloud9 environment via a url like https://hyperloop-tutorial-catmando.c9users.io/ so this gives an error like this: `Mixed Content: The page at 'https://hyperloop-tutorial-catmando.c9users.io/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://hyperloop-tutorial-catmando.c9users.io:25222/'. This request has been blocked; this endpoint must be available over WSS` ---------------------------------------------------------------------------------------------------- [18:04:24] Mitch VanDuyn(@catmando):any hope? ---------------------------------------------------------------------------------------------------- [18:54:40] Mitch VanDuyn(@catmando):@fkchang - nvm (sort of) i'll put a couple of issues in... ---------------------------------------------------------------------------------------------------- ############################## [2017-05-25] ############################## [09:40:02] Htoo Eain Lwin(@htoo-eain-lwin):hello guys. I downloaded opal.js and run on my rails server and it works. but it doesn't work on pure html file. I have to use cdn instead to work. ---------------------------------------------------------------------------------------------------- [09:43:30] Htoo Eain Lwin(@htoo-eain-lwin):Any ideas? ---------------------------------------------------------------------------------------------------- [09:55:56] Htoo Eain Lwin(@htoo-eain-lwin):My story is I wrote PORO and compiled to JS via (http://opalrb.org/try/#) and downloaded (http://cdn.opalrb.org/opal/current/opal.js) and put it in my vendor. and tested my compiled js in rails server and it worked perfect. But I would like to use that compiled js without rails server. Therefore, I put opal.js and compiled js in simple html file and it test on browser and it does raise error on opal.js but when I replaced downloaded opal.js with cdn link, it worked. ---------------------------------------------------------------------------------------------------- [16:50:37] Forrest Chang(@fkchang):@/all I'm trying to start a twitter thread with the author of https://blog.appcanary.com/2017/hard-isnt-simple-ruby-clojure.html?utm_source=rubyweekly&utm_medium=email ---------------------------------------------------------------------------------------------------- [16:51:15] Forrest Chang(@fkchang):I think there's good potential to get exposure hitting a key aspect of Ruby philosophy - making the dev happy https://twitter.com/fkchang2000/status/867779844490133504 ---------------------------------------------------------------------------------------------------- [19:52:43] Elia Schito(@elia):@htoo-eain-lwin could be related to bootstrapping, my advice is to use the gems we provide to get a better more solid experience For rails: `gem "opal-rails"` For simple HTML files: `gem install opal; opal -e "puts 'hello world'" -c > hello.js` and then use `hello.js` in your HTML file ---------------------------------------------------------------------------------------------------- [19:57:14] Elia Schito(@elia):@fkchang saw the video and kinda read the thread (thanks to twitter broken thread viewer), he didn't seem very interested but the final advice seems good: remove any pain-points the user might encounter ---------------------------------------------------------------------------------------------------- [19:58:24] Elia Schito(@elia):Wathing the video I immediately thought about opal when he cited clojurescript and his relationship with JS… ---------------------------------------------------------------------------------------------------- [22:10:34] Elia Schito(@elia):@/all just released opal-rspec 0.6.1 https://rubygems.org/gems/opal-rspec/versions/0.6.1 – just a tiny update, changelog: https://github.com/opal/opal-rspec/blob/0-6-stable/CHANGELOG.md#061---2017-05-25 ---------------------------------------------------------------------------------------------------- ############################## [2017-05-27] ############################## [10:28:19] Forrest Chang(@fkchang):https://twitter.com/fkchang2000/status/868413422399930369 ---------------------------------------------------------------------------------------------------- ############################## [2017-05-29] ############################## [19:04:35] Bernhard Weichel(@bwl21):HI, I observe, that a String is sometimes not represented as a JS primitive but a ruby class. What could be the reason? [![screenshot_867.jpg](https://files.gitter.im/opal/opal/kphD/thumb/screenshot_867.jpg)](https://files.gitter.im/opal/opal/kphD/screenshot_867.jpg) ---------------------------------------------------------------------------------------------------- [19:07:49] Bernhard Weichel(@bwl21):Does that mean, that whenver I pass a string to a native library, I should do it with .to_n ? ---------------------------------------------------------------------------------------------------- [19:22:59] Bernhard Weichel(@bwl21):I have copied parts of activesupport/lib/active_support/core_ext/object/deep_dup.rb , there is the root of the problem. I do a deep_dup on a hash, which makes the strings in that hash to bei String instead of JS primitives. ---------------------------------------------------------------------------------------------------- [19:27:37] Bernhard Weichel(@bwl21):The same happens with Numerical etc. ---------------------------------------------------------------------------------------------------- [19:33:19] Bernhard Weichel(@bwl21):deep_dup is defined in ```ruby class Object # Returns a deep copy of object if it's duplicable. If it's # not duplicable, returns +self+. # # object = Object.new # dup = object.deep_dup # dup.instance_variable_set(:@a, 1) # # object.instance_variable_defined?(:@a) # => false # dup.instance_variable_defined?(:@a) # => true def deep_dup duplicable? ? dup : self end end ``` ---------------------------------------------------------------------------------------------------- [19:36:18] Bernhard Weichel(@bwl21):where dupliactable? is something like ```ruby class Numeric # Numbers are not duplicable: # # 3.duplicable? # => false # 3.dup # => TypeError: can't dup Integer def duplicable? false end end ``` The problem went away after I added deep_dup to String and Numeric directly. But i don't not what I am doing. ```` ## this is necessary for opal ... class String def deep_dup self.to_n end end class Numeric def deep_dup self.to_n end end ``` Any advice is welcome. ---------------------------------------------------------------------------------------------------- [20:09:00] Jamie Gaskins(@jgaskins):[![Screen Shot 2017-05-29 at 4.06.27 PM.png](https://files.gitter.im/opal/opal/GNXm/thumb/Screen-Shot-2017-05-29-at-4.06.27-PM.png)](https://files.gitter.im/opal/opal/GNXm/Screen-Shot-2017-05-29-at-4.06.27-PM.png) ---------------------------------------------------------------------------------------------------- [20:09:08] Jamie Gaskins(@jgaskins):@bwl21 ^^ It's the difference between a string literal and `new String(string_literal)`. It's one of the quirks of JS — they even have a different `typeof`. ---------------------------------------------------------------------------------------------------- [20:10:37] Jamie Gaskins(@jgaskins):The same thing happens with numbers: `123` vs `new Number(123)`. I think it's some legacy stuff from when JS was originally intended to "work like Java". ---------------------------------------------------------------------------------------------------- [20:12:19] Jamie Gaskins(@jgaskins):If you call `.valueOf()` on it, it'll cast itself down to the primitive type, which might be why `.to_n` fixes it. ---------------------------------------------------------------------------------------------------- [20:16:19] Jamie Gaskins(@jgaskins):I ran into this same problem with Clearwater because it checks `typeof` before adding stuff to a DOM node. Some of the math stuff wasn't working because I was getting back objects instead of numbers — but only sometimes. I assume it's something in the bridging stuff between Ruby classes and JS primitives, but I didn't have time to look into it so I just ran everything through `.valueOf()`. ---------------------------------------------------------------------------------------------------- [20:36:19] Bernhard Weichel(@bwl21):@jgaskins do I get it right that I should for example change ```ruby `#{@native_jspdf}.text(#{nx}, #{ny}, #{text}, #{flags})` ``` to ```ruby `#{@native_jspdf}.text(#{nx}.valuelOf(), #{ny}.valueOf(), #{text}.valueOf(), #{flags}).valueOf()` ``` ---------------------------------------------------------------------------------------------------- [20:43:25] Bernhard Weichel(@bwl21):I basically have reimplemented one of my classes based on deep_merge, deep_dup etc. So I think I should find an implementation which does not require a change in the clients of that class.. I guess I stick with the `to_n` in the code I took from active_support untl I am facing another problem :-) Thanks ---------------------------------------------------------------------------------------------------- ############################## [2017-05-30] ############################## [03:18:43] Jamie Gaskins(@jgaskins):I think `to_n` should do the trick if it uses `valueOf()` under the hood — which it should if it doesn't already. ---------------------------------------------------------------------------------------------------- [05:07:42] Joseph McDonald(@jots_twitter):I put some code in: http://opalrb.org/try/# , pasted the output into newfile.js and tried: node newfile.js and get: `ReferenceError: Opal is not defined` do I need to do something special to run the output of `: http://opalrb.org/try/` in node? ---------------------------------------------------------------------------------------------------- [05:24:59] Joseph McDonald(@jots_twitter):I see I need to require code from `http://cdn.opalrb.org/opal/current/opal.js` at the top. that gets "hello world" working, but doesn't work with my test that tries to read ARGV to find out what files to open and process. ---------------------------------------------------------------------------------------------------- [18:14:39] Joseph McDonald(@jots_twitter):This is the code I wanted to try running under opal: https://github.com/timuckun/faster-command-line-tools-in-nim/blob/master/Ruby/csv_test.rb I guess there is something more needed to use ARGV and possibly File.open each_line? ---------------------------------------------------------------------------------------------------- ############################## [2017-06-11] ############################## [19:48:21] James Carlson(@jxxcarlson):An trying to use Opal in chrome. Am using Elm via webpack and have this code: ``` ``` but `require` gives me an error and my other tries have failed also. I've installed opal via npm and also via `npm install opal-webpack --save-dev`, then configuring like this: ``` { test: /\.html$/, exclude: /node_modules/, loaders: [ loader:'file-loader?name=[name].[ext]', test: /\.rb?$/, loader: 'opalrb-loader' ] }, ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-06-15] ############################## [16:10:35] Forrest Chang(@fkchang):@/all Hmm, this implies to me that a good place to spread opal might be in Japan https://appfolio-engineering.squarespace.com/appfolio-engineering/2017/5/24/how-is-ruby-different-in-japan ---------------------------------------------------------------------------------------------------- [16:10:57] Forrest Chang(@fkchang):cuz the Rails community seems to not think it's very relevant ---------------------------------------------------------------------------------------------------- ############################## [2017-06-16] ############################## [22:07:39] Elia Schito(@elia):@jxxcarlson sorry I'm not yet familiar with webpack, but if you show me the error maybe I can help ---------------------------------------------------------------------------------------------------- [22:14:07] Elia Schito(@elia):@jots_twitter ARGV should be supported in nodejs adding a `require 'nodejs'`, the try page is there just for simple stuff, the best option is to install via rubygems and use the CLI: `opal -rnodejs -e 'p :asdf; p ARGV' -c > /tmp/asdf.js; node /tmp/asdf.js foo bar` (requires the `glob` npm module) ---------------------------------------------------------------------------------------------------- ############################## [2017-06-17] ############################## [06:38:41] Carl Zulauf(@carlzulauf):Anyone know of any opal compatible gems that successfully test against opal with travis CI? ---------------------------------------------------------------------------------------------------- [06:49:35] Elia Schito(@elia):@carlzulauf try with the people over at hyperloop (@catmando) and Clearwater (@jgaskins) ---------------------------------------------------------------------------------------------------- [10:04:57] Mitch VanDuyn(@catmando):@carlzulauf we use hyper-spec with ci not with Travis but with several others ---------------------------------------------------------------------------------------------------- ############################## [2017-06-18] ############################## [10:13:59] Carl Zulauf(@carlzulauf):@jgaskins Thank you. That does look pretty simple. ---------------------------------------------------------------------------------------------------- [02:46:31] Jamie Gaskins(@jgaskins):@carlzulauf Clearwater's Travis setup is pretty simple: https://github.com/clearwater-rb/clearwater/blob/master/.travis.yml ---------------------------------------------------------------------------------------------------- [02:47:54] Jamie Gaskins(@jgaskins):And its `Rakefile` is pretty simple, too: https://github.com/clearwater-rb/clearwater/blob/master/Rakefile (just runs a few server-side specs and then launches the Opal specs using PhantomJS) ---------------------------------------------------------------------------------------------------- ############################## [2017-06-21] ############################## [21:26:36] Elia Schito(@elia):@/all 0.10.5 is out, a tiny release: https://github.com/opal/opal/releases/tag/v0.10.5 ---------------------------------------------------------------------------------------------------- ############################## [2017-06-22] ############################## [17:44:00] Elia Schito(@elia):https://robots.thoughtbot.com/headless-feature-specs-with-chrome?utm_source=rubyweekly&utm_medium=email /cc @iliabylich ---------------------------------------------------------------------------------------------------- [17:45:56] Ilya Bylich(@iliabylich):Yeah, I've seen it a few days ago. Nothing useful there ---------------------------------------------------------------------------------------------------- [17:46:29] Ilya Bylich(@iliabylich):I know how to finish a PR, just need to find some time :) ---------------------------------------------------------------------------------------------------- [17:48:22] Elia Schito(@elia):I'm quite familiar with that problem space :laughing: ---------------------------------------------------------------------------------------------------- ############################## [2017-06-23] ############################## [05:48:49] HARD_WRQ(@work_op_twitter):are there any good libraries to work with an in-browser editor with opal? I will resort to hacking on codemirror if not, I want to create a very simple ruby-scriptable editor that my students can use. I'm intensely familiar with ruby, but lost when it comes to the web as I never rode the rails train. thanks ---------------------------------------------------------------------------------------------------- [11:38:25] Mitch VanDuyn(@catmando):@work_op_twitter we have simple tools like that for http://ruby-hyperloop.io ---------------------------------------------------------------------------------------------------- [16:39:40] HARD_WRQ(@work_op_twitter):that's 100% more framework than I need. my app needs to be just an editor on the page, I can do everything else with websockets, but yeah. I don't need a whole web framework. ---------------------------------------------------------------------------------------------------- [17:15:11] HARD_WRQ(@work_op_twitter):so I've discovered Native, I can make it work with that, what a useful class! ---------------------------------------------------------------------------------------------------- ############################## [2017-06-24] ############################## [07:29:35] Elia Schito(@elia):@work_op_twitter be sure to have also a look at the various "playgrounds" in the awesome 😎 opal list http://opalrb.org/libraries/ ---------------------------------------------------------------------------------------------------- ############################## [2017-06-26] ############################## [01:29:47] Colin Gunn(@balmoral):Just found that a class which extends a module fails calling super on an override class method in Opal (master): ``` module Foo def foo puts 'foo' end end class Bar extend Foo def self.foo super puts 'bar' end end Bar.foo => $NoMethodError {name: "foo", message: "undefined method `foo' for #” ``` ---------------------------------------------------------------------------------------------------- [01:41:45] Colin Gunn(@balmoral):sorry, error is: ``` $NoMethodError {name: "foo", message: "super: no superclass method `foo' for Bar", args: Array(0), stack: "foo: super: no superclass method `foo' for Bar”} ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-06-27] ############################## [21:17:00] Elia Schito(@elia):@balmoral that should be fixed in my prepend branch, but alas it's not ready yet… ---------------------------------------------------------------------------------------------------- [21:42:09] Colin Gunn(@balmoral):@elia no worries. Can live without it for now. Thanks for all your great work. 😀 ---------------------------------------------------------------------------------------------------- [21:43:41] Elia Schito(@elia):👍🏼 very appreciated ---------------------------------------------------------------------------------------------------- ############################## [2017-06-30] ############################## [20:06:51] Forrest Chang(@fkchang):@/all So it's just so hard to even get rubyists to consider opal -- what are we missing? ---------------------------------------------------------------------------------------------------- [20:06:52] Forrest Chang(@fkchang):https://twitter.com/johnwlong/status/880864553613090816 ---------------------------------------------------------------------------------------------------- ############################## [2017-07-03] ############################## [23:42:01] Elia Schito(@elia):@fkchang I think it's partly "cool" to say that JS is enough (as it happened with coffee script some years ago) and partly we still miss a drop in Opal framework that works "the rails way" and is so better than using jquery that it's a no-brainer. Once an app with simple needs starts with that I bet It will take some time before opal goes away from the codebase… my 2¢ ---------------------------------------------------------------------------------------------------- ############################## [2017-07-08] ############################## [19:20:50] Damiano Stoffie(@stoffie):Hello to everyone! I would like to develop a frontend-only application using opal but so fare I had no luck with source maps... when I run the example application in opal/examples/sinatra with `bundle exec rackup`I can see the hello world alert on screen but firefox doesn't show the backtrace for the example error! What's going on? Thank you for your help ---------------------------------------------------------------------------------------------------- ############################## [2017-07-09] ############################## [22:39:11] Elia Schito(@elia):@stoffie I think there's something broken with sourcemaps in firefox, can't tell if they're using some new format or relying on some detail we're not implementing in the right way, I expect you'll have some better luck with chrome. Please let me know how it goes or if you catch the problem in firefox, thanks! ---------------------------------------------------------------------------------------------------- ############################## [2017-07-10] ############################## [03:29:56] Billy.Zheng(@zw963):@stoffie , me too, and create issue for this. ---------------------------------------------------------------------------------------------------- [06:55:08] Damiano Stoffie(@stoffie):I had no luck with cromium either! Anyway I will test with chrome. Thanks! ---------------------------------------------------------------------------------------------------- ############################## [2017-07-11] ############################## [17:35:58] Bernhard Weichel(@bwl21):@stoffie I am using Opal for a frontend-only app (www.zupfnoter.de), which compiles to 35000 lines of Javascript code. In the early days I was missing source maps. But now I am familiar with `debugger`and am able to live without it. I had it working in chrome and in Firefox but did not find it very helpful. In other words, debugging should not prevent you from using Opal. ---------------------------------------------------------------------------------------------------- [17:46:14] Bernhard Weichel(@bwl21):@stoffie I should mention, that in my App I have implemented a logger which helps me to trace down in case of exceptions. ---------------------------------------------------------------------------------------------------- ############################## [2017-07-12] ############################## [04:04:04] Jikku Jose(@JikkuJose):@fkchang I think the most important reason people use React is JSX (beyond the obvious & powerful tech superiority). The components looks & feels like HTML that every one understands. Not an expert, but it may help if we can have JSX like dsl, not sure its even possible. ---------------------------------------------------------------------------------------------------- [08:46:03] Elia Schito(@elia):@JikkuJose @fkchang I'm quite sure it can be done with some compiler plugin and abusing heredocs, e.g.: ``` class HelloMessage < React::Component def render <<-JSX
Hello {@props[:name]}
JSX end end ``` or some variant like `<<-HTML` which most editors will highlight as HTML: ``` <<-HTML
Hello {props.name}
HTML ``` ---------------------------------------------------------------------------------------------------- [14:11:38] Jamie Gaskins(@jgaskins):It could just be another stage in the asset pipeline: `application.js.rb.jsx` If a JSX compiler simply translates `
` to `h('div', { id: 'foo' })` and ignores all other syntax, all you'd need is to define a `Kernel#h` method and it would just work. ---------------------------------------------------------------------------------------------------- [14:13:37] Billy.Zheng(@zw963):> @JikkuJose @fkchang I'm quite sure it can be done with some compiler plugin and abusing heredocs, e.g.: ``` class HelloMessage < React::Component def render <<-JSX
Hello {@props[:name]}
JSX end end ``` or some variant like `<<-HTML` which most editors will highlight as HTML: ``` <<-HTML
Hello {props.name}
HTML ``` Pray not do like this!! @Elia, Use HEREDOC is guly, and not `syntax highlight` + `code format` support, personal, i think this is a very bad idea. ---------------------------------------------------------------------------------------------------- ############################## [2017-07-13] ############################## [00:23:35] Forrest Chang(@fkchang):@JikkuJose I thought the original react.rb supported jsx, am I recalling wrong? ---------------------------------------------------------------------------------------------------- [00:24:23] Forrest Chang(@fkchang):anyways, I dunno if that will ppl over to react.rb, in my mind, the Ruby DSL is a selling point to Rubyists, since it's the full power of Ruby, but looks something like slim ---------------------------------------------------------------------------------------------------- ############################## [2017-07-17] ############################## [12:48:49] Billy.Zheng(@zw963):@elia , I just see [this](https://youtu.be/vhIrrlcWphU) Youtube video, ``Opal.rb - Elia Schito - wroc_love.rb 2016`` it is awesome! I think we should add this link to `opalrb.org`, at least I don't found it when I view this site, I know it from `hyperloop.io` sites! ---------------------------------------------------------------------------------------------------- [12:51:45] Billy.Zheng(@zw963):@elia , where `tretrios` example in that video hosts on? thanks ---------------------------------------------------------------------------------------------------- [22:46:37] Elia Schito(@elia):@zw963 thanks man! I'll add it to the site, here's the (updated) repo for that presentation with links to video, slides & code: https://github.com/elia/wrocloverb-2016 ---------------------------------------------------------------------------------------------------- ############################## [2017-07-18] ############################## [17:26:28] Adrian Madrid(@aemadrid):is anybody using `opal` with `Vue.js`? ---------------------------------------------------------------------------------------------------- ############################## [2017-07-19] ############################## [05:33:12] Billy.Zheng(@zw963):> here's the (updated) repo for that presentation with links to video, slides & code: https://github.com/elia/wrocloverb-2016 Thank very much. ---------------------------------------------------------------------------------------------------- [05:39:17] Billy.Zheng(@zw963):@aemadrid > is anybody using opal with Vue.js? I google it before, but just got a very toy project, that not update 2 years. [here](http://ruby-hyperloop.io/tutorials/hyperlooprails/helloworld) is a similar project, it based on `opal` `react-js` and others, do more than `vue.js`, maybe this is what you want. ---------------------------------------------------------------------------------------------------- [16:26:31] Adrian Madrid(@aemadrid):@zw963 thanks for the info ---------------------------------------------------------------------------------------------------- [16:26:55] Adrian Madrid(@aemadrid):found the same as you with regards to the Vue ---------------------------------------------------------------------------------------------------- [16:27:14] Adrian Madrid(@aemadrid):I’ve seen hyperloop before but for some reason I can’t quite get into React ---------------------------------------------------------------------------------------------------- [16:27:23] Adrian Madrid(@aemadrid):Vue.js seems to fit my head much better ---------------------------------------------------------------------------------------------------- [16:28:03] Adrian Madrid(@aemadrid):I’m going to run through the tutorial though ---------------------------------------------------------------------------------------------------- [16:30:31] Billy.Zheng(@zw963):hmmm... I use javascript with very little, so, for me, the choice is very easy. :smile: ---------------------------------------------------------------------------------------------------- [16:30:34] Frederic ZINGG(@fzingg):@aemadrid Hyperloop is using React under the hood but the purpose of Hyperloop and is that it's completely transparent and everything can be coded using RUBY, no more Javascript (almost, sometimes needed for specific case). React is an under layer that could be replace one day. Try the tuto , as you say, to get an idea of the difference between Hyperloop and Javascripts frameqork like React or vue. ---------------------------------------------------------------------------------------------------- [16:31:15] Adrian Madrid(@aemadrid):@fzingg will do ---------------------------------------------------------------------------------------------------- ############################## [2017-07-22] ############################## [11:58:11] Billy.Zheng(@zw963):@/all, After several weeks study, opal, hyperloop, examples from internets, I found I still is a newbie for opal. :worried: I want test https://github.com/opal/opal-browser/blob/master/README.md in a bare new rails project, without `opal-rails` included (just `gem 'opal'` and `gem 'opal-browser' added`), I think i know what is `assets.path` and `load path for opal`, but I still could not make this worked! ---------------------------------------------------------------------------------------------------- [12:01:37] Billy.Zheng(@zw963):```sh couldn't find file 'opal' with type 'application/javascript' ``` ---------------------------------------------------------------------------------------------------- [12:02:25] Billy.Zheng(@zw963):```sh (couldn't find file 'opal-browser' with type 'application/javascript' ``` ---------------------------------------------------------------------------------------------------- [15:21:24] Billy.Zheng(@zw963):Hi, anyone could consider explain `//= require 'opal'` in `app/assets/javascripts/application.js` is what doing . ---------------------------------------------------------------------------------------------------- [15:21:40] Billy.Zheng(@zw963):for `opal-rails` project. ---------------------------------------------------------------------------------------------------- [15:39:24] Billy.Zheng(@zw963):I am thinking about how `opal-rails` make `//= require 'opal'` in `app/assets/javascripts/application.js` work. ```js // Require the opal runtime and core library //= require opal ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-07-27] ############################## [12:57:40] Victor Palomo de Castro(@victor95pc):not working for me either ---------------------------------------------------------------------------------------------------- [13:11:54] Victor Palomo de Castro(@victor95pc):ok I found a way ---------------------------------------------------------------------------------------------------- [13:13:13] Victor Palomo de Castro(@victor95pc):you must require opal, but you don't need to run Opal.load in your application.js ---------------------------------------------------------------------------------------------------- [13:13:48] Victor Palomo de Castro(@victor95pc):it's in the doc, I know, but I'm using the last version and everythings worked ---------------------------------------------------------------------------------------------------- ############################## [2017-08-01] ############################## [16:53:41] Forrest Chang(@fkchang):@/all I just filled out the https://crystal-lang.org/2017/07/31/launching-the-2017-state-of-crystal-survey.html -- we should have one for opal ---------------------------------------------------------------------------------------------------- ############################## [2017-08-16] ############################## [08:06:02] Bernhard Weichel(@bwl21):Hi I have problems to do an ajax-request: ``` def refresh_preview_callbacktext = @editor.get_abc_part result = analyze_course_description(text) HTTP.post("vrmd2html.php", payload:{md_text: result[:de]}).then do |response| `debugger` alert(Native(response)[:body]) end end ``` It invokes the ajax handler (vrmd2html.php) but I have no $_POST. ---------------------------------------------------------------------------------------------------- [08:49:47] Bernhard Weichel(@bwl21):In other words: How can I access the payload in PHP? ---------------------------------------------------------------------------------------------------- [09:05:09] Bernhard Weichel(@bwl21):I think the documentation should express more about the options ... I found the solution: use data instead of payload ``` HTTP.post("vrmd2html.php", data: {md_text: result[:de]}).then do |response| alert(Native(response)[:body]) end ``` ---------------------------------------------------------------------------------------------------- [10:04:59] Ilya Bylich(@iliabylich):@bwl21 I think it should be `HTTP.post('/path', payload).then ...` ---------------------------------------------------------------------------------------------------- [10:06:43] Ilya Bylich(@iliabylich):Here's a simplified example - https://gist.github.com/iliabylich/23b309481511a6ddf19081b0f6af28a1 ---------------------------------------------------------------------------------------------------- [10:41:17] Bernhard Weichel(@bwl21):@iliabylich the problem: with payload, I could retrieve the raw payload in php and parse it. ```php $request_body = file_get_contents('php://input'); $data = json_decode($request_body); ``` Now I have the working solution: ```ruby HTTP.post("vrmd2html.php", data: {md_text: result[:de]}).then do |response| Element.find("#preview_de").html = JSON.parse(response.body)[:result] end ``` with php: ``` $input = $_POST['md_text']; $m = new VrMarkdown(); $result = $m->transform($input); echo(json_encode(array('result' => $result))); ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-08-17] ############################## [16:11:00] Forrest Chang(@fkchang):@/all Rubyconf CFP is opal, on the fence about whether to submit the usual 1/2 dozen proposals - anyone have an idea for themes that the RubyConf proposal commitee might favor, saving the Ruby community, being relevant and happy in a changing tech world , etc. don't seem to stick (or I just suck at proposal writing) ---------------------------------------------------------------------------------------------------- ############################## [2017-08-18] ############################## [17:54:37] Bernhard Weichel(@bwl21):It appears that Opal.rb does not have Date#upto. ---------------------------------------------------------------------------------------------------- ############################## [2017-08-19] ############################## [04:36:29] Jamie Gaskins(@jgaskins):Feel free to submit a PR ---------------------------------------------------------------------------------------------------- [05:06:07] Barrie Hadfield(@barriehadfield):@fkchang I have been thinking about your question. Would it perhaps server us to have a larger number of us all propose talks about Opal/Hyperloop/Clearwater and using Ruby with NPM/Webpack/React, etc - ie just a deluge of “ruby is not just for the backend anymore” proposals? ---------------------------------------------------------------------------------------------------- [05:28:48] Tomasz Wegrzanowski(@taw):i've been checking my old projects, and returning to https://github.com/taw/opal-d3 i'm wondering if there's any way to configure opal-rspec to print proper lines when there's an exception ---------------------------------------------------------------------------------------------------- [05:28:52] Tomasz Wegrzanowski(@taw):right now i'm getting this: ---------------------------------------------------------------------------------------------------- [05:29:03] Tomasz Wegrzanowski(@taw): 1) d3 misc methods d3.version Failure/Error: Unable to find matching line from backtrace expected: "4.4.3" got: "4.5.0" (compared using ==) # $$handle_matcher@http://localhost:9999/assets/opal/rspec/sprockets_runner.js:36031:203 # # Showing full backtrace because every line was filtered out. # See docs for RSpec::Configuration#backtrace_exclusion_patterns and # RSpec::Configuration#backtrace_inclusion_patterns for more information. Finished in 2.78 seconds (files took 5.02 seconds to load) 869 examples, 1 failure, 123 pending ---------------------------------------------------------------------------------------------------- [05:29:23] Tomasz Wegrzanowski(@taw):(the error itself is not very relevant, lack of file:line is) ---------------------------------------------------------------------------------------------------- [07:16:18] Elia Schito(@elia):@taw to see ruby line numbers you'd need to link source maps with the js platform in use and do the mapping, I think node has the API needed to do that, in the browser could depend on the vendor. If you just wanted to get the js lines then should be much easier. @/all Anyway I'm (slowly) progressing on the update of Opal-RSpec to make it work with master. Once that is done I think we can release 0.11. My thought-process has been that many many projects use Opal-RSpec and releasing without proper support would be counterproductive. Please correct me if I'm mistaken or let me know what you think 🤙🏻 ---------------------------------------------------------------------------------------------------- [07:39:57] Elia Schito(@elia):@fkchang knowing the talk selection process and the selectors maybe could help in molding the proposal in a way that makes it more appealing for them and touches topics they care about. In theory, Opal should be the perfect fit for rubyconf… I'd be happy to help reviewing the proposals if you want 🙂 ---------------------------------------------------------------------------------------------------- [07:40:45] Bernhard Weichel(@bwl21):how can i run a single rspec (upto_spec.rb) ? ---------------------------------------------------------------------------------------------------- [07:41:26] Bernhard Weichel(@bwl21):I managed to clone opal and run all specs ---------------------------------------------------------------------------------------------------- [07:56:21] Bernhard Weichel(@bwl21):I tried `bundle exec rspec spec/ruby/library/date/upto_spec.rb` ---------------------------------------------------------------------------------------------------- [07:56:38] Bernhard Weichel(@bwl21):and got ---------------------------------------------------------------------------------------------------- [07:56:49] Bernhard Weichel(@bwl21):``` ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15] 1) An exception occurred during: loading /Users/beweiche/.rvm/gems/ruby-2.4.1/bin/rspec ERROR SystemStackError: stack level too deep /Users/beweiche/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/optparse.rb:827:in `fetch' ``` ---------------------------------------------------------------------------------------------------- [07:57:00] Elia Schito(@elia):`$ bundle exec rake mspec_ruby_nodejs PATTERN=spec/ruby/core/string/sub_spec.rb` This should work, see the hacking guide: https://github.com/opal/opal/blob/master/HACKING.md ---------------------------------------------------------------------------------------------------- [08:05:02] Bernhard Weichel(@bwl21):I did `bundle exec rake mspec_ruby_nodejs PATTERN=spec/ruby/library/date/upto_spec.rb` But it says ``` finished 0 examples, 0 failures (time taken: 0.012000083923339844) ```` is there a filter which I need to turn off? ---------------------------------------------------------------------------------------------------- [08:55:24] Bernhard Weichel(@bwl21):found it, i uncommented the line in filters/bugs/date.rb ---------------------------------------------------------------------------------------------------- [11:13:51] Bernhard Weichel(@bwl21):@JacobEvelyn. Pr will come as i now managed to run the test. I will provide Date#step Date#upto an Date#downto ---------------------------------------------------------------------------------------------------- [15:54:56] Tomasz Wegrzanowski(@taw):@elia Is that setup descriped anywhere? I just `bundle exec rake` to run `opal-rspec` specs ---------------------------------------------------------------------------------------------------- [16:13:31] Bernhard Weichel(@bwl21):@JacobEvelyn sorry, I wanted to mention @jgaskins ---------------------------------------------------------------------------------------------------- ############################## [2017-08-20] ############################## [10:54:41] Bernhard Weichel(@bwl21):I wanted to update to 0.11.rc1 and found a difference in the compilateion result: ```ruby abc = `localStorage.setItem('abc_data', #{abc});` end ``` transpiles to (0.10.5) ``` Javascript return abc = localStorage.setItem('abc_data', abc);; ``` a in 0.11.rc1 it compiles to ``` return (abc = localStorage.setItem('abc_data', abc);); ``` Of course the trailing ';' ist not required. Nevertheless it is an issue which might break existing sources. How should we handle this? ---------------------------------------------------------------------------------------------------- [13:31:28] Elia Schito(@elia):@taw that is for running the ruby spec which comes with the opal repo, also uses MSpec instead of RSpec, everything about that should be described in the HACKING.md file I linked above ---------------------------------------------------------------------------------------------------- [13:32:26] Elia Schito(@elia):@bwl21 definitely submit an issue about that semicolon, it's a bug and needs to be fixed ---------------------------------------------------------------------------------------------------- [16:41:40] Bernhard Weichel(@bwl21):@elia https://github.com/opal/opal/issues/1696 ---------------------------------------------------------------------------------------------------- ############################## [2017-08-22] ############################## [18:23:24] youchan(@youchan):Hi, we will have two talks about Opal in RubyKaigi. http://rubykaigi.org/2017/schedule Of course, I also think RubyConf is good, but please come and join RubyKaigi. ---------------------------------------------------------------------------------------------------- [19:33:15] Forrest Chang(@fkchang):@youchan what talk is about Opal aside from yours? I'd love to go to RubyKaigi but I wouldn't be able to afford the travel/time ---------------------------------------------------------------------------------------------------- [19:34:09] Forrest Chang(@fkchang):@youchan I found it, on the 2nd day ---------------------------------------------------------------------------------------------------- [19:35:55] meh.(@meh):@fkchang http://rubykaigi.org/2017/presentations/yhara.html ---------------------------------------------------------------------------------------------------- [19:36:03] meh.(@meh):oh, you found it, kek ---------------------------------------------------------------------------------------------------- [19:38:21] Forrest Chang(@fkchang):@meh my good man, long time... what's going on? ---------------------------------------------------------------------------------------------------- [19:39:44] Forrest Chang(@fkchang):dxopal is cool https://github.com/yhara/dxopal ---------------------------------------------------------------------------------------------------- ############################## [2017-08-24] ############################## [19:31:55] Forrest Chang(@fkchang):@/all anyone know a way to make opal exceptions spill into the js console log universally? One can wrap exceptions and on rescue console.log it, but I'd like to not have to wrap things ---------------------------------------------------------------------------------------------------- [20:42:31] Ilya Bylich(@iliabylich):@fkchang In the browser you can use `window.onerror = function(message, file, line) { ... }` ---------------------------------------------------------------------------------------------------- [21:31:32] Forrest Chang(@fkchang):@iliabylich I might've asked the question wrong, how will that make sure all runtime opal exceptions log (or error) in the js console ---------------------------------------------------------------------------------------------------- ############################## [2017-08-26] ############################## [23:24:50] Forrest Chang(@fkchang):@elia my rubyconf proposals https://gist.github.com/fkchang/df0a568942251ae258e3f2204ed225da https://gist.github.com/fkchang/664a2c3c2cc2e75227c2aa4aca38296f https://gist.github.com/fkchang/d310b7f2f8011bc8726445837e09199b ---------------------------------------------------------------------------------------------------- ############################## [2017-08-30] ############################## [07:19:27] Elia Schito(@elia):@fkchang they all look great to me! I'll send you a couple comments/questions later via private message ---------------------------------------------------------------------------------------------------- ############################## [2017-09-01] ############################## [16:35:04] Elia Schito(@elia):the two videos are really hilarious 🤣 ---------------------------------------------------------------------------------------------------- [22:49:55] Mitch VanDuyn(@catmando):huh... so far while the videos are funny, actually ruby does the same thing ??? ---------------------------------------------------------------------------------------------------- [22:50:04] Mitch VanDuyn(@catmando):the first video ---------------------------------------------------------------------------------------------------- [15:29:10] Forrest Chang(@fkchang):https://medium.com/@richardeng/javascript-is-the-donald-trump-of-the-it-industry-376ffdda774 ---------------------------------------------------------------------------------------------------- ############################## [2017-09-05] ############################## [14:14:49] meh.(@meh):require 'json' ---------------------------------------------------------------------------------------------------- [15:16:58] kapilpipaliya(@kapilpipaliya):Thanks ---------------------------------------------------------------------------------------------------- [15:18:29] kapilpipaliya(@kapilpipaliya):Then we convert JSON to hash? ---------------------------------------------------------------------------------------------------- [15:28:19] meh.(@meh):it has the same API as the Ruby one ---------------------------------------------------------------------------------------------------- [15:28:25] meh.(@meh):from what I recall ---------------------------------------------------------------------------------------------------- [15:30:52] kapilpipaliya(@kapilpipaliya):I understand it.☺️ ---------------------------------------------------------------------------------------------------- [15:37:38] Elia Schito(@elia):yes, `JSON.parse('{"foo": 123}')` will result in the hash `{foo: 123}` ---------------------------------------------------------------------------------------------------- [15:38:47] kapilpipaliya(@kapilpipaliya):I have JSON file. I want to load. It contains Sidebar menu items. Like icon title link. ---------------------------------------------------------------------------------------------------- [16:01:40] Elia Schito(@elia):@kapilpipaliya you mean loading it via AJAX? ---------------------------------------------------------------------------------------------------- [16:02:31] kapilpipaliya(@kapilpipaliya):no, it's server static file ---------------------------------------------------------------------------------------------------- [16:03:18] Elia Schito(@elia):@kapilpipaliya you need to tell more otherwise the question is too broad ---------------------------------------------------------------------------------------------------- [16:07:02] kapilpipaliya(@kapilpipaliya):currently I only have this information only. I will use 'require JSON'. ---------------------------------------------------------------------------------------------------- ############################## [2017-09-06] ############################## [08:39:07] 深渊漫步(@CicholGricenchos):Hi everyone, I made an erb to virtual dom converter, outputting ruby codes. I'd like to use it in React's render method. But how could I load these erb templates? Should I write a sprockets processor and use something like Opal's `require`? ---------------------------------------------------------------------------------------------------- [08:40:04] Elia Schito(@elia):@CicholGricenchos yes, at least if you plan to use it inside sprockets ---------------------------------------------------------------------------------------------------- [08:42:50] 深渊漫步(@CicholGricenchos):@elia I see. I am going to figure out how `opal-sprockets` works :smile: ---------------------------------------------------------------------------------------------------- [08:43:44] Elia Schito(@elia):@CicholGricenchos good luck! …jokes aside the easiest thing should be to take inspiration from the current ERB processor… ---------------------------------------------------------------------------------------------------- [08:44:14] Elia Schito(@elia):https://github.com/opal/opal/blob/0-10-stable/lib/opal/sprockets/erb.rb ---------------------------------------------------------------------------------------------------- [08:45:31] Elia Schito(@elia):or from that of opal-haml https://github.com/opal/opal-haml/blob/32d7354636a7daa8682ed098ca424fd8e34068bc/lib/opal/haml/processor.rb ---------------------------------------------------------------------------------------------------- [08:46:52] 深渊漫步(@CicholGricenchos):that's helpful, thanks! ---------------------------------------------------------------------------------------------------- [08:48:22] Elia Schito(@elia):@CicholGricenchos ping me if you need anything, I spent enough time dealing with sprockets and I already know a couple of things :smile: ---------------------------------------------------------------------------------------------------- [08:49:06] Barrie Hadfield(@barriehadfield):@elia @fkchang I have been meaning to say, Rack + Opal Sprockets + OpalHotReloader is an outstanding backend. Its simple to setup and very fast to work with. We are building the new Hyperloop website this way, with all the JS coming in through NPM and Webpack (including all of Hyperloop client-side code). From a Ruby perspective I think this is a killer stack. Thank you! ---------------------------------------------------------------------------------------------------- [08:51:34] Elia Schito(@elia):@barriehadfield great to hear that! go Hyperloop! :smile: ---------------------------------------------------------------------------------------------------- [20:57:31] Forrest Chang(@fkchang):@barriehadfield I like a lean mean stack - I'm assuming you're documenting how to work that way ---------------------------------------------------------------------------------------------------- ############################## [2017-09-07] ############################## [05:59:02] Barrie Hadfield(@barriehadfield):@fkchang everything will be documented, and also we plan to write a tutorial for setting up this stack. I have a few details to finish - spent yesterday trying to figure out how to get a catch-all route in Rack (rails: `match '*all', to: 'home#page', via: [:get]`). We need all URLs to be resolved by the client side ReactRouter and Rack gives a 404). Solved this over night realizing that this is not a Rack problem as we will be deploying the site to Github pages so we would need to solve this somehow independently of Rack. Luckily I found this https://github.com/rafrex/spa-github-pages which will hopefully do the trick. I know that with Rack I can use a custom 404.html as well. If anyone is interested in this topic, please say, and I will send the link to the project and tutorial when it exists. ---------------------------------------------------------------------------------------------------- ############################## [2017-09-12] ############################## [13:00:50] Leon(@illogikal):yes please :) ---------------------------------------------------------------------------------------------------- [20:53:00] Colin Gunn(@balmoral):@barriehadfield very keen to see your tutorial on the rack + opal sprockets + hot reloader stack. 😀 ---------------------------------------------------------------------------------------------------- ############################## [2017-09-14] ############################## [16:24:38] Adrian Madrid(@aemadrid):@barriehadfield are you running all Hyperloop code (libs too) through Webpack? I would love to have only Webpack assets and get rid of Rails Sprockets altogether ---------------------------------------------------------------------------------------------------- [19:45:31] Mitch VanDuyn(@catmando):@aemadrid I don't think so, but this is the right forum to ask the question: @/all is the code still maintained that compiles opal using webpack or babel or however that all works. I think there used to be something, but I'm thinking it was not being maintained??? ---------------------------------------------------------------------------------------------------- [19:45:56] Mitch VanDuyn(@catmando):anyway @aemadrid what is wrong with sprockets (unless you are not using rails or sinatra) ---------------------------------------------------------------------------------------------------- [20:25:28] Adrian Madrid(@aemadrid):@catmando I’m using rails but I’ve been burned by Sprockets before and I’d rather use only one packer ---------------------------------------------------------------------------------------------------- ############################## [2017-09-15] ############################## [12:02:06] Jamie Gaskins(@jgaskins):@aemadrid https://www.npmjs.com/package/opal-webpack Last commit was about a year ago, but it apparently works. I remember a lot of discussion happening around it. ---------------------------------------------------------------------------------------------------- [12:04:56] Jamie Gaskins(@jgaskins):FWIW, I really enjoy using Sprockets and wrote [`roda-opal_assets`](https://github.com/clearwater-rb/roda-opal_assets) to use it for Roda apps (I don't use Rails, tbh, if I have the option). ---------------------------------------------------------------------------------------------------- ############################## [2017-09-19] ############################## [12:39:22] Elia Schito(@elia):@/all FYI the new official domain is https://opalrb.com (previously was .org), now with HTTPS support :tada: _all redirects should be in place, please let me know if you notice anything off_ ---------------------------------------------------------------------------------------------------- [15:19:58] Adrian Madrid(@aemadrid):@jgaskins thx! ---------------------------------------------------------------------------------------------------- [17:24:15] Forrest Chang(@fkchang):@/all anyone programmatically setting up promise chains in Opal? My scenario is that I have a list of data items that I want to process serially, incrementally updating status along the way , figure @elia, @meh and @jgaskins to be most likely candidates in this departments ---------------------------------------------------------------------------------------------------- [17:27:58] meh.(@meh):@fkchang you can ---------------------------------------------------------------------------------------------------- [17:28:24] meh.(@meh):just `p = p.then(..)` in a loop for instance, would work ---------------------------------------------------------------------------------------------------- [17:28:38] meh.(@meh):depends on how you want to do it ---------------------------------------------------------------------------------------------------- ############################## [2017-09-20] ############################## [21:37:35] Mitch VanDuyn(@catmando):OKAY TEAM PLEASE PLEASE VOTE: https://confoo.ca/en/yul2018/call-for-papers/speaker/mitch-vanduyn ---------------------------------------------------------------------------------------------------- ############################## [2017-09-21] ############################## [21:53:27] Jamie Gaskins(@jgaskins):@fkchang Sorry, been off gitter a few days. Do you mean you're resolving promises for status updates? ---------------------------------------------------------------------------------------------------- ############################## [2017-09-23] ############################## [09:51:55] Barrie Hadfield(@barriehadfield):@/all here is a build and deployment stack tutorial based on Rack, Opal Sprockets, Opal Hot Reloader, NPM and Webpack: https://github.com/ruby-hyperloop/hyperloop-rack-webpack-stack Motivation: + A Ruby based development environment which is as good as Node.js and Webpack-dev-server. + Development environment - a fast, modern, development stack for building Opal based code (including Hyperloop) with a re-build on every page refresh and hot reloading. JavaScript assets via NPM and Webpack. + Production build - a minimized production application consisting of just two files All feedback most welcome. Hope this useful to anyne building a non-rails app. Note that this is designed for Hyperloop but will work for any Opal based framework or Opal app (just ignore the Hyperloop steps) ---------------------------------------------------------------------------------------------------- ############################## [2017-10-03] ############################## [12:52:59] Frederic ZINGG(@fzingg):HI, When i run this code: ``` ``` I got the error: ``` Uncaught TypeError: item.$__id__ is not a function ``` How to access my Javascript object elements ? Thanks. ---------------------------------------------------------------------------------------------------- [12:56:30] Elia Schito(@elia):@fzingg you can either use the console: `require 'console'; $console.log @obj` ---------------------------------------------------------------------------------------------------- [12:58:06] Elia Schito(@elia):or import the objects as Hash instances: `require 'native'; puts @obj.map{|element| Hash.new(element)}` ---------------------------------------------------------------------------------------------------- [13:25:26] Frederic ZINGG(@fzingg):@elia Tx, the second one works well. ``` rubyobj = @obj.map{|element| Hash.new(element)} puts rubyobj[0][:name] ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-10-05] ############################## [03:48:38] Andrew Havens(@andrewhavens):Hello everyone. I'm trying to find an example of how to load/compile a ".erb" file. I'm new to using Opal, but I have this idea that I want to try rendering an ".erb" file on both the server side and client side. ---------------------------------------------------------------------------------------------------- [03:50:23] Andrew Havens(@andrewhavens):I came across this example (https://github.com/opal/opal/blob/master/lib/opal/erb.rb) but I don't quite understand it. It looks like it's only intended for compiling at runtime, but I want to do the compiling from an actual file at build time. ---------------------------------------------------------------------------------------------------- [20:31:36] Elia Schito(@elia):@andrewhavens here's an usage example: ```plain $ cd /tmp $ opal -v Opal v0.11.0.rc1 $ echo "require 'bar'; puts Template['bar'].render(self)" > foo.rb /p/tmp $ echo "

<%= self.inspect %>

" > bar.opalerb $ opal -I. foo.rb

main

$ opal -I. foo.rb -c > foo.js $ tail -n 20 foo.js return output_buffer.$join();}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); }; /* Generated by Opal 0.11.0.rc1 */ (function(Opal) { var self = Opal.top, $nesting = [], nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require', '$puts', '$render', '$[]']); self.$require("bar"); return self.$puts(Opal.const_get_relative($nesting, 'Template')['$[]']("bar").$render(self)); })(Opal); /* Generated by Opal 0.11.0.rc1 */ (function(Opal) { var self = Opal.top, $nesting = [], nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$exit']); return Opal.const_get_relative($nesting, 'Kernel').$exit() })(Opal); ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-10-06] ############################## [15:34:03] Forrest Chang(@fkchang):@elia did you do the sourcemaps support? I was wondering if there's a way to customize which source maps get requested to the browser, I'd love to be able to cherry pick which source maps get loaded or even do it on demand ---------------------------------------------------------------------------------------------------- [17:28:21] Adrian Madrid(@aemadrid):anybody using `opal` with `brunch`? ---------------------------------------------------------------------------------------------------- [22:41:57] Elia Schito(@elia):@fkchang I did, at least in part, will provide all the support if you intend to work on that ---------------------------------------------------------------------------------------------------- ############################## [2017-10-08] ############################## [20:22:09] Forrest Chang(@fkchang):@elia if you know how that should work in general, I'd be willing to tackle that ---------------------------------------------------------------------------------------------------- ############################## [2017-10-09] ############################## [21:30:06] Elia Schito(@elia):@fkchang yes it works AFAICT, you were thinking about tackling it in sprockets or in some other system? ---------------------------------------------------------------------------------------------------- [21:32:26] Elia Schito(@elia):@fkchang probably the two places you want to start from are https://github.com/opal/opal-sprockets/blob/master/lib/opal/sprockets/source_map_server.rb and https://github.com/opal/opal/blob/master/lib/opal/simple_server.rb#L36-L38 ---------------------------------------------------------------------------------------------------- ############################## [2017-10-10] ############################## [16:33:36] Forrest Chang(@fkchang):@elia what I've been unable to figure out in the past is exactly what the browser server interactions should be, I'd like to write a tool that allow me to surpress source maps until I want them, and then cherry pick which ones to load, vs the "load the entire Ruby std lib, all your gems, one file at a time before the browser finishes your requests" behavior that currently happens ---------------------------------------------------------------------------------------------------- [17:01:59] Elia Schito(@elia):@fkchang being this the problem space I think would be valueable to research what other tools/compilers are doing since I fear that's more on the browser side of things. That said I think even a way to skip source maps for certain files (e.g. non user code like core+stdlib) would be useful to reduce noise and make load times faster. ---------------------------------------------------------------------------------------------------- ############################## [2017-10-11] ############################## [20:37:54] Mitch VanDuyn(@catmando):@/all dumb question. Does the opal compiler on the server (i.e. running as part of sprockets) run regular MRB ruby or is it running inside of a JS engine? ---------------------------------------------------------------------------------------------------- [20:53:57] Forrest Chang(@fkchang):whatever the server ruby is, MRI or Jruby ---------------------------------------------------------------------------------------------------- [21:01:56] Mitch VanDuyn(@catmando):okay... but just to be clear its not making the compilation be done inside of some JS engine right? We are trying to understand why it take sprockets 6 seconds to recompile just a few .rb files... ---------------------------------------------------------------------------------------------------- [22:08:45] Forrest Chang(@fkchang):I suspect that's more of an @elia question, though I'd guess Adam did most of that, opal compiler doesn't need JS to transpile opal to JS, not certain what the execjs requirement is for opal-rails, looking at the gemspec, I notice 2 things, 1) it's a development dependency so it's not required for deploy 2), most of the other development dependencies are to support testing, which require JS ---------------------------------------------------------------------------------------------------- [22:20:10] Elia Schito(@elia):@catmando the first thing you need to che is if the sprockets cache is working properly. Apart from that I guess could just be that Ruby is slow at this kind of code (compiling). On master the slowest part is the lexer, never checked for 0.10 but could easily be something similar. ---------------------------------------------------------------------------------------------------- [22:22:03] Elia Schito(@elia):Also if you happen to find the bottleneck and it is in fact optimizable I’m willing to do what I can to help as I see slow compilations at my workplace too ---------------------------------------------------------------------------------------------------- [22:47:32] Forrest Chang(@fkchang):wonder if we could port the compiler to crystal? ---------------------------------------------------------------------------------------------------- [22:52:10] Elia Schito(@elia):I was reading just yesterday an interesting pr with the parser (gem) reimplemented in c, it wasn’t merged but something like that despite the difficulty, would be very useful ---------------------------------------------------------------------------------------------------- ############################## [2017-10-12] ############################## [18:44:51] Jan Biedermann(@janbiedermann):great, thanks, i will try ---------------------------------------------------------------------------------------------------- [20:12:19] Adrian Madrid(@aemadrid):I can’t seem to get `Opal-Console` to work ---------------------------------------------------------------------------------------------------- [20:13:10] Adrian Madrid(@aemadrid):in the Chrome console I can get `Opal.RUBY_VERSION = “2.2.7”` but I get the `Opal not running or older than 0.7 - Console not supported for this page` in the `Opal-Console` ---------------------------------------------------------------------------------------------------- [21:22:59] Forrest Chang(@fkchang):@aemadrid it works, but there's something I need to fix with newer opal, ignore the message and type this in to handle a formatting bug ---------------------------------------------------------------------------------------------------- [21:23:10] Forrest Chang(@fkchang):```ruby OpalConsole.config.auto_pretty_print = false ``` ---------------------------------------------------------------------------------------------------- [21:23:33] Forrest Chang(@fkchang):@aemadrid I need to get around to fixing that ---------------------------------------------------------------------------------------------------- [22:06:13] Elia Schito(@elia):@janbiedermann @fkchang re windows: I think `RbConfig::CONFIG['host_os']` can have different values for mingw, cygwin, and other windows variants ---------------------------------------------------------------------------------------------------- [22:27:03] Adrian Madrid(@aemadrid):@fkchang that worked! I had to do it a couple times though because I was getting errors like `Exception: TypeError: Cannot read property '$==' of undefined` ---------------------------------------------------------------------------------------------------- [22:27:11] Adrian Madrid(@aemadrid):but doing it again usually solved that ---------------------------------------------------------------------------------------------------- [01:01:42] Colin Gunn(@balmoral):@/all Anyone know how to enable source maps with Roda opal assets? Might be an opal tilt option. ---------------------------------------------------------------------------------------------------- [02:17:00] Jamie Gaskins(@jgaskins):@balmoral Do you mean the `:assets` plugin that comes with Roda or the `roda-opal_assets` gem? ---------------------------------------------------------------------------------------------------- [02:19:13] Colin Gunn(@balmoral):@jgaskins yes - the `:assets` plugin provides `:js_opts` which get passed to `tilt`, but I’ve no idea where to start with that. I’ve tried `Opal::Config.source_map_enabled = true` before setting up the `Opal::Builder` and calling the plugin, but no luck. ---------------------------------------------------------------------------------------------------- [02:20:23] Colin Gunn(@balmoral):@jgaskins oh sorry - not not the `roda-opal_assets` gem, just straight usage of Roda for `roda-opal-example` ---------------------------------------------------------------------------------------------------- [02:21:07] Jamie Gaskins(@jgaskins):To be honest, I haven't had much success with the `:assets` plugin. I never got it to work with `require`. :-\ So it seems to be great if you load all your Opal dependencies and then all of your individual assets separately. ---------------------------------------------------------------------------------------------------- [02:22:21] Jamie Gaskins(@jgaskins):This might get you what you need, though https://github.com/clearwater-rb/roda-opal_assets ---------------------------------------------------------------------------------------------------- [02:26:15] Colin Gunn(@balmoral):`require` seems to work ok with my example. I’ve even moved some code out of `assets/js` and into a `lib` folder, with a stub `assets/js/main.rb` file which requires, say, `lib/client/app.rb`. And got `:dependencies` going so any file changes get past the caching. I’ll check out `roda-opal_assets` again. Thanks for you help. ---------------------------------------------------------------------------------------------------- [02:27:30] Jamie Gaskins(@jgaskins):Nice. I'd be happy to hear how you got that working some time :-) ---------------------------------------------------------------------------------------------------- [02:40:36] Colin Gunn(@balmoral):Very early days, but here’s what I’ve got so far: https://github.com/balmoral/roda-opal-example.git ---------------------------------------------------------------------------------------------------- [02:44:49] Colin Gunn(@balmoral):It would be nice to have a Roda plugin which handles opal/ruby explicitly. A bit beyond my pay grade at present :smile: ---------------------------------------------------------------------------------------------------- [06:29:34] Jan Biedermann(@janbiedermann):@catmando @elia @fkchang i would like to add some numbers to the performance issue: changing a file within a set 10 that is `require_tree 'component'` in rails sprockets: 6 seconds compiling that set of 10 files with Opal::Compiler from irb: 0.026 seconds Its NOT the compiler being slow. Now even if you add some file and cache checks to that 0.026 seconds, and maybe concatenate 3 megabytes of cached code -> 6 seconds is faaaar, faaaaaaaar awaahaay ... ---------------------------------------------------------------------------------------------------- [08:07:45] Elia Schito(@elia):@janbiedermann nice benchmark, did you try with Opal::Builder too? is `require 'opal'` part of the benchmark for the two cases? If the answer to the latter question is yes I think we should report it to the sprockets team… ---------------------------------------------------------------------------------------------------- [09:51:18] Jan Biedermann(@janbiedermann):@elia @catmando i just identified part of the problem, makes me wanno freak out, wtf?: in sprockets-3.7.1/lib/sprockets/uri_utils.rb, def split_file_uri(uri), commenting out this: ``` # Hack for parsing Windows "file:///C:/Users/IEUser" paths path.gsub!(/^\/([a-zA-Z]:)/, '\1'.freeze) ``` reduces load time (without compilation) from 3 to 1,5 seconds, i will report this for sure ---------------------------------------------------------------------------------------------------- [09:51:47] Elia Schito(@elia)::rocket: ---------------------------------------------------------------------------------------------------- [12:37:51] Jan Biedermann(@janbiedermann):@elia another issue is, that with opal, the entire ruby load_path becomes an asset load_path to, now sprockets walks all those directories looking for file changes, thousands of directories and files, with File.stat, which is slow. To make it fast, it should only check the files within the app for changes, maybe that would be the task for opal-rails or opal-sprockets to limit sprockets in that way, not sure how to achieve this. How can i achieve this? ---------------------------------------------------------------------------------------------------- [12:39:35] Elia Schito(@elia):@janbiedermann that's something that actually would help sprockets perfs for any project/compiler, I mean being able to make it stat files only in some dirs and consider other directories as "static". ---------------------------------------------------------------------------------------------------- [12:41:55] Jan Biedermann(@janbiedermann):alright, checking out sprockets ... ---------------------------------------------------------------------------------------------------- [12:42:17] Elia Schito(@elia)::turtle: :turtle: :turtle: :turtle: ---------------------------------------------------------------------------------------------------- [12:43:17] Elia Schito(@elia):@janbiedermann just to add some info, I think in rails 5 sprockets should rely on the file watcher to detect changes, not 100% sure tho ---------------------------------------------------------------------------------------------------- [13:59:28] Jan Biedermann(@janbiedermann):@elia @catmando, just to verify this sprockets thing i gorilla patched sprockets-3.7.1/lib/sprockets/path_utils.rb with ```ruby module PathUtils extend self def stat(path) root = '/put/rails/root/path/here/app' if (path[0..(root.size-1)] != root) @@gorilla_patch_cached_stats ||= {} return @@gorilla_patch_cached_stats[path] if @@gorilla_patch_cached_stats.has_key?(path) @@gorilla_patch_cached_stats[path] = if File.exist?(path) File.stat(path) else nil end else if File.exist?(path) File.stat(path) else nil end end end ``` Results: normal get of page with stock Sprockets 3.7.1: **4 seconds** with my 2 gorilla patches: ###483ms of which in sprockets 0.2s :) :rocket: on second page load ---------------------------------------------------------------------------------------------------- [14:40:15] Elia Schito(@elia)::bomb: :clap: ---------------------------------------------------------------------------------------------------- [14:45:54] Elia Schito(@elia):@janbiedermann I'm copying the patch to my current project right now :smile: ---------------------------------------------------------------------------------------------------- [14:47:05] Jan Biedermann(@janbiedermann):Please express your primal urge here: https://github.com/rails/sprockets/issues/504 ---------------------------------------------------------------------------------------------------- [15:01:20] Elia Schito(@elia):@janbiedermann any reason for this `if path[7..9].include?(':')` not being this `if path[9] == ':'`? ---------------------------------------------------------------------------------------------------- [15:01:59] Jan Biedermann(@janbiedermann):thats just because i don't know if its possible to have /c: //c: or ///c:, i was to lazy to check ---------------------------------------------------------------------------------------------------- [15:03:12] Jan Biedermann(@janbiedermann):if only that 9 case is legal, perfect :), is it? ---------------------------------------------------------------------------------------------------- [15:03:12] Elia Schito(@elia):👍🏼 my guess is that the protocol is `[a-z]+://` and only the third slash acts as root indicator ---------------------------------------------------------------------------------------------------- [15:03:32] Jan Biedermann(@janbiedermann):oh, right, makes sense :+1: ---------------------------------------------------------------------------------------------------- [15:03:37] Elia Schito(@elia):let's see what they say… ---------------------------------------------------------------------------------------------------- [18:25:37] Forrest Chang(@fkchang):@janbiedermann re: the windows gsub, maybe we only do that if the platform is windows, then at least the linux/osx users won't have that ---------------------------------------------------------------------------------------------------- [18:25:42] Forrest Chang(@fkchang):but good work ---------------------------------------------------------------------------------------------------- [18:29:58] Jan Biedermann(@janbiedermann):@fkchang i agree, this path[9] == ':' comes almost for free, so if there is a ':' its windows, how else would you check? ---------------------------------------------------------------------------------------------------- [18:44:00] Forrest Chang(@fkchang):@janbiedermann for recent rubies something like this would work ```ruby require 'rbconfig' @platform = case RbConfig::CONFIG['host_os'] when /darwin/ OSX when /win/ WINDOWS end ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-10-13] ############################## [00:16:08] Jamie Gaskins(@jgaskins):@janbiedermann Is that performance difference on first request or subsequent requests? ---------------------------------------------------------------------------------------------------- [04:49:24] Jan Biedermann(@janbiedermann):@jgaskins subsequent requests only, because on first pass cache must be filled ---------------------------------------------------------------------------------------------------- [04:50:18] Jan Biedermann(@janbiedermann):@elia @fkchang sprockets tests for windows with `if File::ALT_SEPARATOR` ---------------------------------------------------------------------------------------------------- ############################## [2017-10-14] ############################## [18:03:48] Jamie Gaskins(@jgaskins):@janbiedermann That makes sense. I don't see that performance issue with the `roda-opal_assets` gem, though. When I refresh, my app loads instantly no matter how many files it has, so I don't think Sprockets is the issue. ---------------------------------------------------------------------------------------------------- [18:19:09] Jan Biedermann(@janbiedermann):@jgaskins thats interesting, do you have a repo at hand? ---------------------------------------------------------------------------------------------------- [18:22:42] Jamie Gaskins(@jgaskins):@janbiedermann Sure https://github.com/jgaskins/clearwater_roda_example Clone it and run `./dev` to start it up ---------------------------------------------------------------------------------------------------- [18:22:58] Jan Biedermann(@janbiedermann):@jgaskins thanks ---------------------------------------------------------------------------------------------------- [18:27:23] Jamie Gaskins(@jgaskins):Part of it is that `roda-opal_assets` lets Sprockets use the browser's HTTP caching, but even if you Shift-Cmd-R to bypass the cache, it still loads very quickly. ---------------------------------------------------------------------------------------------------- [21:27:47] Jan Biedermann(@janbiedermann):https://github.com/rails/sprockets/pull/506, i believe it is sprockets ;) @jgaskins ---------------------------------------------------------------------------------------------------- [21:30:01] Jan Biedermann(@janbiedermann):thats the moderate version ---------------------------------------------------------------------------------------------------- [23:12:32] Jan Biedermann(@janbiedermann):https://github.com/rails/sprockets/pull/507, gorilla version, i still believe its sprockets ---------------------------------------------------------------------------------------------------- ############################## [2017-10-15] ############################## [04:04:49] Jamie Gaskins(@jgaskins):Weird. I don't understand why you and I would be seeing such different performance, then. ---------------------------------------------------------------------------------------------------- [04:35:53] Colin Gunn(@balmoral):Does anyone know of problems with condional requires using sprockets for testing RUBY_PLATFORM indirectly? I’m using a Platform module which goes like: ``` module Platform module_function def opal? RUBY_PLATFORM == 'opal' end def client? opal? end def server? !opal? end end ``` If I use this like ``` if Platform.client? require ‘client_code.rb’ else require ‘server_code.rb’ end ``` then opal sprockets loads `server_code.rb` when RUBY_PLATFORM is ‘opal’. If I use ``` if RUBY_PLATFORM == ‘opal' require ‘client_code.rb’ else require ‘server_code.rb’ end ``` it works ok. ---------------------------------------------------------------------------------------------------- [05:58:18] Jan Biedermann(@janbiedermann):@jgaskins for your clearwater_roda_example, the load_path is to small, to make a difference. increase load_path size, and loaded set, and sprockets will become a problem. You have just 6 load_paths to look things up, with rails and hyperloop there are hundreds of load paths and over 340 .rb files compiled. ---------------------------------------------------------------------------------------------------- [08:20:59] Colin Gunn(@balmoral):@jgaskins FYI I’ve given up on roda assets plugin (couldn’t get source maps going) and I’ve switched to roda-opal_assets type setup. I don’t much like putting my ruby code under assets/js so have structured it under lib/client, lib/common, lib/server... Thanks for a great example of how to pull all this stuff together. ---------------------------------------------------------------------------------------------------- [08:47:14] Torsten Rüger(@dancinglightning):@balmoral As far as i understood, the test for RUBY_PLATFORM is a compile time thing. Bit like #ifdef in the c days. So the compiler removes the appropriate require completely. If do the test in code (indirectly) both requires are included to be able to perform both branches at runtime. ---------------------------------------------------------------------------------------------------- [10:30:55] Jan Biedermann(@janbiedermann):@elia check current https://github.com/rails/sprockets/pull/506, sprockets uses an internal cache, hardcoded to 1024 entries, which is far to little for ruby-hyperloop or any other large opal-rails project. constant cache misses where the result, https://github.com/rails/sprockets/pull/506 now fixes this and gives me unbelieavable good numbers with opal, also for recompiles :) ---------------------------------------------------------------------------------------------------- [20:57:18] Elia Schito(@elia):@balmoral, @dancinglightning is right, that check is done at compilation level so the constant must be used explicitly, the only alternatives that comes to mind are: - to require the same filename but have different include paths for server & client, that can lead to some confusion - to keep the code as is and configure opal to ignore load errors (setting `dynamic_require_severity` to `ignore`), the con here is that you may miss some actual error in your app ---------------------------------------------------------------------------------------------------- [22:27:50] Elia Schito(@elia):@janbiedermann good catch! As a matter of fact our main app was hitting both the memstore (1024 entries) and the filestore limit (25MB) putting the latter under constant sprockets-GC pressure. Thanks a lot for looking into this, I’ll add this feedback to the PRs too first thing Monday morning 👍🏻👍🏻👍🏻 ---------------------------------------------------------------------------------------------------- [23:02:31] Colin Gunn(@balmoral):Thanks @dancinglightning and @elia for the explanation. Was only a semantic nicety, so great loss. :smile: ---------------------------------------------------------------------------------------------------- ############################## [2017-10-16] ############################## [00:19:14] Colin Gunn(@balmoral):I frequently/randomly get this error when source maps are being fetched from the server: ``` RuntimeError: can't add a new key into hash during iteration /Users/col/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/set.rb:171:in `replace' /Users/col/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/set.rb:171:in `replace' /Users/col/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/set.rb:381:in `collect!' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:85:in `asset_from_cache' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:57:in `block in load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:307:in `each' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:307:in `each_with_index' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:23:in `block in call' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/utils.rb:200:in `dfs' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:24:in `call' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/environment.rb:30:in `find_asset' /Users/col/.rvm/gems/ruby-2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:92:in `[]' /Users/col/.rvm/gems/ruby-2.4.0/bundler/gems/opal-sprockets-c5ce8dc6c5c5/lib/opal/sprockets/source_map_server.rb:87:in `call' /Users/col/.rvm/gems/ruby-2.4.0/gems/rack-2.0.3/lib/rack/etag.rb:25:in `call' /Users/col/.rvm/gems/ruby-2.4.0/gems/rack-2.0.3/lib/rack/conditional_get.rb:25:in `call' /Users/col/.rvm/gems/ruby-2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:153:in `call’ ``` I seem to remember it occuring a while back with Volt too. Haven’t noticed any downside, maybe just will miss a source map. ---------------------------------------------------------------------------------------------------- [00:20:20] Jamie Gaskins(@jgaskins):@janbiedermann Added 350 load paths and files and, sure enough, it's slow as shit on Sprockets 3.7.1. Your patch doesn't make it any faster for me, though, so I'm not sure what we're doing differently. ---------------------------------------------------------------------------------------------------- [00:20:43] Jamie Gaskins(@jgaskins):@balmoral Are you using Puma? ---------------------------------------------------------------------------------------------------- [00:21:00] Colin Gunn(@balmoral):@dancinglightning @elia ^Was only a semantic nicety, so NO great loss. :smile: ---------------------------------------------------------------------------------------------------- [00:22:24] Colin Gunn(@balmoral):@jgaskins mostly using puma, but also testing with thin when experimenting with websockets (seem to get different debug output) ---------------------------------------------------------------------------------------------------- [00:22:44] Jamie Gaskins(@jgaskins):That's usually a multi-threading issue with Sprockets — one thread is trying to add something to the cache while another is iterating. ---------------------------------------------------------------------------------------------------- [00:22:54] Jamie Gaskins(@jgaskins):I primarily see it while using Puma because threads :-) ---------------------------------------------------------------------------------------------------- [00:24:13] Colin Gunn(@balmoral):Thought it might be something like that - is there any way of making it thread safe? ---------------------------------------------------------------------------------------------------- [00:26:03] Jamie Gaskins(@jgaskins):I assume something like this might work: ```ruby class App < Roda assets = Roda::OpalAssets.new mutex = Mutex.new route do |r| mutex.synchronize { assets.route r } end end ``` ---------------------------------------------------------------------------------------------------- [00:26:51] Jamie Gaskins(@jgaskins):It would only serve one asset at a time but the rest of the app would run multithreaded ---------------------------------------------------------------------------------------------------- [00:28:09] Jamie Gaskins(@jgaskins):I've been ignoring it mainly because it doesn't seem to harm anything. ---------------------------------------------------------------------------------------------------- [00:30:33] Jamie Gaskins(@jgaskins):I haven't done the mutex thing myself because that's what Rails does and `Roda::OpalAssets` serves my apps 3x as fast. :-) ---------------------------------------------------------------------------------------------------- [00:37:13] Jamie Gaskins(@jgaskins):@janbiedermann I'd be surprised if any app really needs that many load paths and files, though. That sounds like an excessive number of files to load and an especially _massive_ number of load paths for a single front-end app. ---------------------------------------------------------------------------------------------------- [00:37:14] Colin Gunn(@balmoral):@jgaskins I’ve placed the mutex so that it only syncs when it’s a serving source map request - works great! Thanks for the tip. :smile: ---------------------------------------------------------------------------------------------------- [00:37:23] Jamie Gaskins(@jgaskins):@balmoral Nice! ---------------------------------------------------------------------------------------------------- [00:38:53] Elia Schito(@elia):@jgaskins this is what seems to have resolved the super slow compiling times we were noticing lately: ``` assets_cache_path = "#{::Rails.root}/tmp/cache/assets/#{::Rails.env}" Rails.application.assets.cache = Sprockets::Cache::FileStore.new(assets_cache_path, 200.megabytes) ``` maybe you're hitting the 25mb limit too… ---------------------------------------------------------------------------------------------------- [00:41:18] Jamie Gaskins(@jgaskins):Oh, good point, I didn't think about cache limits. I'm using the in-memory cache, which IIRC is capped at 1000 entries by default. With > 400 assets, plus source maps, my sample app doesn't have much breathing room. ---------------------------------------------------------------------------------------------------- [01:11:20] Colin Gunn(@balmoral):@jgaskins code snippet for source maps thread safety, no noticeable slow down in response… ``` def source_map_prefix '/__OPAL_SOURCE_MAPS__' end def init_source_maps if Opal::Config.source_map_enabled = config.source_maps? && development? ::Opal::Sprockets::SourceMapHeaderPatch.inject!(source_map_prefix) opal_source_map_server = Opal::SourceMapServer.new(sprockets, source_map_prefix) builder = Rack::Builder.new do use Rack::ConditionalGet use Rack::ETag run opal_source_map_server end mutex = Mutex.new @source_map_server = lamba do |env| mutex.synchronize do builder.call(env) end end end end def route(r) … r.on source_map_prefix[1..-1] do r.run @source_map_server end ... end ``` ---------------------------------------------------------------------------------------------------- [01:22:54] Colin Gunn(@balmoral):@elia @janbiedermann @jgaskins load time for my app (nearly 1000 files) halved by doubling sprockets cache memory store size ---------------------------------------------------------------------------------------------------- [08:41:25] Jan Biedermann(@janbiedermann):@balmoral if you got the cache size right, you can determine by measuring the time taken for a `javascript_include_tag` with `Benchmark.measure do`, for me that was double digit seconds, when the cache size is right it schould be 0.00xxx s on a page load without compile. ---------------------------------------------------------------------------------------------------- ############################## [2017-10-24] ############################## [08:22:55] Jan Biedermann(@janbiedermann):how can i use opal 0.11 with opal-rails or sprockets 4 with opal? are there branches for this available? ---------------------------------------------------------------------------------------------------- [09:32:43] Jan Biedermann(@janbiedermann):Oh, i just saw opal-rails master got updated for 0.11 :) ---------------------------------------------------------------------------------------------------- [10:18:19] Elia Schito(@elia):@janbiedermann yeah the current plan is to release once I have opal-{rails,jquery,haml,sprockets,rspec} working with 0.11 ---------------------------------------------------------------------------------------------------- [10:20:52] Elia Schito(@elia):@janbiedermann as for sprockets 4.0 it's a bit in stall as it wasn't very clear where the sprockets team was going after moving the repo to the rails org ---------------------------------------------------------------------------------------------------- [10:32:29] Jan Biedermann(@janbiedermann):@elia thanks, i understand. I just tried compiling ruby-hyperloop with opal 0.11. hyperloop brings a lot of code to compile for the client/browser/opal to get going, so this code has to be compiled at once after installing hyperloop and maybe again after changes to the gems and so on. hyperloop relies on sprockets, so sprockets, the opal processor will do the job. Some numbers: opal-0.10.5: ``` tc: 62.290000 7.360000 69.650000 ( 69.664902) tr: 2.750000 0.460000 3.210000 ( 3.173351) ts: 18.900000 30.560000 49.460000 ( 49.552422) ``` opal-0.11 ``` tc: 207.540000 10.260000 217.800000 (218.658982) tr: 4.320000 0.410000 4.730000 ( 4.778514) ts: 27.070000 37.370000 64.440000 ( 64.722876) ``` tc: time spent in the compiler tr: sprockets processing requires ts: caching source maps tc grew with 0.11 around 3 times. Are there any ideas how to make the processor/compiler faster, that where just not implemented yet? Or can i change some compiler setting? Or how can i make this process faster? ---------------------------------------------------------------------------------------------------- [10:33:47] Jan Biedermann(@janbiedermann):numbers are for compiling ~350 files ---------------------------------------------------------------------------------------------------- [10:37:44] Elia Schito(@elia):@janbiedermann the compiler of 0.11 relies on the "parser" gem, which is much more complete, but also does more work, I think would be interesting to see how much of compiler time is spent in parsing, I don't think any compiling option affects compile time (usually the effects are at runtime) except maybe for generating source maps… ---------------------------------------------------------------------------------------------------- [10:38:30] Jan Biedermann(@janbiedermann):ok, i will check that :) parser ---------------------------------------------------------------------------------------------------- [10:41:05] Elia Schito(@elia):@janbiedermann just the other day I was looking at a PR to parser by @alexdowad for a C implementation of its bottleneck that was finally turned down for a number of reasons ---------------------------------------------------------------------------------------------------- [10:42:47] Jan Biedermann(@janbiedermann):interesting, i will look for that, thanks ---------------------------------------------------------------------------------------------------- [16:29:04] Jan Biedermann(@janbiedermann):@elia confirmed, ~85% of the time are spent in Parser::Base.parse ---------------------------------------------------------------------------------------------------- ############################## [2017-10-25] ############################## [17:54:19] Mitch VanDuyn(@catmando):@elia (or anybody else :-) is there any way to run a specific test (or at least a test file) in opal-rspec. ---------------------------------------------------------------------------------------------------- [17:55:01] Mitch VanDuyn(@catmando):I am following current instructions for browser, i.e. running rackup, then browsing localhost:9292 which all works fine, but I have a single test failing. Anyway to easily just run that one test case? ---------------------------------------------------------------------------------------------------- [20:37:29] Mitch VanDuyn(@catmando):@/all does anybody know about this problem? Object#tap is converting booleans to JS Boolean objects, which are not the same. Sample code here: ---------------------------------------------------------------------------------------------------- [20:37:31] Mitch VanDuyn(@catmando):http://opalrb.com/try/?code:p_false%20%3D%20%60new%20Boolean(false)%60%0Aputs%20%22is%20p_false%20false%3F%20%20%23%7Bp_false%20%3D%3D%20false%7D%22%0Aputs%20%22is%20p_false%20%26%26%20true%20true%3F%20%20%23%7Bp_false%20%26%26%20true%7D%22# ---------------------------------------------------------------------------------------------------- [21:14:00] Mitch VanDuyn(@catmando):actual problem seems to be in "yield" itself... can't quite figure it out... ---------------------------------------------------------------------------------------------------- [21:14:25] Mitch VanDuyn(@catmando):any pointers to where this "block" method that is referenced in "yield1" would help me debug it... ---------------------------------------------------------------------------------------------------- [23:15:03] Elia Schito(@elia):The new Opal-RSpec will have a CLI that will work more or less like the original RSpec CLI, including the single file running capabilities ---------------------------------------------------------------------------------------------------- ############################## [2017-10-26] ############################## [04:07:58] Mitch VanDuyn(@catmando):@elia Yeah I was just trying to figure out this problem that appeared to be hyper-react, but as it turns out, its this issue with yields magically converting `false` to JS `new Boolean(false)` values. Any tips on where that `block` method might be would be appreciated, and I will get a PR done asap. ---------------------------------------------------------------------------------------------------- [06:51:39] LeoDaoTao(@LeoDaoTao):I’ve been experimenting with opal-rails today and I really like the way it handles jQuery. I’ve tried a few jQuery plugins that I use in some of my projects and all just work fine once I expose the methods. I’m having an issue with one of them — jCanvas. I expose the method I’m using (just trying the example from jCanvas homepage), but it does not work and there is no error, it just does not draw on the canvas. If I use JS in the console it works as expected so everything is loaded correctly. Maybe an issue with the way canvas works but I’m not sure. Any ideas on how can even start troubleshooing this? Hard to troubleshoot if you don’t get errors :-) ---------------------------------------------------------------------------------------------------- [06:53:50] Barrie Hadfield(@barriehadfield):@LeoDaoTao try `.to_n` if you are passing an array to a JS method ---------------------------------------------------------------------------------------------------- [06:58:26] LeoDaoTao(@LeoDaoTao):@barriehadfield I’m passing a hash and .to_n did the trick ---------------------------------------------------------------------------------------------------- [06:59:19] LeoDaoTao(@LeoDaoTao):@barriehadfield Thank you! ---------------------------------------------------------------------------------------------------- [07:10:12] LeoDaoTao(@LeoDaoTao):@barriehadfield I’m wondering if this maybe should be done by Opal internally? Are there any cases where .to_n would not be used? ---------------------------------------------------------------------------------------------------- [07:31:49] Elia Schito(@elia):@leodaotao Despite the similar syntax and usage js objects and hashes have major differences, I thought a couple of times about introducing a special syntax or method to produce js objects directly (eg `JS{foo: :bar}`) but never went much further ---------------------------------------------------------------------------------------------------- [07:33:20] LeoDaoTao(@LeoDaoTao):@elia yeah, just realized that after looking up JS docs, JS is not my strong point ---------------------------------------------------------------------------------------------------- [07:39:00] LeoDaoTao(@LeoDaoTao):@elia @barriehadfield so let’s say I have jQuery code that looks like this: ``` $('canvas').drawPolygon({ x: 100, y: 100, radius: 50, click: function(layer) { $(this).animateLayer(layer, { rotate: '+=144' }); } }); ``` How do I get the function passed to click: to work with opal ? ---------------------------------------------------------------------------------------------------- [08:47:38] Elia Schito(@elia):@LeoDaoTao I think it would be something like: ``` Element['canvas'].drawPolygon({ x: 100, y: 100, radius: 50, click: -> (layer) { Element[`this`].animateLayer(layer, { rotate: '+=144' }.to_n); } }.to_n) ``` Note that inside the lamda `self` comes from the lambda definition, that's why we need to explicitly reference `this` in backticks ---------------------------------------------------------------------------------------------------- [22:24:06] LeoDaoTao(@LeoDaoTao):@elia Thank you, I get a `Uncaught TypeError: self.$to_a is not a function` on the click event what could be causing this? ---------------------------------------------------------------------------------------------------- [22:25:43] Elia Schito(@elia):@LeoDaoTao you have to inspect the stacktrace in order to find the cause ---------------------------------------------------------------------------------------------------- [22:27:25] LeoDaoTao(@LeoDaoTao):@elie not sure I understand the error though, let me try to disect it more :-) ---------------------------------------------------------------------------------------------------- [22:34:36] LeoDaoTao(@LeoDaoTao):@elie I’m thinking of using a different canvas library though. jCanvas creates too much spaghetti code that looks bad even when written in ruby. I tried fabric.js which is pure JS and it works with objects. Translates to ruby objecs pretty nicelly when wrapped in Native. I think I’ll just wrap parts of it that I need. Very nice work you guys did with Opal. It’s really impressive! ---------------------------------------------------------------------------------------------------- ############################## [2017-10-27] ############################## [01:13:56] Forrest Chang(@fkchang):@elia the JS object direct syntax is something I would be interested in, but I'd have to think through all the ramifications ---------------------------------------------------------------------------------------------------- [12:17:22] Jan Biedermann(@janbiedermann):@elia the compile performance problem i mentioned before, opal 0.11 being 3 times slower, well, its not. The new parser of 0.11 uses method_missing a lot, when method_missing got overwritten by something not that fast, that will have a very negative effect on compile times. Thats what happened. ---------------------------------------------------------------------------------------------------- [13:44:26] Elia Schito(@elia):@janbiedermann interesting! you have any pointers in the code? I'd like to understand what's going on in a more tangible way ---------------------------------------------------------------------------------------------------- [14:15:00] Jan Biedermann(@janbiedermann):yes, i used stackprof gem to profile the compilation from within the opal-sprockets processor. method_missing is called a lot at the end of the process, but the trace doesn't give more detail than Opal::Compiler#compile here, and during parsing, its called most of the time from lib/parser/lexer.rb#advance. You can see the most dramatic effect by compiling this lexer.rb from within sprockets. This file compiled manually takes ~4s, in sprockets it took ~190s, without method_missng overwritten this file still takes much longer to compile. The time used then within Parser::AST::Node#assign_properties. I don't understand yet whats different there to the "manual" compile. ---------------------------------------------------------------------------------------------------- [14:17:29] Jan Biedermann(@janbiedermann):maybe i need to increase the stackprof resolution there. ---------------------------------------------------------------------------------------------------- [15:04:54] Elia Schito(@elia):@iliabylich see above, maybe you have some more insight into this ---------------------------------------------------------------------------------------------------- [19:07:32] Jan Biedermann(@janbiedermann):Another 0.11 issue, an out of place top level constant: ``` undefined method `component_did_mount' for class `String::Hyperloop::Component::Mixin' ``` The odd thing here being the `String` This does not happen on 0.10.5, but on 0.11 master. I followed it in the debugger, `$parent()` `$$parent` for Hyperloop look fine, this String comes from $$base_module, this gets set when a modules is loaded. What stopped me here is, this Hyperloop::Whatever::Something appears on to many places. How can i find the cause of this? ---------------------------------------------------------------------------------------------------- [23:12:22] Jan Biedermann(@janbiedermann):@elia @iliabylich the thing that was causing this performance problems really was that const missing. The other issue, for the remaining performance problem, has been an issue with my environment. I fixed that. Sorry if caused trouble. All works fine now and beautifully fast. ---------------------------------------------------------------------------------------------------- ############################## [2017-10-28] ############################## [09:19:03] Elia Schito(@elia):@janbiedermann looks related to constant lookup, if given a repro of any kind I can try looking into it (or give directions for anyone wanting to try) ---------------------------------------------------------------------------------------------------- [12:43:26] Jesus Castello(@matugm):Hi :) ---------------------------------------------------------------------------------------------------- [12:43:58] Jesus Castello(@matugm):Would Opal be a good solution for evaluating code on a "interactive coding exercises" kind of site? ---------------------------------------------------------------------------------------------------- [12:44:22] Jesus Castello(@matugm):Instead of evaluating the code on the server & having to sandbox everything. ---------------------------------------------------------------------------------------------------- [19:43:52] Xavier Riley(@xavriley):Hi :wave: I'm hoping to use Opal to implement a subset of Sonic Pi (a Ruby based live coding music environment http://sonic-pi.net/) in the browser with web audio. Most of that should be straightforward but a key part of that API is how it uses multiple threads with calls to `sleep`. While I don't have threads in JS, I can approximate a non-blocking sleep with the following: ``` function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function kick() { console.log("boom") await sleep(1000); } async function hihats() { console.log("tick") await sleep(500); console.log("tick") await sleep(500); } // viewing the console shows these execute concurrently kick(); hihats(); ``` In terms of porting to Opal, I had the following idea. If a class is bridged from an `AsyncFunction`, the parser could check for ``` (async function(){}).constructor.name === "AsyncFunction" ``` and add the `async` keyword in front of the function call for generated methods. That would allow for something like the following: ``` %x{ var async_bridge_class_demo = Object.getPrototypeOf(async function(){}).constructor; async_bridge_class_demo.prototype.$sleep = function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }; } class BridgeFoo < `async_bridge_class_demo` def self.baz puts "in block" `await #{sleep(2000)}` puts "still in block" end end BridgeFoo.baz ``` At the moment this fails because the `await` keyword is placed inside a non-async generated function. Firstly, does this seem like a reasonable approach? Secondly, is this the kind of thing that I'd use a rewriter for? Ideally I'd like to be able to make the `await` implicit so that `sleep(2000)` doesn't have to be placed in backticks but I can't think of a better way at present. ---------------------------------------------------------------------------------------------------- [20:41:18] Xavier Riley(@xavriley):sorry for the noise - I'm still reading up. I'll try to put together a PR once I understand it a bit better ---------------------------------------------------------------------------------------------------- [22:40:17] Forrest Chang(@fkchang):@matugm http://fkchang.github.io/opal-irb/index-jq.html#code:msg%20%3D%20%22Jesus%20Castello%2C%20opal%20is%20pretty%20good%20for%20interactive%20in%20browser%20coding%20and%20more%22%0Aalert%20msg%0Asay%20msg ---------------------------------------------------------------------------------------------------- [22:40:33] Forrest Chang(@fkchang):assuming you have modern browser for the say part ---------------------------------------------------------------------------------------------------- [23:56:28] Elia Schito(@elia):@xavriley what about explicitly using the async keyword with something like this: ``` class Foo JS.async def bar JS.await sleep(2000) end end ``` JS is already used for direct JS calls so it kinda make sense to me to have a special case in the compiler for async/await support… @iliabylich @meh thoughts? ---------------------------------------------------------------------------------------------------- ############################## [2017-10-29] ############################## [19:27:32] chapuzzo(@chapuzzo):it also fails when linked due to << & ¿html? encoding issues ---------------------------------------------------------------------------------------------------- [19:31:36] chapuzzo(@chapuzzo):when compiled and run in node or browser it raises an `ArgumentError: wrong number of arguments (1 for 0)` error ---------------------------------------------------------------------------------------------------- [19:42:59] chapuzzo(@chapuzzo):For the record I found a solution by checking out master version: module_eval with a string requires adding `require 'opal-parser'`to script. ---------------------------------------------------------------------------------------------------- [20:28:15] chapuzzo(@chapuzzo):Now I get an error like this `uncaught exception: bind: undefined method `bind' for nil` my code base doesn't have that anywhere so I supose is an internal opal thing. I've been trying to debug but the stack trace tells nothing to me :disappointed: ---------------------------------------------------------------------------------------------------- [21:52:01] Elia Schito(@elia):@chapuzzo can you share the code (if different from that above) and the commands/code used to generate te error? ---------------------------------------------------------------------------------------------------- [23:33:20] Jan Biedermann(@janbiedermann):@elia about this out of place constant, i found the underlying bug, but still, the `String` is out of place, it should have been `React::Hyperloop::Component::Mixin'`, i will try to prepare a test case for this in the next days. ---------------------------------------------------------------------------------------------------- [19:22:58] chapuzzo(@chapuzzo):hi, I'm new to opal. I have a piece of ruby code running in mri and online try-opal but no when compiled in my machine ... ---------------------------------------------------------------------------------------------------- [19:23:10] chapuzzo(@chapuzzo):http://opalrb.com/try/?code:class_definition%20%3D%20%3C%3CEOB%0A%20%20class%20MyDynamicClass%0A%20%20%20%20def%20tick!%3B%20end%0A%20%20end%0AEOB%0A%0Aparent_module%20%3D%20Module.new%0Aevaled_class%20%3D%20parent_module.module_eval(class_definition)%0A%0Aputs%20evaled_class%0Aparent_module.module_exec%20%7B%0A%20%20puts%20MyDynamicClass%0A%20%20puts%20MyDynamicClass.new%0A%20%20puts%20MyDynamicClass.new.methods%0A%7D ---------------------------------------------------------------------------------------------------- ############################## [2017-10-30] ############################## [00:49:04] Elia Schito(@elia):@janbiedermann thank you very much! ---------------------------------------------------------------------------------------------------- [09:20:08] Xavier Riley(@xavriley):Using JS ---------------------------------------------------------------------------------------------------- [09:59:29] Xavier Riley(@xavriley):using the `JS` keyword sounds reasonable to me :+1: It would also allow for more fine grained control in terms of which functions/blocks that async is applied to. In terms of allowing an implicit `await` for calls to `sleep` is there any way I could convert, say, a block to a source string or AST and then add this in programmatically? (e.g. find/replace on the source string) I realise this would be a complete hack but it would be nice to get a proof of concept together which could handle existing Sonic Pi code ---------------------------------------------------------------------------------------------------- [10:22:44] Elia Schito(@elia):@xavriley I'm not the expert on the argument (@iliabylich knows far more) but the compiler supports AST rewriters out of the box and there's a bunch of them already in use: https://github.com/opal/opal/tree/master/lib/opal/rewriters ---------------------------------------------------------------------------------------------------- [10:23:26] chapuzzo(@chapuzzo):@elia The code base is quite big, It's a running program I want to port to web version. I'll try to produce a slim version isolating the failure and reproducing it. I think the problem comes from binding an unbound method ... ---------------------------------------------------------------------------------------------------- [10:23:39] Elia Schito(@elia):@xavriley this one for example is specific to MSpec https://github.com/opal/opal/blob/master/tasks/testing/mspec_special_calls.rb ---------------------------------------------------------------------------------------------------- [10:25:29] Elia Schito(@elia):@chapuzzo 👍🏼 thanks, the smaller the better! ---------------------------------------------------------------------------------------------------- [10:26:04] chapuzzo(@chapuzzo):by the way, whats the best to get a full stack trace of the failing code? I'try with sourcemaps but nothing useful comes from there.. ---------------------------------------------------------------------------------------------------- [10:27:49] Elia Schito(@elia):@chapuzzo if you're on rails with assets debug mode and source maps set to true you should have one script tag for each corelib file, that helps pinning down the exact point where the failure happens ---------------------------------------------------------------------------------------------------- [10:27:57] Xavier Riley(@xavriley):@elia thanks for the tips - that rewriter seems like an example that I could get my head around :) ---------------------------------------------------------------------------------------------------- [10:28:19] Elia Schito(@elia):👍🏼 :smile: ---------------------------------------------------------------------------------------------------- ############################## [2017-10-31] ############################## [00:13:43] Jan Biedermann(@janbiedermann):i'd like to test with capybara, selenium, FF, Chrome etc., whatever i try, latest geckodriver, chromedriver, i get this: ```ruby page.evaluate_script('Opal') InternalError: too much recursion ``` opal 0.10.5, How can i run tests in FF/Chrome? ---------------------------------------------------------------------------------------------------- [09:52:35] Elia Schito(@elia):@janbiedermann I think opal-rails has a configured capybara with capybara-webkit / FF, let me look that up ---------------------------------------------------------------------------------------------------- [09:54:17] Elia Schito(@elia):I was wrong it's phantomjs/poltergeist but will probably work with other drivers too… https://github.com/opal/opal-rails/blob/master/spec/support/capybara.rb https://github.com/opal/opal-rails/blob/master/spec/integration/js_spec.rb ---------------------------------------------------------------------------------------------------- [09:58:24] Jan Biedermann(@janbiedermann):@elia this seems to be a general serialization problem from webdrivers, as they cant serialize cyclic/recursive objects, i found several workarounds, for example: gist.github.com/Hoff97/9842228 or this: github.com/douglascrockford/JSON-js/blob/master/cycle.js, seems to be general problem in the js world with testing and with more complex and advanced frameworks it becomes more and more a problem. So hopefully one day soon, they will fix that. ---------------------------------------------------------------------------------------------------- [10:00:35] Elia Schito(@elia):fingers crossed ---------------------------------------------------------------------------------------------------- [10:22:58] Ilya Bylich(@iliabylich):@elia I'm not sure that the following would work: ``` ruby class Foo JS.async def bar JS.await sleep(2000) end end ``` From what I see it generates `async(Opal.def(...))` ---------------------------------------------------------------------------------------------------- [10:33:15] Elia Schito(@elia):@iliabylich I was thinking about intercepting it at compiler level and use some kind of `Opal.defasync(…, async function(){…})` but I never really looked into await/async so I might be completely wrong ---------------------------------------------------------------------------------------------------- [10:57:30] Xavier Riley(@xavriley):@elia @iliabylich I'm working on it. I should have a PR ready in the next day or so ---------------------------------------------------------------------------------------------------- [10:57:56] Xavier Riley(@xavriley):At the moment I have everything ready up to `SyntaxError: Unsupported sexp: async :test.js:` ---------------------------------------------------------------------------------------------------- [11:01:49] Xavier Riley(@xavriley):I've added :async and :await as sexp types, and a rewriter to handle conversion from `JS.async` and `JS.await`. I have the sexpressions generating properly I think I've added the right stuff to check the parent scope and add the keywords before calls to `function`. I'm just struggling to get the compiler to accept the new `:async` sexp as valid at the moment ---------------------------------------------------------------------------------------------------- [11:09:45] Elia Schito(@elia):@xavriley feel free to open the PR noting it's WIP, maybe we can help by looking at the current state of the code ---------------------------------------------------------------------------------------------------- ############################## [2017-11-02] ############################## [04:19:18] Surya Poojary(@staymetal):Hello guys ---------------------------------------------------------------------------------------------------- [15:28:15] Forrest Chang(@fkchang):hi @staymetal ---------------------------------------------------------------------------------------------------- [15:36:00] Elia Schito(@elia)::wave: ---------------------------------------------------------------------------------------------------- [15:47:01] Surya Poojary(@staymetal):How are u guys doin ---------------------------------------------------------------------------------------------------- ############################## [2017-11-09] ############################## [13:39:27] Philippe Nénert(@papilip):Hello all, opal is very very good but i cant use Date : Why `Date.parse '2012-10-12'` not work ? Thank in advance ---------------------------------------------------------------------------------------------------- [14:45:44] Mitch VanDuyn(@catmando):@papilip to reduce payload size the date and time STD library are not by default included. You do a `require 'time'` ---------------------------------------------------------------------------------------------------- [14:46:17] Ilya Bylich(@iliabylich):Which version of opal are you using? ``` sh $ opal -v -rdate -e "p Date.parse('2012-10-12')" Opal v0.11.0.rc1 2012-10-12 ``` ---------------------------------------------------------------------------------------------------- [14:46:46] Mitch VanDuyn(@catmando):FYI I'm on my phone. And can't verify the above. May have file name wrong ---------------------------------------------------------------------------------------------------- [14:47:31] Philippe Nénert(@papilip):@ @iliabylich thanks, i’m trying with http://opalrb.com/try/ `opal -v => Opal v0.10.5` ``` require 'date' Date.parse '2012-10-12' parse: undefined method `parse' for Date ``` ---------------------------------------------------------------------------------------------------- [14:53:13] Philippe Nénert(@papilip):@catmando sory i have not read your response `require 'date'` in my rails app, it’s OK ! ---------------------------------------------------------------------------------------------------- [17:02:36] Mitch VanDuyn(@catmando):@papilip if you are enjoying opal and you might checkout http://ruby-hyperloop.org chat is here: https://gitter.im/ruby-hyperloop/chat ---------------------------------------------------------------------------------------------------- ############################## [2017-11-10] ############################## [08:04:14] Philippe Nénert(@papilip):@catmando Thank agin ! ---------------------------------------------------------------------------------------------------- [08:04:42] Philippe Nénert(@papilip):@catmando All JS in our rails app is with Opal ---------------------------------------------------------------------------------------------------- [08:12:24] Ruben De Andrade(@RubenDeAndrade):Hello Guys ! I’m working on a Rails Application using Opal. I wanted to now how i can refresh a element of the page without reload the whole page with Opal. Thanks !! ---------------------------------------------------------------------------------------------------- [09:41:45] Elia Schito(@elia):@RubenDeAndrade if you're using opal-query you can just `Eelement['.my-element-selector'].html = "

hello world

"` There are of course many other options depending on the details of your app ---------------------------------------------------------------------------------------------------- [09:45:31] Ruben De Andrade(@RubenDeAndrade):@elia Ok I see ! Thanks. By the way, i love using Opal :) ---------------------------------------------------------------------------------------------------- [09:46:22] Elia Schito(@elia):Great to hear that! We're in good company! :smile: ---------------------------------------------------------------------------------------------------- [17:14:49] Mitch VanDuyn(@catmando):@papilip - yeah good for you... We have a medium size app that is now completely in ruby (opal) on the client... a much better way to live :-) ---------------------------------------------------------------------------------------------------- [18:15:22] Forrest Chang(@fkchang):@papilip @RubenDeAndrade glad you enjoy it, consider using opal-hot-reloader -- while the benefits are most dramatic when used with ruby-hyperloop (real time updates of hyperreact components w/o refreshing), still useful for non hyperloop Opal apps, I have a number of older apps I use it with along with either embedded opal-irb and opal-console (which I really need to update these days - it works on newer opal versions but says it doesn't and there's a workaround to get it to work) ---------------------------------------------------------------------------------------------------- ############################## [2017-11-11] ############################## [08:48:03] Surya Poojary(@staymetal):Hi guys I'm new to opal ---------------------------------------------------------------------------------------------------- [08:48:31] Surya Poojary(@staymetal):A simple walkthrough if possible from I'll will be appreciated ---------------------------------------------------------------------------------------------------- ############################## [2017-11-14] ############################## [21:50:34] Elia Schito(@elia):@staymetal did you already try following the examples on the website or the readme? on opalrb.com you can find tutorials for Rails, Rack or the Command Line Interface (PS. let me know if you have any feedback on how to improve!) ---------------------------------------------------------------------------------------------------- [23:55:33] Mitch VanDuyn(@catmando):is there any functional difference between ---------------------------------------------------------------------------------------------------- [23:56:09] Mitch VanDuyn(@catmando):```ruby Hash.new(some_native_object) # and `Opal.hash(some_native_object)` # this is much faster! ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-11-15] ############################## [00:43:35] Elia Schito(@elia):@catmando I suspect the latter stops at the first level while the former can work with nested hashes… but if you sense there's an opportunity to implement `Hash.new` in terms of `Opal.hash` and make it faster please do! relevant code: https://github.com/opal/opal/blob/0-6-stable/stdlib/native.rb#L461-L477 https://github.com/opal/opal/blob/0-6-stable/opal/corelib/runtime.js#L800-L804 ---------------------------------------------------------------------------------------------------- [01:51:52] Surya Poojary(@staymetal):@elia sure !? ---------------------------------------------------------------------------------------------------- [01:51:54] Surya Poojary(@staymetal):!! ---------------------------------------------------------------------------------------------------- [12:14:40] Barrie Hadfield(@barriehadfield):Hello all - are there plans for Opal to compile to WebAssembly in the future? ---------------------------------------------------------------------------------------------------- [12:31:43] Elia Schito(@elia):@barriehadfield there are one or two issues open on that topic, but I don’t remember if anyone started any actual work. Anyway we’re open to that but there must be enough browser support first. Also I think would be interesting to see if we can offload just some hot code paths to WA and improve the perf without rewriting everything. ---------------------------------------------------------------------------------------------------- [12:47:19] Barrie Hadfield(@barriehadfield):thanks @iliabylich. I think it is one to watch with great interest. The true democratization of the web and the beginning of the end to the tyrannous reign of JS. ---------------------------------------------------------------------------------------------------- ############################## [2017-11-16] ############################## [17:13:26] Forrest Chang(@fkchang):Food for thought on the need for minimizing JS payload https://medium.com/dev-channel/the-cost-of-javascript-84009f51e99e -- though perhaps not pulling in the entire stdlib unless required could help some ---------------------------------------------------------------------------------------------------- [17:59:59] Mitch VanDuyn(@catmando):@fkchang you know @janbiedermann has made a lot of progress with incremental on demand loading? So as each require comes in... that gets loaded... ---------------------------------------------------------------------------------------------------- [18:01:36] Jan Biedermann(@janbiedermann):to clarify: as each constant gets in, that gets loaded, if the naming conforms to rails autoloading spec ---------------------------------------------------------------------------------------------------- ############################## [2017-11-17] ############################## [18:26:08] ylluminate(@ylluminate):hey guys, i had no idea just how on fire crystal is: https://github.com/opal/opal/issues/1715#issuecomment-345323306 ---------------------------------------------------------------------------------------------------- [18:26:28] ylluminate(@ylluminate):BIG BIG opportunity here ---------------------------------------------------------------------------------------------------- [18:51:57] Forrest Chang(@fkchang):@/all anyone used opal w/brunch? ---------------------------------------------------------------------------------------------------- [20:40:25] Mitch VanDuyn(@catmando):Like I keep saying need crystal to js compiler. I think we could leverage opal for a lot. There are two other projects to do this but not moving fast. ---------------------------------------------------------------------------------------------------- [20:55:09] Forrest Chang(@fkchang):@elia @meh @jgaskins if we were to replace sprockets with a ruby/opal based solution from scratch, what would the bare minimum functionality be (under the assumption that a "sprockets lite" could be both performant and expandable to other backends) ---------------------------------------------------------------------------------------------------- [22:35:58] Elia Schito(@elia):@fkchang do you mean something like Opal::Builder? that's pure homebrew stuff, but compared to sprockets it lacks many features, also as @janbiedermann demonstrated, if you set sprockets up correctly it's quite performant… but of course I'm not sure about the real aim so I may misinterpreted wrt DCE I did some experiments a while ago without much success but I'm still convinced that a dumb tree of calls can be built from each file and method definition in order to eliminate stuff like Struct or String#tr unless it's actually used by the app, unfortunately I'm still in a reduced effort mode thanks to the cute little 5mo baby :baby: that I'm going to swing until asleep in a few moments :smile: ---------------------------------------------------------------------------------------------------- [22:36:52] Elia Schito(@elia)::mega: @/all on the up side I'm almost done with updating all the fundamental libs to work and pass specs with opal 0.11 (opal-rspec is still a bit tricky, but it seems to work more or less). **I intend to release Opal 0.11 on the 8 of december** :blush: :tada: ---------------------------------------------------------------------------------------------------- ############################## [2017-11-19] ############################## [04:39:52] Surya Poojary(@staymetal):Greatttt ---------------------------------------------------------------------------------------------------- [08:57:27] Barrie Hadfield(@barriehadfield):Great @iliabylich - will that include Crystal -> JS? :-) ---------------------------------------------------------------------------------------------------- ############################## [2017-11-26] ############################## [19:54:19] Ish Bhatt(@ibhatt):&&&&&&& ---------------------------------------------------------------------------------------------------- ############################## [2017-11-29] ############################## [13:53:46] Ruben De Andrade(@RubenDeAndrade):Hello Guys !! I wonder how i can detect a Enter key press with Opal rails. If someone can help me ! Thank you :smile: ---------------------------------------------------------------------------------------------------- [14:01:21] Ruben De Andrade(@RubenDeAndrade):Nevermind, I find the answer :smile: The answer is: Element.on :keypress { |event| event.which == 13 (13 is Enter keyCode) } ---------------------------------------------------------------------------------------------------- [16:46:54] rangeoshun(@rangeoshun):Hello there! I just face an issue, or actually two. I hope you guys can help. So: Issue 1. When I use .addEventListener(:keydown) { |event| handle_name_change(event) }, the event is not wrapped in, and I get this error: Uncaught TypeError: event.$target is not a function Can I get opal to wrap the event, or am I doing things the wrong way? --- Issue 2. All JS is executed 3 times for some reason, and I do not know why. Can you help, or guess? --- Here's the repo: https://github.com/rangeoshun/wromoror The files in hand is /app/assets/javascripts/setup.js.rb ---------------------------------------------------------------------------------------------------- [16:51:38] rangeoshun(@rangeoshun):Updated my question, thanks, and cheers! ---------------------------------------------------------------------------------------------------- [17:00:07] rangeoshun(@rangeoshun):Adding: in the handle_name_change method I try to read the event.target.value. ---------------------------------------------------------------------------------------------------- [17:32:18] rangeoshun(@rangeoshun):Issue 2 might be a turbolinks problem I think. ---------------------------------------------------------------------------------------------------- [21:09:01] rangeoshun(@rangeoshun):Ok, I switched to the Element.find("selector").on { |ev| ... } But still find strange, that the native way does not work as one would expect. ---------------------------------------------------------------------------------------------------- ############################## [2017-12-01] ############################## [04:49:59] Jamie Gaskins(@jgaskins):It's because method calls in Opal are prefixed with `$` to keep them from being ambiguous with instance variables in the compiled JS code. So calling `e.target.addEventListener(:foo) { |e| handle(e) }` in Ruby calls something like this: `e.$target().$addEventListener('foo')` with the block attached to the method itself as a property of its underlying function. ---------------------------------------------------------------------------------------------------- [06:29:28] rangeoshun(@rangeoshun):Hey! Thanks for your answer. Thing is, I get that almost all objects are wrapped in with `$` to keep separated from the native JS. The problem is, that if I attach a native event listener, I cannot use the resulting event, because the event object is not wrapped in an opal container, but my code is. That results in my compiled code is trying to access: `event.$target`, but my handler receives as`{ target: div }`this mechanism breaks the native event handler basically. ---------------------------------------------------------------------------------------------------- [11:02:17] rangeoshun(@rangeoshun):Did you guys come accross this issue with `opal-rails`? https://github.com/opal/opal-rails/issues/98 ---------------------------------------------------------------------------------------------------- ############################## [2017-12-02] ############################## [12:07:54] Bernhard Weichel(@bwl21):I try to build a CLI version of my app. Thereby I have problems with the 3rd party javascript libraries. They create classes or objects in a whatever namespace. Sometimes it is in an object called `exports` (when running in node), sometimes it is in the top level object (when running in Browser) What is the right way to implement a ruby module which works in Browser as well as in a node cli script. One of it uses the pattern neatjson_js.js: ```javascript (function(exports){ exports.neatJSON = neatJSON; function neatJSON(value,opts){ // some code here } neatJSON.version = "0.8.3"; })(typeof exports === 'undefined' ? this : exports); ``` in Opal I use this ```ruby if (RUBY_ENGINE == 'opal') require 'json' module JSON require 'neatjson_js' # desperatley try to find neatJSON as method. $neatJSON = %x{exports.neatJSON} rescue %x{neatJSON} def self.neat_generate(object, opts={explicit_sort: []}) outputjs = %x{#{$neatJSON}(#{object.to_n})), #{opts.to_n})}; outputjs end end end ``` ---------------------------------------------------------------------------------------------------- ############################## [2017-12-03] ############################## [22:16:31] Elia Schito(@elia):@rangeoshun saw the issue, thanks for the example app ---------------------------------------------------------------------------------------------------- [22:19:36] Elia Schito(@elia):@bwl21 try experimenting with `node_require` from stdlib `nodejs/kernel` https://github.com/opal/opal/blob/66849b5da5c54236eea5a0e5eaf95ba06a744fe3/stdlib/nodejs/kernel.rb#L19-L21 and let me know how it goes ---------------------------------------------------------------------------------------------------- ############################## [2017-12-04] ############################## [09:53:33] Bernhard Weichel(@bwl21):@elia I got "undefined method `node_require' for JSON" with opal 0.9.0 I then updated to opal 0.10.5 and got "undefined method `node_require' for JSON" as well. but with 0.10.5 I also got a runtime error ``` opal-neatjson.self.js?body=1:16 Uncaught ReferenceError: exports is not defined at opal-neatjson.self.js?body=1:16 at opal-neatjson.self.js?body=1:19 at Opal.modules.opal-neatjson (opal-neatjson.self.js?body=1:36) at Object.Opal.load (runtime.self.js?body=1:1957) at Object_alloc.Opal.require [as $require] (runtime.self.js?body=1:1981) at Opal.modules.application (application.self.js?body=1:9) at Object.Opal.load (runtime.self.js?body=1:1957) at (index):135 ``` The compiiled part is ```javascript $gvars.neatJSON = (function() { try {return exports.neatJSON; } catch ($err) { <--- if fails here if (Opal.rescue($err, [$scope.get('StandardError')])) { return neatJSON; } else { throw $err; } }})(); ``` It seems that the error handling was changed somehow. Anyhow, I don't think that my approach (using try/catch to handle various environments) is the most appropriate one. ---------------------------------------------------------------------------------------------------- [09:54:59] Elia Schito(@elia):@bwl21 that method is in the stdlib (opal/stdlib/nodejs/kernel.rb) so it needs a "require" first try with `require "nodejs/kernel"` ---------------------------------------------------------------------------------------------------- [09:55:59] Bernhard Weichel(@bwl21):Would this limit the script to be used with node only? I would like to have the module for browser as well as node? I will try. ---------------------------------------------------------------------------------------------------- [09:56:50] Elia Schito(@elia):if you wanna compile once then you need some extra work I guess to make it work in both environments ---------------------------------------------------------------------------------------------------- [09:58:01] Elia Schito(@elia):but if you require `opal-platform` then you can use `if OPAL_PLATFORM == 'nodejs'` to discriminate the env https://github.com/opal/opal/blob/66849b5da5c54236eea5a0e5eaf95ba06a744fe3/stdlib/opal-platform.rb ---------------------------------------------------------------------------------------------------- [10:05:21] Bernhard Weichel(@bwl21):Actually I have thee environments: 1. running with Opal server - this is how I develop 2. compile for production to be used in browser (`