Logs for the RingoJS IRC channel,
as logged by ringostarr.
2010-05-11
[02:59] <oravecz> From webapp.js: var configId = env['ringo.config'] || 'config';
[03:00] <oravecz> how is ringo.config set?
[03:04] <earl> it typically is not
[03:04] <earl> ringo.config in the jsgi env points to a module name to be used as config module
[03:05] <earl> typically the default 'config' is used
[03:07] <oravecz> just trying to figure out the nuances...how do properties on env get set?
[03:08] <earl> not sure what you mean?
[03:09] <earl> most jsgi properties are set by the jsgi environment
[03:09] <earl> which are the java classes in org.ringojs.jsgi, in our case
[03:10] <earl> JsgiEnv's ctor in particular, initialises a standard jsgi environment
[03:10] <earl> besides that, jsgi "middleware" might set custom env properties
[03:34] <oravecz> i see, so env['ringo.config'] is set to moduleId in jsgi.js, thx
[08:52] <gmosx> good morning...
[11:17] <hannesw> so is everybody fine with making the switch to JSGI 0.3?
[11:17] <gmosx> yeah...
[11:17] <hannesw> gmosx won't that break your and jack's middleware?
[11:17] <gmosx> is the jsgi0.3 branch fully working?
[11:17] <gmosx> I will convert it to jsgi0.3
[11:18] <hannesw> there's a minor problem with retried requests
[11:18] <gmosx> just let me know that the jsgi0.3 branch is complete and I will port my code (and report problems ;-))
[11:18] <gmosx> retried requests?
[11:19] <hannesw> that's a feature of ringo you can throw {retry: true} and request evaluation will be restarted.
[11:20] <gmosx> where is that useful?
[11:20] <hannesw> we use that to restart evaluation with a different optimization level, e.g. for things that require optimization level -1 such as the profier
[11:20] <gmosx> ah
[11:20] <hannesw> http://ringojs.org/demo/logging?profile=1
[11:21] <gmosx> ok... I don't need this for the time beeing...
[11:21] <hannesw> apart from that, it should be working
[11:21] <gmosx> so I will have to pull ringo/jsgi3 and merge with master?
[11:21] <hannesw> well i will merge soon anyway
[11:21] <gmosx> then I 'll wait for the merge...
[11:22] <gmosx> another thing...
[11:22] <hannesw> but i think writable request method is not yet implemented on jsgi-0.3, so better wait :)
[11:22] <gmosx> i 'll wait ;-)
[11:22] <gmosx> another thing, I understand you added some async stuff, does this mess with appengine?
[11:23] <hannesw> no, it probably just won't work, as appengine doesn#t support it
[11:23] <hannesw> you shouldn't have any problems though
[11:23] <gmosx> ok
[14:39] <robi42> i'm fine with upgrading to jsgi 0.3 impl (as long as it works) :)
[14:40] <robi42> hannesw, is ringo's promise api subject to change?
[14:40] <hannesw> robi42 no if you ask me
[14:40] <hannesw> yes i think if you ask earl
[14:40] <robi42> thought about posting a little example following your gist
[14:40] <hannesw> if more people have a problem with it, we can change it
[14:40] <hannesw> +1
[14:41] <robi42> to wet people's appetite, so to speak ;)
[14:41] <hannesw> something long-pullish would be cool
[14:41] <hannesw> err... pollish :)
[14:41] <robi42> :)
[14:41] <hannesw> finally fixing file upload here
[14:41] <robi42> for the time being i'll just start with your gist
[14:42] <robi42> then something more "useful" as a follow-up or so
[14:51] <olegp_> hey guys, further to our chat the other day, I've got a ringo-admin "war" script, which packages up a ringojs app as a webapp archive
[14:51] <olegp_> http://ringojs.pastebin.com/WgtXUuLV
[14:52] <olegp_> it needs to be cleaned up a bit, but the functionality is there, if anybody wants to incorporate it into the project
[14:52] <olegp_> things that need to be cleaned up are:
[14:52] <olegp_> 1) removed commented out native interface
[14:52] <olegp_> 2) move zip method into zip.js ?
[14:53] <olegp_> 3) consolidate the copyTree, copyJars and other methods which are copied straight from create.js
[15:19] <robi42> fyi: http://log.robert42.com/6 (feedback welcome)
[15:21] <robi42> olegp_, awesome!
[15:23] <olegp_> also it takes the current dir youre in as the webapp dir root, which may not be too clear from the help
[15:24] <olegp_> and the logic for figuring out whether it should create a WAR or just copy stuff to a dir is determined by the path provided
[15:25] <olegp_> if it sees an extension, it creates a war, otherwise it assumes you want to just copy all the files to a directory
[15:25] <olegp_> should maybe make that more explicit via an option
[15:57] <robi42> oberhamsi: thumbs up for the tutorial wiki page, great stuff! :)
[15:57] <oberhamsi> yep thanks
[15:57] <oberhamsi> want something to lure php devs hehe
[15:58] <robi42> :)
[15:58] <robi42> anyway, we need to have some more extensive "getting started" info provided
[15:59] <robi42> it's not enough if only the handful of us knows how cool ringo is, i guess ;)
[15:59] <robi42> know*
[16:00] <earl> robi42, re promise api: no, i don't want it to change either
[16:01] <robi42> ok
[16:01] <earl> robi42: i'd only like to change the jsgi-side of handling promises
[16:01] <robi42> ah ok, i see
[16:01] <robi42> so the interface wouldn't be touched by that then
[16:02] <earl> hannes' example gist would still work
[16:02] <robi42> ok
[16:03] <earl> the only thing i'd like to add, is that you'd also be allowed to directly return the "deferred" object you get from calling defer()
[16:04] <earl> so that you don't _have_ to write `return response.promise` but also can simply write `return response`
[16:05] <robi42> ah, would that be possible to allow both ways?
[16:08] <earl> yes, i think so
[16:11] <earl> i think adding `if (typeof result.promise.then === "function) result = result.promise;` after line 70 of ringo/jsgi.js should suffice
[16:11] <earl> (module typos)
[16:11] <earl> (modulo*, damn ....)
[16:14] <robi42> ok, i see
[16:51] <robi42> oberhamsi: in your tutorial there's `Foo.query().slice(from, to)` mentioned
[16:51] <robi42> is that an api proposal, so to speak? :)
[16:52] <oberhamsi> ops, no that needs fixing
[16:52] <oberhamsi> but.. not the worst accidental proposal i ever made
[16:52] <robi42> :)
[16:52] <oberhamsi> query().forEach
[16:53] <robi42> btw, hibernate currently supports limit(int), offset(int) and range(from, to)
[16:53] <oberhamsi> great, i will switch to hibernate for tutorial. more conventional
[16:53] <robi42> :)
[16:54] <robi42> forEach's actually already supported since what you get is an array, no?
[16:55] <oberhamsi> ah i wrote query().select().slice(.. and that works of course
[16:55] <robi42> ah, i see
[16:55] <robi42> sure
[16:55] <oberhamsi> :)
[16:55] <oberhamsi> in hibernate it do: query().range(0,20).select() ?
[16:56] <robi42> exactly
[16:56] <robi42> so you could "prepare" a query and "execute" it later, so to speak
[16:57] <oberhamsi> aha okay.
[16:57] <robi42> that's the nice thing about select() :)
[16:57] <oberhamsi> my first thought was to replace select() with forEach, range(), but that doesn't make sense due to select('fieldname') possibility
[16:57] <oberhamsi> ^^ and the prepare aspect
[16:57] <robi42> right :)
[17:15] <emilis_info> uhm... what should I use instead of "file" module?
[17:15] <hannesw_> emilis_info: fs
[17:15] <hannesw_> it's the same, only better :)
[17:19] <emilis_info> hmm ok :)
[17:31] <hannesw_> olegp_ create-war script looks good
[17:31] <hannesw_> there are a few things that can be done in ringo natively
[17:31] <hannesw_> like java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
[17:31] <hannesw_> ~ new ByteArray(1024)
[17:31] <olegp_> ok
[17:32] <olegp_> would it be worth adding that whole lot to zip.js?
[17:32] <hannesw_> yes, i'd like to have support for creating zip files
[17:33] <hannesw_> i think this could become a new option to ringo-admin create, right?
[17:33] <hannesw_> like ringo-admin create -w/--war
[17:33] <hannesw_> what do you think?
[17:34] <olegp_> yeah, I had it inside create to start off with
[17:34] <olegp_> but then realized its not a project setup task, but rather a packaging one
[17:34] <olegp_> so separated it out into a separate js file
[17:34] <hannesw_> ah, ok. true
[17:35] <olegp_> so maybe put it into a "package.js" file or something ... and leave room for extending it to package app up as a deb or whatever
[17:35] <hannesw_> I'll give it a try
[17:35] <olegp_> although package may not be the best name, since it overlaps with the concept of commonjs packages
[17:35] <hannesw_> yes
[17:35] <olegp_> distribute maybe?
[17:36] <olegp_> oh also a quick note: I created a webapp skeleton app, which is just the appengine app without the appengine specific stuff
[17:38] <hannesw_> ok
[17:39] <hannesw_> we definitley need a place to put all our skeletons or app templates or whatever we call them
[17:40] <olegp_> I was thinking that there should only be one format of ringo app for dev
[17:40] <olegp_> the fact that you can set up an appengine layout or standard layout is a bit confusing
[17:41] <hannesw_> agreed. problem is that google app engine is so different (special apis for everything) that you need to develop inside it
[17:41] <olegp_> if somebody does want it in appengine/webapp format, they could first create a ringo skeleton app, then call "distribute" on it to turn it into an appengine/webapp format
[17:41] <olegp_> yeah ..
[17:42] <hannesw_> but i think appengine is a special case
[17:44] <hannesw_> so.. a lot of last minute stuff i committed today
[17:45] <hannesw_> i know that might be a bit worrying
[17:45] <hannesw_> given tomorrow's release
[17:46] <hannesw_> but i think it's better to have the APIs in the release, maybe mildly broken, than introduce new APIs immediately after release
[17:46] <hannesw_> io.MemoryStream will definitely be very useful (it already is)
[17:47] <hannesw_> is everybody happy with the name "MemoryStream"?
[17:47] <hannesw_> is it clear what it is?
[17:47] <earl> yes, sounds good
[17:50] <robi42> yep, +1 from my side for that as well.
[17:51] <robi42> just noticed there are a few typos in MemoryStream's jsdoc header
[17:54] <hannesw_> i guess there are, and black holes too :)
[17:54] <robi42> :)
[18:11] <earl> ha!
[18:23] <gmosx> hannes?
[18:23] <gmosx> I pulled from the latest git repo, and now request.params seems to be not working (at least for POST requests)
[18:23] <gmosx> the hash is empty...
[18:24] <gmosx> any ideas?
[18:27] <hannesw_> gmosx will look into it
[18:31] <gmosx> thanks
[18:34] <hannesw_> gmosx everything works normal for me
[18:34] <hannesw_> have you rebuilt the jar file?
[18:34] <gmosx> hmm...
[18:35] <gmosx> yeah, let me check the symlinks...
[18:35] <hannesw_> is this a normal form or a file-upload form?
[18:36] <gmosx> hmm this is an ajax POST request
[18:36] <gmosx> $.post(...)
[18:36] <gmosx> jquery...
[18:36] <gmosx> request.params is {} (empty)
[18:37] <gmosx> (the methodoveride works fine btw, thanks)
[18:37] <gmosx> this used to work...
[18:40] <gmosx> have you merged the jsgi0.3 stuff?
[18:41] <hannesw_> hm, i just tried a project where i use jquery $.post() and it's working
[18:41] <hannesw_> no, not yet
[18:41] <gmosx> ah, annoying... :(
[18:41] <gmosx> let have a better look...
[18:43] <gmosx> hmm some middleware seems to mangle the request...
[18:44] <hannesw_> ahhh
[18:44] <hannesw_> maybe it's because of the method (POST) not being POST anymore?
[18:44] <hannesw_> i think we're only parsing input if request is post...
[18:45] <hannesw_> http://github.com/ringo/ringojs/blob/master/modules/ringo/webapp/request.js#L86
[18:46] <hannesw_> maybe try to comment out that line
[18:47] <gmosx> line 86?
[19:02] <gmosx> hmm there is a problem when calling both jacks Request(env) and Ringo's Request(env)
[19:02] <gmosx> anw, will fix later...
[19:16] <gmosx> hannesw: still here?
[19:21] <gmosx> I think I found the problem
[19:21] <gmosx> if I call new Request(env) 2 times
[19:21] <gmosx> the second time request.params is empty
[19:23] <gmosx> new Request(env) should be idempotent (and cached in env for multiple invocations)
[19:35] <bailey_> Hi All- I'm new to ringo, but excited by it's possibilities. I'm currently trying to get RIngoJS to connect to MongoDB...any suggestions?
[19:36] <gmosx> hey bailey_, welcome...
[19:36] <gmosx> no idea about mongodb though, sorry :(
[19:37] <earl> bailey_: we don't have a mongodb connector for ringojs at the moment
[19:37] <earl> best idea would probably to look for a nice java lib and wrap it
[19:38] <earl> using java libs from ringojs is usually nice and easy
[19:38] <bailey_> Hi guys, thanks for the replies! I'm installed narwhal-mongodb as a package (which uses a javalib) but it's now throwing a java error.
[19:39] <bailey_> I'll have to play around with it for a bit and see what we can find.
[19:39] <earl> you could post the error at http://ringojs.pastebin.com/
[19:41] <bailey_> thnx earl, I'll get ahold of the narwhal-mongodb creator and see what light he can shed. if there's still an issue I'll post it.
[19:42] <gmosx> perhaps this will help
[19:42] <gmosx> http://github.com/gmosx/narwhal-lib
[19:42] <gmosx> narwhal stuff that works with ringojs
[19:44] <robi42> nice
[19:44] <bailey_> ah cool
[19:47] <robi42> bailey_, there's an official mongodb java driver lib; so probably wrapping that would be a way to go: http://api.mongodb.org/java/2.0-pre1-/
[19:49] <bailey_> great. I'll give that a shot and see what we can spin up. thanks again
[22:53] <bailey_> Hi all- Just an update from my earlier question. After installing the latest narwhal-mongodb package, the path to the mongo jar needed updated in the package.json file (was missing "jars/" before the jar file name), and Voila, connecting and querying!
[22:54] <earl> bailey_: good to know!