Hi all.

I wanted to check with you all the approach that I thought to consider
distributing reusable AngularJS modules between different teams dealing
with large AngularJS applications.

First of all, the AngularJS modules are developed using the pattern I
described in my blog post: http://leog.me/log/large-angularjs-app-components.
To sum it up, as I'm using RequireJS, I essentially define a RequireJS
module that creates an AngularJS module with a name that is being returned
as part of the RequireJS module. That way I stop relying on knowing the
created AngularJS module names. This simplifies a complex AngularJS module
creation by requiring the correct RequireJS module and grabbing the
AngularJS module name to inject on the newly created AngularJS module.

Next thing to have in mind, these self-contained RequireJS modules that
exports AngularJS module names to be used by any other RequireJS module,
also have their own test specs. The idea is to have each of these
self-contained component stored in a repository in order to maintain
independence between components in terms of development. Of course that one
of these components may require other components from the RequireJS
definition of it, and that should be very clearly explained on the README
of the component as dependency detection over repositories is not something
that is implemented for what I know. These components are not meant to be
built. Also it can happen that a component can be updated by anyone that
considers to spread a customization to others. Furthermore, more than one
version of the component can be developed for different reasons which can
be reflected as repository branches.

Going to the point, these components provide a part of a huge application.
An application should include these components on its code, tweak them if
necessary (always taking care of the base tests provided) and run the
necessary tasks to test the application going through the process of
running the component tests and the application integration tests.
Eventually also running the application build task.

Why not use Bower you may ask. Well, Bower provides an excellent way to
consume vendor-like libraries, a pre-built piece of functionality for you
to use following an API provided by the library. This approach intends to
separate code to be maintainable and serve as a basis of repeated pieces of
functionality, highly customizable and componentized to be help developers
have a common basis of components, keep UI/UX consistency between developed
apps and promote an established and proven architecture that can lead to
successful applications.

What I concluded with all these arguments is to use Git Subtrees which
basically helps you to include a repository (component) into another
repository (application) to compose a complex architecture of parts. I
found subtrees to be a powerful tool to support every single argument and
requirement I exposed. Too bad it does not have a manifest-like
configuration file like submodules have to simplify every single use case
of it using friendlier names of repositories among other nice-to-have.

So, what do you think? Do you mind sharing your experience dealing with
similar scenarios? How about Git Subtree, did you had the chance to use it?
Is it good?

Thanks a lot in advance and please do not hesitate to reply with any
question if you have any doubt.

Cheers!

-- 
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.

Reply via email to