Skip to content

Commit

Permalink
Update use of initializers
Browse files Browse the repository at this point in the history
Marionette as of v2.3.0 has marked initializers as a deprecated feature.
marionettejs/backbone.marionette@1717c71

Why is this?

Back when Marionette was built (late 2011), module patterns were still
emerging, it was the wild west in many ways. @derickbailey came up with
the idea of marionette modules. Modules were built for managing "components" and nested
components. They could be stopped and started at will and were also
started and stopped with their parents (since modules are nestable).

Initializers and Finalizers (pieces of the Marionette.Callbacks helper
class) are a great idea, and are a very powerful one at that, allowing people to specifiy actions to take onStart or
onEnd.

That said, the year is 2015 and much has changed about the landscape of
modules and javascript. Heck @derickbailey even wrote a post about why you
should not use them anymore.
http://derickbailey.com/2014/06/10/browserify-my-new-choice-for-modules-in-a-browser-backbone-app/

Marionette is moving away from modules, and is moving into the land of
applications and sub applications to help people better handle complex
applications.

-------

fixes tastejs#1105
  • Loading branch information
samccone committed Feb 17, 2015
1 parent 79bba43 commit 88416c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/backbone_marionette/js/TodoMVC.TodoList.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ TodoMVC.module('TodoList', function (TodoList, App, Backbone, Marionette) {
}
});

// TodoList Initializer
// On App start
// --------------------
//
// Get the TodoList up and running by initializing the mediator
// when the the application is started, pulling in all of the
// existing Todo items and displaying them.
TodoList.addInitializer(function () {
App.on('start', function () {
var controller = new TodoList.Controller();
controller.router = new TodoList.Router({
controller: controller
Expand Down

0 comments on commit 88416c1

Please sign in to comment.