0
votes
1answer
156 views

With AMD style modules in JavaScript is there any benefit to namespaces?

Coming from C++ originally and seeing lots of Java programmers doing the same we brought namespaces to JavaScript. See Google's closure library as an example where they have a main namespace, goog and ...
2
votes
0answers
69 views

How to organize legacy multi page web app with tons of Javascript spaghetti [duplicate]

I have inherited of an application and need to reorganize and I hope I will be able to modularize the tons of Javascript that is everywhere. It is a multi-page webapp. Each page has a script tag in ...
4
votes
3answers
244 views

How should modules access data outside their scope? [closed]

I run into this same problem quite often. First, I create a namespace and then add modules to this namespace. Then issue I always run into is how best to initialize the application? Naturally, each ...
8
votes
2answers
1k views

How to modularize and package a client-side Javascript library today?

I've been catching up with the modern client-side JS ecosystem and reading up on CommonJS and AMD (incl. associated tools - browserify, requirejs, onejs, jam, dozens of others). If I'm writing a ...
1
vote
0answers
950 views

How should I structure modules in an Angular.js application?

I am fairly new to Angular.js, and one that confuses me is how to best use modules in an application. It seems to me that modules can contain any of the other common constructs in AngularJS ...
5
votes
2answers
480 views

Javascript Architectural Model

Are there any obvious flaws to this OO architectural model which I intend to implement using javascript? It is similar to the MVP model but instead the role of the model is broken down into three ...
4
votes
1answer
2k views

Node.js app private modules. Where to put them?

The situation would be: I develop 2 projects in my Node.js development environment, P1 and P2. P1 required the development of two simple modules, mod1 and mod2, which are stored in P1/lib. Each one ...
2
votes
2answers
1k views

one single compressed js file VS compressed requirejs module files

I just started using requirejs and I love it. I have one concern though. I've been compressing all my js files into one single file. Even with requirejs optimizer, I need to load module files from the ...
2
votes
2answers
299 views

Incorporating libs into module pattern

I have recently started using require.js (along with Backbone.js, jQuery, and a handful of other JavaScript libs) and I love the module pattern (here's a nice synopsis if you're unfamiliar: ...