I also can't think of much precedent for CommonJS modules that silently do
things behind the scenes, and subsequently just return a string.
If we want to write our own angular modules with CommonJS, presumably we'd
want to be able to write something like:
```js
require('ngApp').controller('homeCtrl', ctrlFunc);
```
In my experience, Angular's module system is a key weakness. If we build
compatibility with established module systems, large Angular will be able
to immediately take advantage of the improved encapsulation and
dependency-resolution that CJS promotes. Similarly, this gradually moves
toward the module system that will be used in Angular 2.x.
While CJS support is a great short-term goal, I believe that Angular 1.x
needs to adopt (or, at least support) ES6 modules. ES6 is the future, the
module specification has been finalized, and the module syntax can be
efficiently transpiled into ES5 code that can be used today. The upgrade
path to Angular 2 will not necessarily be smooth, but this is one area
where we can certainly ease the transition.
-- Andrew
On Wednesday, January 14, 2015 at 8:51:04 AM UTC-5, Paul Everitt wrote:
>
>
>
> On Wednesday, January 14, 2015 at 8:20:36 AM UTC-5, Ben Clinkinbeard wrote:
>>
>> If the `require('angular-route').name` format were enabled, people
>>> currently shimming the modules would essentially be able to remove the
>>> shimming infrastructure and leave their code untouched. That seems like a
>>> win to me.
>>>
>>
> Very big +1 from me on this, for the "removing" reason.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.