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

Batched change notifies child component before parent stache binding #2252

Closed
dylanrtt opened this Issue Feb 11, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@dylanrtt
Contributor

dylanrtt commented Feb 11, 2016

This bug was introduced in 2.3 (absent in 2.2.9), and is still present in 2.3.15.

{{#eq page 'view'}}
  <foo-view page="{page}"></foo-view>
{{/eq}}

If <foo-view> binds to page, and page is changed in a batch, it seems the component is notified of the change before the stache binding. The stache binding should be called back first to remove the component and hopefully prevent the other batched event from running (however that works).

http://jsbin.com/xeqosawako/edit?html,js,console,output

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Apr 26, 2016

Contributor

There's an issue keeping this for 3.0. Essentially, live-binding relied on a synchronous notification of removed events to teardown the bindings.

In 3.0, for performance reasons, I was hoping to use MutationObservers to know when elements are added or removed. MutationObservers dispatch at the next turn.

I'm going to try to come up with a way for this to work without having to resort to synchronous "removed" events.

Contributor

justinbmeyer commented Apr 26, 2016

There's an issue keeping this for 3.0. Essentially, live-binding relied on a synchronous notification of removed events to teardown the bindings.

In 3.0, for performance reasons, I was hoping to use MutationObservers to know when elements are added or removed. MutationObservers dispatch at the next turn.

I'm going to try to come up with a way for this to work without having to resort to synchronous "removed" events.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Apr 26, 2016

Contributor

actually, listening to nodeLists teardown should work.

Contributor

justinbmeyer commented Apr 26, 2016

actually, listening to nodeLists teardown should work.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
Contributor

justinbmeyer commented Aug 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment