Skip to content

Conversation

@paulfalgout
Copy link
Member

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

return onceCallback;
}

// a custom event channel. You may bind a callback to an event with `on` or
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below is a refactored version of Backbone's Events

// Marionette.extend

var extend = Backbone.Model.extend;
function extend (protoProps, staticProps) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from Backbone


// Event Delegator

function setEventDelegator(mixin) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event delegator handles DOM event delegation and was copied from Backbone.View

return this;
}
var DomApi = {
// Returns a new HTML DOM node of tagName
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOM Api was updated to remove jquery by default as $el is no longer cached on the view

preinitialize: function preinitialize() {},
Dom: DomApi,
// Create an element from the `id`, `className` and `tagName` properties.
_getEl: function _getEl() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied/modified from Backbone.View


_.extend(ViewMixin, BehaviorsMixin, CommonMixin, DelegateEntityEventsMixin, TemplateRenderMixin, TriggersMixin, UIMixin);

function isView(view) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New way of determining what a view is. Rather than depending on prototypal inheritance, anything that supports the API used by Marionette will be attempted.

if (this.$el.length > 1) {
this.$el = this.Dom.getEl(this.el);
}
this.el = this.getEl(el);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$el is no longer cached on Regions

this._setOptions(options, ClassOptions$2);

this._initBehaviors();
this.preinitialize.apply(this, arguments);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bb's preinitialize added to views

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants