-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Layout structures without perf penalties. #2228
Comments
What do you mean? |
What I mean is that we have to visit every layout module (suppose each layout is defined in it's own file/module) to understand the app's layout view hierarchy. |
Is this any different than when you're using application regions? |
Same thing. Having regions in the Application just means we can initially see the top level of the layout inside the application instance instead of at the next level down in a LayoutView. What I mean is to be able to see the whole structure of the nested layouts all at once. F.e., instead of opening up each LayoutView subclass of an app and looking at it's onRender method to see what views it adds to its regions so that I could then open the files for those views, it's nice to be able to see it in a single place. |
If you try some of the demos at http://famo.us/university, you'll notice a structure similar to the first example above. The whole "tree" of the application is discernible all at once. |
I think now that we've merged
|
Using onRender for a root layout, and onBeforeShow for child layouts, is nice, but the structure of the layouts is hidden in the code and so a newcomer to the code has to traverse it to learn what's happening.
As mentioned, it's possible to do this (the very last example in that section) to put together a layout structure in a single place, but with performance penalties: http://marionettejs.com/docs/v2.3.1/marionette.layoutview.html#nested-layoutviews-and-views
It'd be super great to be able to do that without performance penalties. Perhaps something along the lines of (and considering that Application.regions are deprecated, so skipping that line)
so that multiple renders don't happen. Some syntax like the following might show structure.
And the structure of the application can be set up in a single place.
The text was updated successfully, but these errors were encountered: