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

The "update" event gets triggered before "mount" #1661

Closed
GianlucaGuarini opened this Issue Mar 7, 2016 · 10 comments

Comments

Projects
None yet
4 participants
@GianlucaGuarini
Member

GianlucaGuarini commented Mar 7, 2016

@GianlucaGuarini GianlucaGuarini added the bug label Mar 7, 2016

@GianlucaGuarini GianlucaGuarini added this to the 3.0.0 milestone Mar 10, 2016

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Mar 10, 2016

Member

this will be a breaking change and it will be introduced in riot 3.0.0

Member

GianlucaGuarini commented Mar 10, 2016

this will be a breaking change and it will be introduced in riot 3.0.0

@believer-ufa

This comment has been minimized.

Show comment
Hide comment
@believer-ufa

believer-ufa Mar 10, 2016

Gianluca, can you tell where is i can read about Riot.js 3.0? Sorry for offtop.

believer-ufa commented Mar 10, 2016

Gianluca, can you tell where is i can read about Riot.js 3.0? Sorry for offtop.

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Mar 10, 2016

Member

You can check the commits on the next branch.
You can try it using npm install riot@next
And you can read our discussions on any pull request on the next branch

Member

GianlucaGuarini commented Mar 10, 2016

You can check the commits on the next branch.
You can try it using npm install riot@next
And you can read our discussions on any pull request on the next branch

@GianlucaGuarini GianlucaGuarini referenced this issue Mar 19, 2016

Closed

Riot 3.0.0 roadmap #1694

14 of 16 tasks complete
@rogueg

This comment has been minimized.

Show comment
Hide comment
@rogueg

rogueg Apr 17, 2016

Member

I was also confused by this behavior at first, but having looked at the code it now makes more sense. What do you think the behavior should be?

Member

rogueg commented Apr 17, 2016

I was also confused by this behavior at first, but having looked at the code it now makes more sense. What do you think the behavior should be?

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 17, 2016

Member

@rogueg the update/updated events will be triggered only after the tag will have the isMounted flag to true

Member

GianlucaGuarini commented Apr 17, 2016

@rogueg the update/updated events will be triggered only after the tag will have the isMounted flag to true

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
Member

GianlucaGuarini commented Apr 17, 2016

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 17, 2016

Member

http://plnkr.co/edit/EWLe1kGsJTlW6G8XcwjA?p=preview no even if we check the isMounted flag the problem still exists

Member

GianlucaGuarini commented Apr 17, 2016

http://plnkr.co/edit/EWLe1kGsJTlW6G8XcwjA?p=preview no even if we check the isMounted flag the problem still exists

@rogueg

This comment has been minimized.

Show comment
Hide comment
@rogueg

rogueg Apr 17, 2016

Member

I should add a comment to that line. It's intent is to prevent updates
after unmount, not before mount.

Having update happen before mount means that when the DOM gets inserted,
it's all ready and won't need to be modified any more. My gut says that's
better for performance, but we could test it.

On Sunday, April 17, 2016, Gianluca Guarini notifications@github.com
wrote:

@rogueg https://github.com/rogueg the update/updated events will be
triggered only after the tag will have the isMounted flag to true


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1661 (comment)

Member

rogueg commented Apr 17, 2016

I should add a comment to that line. It's intent is to prevent updates
after unmount, not before mount.

Having update happen before mount means that when the DOM gets inserted,
it's all ready and won't need to be modified any more. My gut says that's
better for performance, but we could test it.

On Sunday, April 17, 2016, Gianluca Guarini notifications@github.com
wrote:

@rogueg https://github.com/rogueg the update/updated events will be
triggered only after the tag will have the isMounted flag to true


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1661 (comment)

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 17, 2016

Member

@rogueg I have fixed the issue ;) my patch was enough ff2afc1

Member

GianlucaGuarini commented Apr 17, 2016

@rogueg I have fixed the issue ;) my patch was enough ff2afc1

@rvion

This comment has been minimized.

Show comment
Hide comment
@rvion

rvion Apr 18, 2016

my app is ~1.5/1.6 time faster to load now, perfect !
edit: the updated event doesn't seem to be triggered anymore after mount.

rvion commented Apr 18, 2016

my app is ~1.5/1.6 time faster to load now, perfect !
edit: the updated event doesn't seem to be triggered anymore after mount.

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