mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
652eaeff2a
Summary: The issue was that on every key stroke the whole composer, participants and all, were getting re-rendered. According to React.perf, the `TokenizingTextField`s were taking a very long time to render and never changing. This was fixed by adding a simple `shouldComponentUpdate` check. The composer also has several regions that only change when the `props` do. These are now cached. The cache reset when the `props` do. After all of that, rendering the whole composer still takes 20-40ms. If you're tying in the composer very quickly, text entry can approach that render time. This starts to stack multiple React rendering passes up and bogs the whole system down. Luckily, we can simply render the composer less frequently. Now, after changes are persisted to the `DraftStoreProxy`, we simply debounce the proxy `trigger`. The users don't see this because the native `contenteditable` field will update immediately. When the debounced proxy trigger fires, it will transparently update the view to the latest state. Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Subscribers: mg Differential Revision: https://phab.nylas.com/D1749 |
||
---|---|---|
.. | ||
account-sidebar | ||
attachments | ||
calendar-bar | ||
composer | ||
composer-signature | ||
developer-bar | ||
file-list | ||
inbox-contact-elements | ||
message-list | ||
message-templates | ||
mode-switch | ||
notification-mailto | ||
notification-update-available | ||
notifications | ||
onboarding | ||
search-bar | ||
settings | ||
sidebar-fullcontact | ||
sidebar-inbox-internal | ||
thread-list | ||
today | ||
tooltip | ||
ui-dark | ||
ui-light | ||
unread-notifications |