PaulUithol / Backbone-relational

Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models
http://backbonerelational.org
MIT License
2.34k stars 330 forks source link

ES2015 Refactor (Release Checklist) #572

Open bpatram opened 8 years ago

bpatram commented 8 years ago

I've started work on refactoring some of bbr to use Rollup + Babel with a more modular design. Overall this should help everyone out to make it more extensible and easier to maintain in the long run. All work will be done on the next branch, if you are submitting a pull request make sure to branch off next until the release is completed.

Since This library is so tightly coupled in places there will be more extensive refactoring required (for example, the base Relation 'class' is dependent on HasOne and HasMany while both HasOne and HasMany extend and depend on Relation).

Due to the nature of this large of a refactor I'm unsure how collaboration will work out with PRs and merge conflicts. It will take extra coordination.

bpatram commented 8 years ago

What I ended up adding is a relation type store, which maps the relation types to their names. 'HasMany' => Relation.HasMany and the same idea for HasOne. This would also make it easier to override and register new relation types (Many to many?) in the future.