(⊃。•́‿•̀。)⊃━☆゚.*・。゚ The Backbone Framework: http://marionettejs.com
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
Bump jsdom from 14.0.0 to 16.5.… (compare)
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
export function renderView(view) {
if (view._isRendered) {
return;
}
if (!view.supportsRenderLifecycle) {
view.triggerMethod('before:render', view);
}
view.render();
view._isRendered = true;
if (!view.supportsRenderLifecycle) {
view.triggerMethod('render', view);
}
}
if a view HAS NO supportsRenderLifecycle there will be call to view.triggerMethodtriggerMethod() {}
or supportsRenderLifecycle: true
triggerMethod
or setting those two flags to true is effectively the same thing
....
if (!view.supportsRenderLifecycle && view.triggerMethod) {
view.triggerMethod('render', view);
}
triggerMethod
function
supportsRenderLifecycle
while rendering.render
and there some code related to render
event why i cant implement it in my render?render
hook for other purpose i definitely will get side effect after rendering my view in a mn region
Paul, what do you think about some marionetteConfig
in Mn5?
what if there will be one:
export const marionetteConfig = {
DomApi: DefaultDomApi,
viewRenderer: DefaultViewRenderer,
.... // other configurations
}
and in a view it could be:
- Dom: DomApi,
+ getDomApi() {
return marionetteConfig.DomApi
}
...
and changing the domApi will be like
import { marionetteConfig } from 'backbone.marionette';
marionetteConfig.DomApi = MyDomApi;
Hey, very "general" question... I'm runnin Marionette 3.5 in a webpack build, using "import"
Now, should I
import Marionette from 'backbone.marionette';
or
import Marionette from 'backbone.marionette/lib/backbone.marionette.esm';
or
import {View} from "backbone.marionette";
Or any other?
Any advantages of one or the other? Tree-Shaking maybe?
dom:refresh
reflects when the contents of a view's el change in the DOM, and dom:remove
reflects when the contents of a view’s el are about to change in the DOM.
.stopListening()
in mn destroy cycle.this.stopListening();
this.off();
for(let prop in this) {
delete this[prop]
}
this.listenTo(this
is not equal this.on(
:)) only that.this.listenTo(this
as it is exactly like this.on
except that it keeps a 2nd hash of objects it references.. which is particularly not useful when listening to self.
HI all
i am going to try this approach:
// just for example
const model = new Model({ created: new Date(), bigNumber: 123456789 });
// some schema implementation
const modelSchema = {
// ....
display(property, model) { return; // some logic here }
}
const ModelView = View.extend({
model: model,
template: _.template('<%= display.created %>: <%= display.bigNumber %>'),
templateContext() {
return {
display: createDisplayModelProxy(this.model, modelSchema)
}
}
});
function createDisplayModelProxy (model, schema) {
const handler = {
get (target, name) {
return schema.display(name, model);
}
};
return new Proxy(model.attributes, handler);
}
has anyone ever done something like this? can you share any of your thoughts?