documentcloud/backbone — Issue #770: Proposal :: Modularizing Backbone
Author: alvincrespo
Created: 2011-12-01 15:06:07+00:00
State: open

Problem:

As the project expands, keeping the source code within one file will become much more problematic. The complexity of the code itself will become an issue without modularizing each part of the framework (Models, Views, Collections, etc...). This easily effects those who wish to use only part and not all of the framework - for example a developer may wish to only use the Models part of the framework and not Views since it may not be necessary.

Possible Solution:

I propose that we modularize each component of the framework, meaning we have one module for Models another for Views and so on. With these we would have different files that follow a convention, something like backbone.models.js and backbone.views.js.

Possible Solution - Pros:
Some benefits of doing this would be to improve organization, increase modularity and quick referencing. In the long term this will help increase the involvement of the community as it would be easy to find and quickly diagnose issues but it would also allow the community to choose what they need when they need it with custom build processes that could go along with this proposal.

Possible Solution - Cons:
On the other hand, it could be a problem as it would probably make it a bit more complex for those who have learned the source code as it is right now. It would also need some more in depth testing of each module and how they relate to each other - tests could become complex with custom build processes as well.

Summary

Currently the framework exists within one file and is not modular - not giving the community flexibility to easily implement what the need. For this, I propose we modularize the framework. This will allow supporters to use what they want when they want it while giving the framework more structure and organization. I believe the effort to do this would most certainly help community involvement and the overall advancement of the framework.