Skip to content

Releases: marionettejs/backbone.marionette

v2.4.1

01 Mar 14:40
Compare
Choose a tag to compare

v2.4.1 view commit logs

Fixes

  • Fixed a nasty bug where reorderOnSort when used on a CompositeView would not respect the childViewContainer.

General

  • Add JSCS for style linting and consistency.

Docs

  • Improve internal linking across docs, to make it easier for people to understand how pieces relate to each other.

v2.4.0

23 Feb 21:53
Compare
Choose a tag to compare

2.4 In Overview

The Marionette 2.4 release is primarily focused around adding power and performance to Marionette.CollectionView’s and CompositeViews. It is now possible for users to declaratively sort, filter, and reorder in a performant and clear way on the view layer. Prior to this work it was difficult and required significant workarounds.

As well as working on the CollectionView layer we have added full support for lodash and multiple builds of backbone, underscore and lodash. Allowing the user to pick whatever tools they wish.

The other powerful feature that we introduced in this release is the concept of childEvents for LayoutView and their subviews. Prior to this release there was never a great way to listen or react to events that were triggered on subviews, like when something was rendered or destroyed. Now we have brought over the declarative childEvents hash from CollectionView into the LayoutView.

As always come and join us in chat

View Some Live Demos

Features

  • CollectionView
    • You can now set a filter method on a CollectionView or CompositeView to filter what views are shown. This is useful for when you are displaying a list that a user can filter.
    • Add the reorderOnSort option to CollectionView and CompositeView to use jQuery to move child nodes around without having to re-render the entire tree. This is a massive perf boost and is an easy win if you are sorting your collections.
    • The CollectionView now has a viewComparator, to enable custom sorting on a per view basis regardless of what how your backing collection is sorted.
    • Refactor sort param lookup to use Marionette.getOption.
    • Fix childViews now fire a before:show event even if the childView is inserted after the parent CollectionView or CompositeView has been shown.
  • Regions
    • The empty method now takes an optional preventDestroy flag to prevent the destruction of the view shown within.
    • this.myRegion.empty({preventDestroy: true})
  • TemplateCache
    • The templateCache get method now takes a second param of options to enable passing options to the loading of templates.
  • LayoutView
    • Add a new helper method for easier showing of child nodes showChildView
    • this.showChildView('sidebar', new SidebarView());
    • Add a new helper method of easier retrieving of child nodes getChildView
    • this.getChildView(‘sidebar’)
    • Add a destroyImmediate option to the LayoutView, to destroy the layout view element and then remove the child nodes. This is a perf optimization that you can now opt into.
    • @ui interpolation is now supported within region definitions on a LayoutView
    • child event support was added via onChildViewX or via the declarative childEvents hash
  • ItemViews
    • the isRendered property is now set to true after render, even if no template is set.
    • Views
    • The destroy method now returns this instance that was destroyed to enable easier chaining of view actions.
    • If you define the options hash on your Marionette.View or if you pass options as a function to your Marionette.View, pass the result of options down to the backbone view constructor.
    • All views now have a isRendered property, that is updated after render and destroy.
  • Object
    • The destroy method now returns this instance that was destroyed to enable easier chaining of object actions.
  • Behavior
    • The destroy method now returns this instance that was destroyed to enable easier chaining of behavior actions.
    • Expose the UI hash to a behavior instance. The behavior UI hash is a composite of the view hash and the behavior hash merged with the behavior hash tasking precedence.

Util

  • Marionette._getValue will now use call under the hood if no arguments are passed (micro optimization).
  • Add Marionette.mergeOptions to Marionette.View* classes, Marionette.Object. Marionette.AppRouter, Marionette.Controller
  • mergeOptions is a handy function to pluck certain options and attach them directly to an instance.

Docs

  • Minor documentation cleanups and fixes

Deprecation Notices

  • Deprecate Marionette.Controller, Use Marionette.Object instead.

Misc

  • YAML api documentation is now linted on each PR.
  • Add Marionette.FEATURES flag.
  • Refactor several methods to enable 100% compatibility with lodash.

v2.3.2

30 Jan 16:04
Compare
Choose a tag to compare

v2.3.2 view commit logs

2.3.2 in overview:

Bug Fixes
  • Fix IE8 regression in Marionette._getValue to always call apply with either an array of params or an empty array.

v2.3.1

14 Jan 23:45
Compare
Choose a tag to compare

v2.3.1 view commit logs

2.3.1 in overview:

Features
  • Regions can set a parentEl as a way of specifying the DOM tree (default body) that they are scoped with. (useful for instance in LayoutView).
  var region = new Region({parentEl: $(#sub-tree”)})
Bug Fixes
  • Layout region lookups are now scoped to the layout and not to the entire DOM.
  • Calling delegateEvents after the ui hash has been modified now works.
  • Prevent unsetting event listeners on region swap when a view is swapped out from a region, but not destroyed, its DOM events will not be removed.
  • A view's isDestroyed state is now explicitly set to false when the view is created.
Refactors
  • Added Marionette._getValue. This method is similar to _.result. If a function is provided we call it with context otherwise just return the value. If the value is undefined return a default value. This method is private and should not be used directly in your code.
  • Various other code refactors.

v2.3.0

17 Dec 22:54
Compare
Choose a tag to compare

2.3.0 in overview:

This release of Marionette contains a significant amount of code optimizations and refactors. These changes will not be visible to you as end user however as they improve the underlying base of Marionette and speed up your app to improve consistency across the base classes. Such speed ups are most visible in the great work @megawac has been doing in both serializeData and triggerMethod

As always you can come chat with us in the main chatroom at https://gitter.im/marionettejs/backbone.marionette/

Work has been continuing on improving the documentation of Marionette, via an external custom JSDOC tool that @ChetHarrison has been spear heading via https://github.com/ChetHarrison/jsdoccer

If you have not already checked out Marionette Inspector, it is a great tool that Jason Laster has been working on to make debugging and working with marionette much easier. https://github.com/MarionetteLabs/marionette.inspector

Features
  • Marionette.isNodeAttached
    • Determines whether the passed-in node is a child of the document or not.
  • View "attach" / onAttach event
    • Triggered anytime that showing the view in a Region causes it to be attached to the document. Like other Marionette events, it also executes a callback method, onAttach, if you've specified one.
  • View "before:attach" / onBeforeAttach
    • This is just like the "attach" event described above, but it's triggered right before the view is attached to the document.
  • AppRouter Enhancements
    • triggerMethod, bindEntityEvents, and unbindEntityEvents are now available on AppRouter
  • Marionette.Application is now a subclass of Marionette.Object
  • Marionette.Behavior is now a subclass of Marionette.Object
  • Marionette.Region is now a subclass of Marionette.Object
  • CompositeView’s getChildViewContainer now receives childView as a second argument.
  • Region Triggers now pass the view, region instance, and trigger options to all handler methods
  • CollectionView emptyViewOption method now receives the model and index as options.
  • Allow non-DOM-backed regions with allowMissingEl
    • allowMissingEl option is respected by _ensureElement
    • _ensureElement returns a boolean, indicating whether or not element is available
    • Region#show early-terminates on missing element
  • Regions now ensure the view being shown is valid
    • Allowing you to handle the error of a region.show without the region killing the currentView and breaking without recourse.
    • Appending isDestroyed to a Backbone.View on region empty now adds the same safety for not re-showing a removed Backbone view.
  • Marionette is now aliased as Mn on the window.
  • Collection/Composite Views now support passing in 'sort' as both a class property and as an option.
  • RegionManager will now auto instantiate regions that are attached to the regionManager instance.
new Marionette.RegionManager({
  regions: {
    "aRegion": "#bar"
  }
});
Fixes
  • Region now uses $.el.html(‘’) instead of .innerHTML to clear contents.
    • We can not use .innerHTML due to the fact that IE will not let us clear the html of tables and selects. We also do not want to use the more declarative empty method that jquery exposes since .empty loops over all of the children DOM nodes and unsets the listeners on each node. While this seems like a desirable thing, it comes at quite a high performance cost. For that reason we are simply clearing the html contents of the node.
  • Destroying an old view kept alive by {preventDestroy: true} no longer empties its former region.
    • Now the destroy listener from previous view is removed on region show
  • AppRouter this.options now assigned prior to initialize being called.
Deprecation Warnings
  • Marionette.Application.addInitializer
  • Marionette.Application Channel
  • Marionette.Application Regions
  • Marionette.Callbacks
  • Marionette.Deferred
  • Marionette.Module.addInitializer
  • Marionette.Module.addFinalizer

v2.3.0-pre

10 Dec 23:42
Compare
Choose a tag to compare
v2.3.0-pre Pre-release
Pre-release

npm i [email protected]
bower i backbone.marionette#v2.3.0-pre

Marionette v2.3.0 in Overview:

This release of Marionette contains a significant amount of code optimizations and refactors. These changes will not be visible to you as end user however as they improve the underlying base of Marionette and speed up your app to improve consistency across the base classes. Such speed ups are most visible in the great work @megawac has been doing in both serializeData and triggerMethod

As always you can come chat with us in the main chatroom at https://gitter.im/marionettejs/backbone.marionette/

Work has been continuing on improving the documentation of Marionette, via an external custom JSDOC tool that @ChetHarrison has been spear heading via https://github.com/ChetHarrison/jsdoccer

If you have not already checked out Marionette Inspector, it is a great tool that @jasonLaster has been working on to make debugging and working with marionette much easier. https://github.com/MarionetteLabs/marionette.inspector

Features
  • Marionette.isNodeAttached
    • Determines whether the passed-in node is a child of the document or not.
  • View "attach" / onAttach event
  • Triggered anytime that showing the view in a Region causes it to be attached to the document. Like other Marionette events, it also executes a callback method, onAttach, if you've specified one.
  • View "before:attach" / onBeforeAttach
    • This is just like the attach event described above, but it's triggered right before the view is attached to the document.
  • AppRouter Enhancements
  • triggerMethod, bindEntityEvents, and unbindEntityEvents are now available on AppRouter
  • Marionette.Application is now a subclass of Marionette.Object
  • Marionette.Behavior is now a subclass of Marionette.Object
  • Marionette.Region is now a subclass of Marionette.Object
  • CompositeView’s getChildViewContainer now receives childView as a second argument.
  • Region Triggers now pass the view, region instance, and trigger options to all handler methods
  • CollectionView emptyViewOption method now receives the model, and index as options.
  • Allow non-DOM-backed regions with allowMissingEl
  • allowMissingEl option is respected by _ensureElement
  • _ensureElement returns boolean, indicating whether or not element is available
  • Region#show early-terminates on missing element
  • Regions now ensure the view being shown is valid
    • Allowing you to handle the error of a region.show without the region killing the currentView and breaking without recourse.
  • Appending isDestroyed to a Backbone.View on region empty now adds the same safety for not re-showing a removed backbone view.
  • Marionette is now aliased as Mn on the window.
  • Collection/Composite Views now support passing in 'sort' as both a class property and as an option.
  • RegionManager will now auto instantiate regions that are attached to the regionManager instance.
new Marionette.RegionManager({
  regions: {
    "aRegion": "#bar"
  }
});
Fixes
  • Region now uses $.el.html(‘’) instead of .innerHTML to clear contents.
    • We can not use .innerHTML due to the fact that IE will not let us clear the html of tables and selects. We also do not want to use the more declarative empty method that jquery exposes since .empty loops over all of the children DOM nodes and unsets the listeners on each node. While this seems like a desirable thing, it comes at quite a high perf cost. For that reason we are simply clearing the html contents of the node.
  • Destroying an old view kept alive by {preventDestroy: true} no longer empties it’s former region.
  • Now the destroy listener from previous view is removed on region show
  • AppRouter this.options now assigned prior to initialize being called.
Deprecation Warnings
  • Marionette.Application.addInitializer
  • Marionette.Application Channel
  • Marionette.Application Regions
  • Marionette.Callbacks
  • Marionette.Deferred
  • Marionette.Module.addInitializer
  • Marionette.Module.addFinalizer

v2.2.2

22 Oct 19:45
Compare
Choose a tag to compare

Fixes

  • Remove duplicate call to region.empty on view destroy.
  • Fix call time of swapOut.
  • Fix broken link in Marionette Error messages

v2.2.1

01 Oct 14:56
Compare
Choose a tag to compare
Fixes
  • Revert collection type checking for collectionView.

v2.2.0

09 Sep 22:09
Compare
Choose a tag to compare
  • Features
    • Normalize region selectors hash to allow a user to use the @ui. syntax
    • Marionette.triggerMethodOn
      • triggerMethodOn invokes triggerMethod on a specific context
    • Marionette.Error
      • captureStackTrace cleans up stack traces
    • add view _behaviors reference to associated behaviors
      • enabling you to easily test and spy on your behaviors
    • CollectionViews now receive events from emptyViews in the childEvents hash
    • Regions now receive swapOut and beforeSwapOut events.
    • Application has this.options
    • Application has initialize method
    • Behaviors no longer wrap view methods
  • Bug Fixes
    • LayoutView’s regions are scoped inside it’s el
    • Fix inconsistent Marionette.Object constructor implementation.
    • emptyView instances now proxy their events up to the collection / compositeView
    • collection / compositeView does not listen to collection add/remove/reset events until after render.
    • Marionette.normalizeUIKeys no longer mutates UI hash
  • Better Errors
    • View destroyed error now includes the view cid in the error message.
    • Throw an error when Marionette.bindEntityEvents is not an object or funcunction
    • Throw a descriptive error for collectionViews
      • If you do not pass a valid collectionView instance you are now given a logical error.
  • Documentation Improvements
    • New API docs are in progress
    • Examples have been cleaned up

v2.2.0-pre.2

03 Sep 17:39
Compare
Choose a tag to compare
v2.2.0-pre.2 Pre-release
Pre-release
v2.2.0-pre.2