version 1.0.0
YEP ANOTHER ONE!
It is always a lack of something in the current javascript MVC frameworks. And no clear points to plug own interfaces to them.
@tylerkeating Just looking at the JavaScript MVC landscape. It must be easier to write a new framework than to adopt the patterns of one that exists!
Can't say better.
Conventional based
- All folders should be on their own places (it could be overriden in code)
- Folder names must begin with Capital letters (couldn't be overriden)
- The names of controller, model and view must correspond each another (could be overriden)
#Default folders structure
|--Controllers
|-twitController.js
|--Models
|-twit.js
|--Views
|--Shared
|--_layout.html
|--Twit
|--index.html
|--item.html
-
Link hashtag is changed
-
Router parse hashtag and invoke controller's action
twits/index -> invoke TwitController::index
status/item/10 -> invoke StatusController::item(10)
-
Controller loads and generates* view corresponded to the controller's action
TwitController::index -> Views/Twit/Index.html
*in other term - aggregate view itslef, layout and contained partial views.
-
Load data from the service and map them to knockout object (viewModel).
twits/index -> [GET] http://url/twits
status/item/10 -> [GET] http://url/status/10
-
Bind knockout object to the view's viewModel. Knockout generate resulted client view on the base of the html bindings and loaded data.
All steps are customized. All classes and views are loaded separately and asynchronously via require.js
Extensions and overridings of default implementation
Toughly bound to knockoutjs