I'm currently facing this argument about namespaces on javascript and I need a community opinion.
The scenario: The architect in charge of this project somehow is devoted to RequireJS and really wants to use it.
I must say that the application is a backoffice, layed out as a wizard, so you kind of go back and forth on 6 pages with some complex business logic to at the end fill something that here I can described as a process request.
Ok, no single page application no nothing fancy on those matters. Plain backoffice web app, multi-page, with a very complex UI where every page is requested to the server and all resources (css, javascript and such) must be loaded at page load.
Main question: Knowing the kind of app we're talking about, why RequireJS in the first place?
Second question: Why try to convince that the best approach for namespacing in javacript is by using RequireJS? Am I missing something?
My opinion: For me it makes no sense at all. It's cumbersome to use RequireJS here because no resource is loaded on demand, they are all loaded at page load (just because we need them all at page load). We need to support at least IE8, Chrome, Firefox and Opera and we already had a lot of trouble with the resource loading across all these browsers. There is already a lot of trickery to make sure everything loads as expected through Require.
For namespacing it's even worse. Sure it works but again, seems cumbersome to me and on this matter is actually very limited.
So am I missing something? I need a third (or a 100th) opinion here.
- What do you think of this?
- What do you use?
- Why?
Thanks in advance