I am studying the possibility of building Javascript applications in the Java / OSGi modularity style. I am sure I will not manage to actually reach the kind of flexibility that OSGi provides, but I would need to get to at least the following list:
- split javascript code as modules, each module would lay in its own git repository
- ideally, as little as possible dependencies between modules and definitely no circular dependencies between modules
- have 2 or more “main” javascript applications that will use the modules described above
If I will manage to setup the above then I will probably want to be able to organize modules as layers like: core layer with several modules, ui layer, applications layer.
Are there any javascript libraries that help building the above setup? Is something like this possible in javascript?
Note: When I say javascript, I don’t actually mean plain javascript. I am going to use a library like ExtJS or jQuery for the UI part at least.
Checkout RequireJS an implementation of Asynchronous Module Definition