Open haohello opened 11 years ago
I've got a very large portion of Chaplin working with Node.js: Views, Models (with validation), Controllers, Routes, Templates. I have no idea if it is the most efficient way but I would definitely be open to discussing this more.
@chrisabrams Could you please share your code with me and let's see how to optimize it?
+1, I also have a similar task now, so it would be very helpful to see any example
@chrisabrams I saw your project The-Tramp works on node.js, however there is one thing that I don't like is the way that you are using jquery and jsdom on the server side to build html doms. Well, i'm going the another route with backbone.layoutmanager which is a Backbone.View descendant, and I rewrote the Chaplin.View to inherit from the backbone.layoutmanager, it works great for me.
Since I'm currently developing a cms, I might open source it once it is fully workable.
Looking forward to seeing your example.
I'm also interested on this. Let's keep this thread updated with our findings. And maybe more of us could work on a common solution.
After reading the source code of Chaplin, I've got some idea to port the router related class to node.js, however as for the view rendering, there will be a lot of work to be done to get it working in node.js. Mostly about having the chaplin to work asynchronously for the view rendering, and notify the express router function to respond the constructed html to the client once it finishes the rendering for various views.
The other backbone related project which can be working on the server side node.js environment is backbone.layoutmanager, it uses jquery deferred or underscore deferred to accomplish such kind of asynchronous handling.
Please let me know if you've got any ideas to get this working in node.js.