You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two general categories of views in Backbone. One category are pre-existing nodes that are unlikely to be rendered ever. An example of this would be creating a rootView and passing the body as the element, in a situation where the body already has a handful of nodes. The other category are views which may or may not have templates and are rendered throughout the application's lifecycle. The latter of the two categories is by far the most common.
Marionette does not distinguish between these two types of views, which creates some bad side effects. For instance, both sorts of LayoutViews are treated identically, which leads to some nasty bugs.
One way to resolve situations like that are to differentiate between these two use-cases. We can infer that a view exists based on two criteria: it has no template, and it has children nodes.
During the instantiation phase of any view, this would be used to dictate the behavior of the view. Take a LayoutView, for instance. Pre-existing nodes would have their regions instantiated instantly, and their UI would also be bound instantly. LayoutViews that aren't pre-existing would wait until the first render before doing these actions.
The text was updated successfully, but these errors were encountered:
There are two general categories of views in Backbone. One category are pre-existing nodes that are unlikely to be rendered ever. An example of this would be creating a
rootView
and passing thebody
as the element, in a situation where thebody
already has a handful of nodes. The other category are views which may or may not have templates and are rendered throughout the application's lifecycle. The latter of the two categories is by far the most common.Marionette does not distinguish between these two types of views, which creates some bad side effects. For instance, both sorts of LayoutViews are treated identically, which leads to some nasty bugs.
One way to resolve situations like that are to differentiate between these two use-cases. We can infer that a view exists based on two criteria: it has no template, and it has children nodes.
In other words:
During the instantiation phase of any view, this would be used to dictate the behavior of the view. Take a LayoutView, for instance. Pre-existing nodes would have their regions instantiated instantly, and their UI would also be bound instantly. LayoutViews that aren't pre-existing would wait until the first render before doing these actions.
The text was updated successfully, but these errors were encountered: