Ringobot log - RingoJS IRC channel: #ringojs on irc.freenode.net

2010-07-31:

[8:08] <hannesw> http://hns.github.com/2010/07/30/modules.html
[8:35] <zumbrunn> nice post Hannes!
[8:35] * zumbrunn loves it
[12:02] <hannesw> zumbrunn thanks!
[12:02] <robi42> getting rid of import() is fine with me, doesn't really add much value to justify existence, imho
[12:02] <robi42> btw, new post on modules & co. rocks!
[12:03] * robi42 gotta leave
[12:12] <earl> as you might have guessed, i'd prefer for import/include to stay, as a both like and use them
[12:12] <earl> but if they really gotta go, i probably could live with it
[13:14] <hannesw> earl are you using import() a lot?
[16:06] <earl> i'm using it less these days, mostly prefering destructuring assignments now
[16:07] <earl> and given that most of our modules are in nested namespaces anyway, the utility is somewhat limited
[16:08] <earl> so i mainly use it for the fs module, still preferring import('fs') over the repetitive var fs = require('fs')
[16:09] <hannesw> i see
[16:09] <earl> so as i said, i guess i could live without :)
[16:09] <earl> hooray for the core->utils migration btw
[16:11] <earl> if i would have any idea on how to improve on it, i would remark that the uppercase module naming is ugly as hell
[16:11] <earl> but i don't have a good idea, so ...
[16:35] <oravecz> Is there anything I can extend to switch ringojs to use getwriter instead of getoutputstream?
[16:36] <oravecz> I've embedded a portlet container in a web application. My portlets are written using ringojs. The JSP's want to use getWriter() inherently, but RingosJS wants to use getOutputStream(). This causes the familiar IllegalStateException when you try to use both output mechanisms in a servlet.
[17:12] <hannesw> oravecz no idea
[17:12] <hannesw> JSGI uses binary writes by definition
[17:12] <hannesw> how do you mix JSPs with ringo?
[17:14] <oravecz> using portlets
[17:14] <oravecz> THe portal page is typically a JSP, but delegates to "portlets" to render their own views
[17:14] <hannesw> i see
[17:14] <oravecz> I think I am on to something now. I am flipping the logic in writeBody
[17:15] <hannesw> well we could catch the illegalstateexception and use the writer if necessary
[17:15] <oravecz> I don't think portlets can return binary by definition
[17:15] <oravecz> so, i'm using response.getWriter
[17:16] <oravecz> and forgetting about the check for part instanceof Binary
[17:16] <oravecz> It works
[17:18] <hannesw> i guess we could use another X-JSGI-* meta header for this
[17:18] <hannesw> like X-JSGI-String-Response
[17:21] <robi42> just in case: i'd like `include()` to stay (useful in repl sessions and so on) but can live w/o `import()`
[17:21] <oravecz> it may be helpful for other users, but because the portlet lifecycle is different than the servlet lifecycle I had to provide a different version of jsgi.js and JsgiServlet anyway
[17:22] <oravecz> I am planning to switch over to Spring Portlet MVC at some point. I don't know if they leverage the Servlet API instead of the Portlet API, so maybe a chocie between getWriter() and getOutputStream() might be useful there...
[17:50] <ringostarr> 8dda7d2 Hannes Walln?fer: Readd Sorter factory function