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

Don't delay loading fetching labels/folders #461

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmulholland
Copy link

@bmulholland bmulholland commented Oct 13, 2022

Code changes

Currently, the await stops loading while all folders/labels are loaded, slowing down initial load time. This changes to a callback, which allows the rest of the component to load asynchronously.

Also, these folders/labels are ONLY used to fetch the ID of the trash folder/label. Loading a list of all folders/labels seems really inefficient for just that...

Edit: here's a writeup that I've previously sent to Nylas Product Management:

The mailbox component loads quite slowly (I count 3-4s when loading zero threads), and there are some basic optimizations that could help. For instance, threads are only loaded after the folders or labels are fetched, which takes at least half a second. But the folders/labels are only used when a thread is deleted, so it could be fetched after threads with minimal risk, or even on demand, when the user deletes the thread. And, in fact, the component fetches a list of all folders/labels — but then uses that list only to search through and find the ID of trash, ignoring all the rest. This will unnecessarily impact load time especially for people with lots of folders or threads.

Readiness checklist

  • Added changes to component CHANGELOG.md
  • New property added? make sure to update component/src/properties.json
  • Cypress tests passing?
  • New cypress tests added?
  • Included before/after screenshots, if the change is visual

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@vercel
Copy link

vercel bot commented Oct 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
components ❌ Failed (Inspect) Oct 18, 2022 at 2:43PM (UTC)

@vercel
Copy link

vercel bot commented Oct 13, 2022

@bmulholland is attempting to deploy a commit to the Nylas Team on Vercel.

A member of the Team first needs to authorize it.

@AaronDDM AaronDDM requested review from yifanplanet, a team and ellioty and removed request for a team October 14, 2022 17:40
@yifanplanet yifanplanet removed the request for review from ellioty January 9, 2023 19:31
@yifanplanet yifanplanet removed their request for review March 17, 2023 14:57
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.

2 participants