-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
chore(homepage): separate out api calls to make homepage load more dynamically #13500
Conversation
@@ -123,8 +115,50 @@ function Welcome({ user, addDangerToast }: WelcomeProps) { | |||
); | |||
}), | |||
); | |||
|
|||
// Sets other activity data in parallel with recents api call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always appreciate comments like this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, so I'll approve. There are some open questions/nits about typing and one more promise.all
that might be OK to parallelize, so I'll refrain from merging in case you want to address that in this PR. Some parts (e.g. a pass at tighter typing) might be good to open another PR around if you'd rather not tackle it right now.
... last and least, a quick lint-fix looks to be warranted.
Codecov Report
@@ Coverage Diff @@
## master #13500 +/- ##
==========================================
- Coverage 77.17% 73.17% -4.00%
==========================================
Files 905 615 -290
Lines 45675 21917 -23758
Branches 5511 5820 +309
==========================================
- Hits 35248 16037 -19211
+ Misses 10298 5737 -4561
- Partials 129 143 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM with a couple of small nits (mostly naming suggestions). Didn't have time to test, though.
Happy to stamp once we have design/PM sign-off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what's the best way to test, but compared before and after locally. difference in performance is quite noticeable?
Good to go! 🟢
Before
https://user-images.githubusercontent.com/67837651/111709553-0977eb00-8805-11eb-9abf-0d00d04a2cbb.mov
After
https://user-images.githubusercontent.com/67837651/111709580-172d7080-8805-11eb-81b3-23e0359ea456.mov
@junlincc Ephemeral environment spinning up at http://34.208.210.86:8080. Credentials are |
recents-empty-result.mp4So it seems once other API is returned, "Recents" was rendered with an empty result before its own API response returns, resulting in a flash of the empty state---this is more noticeable if the Can we get this fixed before merging this PR? |
@ktmud fixed Screen.Recording.2021-03-19.at.5.50.18.PM.mov |
Looks good! |
/testenv up |
@ktmud Ephemeral environment creation is currently limited to committers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to go.
-junlin
Ephemeral environment shutdown and build artifacts deleted. |
…namically (apache#13500) * separate out api calls * add new loading states * remove consoles * update tests * fix types and lint * make code more robust and add test * address comments * address comments * fix lint
SUMMARY
This pr is based off feedback from users with slow loading home page from api calls. The initial setup for page load was to batch call for all data on page load. This pr separates out api calls for recent activity and run mine's api calls in parallel on page load. This should allow some data to show faster on homepage without depending on long api requests.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
Unit test will be updated as change are made.
ADDITIONAL INFORMATION