Skip to content

Releases: marionettejs/backbone.marionette

v2.2.0-pre

03 Sep 01:34
Compare
Choose a tag to compare

v2.1.0

30 Jul 00:51
Compare
Choose a tag to compare
  • Features
    • Marionette.Object
      • A base class which other classes can extend from. Marionette.Object incorporates many backbone conventions and utilities like initialize and Backbone.Events. It is a user friendly class to base your classes on to get Backbone conventions on any generic class.
    • Add a el reference to the views el from within a behavior instance.
    • ItemViews can now have no template by setting template: false
    • Application objects can now configure their default message channel.
      • This will allow you to configure multiple applications to exist at the same time within an apps without their event bus colliding.
    • Application objects now have the getOption method.
    • Regions now have a hasView method to determine if there is a view within a given region.
    • Views no longer use toJSON directly on models. instead they call into the new overridable methods serializeModel and serializeCollection where are called via serializeData
    • Return chainable objects from more methods to be consistent
      • Application: emptyRegions
      • Application: removeRegion
      • CollectionView renderChildView
      • Controller new
      • LayoutView destroy
      • Region reset
      • Region attachView
      • Region empty
      • RegionManager destroy
      • RegionMananger emptyRegions (now returns regions)
      • RegionMananger removeRegions (now returns regions)
      • RegionMananger removeRegion (now returns region)
      • View destroy
      • View undelegateEvents
      • View delegateEvents
    • RegionManager addRegions now accepts a function that returns a region definition in addition to a region definition object
      • This extends to Marionette.Application’s and CompositeView’s regions properties
    • Added CollectionView resortView
      • Override this method on a subclass of CollectionView to provide custom logic for rendering after sorting the collection.
    • View instance is now passed as a third argument to Marionette.Renderer.render
    • Add getRegionMananger to Application
  • Fixes
    • CollectionView now maintains proper order when adding a mode
    • Fix component.js path
    • Prevent AppRouter from erroring when appRoutes are passed into the router constructor as an option.
    • UI hash keys now only allow documented syntax, enforcing @ui.stuff instead of @ui<ANY_CHAR>stuff

v2.1.0-pre

24 Jul 21:11
Compare
Choose a tag to compare
v2.1.0-pre Pre-release
Pre-release
v2.1.0-pre

v2.0.3

19 Jul 02:19
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed an issue where before:show was not triggered on a view's behavior when shown within a region.
    • Destroying a view outside of its region will now cause the region to remove its reference to that view.

v2.0.2

12 Jul 23:49
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed issue where render:collection called before the entire collection and children had been rendered.
  • General
    • Remove bundled main entry point for bower.

v2.0.1 Release

19 Jun 14:07
Compare
Choose a tag to compare
  • Fix missing Wreqr and Babysitter in Core AMD definition. via #1501

v2.0.0

18 Jun 01:35
Compare
Choose a tag to compare

If you are looking to upgrade a 1.x app please use https://github.com/marionettejs/Marionette.Upgrade

Questions? Need help? Join us on gitter.im
https://gitter.im/marionettejs/backbone.marionette

The Changes:

General

  • API change: Removed the Marionette.$ proxy. We are now using Backbone.$ instead.
  • API change: All instances of the word type in the API have been replaced with the word class. For instance:
    • regionType => regionClass
    • ChildViewType => ChildViewClass
  • triggerMethod now calls the method before triggering the event. Previously it was the other way around.
  • jQuery deferred objects can now be replaced via the global Marionette.Deferred object.
  • Stricter JSHint rules were implemented for more consistent style across the codebase.
  • A new property, Marionette.VERSION, was added.
  • Most classes now have getOption attached to their instances, taking advantage of the new helper function Marionette.proxyGetOption
  • Most classes now have bindEntityEvents attached to their instances, taking advantage of the new helper function Marionette.proxyBindEntityEvents
  • Most classes now have unbindEntityEvents attached to their instances, taking advantage of the new helper function Marionette.proxyUnbindEntityEvents
  • There are now only two built versions of Marionette, and both come in UMD wrappers. The first is the core by itself and the second is the bundled version (with Wreqr and Babysitter).

Applications and Modules

  • API change: The arguments of a Module’s initialize function are now consistent with Module constructor argument order. Previously they were inconsistent with one another.
initialize: function( moduleName, app, options ) {
  • API change: Application’s initialize triggerMethods have been renamed to start, which is more descriptive of what is actually happening. More specifically, initialize:before and initialize:after are now before:start and start, respectively. Note that no functionality has been lost with this change; it is merely a changing of names.
  • The Application message system has been replaced with a channel named “global”
  • Applications have two new triggerMethods: before:region:add and before:region:remove to complement their existing region events.

Controllers

  • API change: stopListening is now called after the destroy triggerMethod is called.
  • API change: close has been renamed to destroy to emphasize the fact that an instance should not be reused, or ‘opened,’ after it is destroyed.
  • The before:destroy triggerMethod has been added to controllers. Due to this your controllers can now implement a onBeforeDestroy method to be invoked just before a Controller has been destroyed.

Behaviors

  • Behaviors now support a means to group behaviors together. Any Behavior can now have a behavior key of its own, very similar to how a view can have behaviors.

Regions

  • API change: Regions now throw an error when show is called with a nonexistent el. Previously this was a silent failure.
  • Region’s ensureEl has been renamed to _ensureElement
  • API change: Regions now expose region.el and region.$el, just like View’s.
    Due to this change if you were depending on region.el to be a string selector you must update your code to use region.$el.selector.
  • API change: The open method has been renamed to attachHtml.
  • API change: The close method has been renamed to empty, as it functions quite differently from a View’s close method.
  • Regions now use .innerHtml when clearing contents as compared this this.$el.empty().
  • region.show now return this, just like how a view’s render returns this.
  • Regions trigger two new events, before:swap and swap, when it swaps views when calling show.
  • Region’s el can now be a DOM node / DOM string selector / Jquery selector instance, just like a View’s el.
  • Calling show on a region with the same view that is currently shown is now a noop. Previously the view would be re-rendered. You can force a rerender by passing forceShow: true with the region show options.
    MyApp.mainRegion.show(myView, {forceShow: true});
  • Regions now fire a new triggerMethod, before:destroy, before they are destroyed.
  • There is a new triggerMethod: before:empty

RegionManagers

  • getRegions: returns all of the regions of a given RegionManager instance as an Array. This method is also exposed to the Layout and Application as getRegions.

Views

  • API change: Layout is now called LayoutView.
  • API change: Renamed close to destroy for views. Close was a confusing verb for users who thought that they could be reopened. The verb destroy makes it more clear that once a view is destroyed you can not reuse it.
  • API change: Returning false from onBeforeClose no longer prevents the view from closing. This behavior was inconsistent with the rest of the library, and would require far too much logic to respect in all cases. Instead of returning false, you should handle your logic before calling close on the view.
  • API change: appendHtml has been renamed to attachHtml. appendBuffer has been renamed to attachBuffer
  • API change: Removes duplicate and inconsistent itemView events. No functionality was lost with this change; simply use the unprefixed version instead. For instance, use before:render instead of item:before:render.
    • item:before:render
    • item:rendered
    • itemview:item:before:render
    • itemview:item:rendered
    • itemview:item:before:close
    • itemview:item:closed
  • item:before:destroy
    • item:destroyed
  • API change: childEvents callbacks no longer receives the event name as the first argument, making the arguments of those callbacks consistent with standard trigger callbacks.
  • API change: itemView within a collectionView is now known as childView. This removes confusion for new users as to the fact that you can show any type of view in your collectionView. All CollectionView methods that referenced itemView now use the same childView as well. For instance, getItemView is now getChildView. Do note that CompositeViews extend from CollectionView, so these API changes affect that Class as well.
  • API change: collectionView, and compositeView, have new listener callbacks for their underlying collection. addChildView is now _onCollectionAdd and removeItemView is now _onCollectionRemove
  • API change: renderModel for compositeView is now called _renderRoot.
  • API change: collectionView’s and compositeView’s method onChildRemove is now known as _onCollectionRemove
  • Bug fix: UI interpolation for events no longer mutates the prototypes event hash
  • Bug fix: UI interpolation for events now works properly if you dynamically add @ui interpolated events to a view instance and call delegateEvents on the view instance.
  • A views html content insertion can now be overridden on a per view basis via attachElContent to render in a non standard way for optimization and not standard use cases. This is available to all views with templates: Item View, Layout View, and Composite View.

For example, using innerHTML instead of $el.html

attachElContent: function(html) {
 this.el.innerHTML = html;
 return this;
}
  • A new triggerMethod was added to collectionView: before:remove:child.
  • Collection and Composite Views now respect the collection comparator when rendering and when new views are added. This means that your collection will stay in order on the DOM.
  • collectionView and compositeView now have an optional emptyViewOptions property which allows you to customize your emptyView.
  • addItemView is now addChild : This will not be a one to one conversion and will require you to update your implementation if you are not calling super
  • Layouts now facilitate overriding the default RegionManager with a custom Class through the use of the getRegionManager method.
  • LayoutViews now lets you specify the regions hash as an option upon instantiation. Previously you need to create a brand new LayoutView class to set the regions.
new Marionette.LayoutView({
 regions: {
   "cat": ".doge",
   "wow": {
     selector: ".such",
     regionClass: Coin
   }
 }
})
  • LayoutViews have a new property: regionOptions. These are the options that are passed into each region upon creation.
Cleanup
  • Removes calls to MyClass.prototype.constructor, instead simply referencing MyClass.
  • Swapped Jasmine for Mocha for unit tests
  • All code is now instrumented via coveralls for every PR. This gives a code coverage statistic for us to identify testing gaps.

For a closer look at each change, refer to the https://github.com/Puppets/marionette-changelog-detail.

v1.8.8 nested behavior onShow fix

13 Jun 16:00
Compare
Choose a tag to compare
  • Fixes
    • Fixed the case where onShow was not called on child view behaviors when inside a Collection or Composite view.

@UI fix

06 Jun 22:38
Compare
Choose a tag to compare
  • Fixes
    • Fixed nasty ui interpolation bug with behaviors.
  • General
    • Minor Doc cleanup

v2.0.0-pre.2 - fast forward

04 Jun 02:38
Compare
Choose a tag to compare
Pre-release

The changelog is quite large, please refer to the google doc for a summary
https://docs.google.com/document/d/1fuXb9N5LwmdPn-teMwAo3c8JTx6ifUowbqFY1NNSdp8/edit#

Please reach out with questions and or feedback here
https://gitter.im/marionettejs/backbone.marionette