Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding r.js support #67
in your intro you recommend r.js but don't exactly use it for the examples - at least not in the modular-backbone one. So I decided to try learn how it works using that example. After several failed attempts to configure it I finally got it working (prompting this pull request) but I'd like to get your opinion on my approach. I think there could be a better way but I don't know enough syntax for r.js - perhaps you do.
Ideally, when I build this project, I'd like the final main-built js file to appear in a separate directory with a new index.html which would use it. This separate directory would also have the supporting images and css folders. Instead of a separate directory, I ended with a simply main-built.js file and then I manually had to create a index-prod.html file to use and all this source is in the same "modular-backbone" directory.
How would one setup the build.js to produce this file structure within a new "app-built" directory? And give us a structure something like this:
or what would you recommend?
Hey Brandon, bit stressed for time right now so will come back to this in a few days.
In the mean time here are two examples
Neither of them are as elegant as I'd like but I will work with you here to get something beautiful.
feeling less stressed these days? I hope so... because I have some stuff for to review - much more than r.js support
I have another pull request as I re-worked this:
I think I made it a bit more approachable for someone new to these concepts and focussed on getting it work locally.
I'd really like your input because the next step is to get it to work on a hosted platform - ideally Nodejitsu - where you have your other tutorials.
My local version has 1 server file - see server.js - which contains both a http server and a mongo server listening on two different ports. It works perfectly. You can start up mongodb locally; create a messages collection; and start sending and receiving messages.
Then, for my nodejitsu attempt, I decided to break that file into two distinct apps (see server-http.js and server-mongo.js); inspired by one of your cryptic comments ;-D I have a http app that serves up the html/js/css to the browser and another app that deals with mongo. In my logs, I can see that the two apps are talking to each other - receiving the messages - but they aren't getting saved and returned from mongohq.
Anyways, please pull and poke around a bit -- I'm confident that the local version will be helpful and it shouldn't take much more effort to get the nodejitsu version rocking too.
awesome thanks! I'm going to review that update on the weekend again as I made a lot more progress since that post - I also want to explore a few more ways to use Restify and Mongoose - I'll try to commit it on sunday.
I actually like the existing site ;-D -- your time might be better spent on a little retro fitting instead of a complete overhaul
I've made my commit and it looks like they landed here ok - I'm going to delete my forked repo and do some more testing tomorrow. Along with a couple mongoose updates, I've just added yeoman support ( I was using MAMP ) which gives one live reload. This basically eliminates the need for a local static http server but of course you may still one when you go to host it remotely so I've left it in just in case it becomes necessary.