Comments (9)
Hey @jiaweihli - as far as I understand, LayoutView
extends from ItemView
which is being covered, and it also doesn't do any specific rendering on its own (instead, it manages Region
s and put them to render) so initially I thought there was not much else to be done for it. The code is here: https://github.com/marionettejs/backbone.marionette/blob/master/src/layout-view.js
Anyhow, I can't take my analysis for granted so if you see any potential for implementing VDOM please bring it up, and if you feel so, please be more than welcome to join us playing with it as well :)
from marionette-vdom.
Support for layout views would ultimately make fine-grained UI updates on a per-attribute basis redundant - change: 'render'
all the way. :P
from marionette-vdom.
As @jeffijoe mentioned, the issue is that sometimes LayoutViews
are completely re-rendered - this destroys its child ItemViews
.
from marionette-vdom.
I see. so yes it would be nice to add LayoutViews
specific support that won't destroy its ItemViews
.
@jiaweihli I just saw your post on Gitter, is your CompositeView
suffering from the same thing?
Two things that I wanted to understand are:
a) Is your LayoutView
/ CompositeView
composed only by VDOM ItemViews
?
b) If not, would you please try that and tell me if it would still re-create everything?
from marionette-vdom.
A:
Sometimes, sometimes not.
B:
Yes, it would still re-create everything, since I'm binding change: 'render'
in modelEvents
.
I've run into each of these cases:
- I need to re-render a portion of the view's template (it depends on a model attribute), which forces
onRender
and re-rendering my children. - I want to re-render a specific
LayoutView
child. - I need to re-render a
CompositeView
child because I need to re-evaluate itsattachHtml
function.
from marionette-vdom.
Gotcha. Thanks! I will have a look this Sunday
from marionette-vdom.
I have just released v0.2.1 with Marionette 3 support, which replaces LayoutView
and ItemView
with just a View
. Hence, I'm closing this issue since everything will be covered already by View
.
from marionette-vdom.
In our application we support it by creating a layoutView which extends from:
var LayoutView = Marionette.LayoutView;
return LayoutView.extend({
setElement: MarionetteVDOM.ItemView.prototype.setElement,
attachElContent: MarionetteVDOM.ItemView.prototype.attachElContent,
remove: MarionetteVDOM.ItemView.prototype.remove
});
To render on model change we simply added:
this.listenTo(this.model, 'change', this.render);
from marionette-vdom.
Cool. Thanks @trystian1 - your solution would be the case for Marionette 2.
from marionette-vdom.
Related Issues (8)
- YAVDOM HOT 9
- Bloated size? HOT 3
- Is this module still recommended? HOT 3
- No option to convert HTML with keys. HOT 2
- still alive and production ready? HOT 4
- Performance is really bad so far HOT 2
- In-browser version HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marionette-vdom.