-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
WIP: separate create from mount #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current coverage is 90.84% (diff: 100%)@@ master #91 diff @@
==========================================
Files 48 48
Lines 1310 1322 +12
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1189 1201 +12
Misses 121 121
Partials 0 0
|
Are we sure about doing keyed updates by default? It creates overhead (both in terms of code and computation) but in a lot of situations has no benefit. I think it needs to be opt-in – what does this look like with just the |
I rebased this with only the mount stuff, with a few other changes:
I am not so sure about the initial mounting for non-toplevel blocks however. It might interact strangely with components that have lifecycle callbacks. Those callbacks should only ever be called when the elements are actually mounted to the dom, so that |
To elaborate further on the mindfuck I’m currently experiencing:
I think we somehow need to further split up the phases of mount to dom tree (might be detached) and fire |
So there already was some |
Am working through the merge conflicts, will submit a PR to this branch shortly. Just curious about return {
mount: function ( _target, _anchor ) {
target = _target;
anchor = _anchor;
target.insertBefore( p, anchor );
}, When would they be needed outside the |
This is a first step towards keyed iteration, see #81, #77, #33
The changes got a bit more invasive than I had hoped, but the tests do pass so thats a plus :-)
The
EachBlock
changes currently take the index as key, which is pretty useless for now, but pending some bikeshedding on actual keyed{{#each}}
syntax, this should be good to go.