Logs for the RingoJS IRC channel, as logged by ringostarr.

2010-05-17

[10:05] <gmosx> good morning...

[10:11] <hannesw_> good morning

[10:13] <gmosx> module.shared = true doesnt work for my use case either

[10:13] <gmosx> I have a module with a 'cache' variable

[10:13] <hannesw> is it your own module?

[10:13] <gmosx> yes

[10:13] <hannesw> why doesn't module.shared work?

[10:13] <gmosx> I 've put module.shared = true on top

[10:14] <gmosx> I have code similar to this

[10:14] <gmosx> var cache = {};

[10:14] <gmosx> if (!cache[key]) {....; cache[key] = val; } else {...}

[10:14] <gmosx> the cache is always empty on every refresh

[10:15] <gmosx> (ie the else clause is never executed)

[10:17] <gmosx> any idea?

[10:18] <hannesw> no, that should work

[10:19] <hannesw> can you put a print("something") statement in the top level scope of that module to see if it is actually reevaluated on each request?

[10:33] <gmosx> hmm the module is not revaluated... strange...

[10:33] <gmosx> I will have a better look, bbl

[10:36] <gmosx> ok, I had to add module.shared to multiple modules for this to work...

[10:37] <gmosx> Would it be too much to ask for a servlet option that makes shared=true the default?

[10:38] <gmosx> i mean this module.shared hack is not compatible with the commonjs proposal, narwhal does not support it, and I don't think node supports it.

[10:38] <hannesw> it should be compatible

[10:38] <hannesw> but yes, i'm considering making shared = true the default

[10:39] <gmosx> perhaps this can be an option

[10:39] <gmosx> module-shared

[10:40] <gmosx> on the positive side, I am now switched 100% to RingoJS ;-)

[10:40] <hannesw> that's very cool!

[10:41] <hannesw> I'll consider doing something about the shared issue

[10:41] <hannesw> i already considered making shared the default, and allowing modules to "opt out"

[10:42] <gmosx> imho, that would be a better default...

[10:42] <hannesw> yes, maybe..

[10:42] <gmosx> a quick grep revealed that most ringojs' modules jave shared=true anw...

[10:43] <hannesw> true

[10:44] <hannesw> there's only one module which must not be shared which is ringo/webapp/env, and i want to get rid of that (reimplement it) anyway

[10:49] <gmosx> I had a quick look at env, it looked like a strange implementation...

[10:49] <gmosx> (dunno remember why though ;-))

[10:49] <gmosx> btw, a question:

[10:51] <gmosx> if you know, when the servlet is running on appengine, each request goes to a separate thread? if I have shared=true in the config module can

[10:51] <gmosx> I avoid reinitialization on each request?

[11:00] <hannesw> gmosx: yes, with shared = true the module is not initialized for each request/thread

[11:01] <gmosx> but I still have to add module=true to every single module in my app (and all the dependencies), not good, I really hope you change the default.

[11:31] <robi42> hannesw, if you don't mind i'd blog your websocket protocol code snippet?

[11:31] <hannesw> robi42 did you try it?

[11:31] <hannesw> it isn't working yet

[11:31] <robi42> oh, ok. :)

[11:31] <hannesw> still working on it with mr. rinner

[11:31] <robi42> i see :)

[11:33] <robi42> where's the catch?

[11:43] <robi42> btw, just tried and at least websocket servlet `doGet`'s working here

[11:53] <hannesw> now it's working

[11:53] <hannesw> http://gist.github.com/403604

[11:54] <hannesw> will also switch ringo-cometd to new addServlet() method so we don't need a custom jetty.xml...

[11:55] <robi42> great

[12:08] <robi42> hm, getting "java.lang.NoSuchMethodError: org.eclipse.jetty.io.AsyncEndPoint.cancelIdle()" here. but probably i'm doing something wrong. :)

[12:09] <hannesw> mixing different versions of jetty?

[12:09] <robi42> possibly

[12:11] <robi42> which websocket jar version's recommended, btw? got jetty-websocket-7.1.0.v20100505

[12:12] <hannesw> always use the same as your other jetty fiels

[12:13] <robi42> ok

[12:17] <robi42> yay, it's working.

[12:24] <robi42> will/would we provide that as a package?

[12:40] <hannesw> we could

[12:55] <robi42> hannesw, shall we host it on ringo github account?

[12:55] <robi42> (just packaged it up)

[13:07] <robi42> hannesw, fyi: put (working) package there meanwhile: http://dav.robert42.com/ringo-websocket.zip

[13:32] <hannesw> robi42: i don't think this should be a ringo maintained package

[13:33] <hannesw> also, this is currently missing an API an actual application could use

[13:34] <hannesw> it's just a demo really, for a technoligy that is not yet widely implemented

[13:37] <robi42> isn't the actual api html5 websocket client one?

[13:38] <hannesw_> i was talking about the server side API

[13:39] <robi42> ok

[13:56] <robi42> hi rist, fyi: put up a little package of experimental websocket support, so one could simply `bin/ringo-admin install http://dav.robert42.com/ringo-websocket.zip` to give it a spin

[13:57] <rist> swa it already in the chat logs

[13:57] <rist> thanks

[14:12] <robi42> hannesw, webapp skeleton is a bit "untidy", may i push little cleanup? (looking at actions.js stub index action, that is)

[14:13] <hannesw> robi42 sure

[14:13] <hannesw> also, i think we need to get namespace-skeleton out of packages.

[14:15] <robi42> agreed

[14:15] <robi42> one place for all skeletons/stubs could be useful?

[14:39] <hannesw> updating ringojs.org to a current snapshot

[15:17] <robi42> (fyi: updated log.robert42.com to current ringo master snapshot as well)

[15:55] <hannesw> I switched module default state to be shared

[18:51] <earl> hannesw: with modules now being shared by default, should we probably remove all explicit `shared = true` settings?

[20:00] <hannesw> earl: yes maybe

[20:03] <hannesw> good evening!

[20:03] <hannesw> ready when you are :)

[20:12] <robi42> i'm here :)

[20:14] <hannesw> fixing some fileuplaod issues

[20:16] <robi42> hannesw, after that 0.5 should be ready in your opinion?

[20:17] <hannesw> well, almost.

[20:17] <robi42> what's missing?

[20:18] <oberhamsi> i'm mostly here as well :)

[20:33] <hannesw> hey oberhamsi if we're 3 that's enough for a meeting :)

[20:34] <hannesw> robi42 can't say, i keep testing and finding things i want to fix

[20:34] <hannesw> but i think we're almost there

[20:35] <robi42> dropping out for dinner shortly, sorry :)

[21:44] <gmosx> hannesw: thanks for making shared the default!

[21:55] <xchl> hello all!

[21:55] <hannesw> hey xchl!

[21:56] <xchl> big changes w/ shared-modules-as-default!

[21:56] <hannesw> you think? not so big imo

[21:56] <hannesw> have been pondering this for a long time

[21:56] <xchl> behaviour that way is probably closer to what people (incl. me) would expect ...

[21:56] <hannesw> think it's the right thing to do

[21:56] <hannesw> yep

[21:57] <hannesw> think so too

[21:57] <robi42> should it also have an impact on performance, btw?

[21:57] <xchl> in any case, that module (not-)sharing business would profit tremendously from a bit of documentation

[21:57] <xchl> (but maybe there is already and I haven't stumbled across it yet)

[21:57] <hannesw> robi42 yes

[21:57] <hannesw> xchl indeed

[21:58] <hannesw> i think i wrote about it somewhere somtime

[21:58] <robi42> ah great, was wondering why log.robert42.com suddenly feels snappier :)

[21:58] <xchl> _even_ snappier :)

[21:58] <robi42> :)

[21:59] <robi42> actually we could also allow for disabling skin reloading in production, no?

[22:00] <gmosx> hey all ;-)

[22:00] <gmosx> 0.5 is shaping up to be a *great* release

[22:00] <xchl> hannesw: http://ringojs.org/wiki/Modules_and_Scopes/ - that's probably what you were thinking about

[22:01] <hannesw> right

[22:01] <xchl> hey gmosx!

[22:01] <xchl> appenginejs almost makes me want to check out appengine ;-)

[22:01] <hannesw> gmosx thanks, you contributed to that too

[22:02] <gmosx> hannesw: nah, hopefully I can contribute in the 0.6 cycle

[22:02] <gmosx> xchl: appengine is great ;-)

[22:03] <gmosx> xchl: most probably the best way to get from a 'toy' web app to a real world web app (no need to worry about infrastructure and restrictions that guide you)

[22:04] <hannesw> the one thing i dislike about appengine is the long initial load time

[22:04] <hannesw> otherwise it's truely great

[22:04] <gmosx> just use the cron trick

[22:04] <gmosx> or wait for reserved instances (is on the roadmap)

[22:05] <xchl> hannesw: I guess that's not really an issue for apps that are actually used, right?

[22:05] <gmosx> hannesw: what I really love about appengine is that you need no system administration ;-)

[22:05] <robi42> cron trick works fine there, yep

[22:05] <hannesw> xchl depends on what you call used :) gmosx didn't know about reserved instances, interesting

[22:05] <gmosx> hannesw: and you can't beat the price (for small apps)

[22:06] <gmosx> hannesw: have a look at the roadmap:

[22:06] <gmosx> http://code.google.com/appengine/docs/roadmap.html

[22:08] <hannesw> interesting!

[22:09] <gmosx> yeah

[22:10] <xchl> ahhh, lots of my early gripes have been fixed

[22:11] <robi42> having appenginejs supported on top of ringo's really awesome, thanks gmosx

[22:11] <gmosx> a lot is fixed... it's a great platform now, and the possibilities for the future are boundless...

[22:11] <xchl> and appenginejs' pythonic api looks very nice, indeed

[22:11] <gmosx> and you can use javascript now, what more can you ask ;-)

[22:12] <gmosx> I try to mirror the Python API exactly, this way there is no need to write docs (can reuse the Python docs)

[22:12] <robi42> great

[22:13] <gmosx> the Java API felt to alien for Javascript, so I decided to port the Python API

[22:14] <xchl> that was/is an excellent idea

[22:14] <gmosx> :)

[22:14] <xchl> is the component status on appenginejs.org still up-to-date?

[22:15] <gmosx> the components mostly work ;-)

[22:15] <gmosx> perhaps I should increase the percentages...

[22:15] <gmosx> more or less everything works...

[22:16] <xchl> is there a work roadmap somewhere? in the recent mails, you mentioned that you'd like some help ...

[22:16] <gmosx> but I need some help from hannes to optimize some low level code in the datastore api (that was one of the reasons of switching to ringojs ;-))

[22:16] <xchl> ah, ok :)

[22:16] <gmosx> hmm, I can post some kind of roadmap or stuff that needs to get done...

[22:16] <gmosx> one example is google.appengine.ext.webapp

[22:17] <gmosx> haven't converted that because I use JSGI/Nitro...

[22:17] <gmosx> but it would be great to have for completeness...

[22:17] <gmosx> (if I find a volunteer that is)

[22:18] <gmosx> another thing that is missing and that is probably easier to add is support for GQL in the datastore API...

[22:18] <gmosx> anw, if you are interested, try the examples, play a bit with the code (I will help you with any questions you might have) and then we can see If you can help...

[22:19] <xchl> yes, will do so!

[22:19] <gmosx> thanks...

[23:34] <hannesw> i made some changes to basicauth middleware

[23:34] <hannesw> let me know if you have troubles with these

[23:41] <robi42> hannesw, looks and works fine

[23:42] <hannesw> i'm not sure if we should remove surrounding slashes

[23:42] <hannesw> maybe yes

[23:53] <robi42> well, this way one has to provide root slashes for realms in config.js (which is fine, imho)

[23:57] <robi42> basically, `secure[/area]: credentials` vs. `/secure[/area]: credentials` (config-wise)

[23:58] <robi42> (while the latter realm def. needs to be a string literal, of course)