Marionette.js v3. Getting started with new version
Welcome to the party.
The main goal of Marionette v3 was to clean up and simplify the API.
The library was converted to ES6 and organized for easier contribution.
Marionette v3 is both smaller and faster than v2.x.
In future major releases we hope to improve the performance and simplify further.
Let’s go through some of the changes in v3.
Version 2.x had many different kinds of views:
In version 3
LayoutView were ‘merged’ into
CompositeView was deprecated for removal in v4.
Now we have only
Here are some simple examples:
View handle regions?
The same as
LayoutView did however regions are no longer attached
directly to the view.
How can I build table or tree without
If you build your table or tree using
CompositeView just take a look here
to learn how to easily migrate to using
In version 3 the region events
before:show are no longer triggered
on the view. You can use
before:render events in most cases. If
you need to know that the view is in the DOM then you can use
which is triggered after the attach event and every subsequent
Learn more about view lifecycle events here.
Child views events
childEvents attribute was renamed to
Proxied events do not append
this by default
In Marionette v2 all events that were proxied to the parent prepended the child view as the
1st argument of the event. In v3 this is no longer the case. All internally triggered events
will prepend the childView as the 1st argument, but custom triggered events won’t by default.
templateHelpers property was renamed to
Marionette.Controller was removed. Use
Application now only accepts a single region instead of acting more as a
Also initializers were removed. Use the
start event to initialize other classes.
Last the global wreqr channels on
Application were removed. Use
Marionette.Module was removed. A modern module loader such as browserify or webpack is preferred.
However there is a shim for
Marionette.Module available here.
Marionette.RegionManager was removed. This publicly exposed class was mostly used as a common
class used between
Backbone.Wreqr was replaced with
on why we decided to replace it.
Backbone.BabySitter which was a fundament for managing child view,
became a core part of
Marionette.js, and is no longer a dependency of Marionette.
Don’t worry if you use it directly, it’s still a supported library so you can use it
separately in your
Marionette’s bundled build
Marionette now only has a single build and requires Radio as a dependency.
For additional information check out the upgrade guide.
The Marionette v3 compat tool also details the breaking changes in its documentation.
We would strongly recommend looking at Marionette guides,
simple setups with different build tools and additional resources
to build awesome stuff using Marionette.js v3.
Thank you everyone for your contributions and helping v3 out! Cheers!