V1.8.0 - The Road
-
General
- Update Gruntfile.
- The default task (
grunt
) now runs tests. $ grunt dev
watch for watching.$ grunt build
runs the tests and compiles.- Add better inline documentation for module implementation.
- Add better inline behavior documentation.
-
Fixes
- Behaviors now correctly lookup methods for
modelEvents
andcollectionEvents
. - The
CollectionView
now triggers close on its children in the correct order.
- Behaviors now correctly lookup methods for
-
Features
- Add
onRoute
to theappRouter
.
Backbone.Marionette.AppRouter.extend({ onRoute: function(route, params) { } })
Region.show
now takes an option to prevent closing the previous view in the region. By default a region will automatically close the previous view, however you can prevent this behavior by passing{preventDestroy: true}
in the options parameter.
myRegion.show(view2, { preventDestroy: true })
- Add a
getRegion
method toLayout
. This is in line with the eventual goal of not attaching regions to the root layout object. - Behavior instances now extend from Backbone.Events, allowing you to use
.listenTo
and.on
. - Allow Behaviors to have a functional hash lookup.
Marionette.ItemView.extend({ behaviors: function() { // “this” will refer to the view instance return : { BehaviorA: {} } } })
- RegionManagers now calls
stopListening
on a regions on removal.
- Add
-
Refactors
- Abstract underscore collection method mixin into a generic helper.
- Use built in marionette extend for behaviors.
-
Tests
- Add a whitespace linter to the text coverage. Trailing whitespace now causes travis.ci to fail.
- Add test coverage for
bindEntitiyEvents
andunbindEntityEvents
. - Test public API for the
regionManager
. - Improve view trigger tests for better control when testing.