Saleem, I had a little time to experiment with mundle tonight. It's interesting and shows promise, but I have some significant concerns. I'd be interested in your perspective on them:
1. Modules are loaded using XMLHttpRequest, which immediately brings up cross-domain concerns. Only pages on the same protocol and exact hostname will be able to load these modules without adding JSONP or CORS support. 2. When a module is requested, the payload returned is JSON containing strings of code which are eval'ed. If you didn't already know, eval is evil. But even more troubling is that code loaded this way doesn't show up in the WebKit inspector (without using @sourceURL), thus hard to debug, set breakpoints, trace, etc. I see room for a tool like mundle, as it solves some problems other loaders do not. But either one of the concerns above is enough for me to move on. I suggest that you read this link carefully, as it explains these issues better than I can: http://requirejs.org/docs/why.html#5 I recommend you consider making the following improvements: 1. To get around the cross-domain issues, load modules by injecting a script tag into the <head> instead of using an AJAX call. A simple example of doing this can be found in the $script loader (see https://github.com/ded/script.js/ ). More complex implementations, such as YepNope, allow scripts to be loaded concurrently in any order, but executed in the specific order you desire. This is done by loading scripts as an image and letting the browser cache them, then loading them again from cache as JS in the correct order to execute them. 2. Have the server combine modules into a regular Javascript file, not a JSON file. You have an advantage that most loaders do not - there is a server-side component! So use it to build and wrap the raw modules with the correct "exports" context and so forth. 3. Word of advice: you will get more interest if mundle was written in Javascript, not Coffeescript. Most developers I know want critical components (such ast their loader) to be pure JS. I have nothing against Coffeescript myself, and have used it on some projects. But I believe it is something better suited for building your custom application, not general purpose tools such as a loader. Lastly, I created a pull request to fix an issue when loading mundle modules from an HTTPS server. I found that all modules were loaded via HTTP only, even if the current page is HTTPS. Here's the fix: https://github.com/meelash/Mundlejs/pull/17 I hope this helps! Tauren On Thu, Jan 3, 2013 at 3:09 PM, Oliver Leics <[email protected]> wrote: > On Thursday, January 3, 2013 6:44:54 PM UTC+1, Saleem Abdul Hamid wrote: > >> Aren't there plenty of successful os projects with GPL? Is there any >> reason why it doesn't work in the node community, besides what everyone >> else is doing? Are there a majority of commercial project using node? >> > > Latest discussion: > https://groups.google.com/forum/?fromgroups=#!topic/nodejs/5xxD2c4UfK8 > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
