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

Cleaner rerendering #177

Merged
merged 6 commits into from
Mar 27, 2017
Merged

Cleaner rerendering #177

merged 6 commits into from
Mar 27, 2017

Conversation

zenoamaro
Copy link
Owner

Concept of cleanProps allows performing regular updates that affect DOM nodes.

Keyed elements and controlled lifecycle avoid breaking Quill when re-rendering.

Optimized comparisons for value prop updates after content changes.

Should fix #147 and others.

Concept of `cleanProps` allows performing regular updates that affect DOM nodes.

Keyed elements and controlled lifecycle avoid breaking Quill during re-renders.

Optimized comparisons for value prop updates after content changes.
@zenoamaro
Copy link
Owner Author

@alexkrolick try doing something outrageous, such as changing the theme every few seconds.

Changing things like className will also be much less heavy.

Focus can't be maintained (yet) when re-rendering the whole Quill.

@alexkrolick
Copy link
Collaborator

Focus can't be maintained (yet) when re-rendering the whole Quill.

I'm thinking that these APIs should be used in the regeneration case:

@alexkrolick
Copy link
Collaborator

Demo of the two cases to confirm this is working: https://codepen.io/alexkrolick/pen/KWBJgQ?editors=0010

- preserves focus between dirty updates
@alexkrolick
Copy link
Collaborator

@zenoamaro 🍾 Type something and wait for the theme to change:

https://codepen.io/alexkrolick/pen/KWBJgQ?editors=0010

- clear the cached selection and quill delta after regenerating for a dirty update so that later changes will pass through to the state.value condition
- add comments for regeneration code
@alexkrolick alexkrolick merged commit 5fdb6bf into master Mar 27, 2017
@zenoamaro
Copy link
Owner Author

Great, thanks a lot!
Think this is the last blocker?

🎩
🕶
🌂

@alexkrolick
Copy link
Collaborator

alexkrolick commented Apr 3, 2017

I considered making this rc-1 instead of beta-4 but figured we should probably take a closer look at #175 to see if a fix is possible in 1.0.0. @zenoamaro what do you think?

@zenoamaro zenoamaro deleted the cleaner-rerendering branch July 30, 2017 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-rendering after props change adds another toolbar
2 participants