The Backbone Framework

Overview

Marionette.js

The Backbone Framework

Coverage Status Gitter Chat

Cross Browser Testing

Marionette v5

Marionette is dropping its dependency on Backbone. That library is available here: https://github.com/marionettejs/marionette Until further notices changes to backbone.marionette will be limited to fixes. All new feature work will take place on marionette.

Marionette v4

Marionette 4 is now available! See our upgrade notes for the differences between v3 and v4. Please let us know if you encounter any issues so we can resolve them and help us continue work on Marionette!

About Marionette

Marionette is a composite application library for Backbone.js that aims to simplify the construction of large scale JavaScript applications. It is a collection of common design and implementation patterns found in applications.

Documentation

All of the documentation for Marionette can be found at

marionettejs.com/docs/current

App Architecture On Backbone's Building Blocks

Backbone provides a great set of building blocks for our JavaScript applications. It gives us the core constructs that are needed to build small apps, organize jQuery DOM events, or create single page apps that support mobile devices and large scale enterprise needs. But Backbone is not a complete framework. It's a set of building blocks. It leaves much of the application design, architecture and scalability to the developer, including memory management, view management, and more.

Marionette brings an application architecture to Backbone, along with built in view management and memory management. It's designed to be a lightweight and flexible library of tools that sits on top of Backbone, providing the framework for building a scalable application.

Like Backbone itself, you're not required to use all of Marionette just because you want to use some of it. You can pick and choose which features you want to use. This allows you to work with other Backbone frameworks and plugins easily. It also means that you are not required to engage in an all-or-nothing migration to begin using Marionette.

Chat with us

Find us on gitter.

We're happy to discuss design patterns and learn how you're using Marionette.

Key Benefits

  • Scalable: applications built in modules with event-driven architecture
  • Sensible defaults: Underscore templates are used for view rendering
  • Easily modifiable: works with the specific needs of your application
  • Reduce boilerplate: for all views, including specialized types
  • Create: application visuals at runtime with Region and View objects
  • Nested: Views and CollectionViews within visual regions
  • Built-in: memory management and zombie-killing for Views, CollectionViewsa and Regions
  • Event-driven architecture: utilizing Backbone.Radio
  • Flexible: "as-needed" architecture allowing you to pick and choose what you need
  • And much, much more

Source Code and Downloads

You can download the latest builds directly or visit the downloads section on the Marionette website for more downloading options.

MarionetteJS.com

NPM and Bower

Marionette is available via bower and npm:

# NPM
npm install backbone.marionette

# Bower
bower install marionette

Release Notes And Upgrade Guide

Changelog: For change logs and release notes, see the changelog file.

Upgrade Guide: Be sure to read the upgrade guide for information on upgrading to the latest version of Marionette.

Annotated Source Code

The source code for Marionette is heavily documented. You can read the annotations for all the details of how Marionette works and advice on which methods to override.

View the annotated source code

Compatibility and Requirements

MarionetteJS currently works with the following libraries:

Marionette has not been tested against any other versions of these libraries. You may or may not have success if you use a version other than what is listed here.

How to Contribute

If you would like to contribute to Marionette's source code, please read the guidelines for pull requests and contributions. Following these guidelines will help make your contributions easier to bring into the next release.

Github Issues

Report issues with Marionette, submit pull requests to fix problems, or to create summarized and documented feature requests (preferably with pull requests that implement the feature).

Comments
  • Create all of the jsdoc Files

    Create all of the jsdoc Files

    Classes

    • [x] application (@jasonLaster)
    • [ ] approuter {stubbed version}
    • [ ] behavior {has a template}
    • [ ] collectionview {has a template} (@joshbedo)
    • [ ] compositeview {has a template}
    • [x] controller (@benfenton)
    • [x] itemview {has a template} (@bendman)
    • [x] layoutview (@jdaudier)
    • [ ] module {stubbed version}
    • [ ] object (@fabiii21)
    • [x] region (@jasonLaster)
    • [x] regionManager (@jdaudier)
    • [ ] view {has a template} (@jdaudier)

    Functions

    • [x] helpers (@moimikey)
    • [ ] renderer
    • [x] bindEntityEvents (@moimikey)
    • [ ] domRefresh
    • [x] triggermethod (@moimikey)
    • [ ] templatecache
    • [ ] behaviors
    • [ ] callbacks

    Nice docs for inspiration: https://github.com/PharkMillups/beautiful-docs

    docs 
    opened by jasonLaster 93
  • Introduce view.getUI

    Introduce view.getUI

    getUI is a stable interface to the view ui hash

    An error is thrown when attempting to access undefined ui elements. An error is thrown when attempting to access ui elements before the view has been rendered. The jQuery collection matching the ui element selector is returned when the view is live. An empty jQuery collection is returned after the view has been destroyed.

    Fixes #2102

    minor 
    opened by duncanbeevers 67
  • Investigate first class support for virtual DOM

    Investigate first class support for virtual DOM

    I think this is very possible to support within marionette. https://github.com/Matt-Esch/virtual-dom

    Avenues of Investigate

    • VDOM templating
    • VDOM view render override
    • VDOM nesting (think regions, layoutview's)
    discussion 
    opened by samccone 59
  • Marionette as a framework

    Marionette as a framework

    Intentionally, Marionette v1 has been quite barebones much like Backbone. It is a library and not a framework. Alongside the v2.0.0 core, I was hoping that we might look at building a framework on top of Marionette.

    We could re-use existing Backbone plugins like Backbone.Mutators and other libraries like RivetsJS. Then we'd write an integration layer on top of the core and maintain an official yeoman generator to tie everything together.

    The generator would optionally support different technologies like RequireJS, CoffeeScript and various template languages like Underscore, Handlebars and Dust.

    We can use best practices from books like Marionette Gentle Introduction, @derickbailey's + community recommendations and learnings from other frameworks like AngularJS to prescribe a recommended way to use Marionette.

    The result would be Marionette Framework, but underneath all this is the v2 core which can still be used as a standalone library like v1 is currently; all it would depend on is Backbone, Underscore and jQuery.

    Obviously the above plugins, libraries, languages, etc I've mentioned above are open for discussion, I've just plucked some popular examples.

    discussion 
    opened by cobbweb 53
  • Use template as el

    Use template as el

    One thing I find increasingly annoying about Backbone is it's penchant for wrapping everything in a div. While using LayoutManager for a short time, I liked how a developer could set the el of a View to false, so as to tell LayoutManager to use the provided template as the Views el.

    IMO, this should be a part of Marionette also. There is already the option to pass false to template to disable it, so would follow suit in that regard.

    It would be optional and defaulted to the current behaviour to not break any backwards compatibility.

    From what I can see of the source code, it's not easily something that can be monkey patched in an extension of View either, although I am really going to try.

    Any thoughts?

    discussion 
    opened by designermonkey 51
  • Rename `templateHelpers`

    Rename `templateHelpers`

    Marionette's views provide a fancy method called templateHelpers. This method provides a hook for you to add extra data to your template before it is rendered, which is super useful. But the name is terrible!

    Firstly, there's no notion of helpers in Underscore templates, only data. In this case, templateHelpers are adding extra data to your template. In Handlebars lingo, this would be equivalent to adding to the context that you pass to your template. In neither situation, though, is this method dealing with anything called a 'helper.'

    In fact, in Underscore there's no notion of helpers at all, so it's simply an invented term. And with Handlebars the situation is far worse – the method conflicts with Handlebars helpers, which are an entirely different concept altogether!

    In my opinion, this method's name should reflect the fact that it is adding data, or context, to a template, and should not use the word 'helpers' at all.

    Just to throw a possibility out there, templateData is one option. I can't say I'm super thrilled about this option, but I do think that it's better than templateHelpers.

    major 
    opened by jamesplease 50
  • Build jsdoc static analysis tool

    Build jsdoc static analysis tool

    This issue was started in #1756 by @ChetHarrison

    We should build a tool that helps automate some of the jsdoc work involved with documentation:

    1. generate yaml for new classes / utility functions
    2. lint existing api for missing functions, parameters, properties, events
    3. add function bodies to api

    The work is being done in this repo: https://github.com/ChetHarrison/jsdoccer

    docs minor 
    opened by jasonLaster 47
  • Extended `module` functionality

    Extended `module` functionality

    Fixes the botched PR #844, which in turn adds the functionality described in #837.

    -Modules now have the functionality of Marionette.extend. -Upon creation, Modules will fire the initialize function, if it exists -You may also pass a custom class to be instantiated as the Module when adding a new Module to the Application.

    It breaks backwards compatibility in its current implementation, and has questionable unit tests.

    opened by jamesplease 47
  • Abstract DOM Mixin

    Abstract DOM Mixin

    The backbone way of using instanceof to check if the el is already a instance of $ is 10x faster than re-wrapping the jquery. https://jsperf.com/re-jquery-vs-instanceof/1

    At first I intended to make this public, but it conflicts with the region function by the same name. Rather than try and sort through that conflict I though the simplest approach was to get this in, and we can hash out naming in subsequent PRs.

    enhancement 
    opened by paulfalgout 44
  • Removing Modules in favor of subapps

    Removing Modules in favor of subapps

    As of v2.2.2, Marionette has two separate classes for managing the lifecycle of the application and it's components: Marionette.Application and Marionette.Module. This proposal aims to offer a path for replacing Modules with the Application and subapps.

    Relevant issues

    • #1321 - Remove modules / Support multiple apps
    • #1796 - v3.0.0 plan

    Current State of Application and Module

    Marionette.Application is used to start the app and its submodules. It additionally provides a global hook to access modules and the global event channel.

    Marionette.Module provides a means of starting a portion of the application, including submodules. Modules have the option of immediately starting with their parent, and they can also be stopped (something that can't be done to the application). Modules can be created by extending the Module class, or by using the module method on the application, which provides access to the App, for global module access, and the rest of Marionette's dependencies.

    Much of the existing capabilities of Marionette.Application and Marionette.Module are of dubious value in the days of AMD/CommonJS/ES6. Providing global access to the world is very hard to maintain and scale, often requiring manual management of file load order and causing problems when trying to find all the places a particular component is used. Attaching everything to a namespace under a single variable is no longer considered good practice, and it should not be a focus of the framework. Additionally, the fact that there are so many ways of creating modules is confusing.

    Using the Application to manage the full app lifecycle

    Historically, it was only possible to have one Application due to the fact that all instances shared the global channel. Now that the channel is configurable on a per-application basis (#1528), it is trivial to support multiple Applications on the same page. This invites scrutiny of the divide between the Application and Module classes in the area of app lifecycle management.

    There is currently discussion to remove RegionManager capabilities and event channel properties from the Application in v3. That would leave the Application with only three behaviors:

    1. Starting the application (and any attached submodules)
    2. Creating modules with Application#module
    3. Providing a global hook to for attaching things to

    I would argue that only the first behavior is useful, and that the third one is downright harmful.

    Meanwhile, module behavior will remain largely unmodified and support the following:

    1. Starting themselves and any submodules
    2. Starting with the parent module or application
    3. Stopping themselves and their submodules
    4. Attach themselves as a property of the parent module

    All of which but the last are useful and good practice. Interestingly enough Modules will do everything useful that Applications do, but in a more straight-forward manner (the code for making Modules start with the Application lives in the Module).

    At this point, it no longer makes sense to have two classes managing application lifecycle. I am proposing that we only have one class to manage application lifecycle, the Application, and that Modules should be replaced with subapps attached to an instance of Application. All subapps would also be instances of Application.

    Subapp API

    The usage of the Application and subapps would look as follows

    var JellyApp = Marionette.Application.extend({});
    var PeanutApp = Marionette.Application.extend({});
    var ShellApp = Marionette.Application.extend({});
    
    var MyApp = Marionette.Application.extend({
        // can also be a function
        subapps: {
          jelly: JellyApp,
          peanut: {
            applicationClass: PeanutApp,
            butter: true,
            startWithParent: false,
            subapps: {
              shell: new ShellApp()
            }
          }
        },
    
        // can also be a function
        subappOptions: {
          edible: true
        }
    });
    
    var app = new MyApp();
    var jellyApp = app.getSubapp('jelly');
    var peanutApp = app.getSubapp('peanut');
    var shellApp = peanutApp.getSubapp('shell');
    
    jellyApp.edible; // true
    peanutApp.edible; //true
    peanutApp.butter; // true
    
    app.start();
    jellyApp.isRunning(); // true
    peanutApp.isRunning(); // false
    legumeApp.isRunning(); // false
    
    peanutApp.start();
    legumeApp.isRunning() // true
    
    app.stop();
    jellyApp.isRunning(); // false
    peanutApp.isRunning(); // false
    legumeApp.isRunning(); // false
    

    Version Plans

    • v2.3
      • Deprecate the behavior whereby an Application extends itself with all of it's options at initialize (separate issue coming).
      • Deprecate initializers on Application and Module, assumed from deprecation of Marionette.Callbacks in #1965 (separate issue coming).
    • v3.0.0
      • Remove this awful line of code. It makes life difficult when adhering to semver (see the confusion caused at #1536), and it really isn't an awesome feature.
      • Remove initializers from Application and Module
    • v3.x
      • Add support for subapps in Application
      • Add stop to Application
      • Module will extend application, and its only additional behavior will include whatever is necessary to support Application#module
      • Deprecate Module and all supporting methods, e.g.Application#module
    • v4
      • Remove Module and all supporting methods
      • At this point, I certainly hope no one will care enough about the discussed Marionette.Namespaces behavior to actually consider supporting it (but it is a possibility).

    Not removing modules immediately in v3 might place a bit of a burden on the code, but I think it is very important from the standpoint of not isolating/splitting the Marionette community. Many Marionette tutorials emphasize modules, and large swaths of production code almost certainly depend on them.

    discussion enhancement major 
    opened by cmaher 44
  • Remove modules / Support multiple apps

    Remove modules / Support multiple apps

    Much has been said about these crazy things, the code base will cheer when they are dead.

    Multiple apps should solve peoples needs.

    Lets put this as critical for the path to v3.

    major 
    opened by samccone 43
  • Bump json5 from 2.1.0 to 2.2.3

    Bump json5 from 2.1.0 to 2.2.3

    Bumps json5 from 2.1.0 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1

    • New: package.json and package.json5 include a module property so bundlers like webpack, rollup and parcel can take advantage of the ES Module build. (#208)
    • Fix: stringify outputs \0 as \\x00 when followed by a digit. (#210)
    • Fix: Spelling mistakes have been fixed. (#196)
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2 [code, diff]

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1 [code, [diff][d2.1.1]]

    ... (truncated)

    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • getOption falsy key behavior differs from native js object

    getOption falsy key behavior differs from native js object

    Description

    the getOption method have falsy check for keyName and this may lead for some unexpected results. link to source: https://github.com/marionettejs/backbone.marionette/blob/0b383151057fb2728f9db98afbc26a614cbc8eb7/src/common/get-option.js#L7

    example:

    const falsyKey = 0;
    const view = new Mn.View({ [falsyKey]: 'some value' });
    console.log(view.getOption(falsyKey)) // undefined;
    console.log(view.options[falsyKey]) // somev value;
    

    the codepen: https://codepen.io/dimatabu/pen/vYWwyMR?editors=0010

    solution:

    const getOption = function(optionName) {
    -  if (!optionName) { return; }
    + if (!arguments.length) { return; }
    };
    
    opened by taburetkin 0
  • CollectionView Comparator documentation is confusing when using functions

    CollectionView Comparator documentation is confusing when using functions

    Description

    I was trying to sort my CollectionView with different types of comparators, and the behavior was kind of confusing and inconsistent to the documentation.

    Specifically I was looking at this example from the docs near getComparator. https://marionettejs.com/docs/v4.1.2/marionette.collectionview.html#sorting-the-children

    import { CollectionView } from 'backbone.marionette';
    
    const MyCollectionView = CollectionView.extend({
      sortAsc(model) {
        return -model.get('order');
      },
      sortDesc(model) {
        return model.get('order');
      },
      getComparator() {
        // The collectionView's model
        if (this.model.get('sorted') === 'ASC') {
          return this.sortAsc;
        }
    
        return this.sortDesc;
      }
    });
    

    Expected behavior

    According to the documentation, I would expect the CollectionView to sort the models in it's collection according to the 'order' property. If I have a collection with models with an age attribute, I would expect the following call to sort them oldest to youngest.

        sortAgeDesc() {
      	this.setComparator((model) => {
        	return -model.get('age');
        })
      }
    

    Actual behavior

    The above code fails with Uncaught TypeError: model.get is not a function

    This is because the CollectionView actually passes in instances of the child views, and not the models. So something like

      sortAgeDescWithView() {
        this.setComparator((childView) => {
        	return -childView.model.get('age');
        })
      }
    

    actually works how I would expect.

    I created a JSFiddle here https://jsfiddle.net/a2xjcvp3/1/

    I'm not sure if the issue is just confusing documentation. The example in the docs makes it seem like any functions you set as the comparator for a CollectionView will be given model instances. If the code is working as intended, than only the documentation needs to be fixed.

    As an aside the setComparator('age') works as expected.

    Environment

    1. Marionette version: 4.1.3
    2. Backbone version: 1.4.0
    3. Additional build tools, etc:
    docs help wanted 
    opened by burnhamup 1
  • v5 Migration

    v5 Migration

    DO NOT MERGE

    This PR serves as a migration guide for moving to https://github.com/marionettejs/marionette with the exception of Radio integration.

    But it should make relevent breaking changes more obvious

    opened by paulfalgout 0
  • Prevent double renders on internal renders

    Prevent double renders on internal renders

    A collectionview renders on addChildView and a view renders with getRegion in both of these cases we should prevent the render if these items are occurring inside of a before:render event by keeping track of a private _isRendering flag.

    opened by paulfalgout 0
Releases(v4.1.3)
  • v4.1.3(Nov 12, 2020)

  • v4.1.2(Apr 21, 2019)

  • v4.1.1(Apr 21, 2019)

  • v4.1.0(Apr 20, 2019)

    v4.1.0 view commit logs

    Features

    • CollectionView#addChildView now accepts a preventRender option.
    • Marionette now uses el.ownerDocument.documentElement; by default instead of document.documentElement for querying, customizable via DomApi.getDocumentEl.
    • The UMD build now reinstates noConflict for using multiple versions on the global scope.

    Fixes

    • Fixed a case where a child view could potentially get multiple destroy events.
    • Pre-rendered views from outside of a region will now correctly empty an current view in a region if shown.
    • CollectionView's emptyView will now respect the childViewContainer for attachment.

    Misc

    • Updated backbone dependency to allow for 1.4 without a warning.
    • Tooling and testing was updated and improved removing gulp.
    • Region._setElement was added for internal use, but may be made public in a future release.
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Aug 6, 2018)

    v4.0.0 view commit logs

    Breaking Changes

    The breaking changes are documented in the upgrade guide.

    Features

    • CollectionView can now render a template in the same fashion of the removed CompositeView.
    • View#triggers now passes the originating DOM event object as the final argument of the triggered Mn event.
    • View classes now have the bindRequests and unbindRequests API.
    • The ES6 package was exposed in package.json on jsnext:main
    • The underscore dependency was updated to include 1.8.3 - 1.9.x.

    Documentation

    The documentation structure was overhauled to provide a flow to reading through the docs.

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-beta.1(Jul 23, 2018)

    For v4 documentation: https://github.com/marionettejs/backbone.marionette/blob/v4-beta/docs/installation.md

    For the v3-v4 upgrade guide: https://github.com/marionettejs/backbone.marionette/blob/v4-beta/docs/upgrade-v3-v4.md

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha.1(Jun 8, 2018)

  • v3.5.1(Nov 9, 2017)

  • v3.5.0(Nov 5, 2017)

    Features

    • NextCollectionView's filter event now returns the attaching and detached views.
    • unbindEvents and unbindRequests can now be called without handlers to remove all handlers from an entity.

    Fixes

    • If an event handler on a behavior was undefined it would remove any prior defined handler.
    • When a behavior is destroyed it will now undelegate the behavior events and triggers.
    • When a view was added a performance check on NextCollectionView would sometimes prevent existing views from sorting correctly.
    • NextCollectionView viewFilter will now be called with the same arguments with underscore or lodash.

    Deprecations

    • Multiple handlers for a single event. If needed, use a single handler to call multiple methods.
    Source code(tar.gz)
    Source code(zip)
  • v3.4.4(Oct 3, 2017)

    Fixes

    • Prevent exception when a view is instantiated with a non-existing selector el.
    • When a collection defines the NextCollectionView sort order, the add at end performance improvement was removed to prevent edge case errors.
    • NextCollectionView no longer sorts according to the collection if sortWithCollection is set to false.
    • When views added to NextCollectionView from a collection don't have a matching model, removing the model no longer throws an error.

    Misc

    • NextCollectionView now uses backbone update flags instead of calculating changes for sorting
    Source code(tar.gz)
    Source code(zip)
  • v3.4.3(Sep 6, 2017)

    Fixes

    • NextCollectionView collection single model remove no longer incorrectly removes all children
    • EmptyView will correctly display if a NextCollectionView is rendered in initialize
    Source code(tar.gz)
    Source code(zip)
  • v3.4.2(Aug 20, 2017)

    Fixes

    • Regions will now ensure there is only one node in its $el
    • Regions will not query outside of the parent view if the selector is not found in its context
    • The setDomApi and setRenderer class methods now correctly return the prototype when called
    Source code(tar.gz)
    Source code(zip)
  • v3.4.1(Aug 9, 2017)

    Fixes

    • Options passed to a behavior are now correctly passed to the behavior
    • The ES6 module is no longer exposed in package.json as this was breaking for some builds
    • The detachContents will now correctly detach when using monitorViewEvents: false on a NextCollectionView
    Source code(tar.gz)
    Source code(zip)
  • v3.4.0(Aug 5, 2017)

    Features

    • A new build of Marionette supporting ES6 modules was added
    • Added DOM API to encapsulate DOM interactions in the views and region
    • monitorViewEvents was added as an option to all Views to disable DOM lifecycle events
    • Added swapChildViews to NextCollectionView
    • Added viewComparator: false option to NextCollectionView for disabling the default sort

    Experimental API Breaking Changes

    • DOM Mixin was removed (replaced with DOM API)
    • NextCollectionView attachHtml no longer receives the view as the first argument

    Fixes

    • A region's currentView will now be set during that view's initial dom:refresh event
    • A view will now be considered rendered if its el has contents and not only if it has an el

    Misc

    • While Backbone.Radio is still a dependency, it will no longer cause Marionette to error if nonexistent
    • Various performance improvements
    Source code(tar.gz)
    Source code(zip)
  • v3.3.1(May 3, 2017)

  • v3.3.0(May 1, 2017)

    v3.3.0 view commit logs

    Features

    • Added removeView and isSwapping to Region to better support animation
    • NextCollectionView added as a potential replacement for CollectionView in v4
    • Added view initialize event to behaviors
    • getRegion will now render the region's view if it is currently not rendered
    • If a behavior or a region is destroyed it will now be removed from the view
    • Added onDomRemove event for better clean up of things added in onDomRefresh
    • childViewEventPrefix feature flag to allow for false by default
    • Support custom renderers per view prototype

    Fixes

    • Trigger detach events when restoring el

    Deprecations

    • template: false deprecated in favor of template: _.noop
    • Behavior defaults deprecated in favor of setting options on the Behavior definition
    • Marionette.Renderer in favor of new custom view renderer.

    Misc

    • Update babel and build tools
    • Fix tests runner for IE11
    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Feb 21, 2017)

    Features

    • Separate Mn DOM interaction into a mixin for DOM plugin ease
    • View.childViewEvents should support trigger
    • Allow showing a template or static string in a region
    • Feature/trigger method event args

    Fixes

    • Custom CollectionView.viewComparator no longer sorts collection.models
    • CollectionView re-indexes correctly when removing views.
    • CollectionView.filter can filter by View child index
    • Region will no longer detach pre-existing HTML when View's el is already in the region
    • Fix Region clean up when View is destroyed
    • Destroy CollectionView.children by View and not Model

    Misc

    • Remove MarionetteError "ViewDestroyError" from View's
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Oct 13, 2016)

    v3.1.0 view commit logs

    General

    • Performance optimizations for triggerMethod, mergeOptions and other internal event handlers
    • Significant render and removal optimizations for CollectionView utilizing Backbone's update event

    Features

    • Region.detachView and View.detachChildView were added for removing a view from a region without destroying it. This is preferred to the now deprecated preventDestroy region show/empty option
    • childViewEventPrefix: false will disable auto-proxying of child events to the parent view
    • Application will now accept a region definition object literal as an instantiation option
    • Regions are now destroyed when removed from a View

    Fixes

    • Fixed an issue with Lodash 4 compatibility related to behavior events

    Deprecations

    • Region empty's preventDestroy option was deprecated in favor of detachView
    • A region definition object literal's selector key was deprecated due to redundacy in favor of the existing key el

    Misc

    • Many documentation fixes for v3
    • Removed shouldReplace logic from attachHtml so overriding no longer breaks replaceElement functionality
    • Exposed View.normalizeUIString for external libraries
    • Improvements were made for Views initialized with existing DOM elements
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Aug 23, 2016)

    🎉

    v3.0.0

    Version 3.0.0 of Marionette has arrived and contains many improvements over version 2.x but also some API Changes. Below is a list of the changes made to each component.

    To help the community transition over we have released a v2 patch tool to assist the upgrade. Marionette Patch Tool

    View

    • LayoutView + ItemView merge and rename to View.
    • Marionette.View -> ViewMixin
    • Added LayoutView shortcut methods such as showChildView.
    • isDestroyed and isRendered made private with a public accessor method.
    • Now set _isDestroyed to false by default
    • Call Backbone.View with result of options (163188eeb8)
    • CompositeView's renderChildren is now public.
    • Renamed childEvents to childViewEvents.
    • Removed passing view options as a function
    • Renamed templateHelpers to templateContext
    • Made sure before:render is triggered before emptying regions.
    • Regions are not attached directly to the layout. Use getRegion to access the region or showChildView to show a View within it.
    • Allowed CompositeView to attach to existing HTML with template:false
    • Added hasRegion for layouts
    • Enabled passing preventDestroy to region.empty.
    • View now removes its element before destroying child regions. There was an option to turn it on, but now it’s available by default. This helps remove all of the synchronous paints going up the tree.

    CollectionView

    • The childView attribute now accepts a function
    • getChildView was removed
    • emptyView now accepts a function as an arg.
    • Proxied events do not append “this” as an argument
    • Removed the apply:filter event from CollectionView.
    • removeChildView now returns the removed view.

    Regions

    • Fixed inconsistency in addRegion, it now behaves like addRegions and adds the region to internal this.regions.
    • View can replace regions's el.
    • Replaced region manager with region-mixin.
    • Removed static buildRegion
    • Removed swap events.

    Application

    • Introduced region to Application (rootRegion)
    • Removed regions
    • Removed Initializers and Finalizers Callbacks
    • Removed Application vent, commands, requests

    Object

    • Added support for Object.isDestroyed

    ES6

    • Added Rest & Spread ES6 syntax
    • using ES6 Modules
    • Replaced var and let with const.

    General Enhancements

    • Added DEV_MODE
    • Changed _.rest multiple arg usage to drop for lodash 3 support.
    • Behavior, View Mixins.
    • Added cid field to object, application, behavior, and region
    • Added TemplateCache options.
    • Allow a user to define trigger handlers in options.
    • Increased Lodash compatibility, (now supports upto lodash 4)
    • Added first class support for Backbone.Radio in Mn.Object
    • Updated BB and _ deps to modern versions
    • Updated Radio from 0.9 to 2.0
    • delegateEntityEvents. Delegate Events used to set delegate entity events, it was extracted because now backbone calls delegateEvent everytime the element is set.
    • Added Backbone.Babysitter to Mn and removed the Babysitter dependency.

    Deprecations

    • Deprecated CompositeView
    • Deprecated Behavior Lookups.

    Removed

    • Removed Marionette.Module - there’s a shim that you can pull in to get Module and Deferred
    • Removed Marionette.Deferred
    • Removed component.json
    • Removed Controller
    • Removed Callbacks
    • Removed Wreqr (replaced with Radio)
    • Removed actAsCollection
    • Removed _getValue.

    API Renames

    • Renamed render:collection => render:children
    • Renamed bindEntityEvents => bindEvents.

    v3.0.0-pre5

    Documentation

    • Improved installation docs.
    • Updated CollectionView docs to reflect API changes.
    • Improved Behavior docs.
    • Improved functions docs.
    • Improved update guide.
    • Added "basics" docs.

    API Changes

    • emptyView now accepts a function as an arg.
    • Removed the apply:filter event from CollectionView.
    • removeChildView now returns the removed view.
    • bindEntityEvents renamed bindEvents.
    • Deprecated Behavior Lookups.
    • Added Backbone.Babysitter to Mn and removed the Babysitter dependency.

    Bug fixes

    • CollectionView now only triggers destroy:children if it has been rendered.
    • Parent views will now successfully listen for destroy in childViewEvents.

    Misc

    • Replaced var and let with const.
    • Added consistent function declarations and added rules to eslint.
    • Tweaked peerDependencies to only allow patch versions.
    • Directory structure changes and file naming consistency.
    • Improved test coverage.
    • Removed bundled build.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-pre.5(Aug 4, 2016)

    v3.0.0-pre5

    Documentation

    • Improved installation docs.
    • Updated CollectionView docs to reflect API changes.
    • Improved Behavior docs.
    • Improved functions docs.
    • Improved update guide.
    • Added "basics" docs.

    API Changes

    • emptyView now accepts a function as an arg.
    • Removed the apply:filter event from CollectionView.
    • removeChildView now returns the removed view.
    • bindEntityEvents renamed bindEvents.
    • Deprecated Behavior Lookups.
    • Added Backbone.Babysitter to Mn and removed the Babysitter dependency.

    Bug fixes

    • CollectionView now only triggers destroy:children if it has been rendered.
    • Parent views will now successfully listen for destroy in childViewEvents.

    Misc

    • Replaced var and let with const.
    • Added consistent function declarations and added rules to eslint.
    • Tweaked peerDependencies to only allow patch versions.
    • Directory structure changes and file naming consistency.
    • Improved test coverage.
    • Removed bundled build.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-pre.4(Jun 1, 2016)

    v3.0.0-pre4

    Documentation

    • Improved View documentation.
    • Added Backbone.Radio integration documentation.
    • Fixed broken links in CollectionView documentation.
    • Removed Marionette.Module documentation.
    • Add installation documentation.
    • Removed outdated API documentation.
    • Added Upgrade Guide.

    API Changes

    • return this from all functions that do not return anything, useful for chaining.
    • Removed getValue and internal getOption.

    Bug fixes

    • CollectionView#reorder will no longer remove an already displayed emptyView.
    • Calling Backbone.View constructor with arguments consistently across all views.
    • Monitor for child already attached.
    • When a view is attached to an existing element, isRendered() should reflect true.
    • Region empty edge-case fix that prevents view destroy handlers calling empty.
    • Region now detaches previous html if there is no view.

    Misc

    • Build browser tests with rollup.
    • Fix bundled build.
    • Linter fixes.

    Also, please help us finish v3!

    Source code(tar.gz)
    Source code(zip)
  • v2.4.7(May 31, 2016)

  • v2.4.6(May 25, 2016)

  • v3.0.0-pre.3(Apr 4, 2016)

    v3.0.0-pre3

    Dependency Updates

    • Backbone and Underscore moved to peerDependencies to solve dependency conflicts for browserify and webpack users.
    • Added support for Lodash 4.

    Documentation

    • Application documentation updates.

    API Changes

    • Removed unused collection parameter from CollectionView.isEmpty.

    Bug fixes

    • replaceElement and allowMissingEl are now able to be overridden in Region.show.

    Misc

    • Gulp test-browser task fixed.
    • es-lint fixes.
    • Added more es6 syntax.
    • Fixed the UMD exported build.

    Also, please help us finish v3!

    Source code(tar.gz)
    Source code(zip)
  • v2.4.5(Mar 16, 2016)

    v2.4.5 view commit logs

    Fixes

    • Marionette.View#ui will now bind events when names are hyphenated.
    • Nonexistent event handlers now fail silently.

    Misc

    • Updated Backbone dependency to 1.3.2.
    • devDependencies updated.
    • Updated uglify to fix deprecated sourcemap pragma //@ replaced with //#.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-pre.2(Mar 8, 2016)

  • v3.0.0-pre.1(Mar 8, 2016)

  • v2.4.4(Nov 22, 2015)

    v2.4.4 view commit logs

    Fixes

    • Region#empty will return the region instance whether or not it has a current view.
    • CollectionView#reorder will now correctly respect any set filter.
    • Fixed childEvents failing to trigger during showing a view in a region.
    • Stop deleting the currentView._parent if showing the same view in a region.

    Misc

    • LayoutView#showChildView new options argument passed to underlying Region#show to enable full show functionality.
    • Added support for passing down arguments to Object#destroy.
    Source code(tar.gz)
    Source code(zip)
  • v2.4.3(Sep 10, 2015)

    v2.4.3 view commit logs

    Fixes

    • TemplateCache#loadTemplate accepts empty script-tag templates.
    • Parent LayoutView's childEvents continue working with views attached manually using Region#attachView.
    • When an array of items (length > 1) are added to a collection backing a CollectionView using the at option, the child views are appended to the DOM in the proper order.
    • When models are added to a collection backing a CollectionView with the at option, the child views are rendered in the proper order even when the CollectionView has a filter.
    • CollectionView#isEmpty respects a false return value even when there are no child views.
    • Region#empty reliably destroys views when called with options.
    • CollectionView child views can, in turn, render children within onBeforeShow as documented.
    • CollectionView childView and emptyView can be pure Backbone.View classes.

    Docs

    • Better documentation around view childEvents that reinforces the distinction between child view triggers and events.
    • Guidance on achieving full event lifecycle while using Backbone.View as the child view within CollectionViews or LayoutViews/Regions.

    Misc

    • LayoutView#showChildView new options argument passed to underlying Region#show to enable full show functionality.
    • Allow Application to be initialized with multiple arguments for consistency with earlier releases.
    • More comprehensive support for Backbone child views, including a more rigorous test suite and support for render, destroy, and dom:refresh lifecycle events when shown by CollectionViews or LayoutViews/Regions.
    • Bumped Backbone dependency to 1.2.3
    Source code(tar.gz)
    Source code(zip)
  • v2.4.2(Jun 17, 2015)

    v2.4.2 view commit logs

    Fixes

    • Fixed a bug where reorderOnSort would not reorder back to the original order.
    • Stop deleting $childViewContainer so that it can be accessed in behaviors.
    • Ensure before:show and show events are triggered on CollectionView children.
    • Ensure onBeforeAttach and onAttach are called for CollectionView children.
    • Allow for disabling of triggerBeforeAttach and triggerAttach via show() options.
    • Added the documented buffer argument to attachBuffer and changed implementation so this was used rather than _createBuffer.
    • Fixed potential memory leak when destroying children on CollectionView by making the checkEmpty call optional.

    Docs

    • Improve documentation around the requirement for an initial render to bind events in CollectionView.
    • Add documentation around UI interpolation usage.
    • Add documentation to warn about the full re-render of a CollectionView or CompositeView if reorderOnSort is not set.

    Misc

    • Bumped Underscore and Backbone dependencies to 1.8.3 and 1.2.1 respectively.
    Source code(tar.gz)
    Source code(zip)
Strengthening your Backbone

NOTICE: This repository has been archived and is not supported. NOTICE: SUPPORT FOR THIS PROJECT HAS ENDED This projected was owned and maintained by

Walmart Labs 1.3k Nov 15, 2022
HTML5 application architecture using Backbone.js

An Application Architecture Using Backbone.js Introduction Chaplin is an architecture for JavaScript applications using the Backbone.js library. All i

Chaplin – JavaScript Application Architecture Using Backbone.js 2.9k Jan 4, 2023
The worlds smallest fully-responsive css framework

FLUIDITY A fully responsive css framework that is impossibly small HTML is almost 100% responsive out of the box. This stylesheet patches the remainin

murmurs 1.1k Sep 24, 2022
An HTML5/CSS3 framework used at SAPO for fast and efficient website design and prototyping

Welcome to Ink Ink is an interface kit for quick development of web interfaces, simple to use and expand on. It uses a combination of HTML, CSS and Ja

SAPO 1.9k Dec 15, 2022
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.

?? Welcome to DataFormsJS! Thanks for visiting! ?? ?? ?? ?? ?? ?? 中文 (简体) 欢迎来到 DataFormsJS Español Bienvenido a DataFormsJS Português (do Brasil) Bem

DataFormsJS 156 Dec 8, 2022
HTML Framework that allows you not to write JavaScript code.

EHTML (or Extended HTML) can be described as a set of custom elements that you can put on HTML page for different purposes and use cases. The main ide

Guseyn Ismayylov 171 Dec 29, 2022
One framework. Mobile & desktop.

Angular - One framework. Mobile & desktop. Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScr

Angular 85.7k Jan 4, 2023
Ember.js - A JavaScript framework for creating ambitious web applications

Ember.js is a JavaScript framework that greatly reduces the time, effort and resources needed to build any web application. It is focused on making yo

Ember.js 22.4k Jan 8, 2023
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Supporting Vue.js Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome ba

vuejs 201.7k Jan 8, 2023
The tiny framework for building hypertext applications.

Hyperapp The tiny framework for building hypertext applications. Do more with less—We have minimized the concepts you need to learn to get stuff done.

Jorge Bucaran 18.9k Jan 4, 2023
A framework for building native apps with React.

React Native Learn once, write anywhere: Build mobile apps with React. Getting Started · Learn the Basics · Showcase · Contribute · Community · Suppor

Facebook 106.8k Jan 3, 2023
MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers

Derby The Derby MVC framework makes it easy to write realtime, collaborative applications that run in both Node.js and browsers. Derby includes a powe

DerbyJS 4.7k Dec 31, 2022
A JavaScript Framework for Building Brilliant Applications

mithril.js What is Mithril? Installation Documentation Getting Help Contributing What is Mithril? A modern client-side JavaScript framework for buildi

null 13.5k Dec 26, 2022
Better MV-ish Framework

❗ I started working on this project in 2012. React didn't exist, Angular didn't have a stable 1.0 release, Internet Explorer 7, 8, 9 was used by 35% o

Antonio Stoilkov 2.8k Jan 1, 2023
A framework for real-time applications and REST APIs with JavaScript and TypeScript

A framework for real-time applications and REST APIs with JavaScript and TypeScript Feathers is a lightweight web-framework for creating real-time app

Feathers 14.2k Dec 28, 2022
A rugged, minimal framework for composing JavaScript behavior in your markup.

Alpine.js Alpine.js offers you the reactive and declarative nature of big frameworks like Vue or React at a much lower cost. You get to keep your DOM,

Alpine.js 22.5k Dec 30, 2022
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Bootstrap 161.1k Jan 4, 2023
Semantic is a UI component framework based around useful principles from natural language.

Semantic UI Semantic is a UI framework designed for theming. Key Features 50+ UI elements 3000 + CSS variables 3 Levels of variable inheritance (simil

Semantic Org 50.3k Jan 3, 2023