Skip to content
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
Closed

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

GianlucaGuarini opened this issue Mar 7, 2016 · 10 comments
Labels
Milestone

Comments

@GianlucaGuarini
Copy link
Member

@GianlucaGuarini 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
Copy link
Member Author

@GianlucaGuarini GianlucaGuarini commented Mar 10, 2016

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

@believer-ufa
Copy link

@believer-ufa believer-ufa commented Mar 10, 2016

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

@GianlucaGuarini
Copy link
Member Author

@GianlucaGuarini 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 mentioned this issue Mar 19, 2016
14 of 16 tasks complete
@rogueg
Copy link
Member

@rogueg 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
Copy link
Member Author

@GianlucaGuarini 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
Copy link
Member Author

@GianlucaGuarini GianlucaGuarini commented Apr 17, 2016

@GianlucaGuarini
Copy link
Member Author

@GianlucaGuarini 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
Copy link
Member

@rogueg 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
Copy link
Member Author

@GianlucaGuarini GianlucaGuarini commented Apr 17, 2016

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

@rvion
Copy link

@rvion 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.