-
Notifications
You must be signed in to change notification settings - Fork 6
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
perf: adjust code fetching all projects #989
Conversation
… unnecessary * take advantage of getProjects in getAllProjects. * invoke getAllProjects for starred projects * prevent fetching user projects when browsing as anonymous fix #986
While working on this, I came up 2 possible follow up -- I'll create the issues if they are relevant. 1.We could further improve the projects fetching logic by:
The speedup is considerable only with a lot of member/starred projects (100+). We could probably address with lower priority. 2.An interesting idea would be adding a global notification system so that we can popup info/ warning messages when something not too critical goes wrong. |
src/api-client/project.js
Outdated
@@ -96,9 +96,9 @@ function getFilesTreeLazy(client, files, projectId, openFilePath, lfsFiles) { | |||
|
|||
} | |||
|
|||
function addProjectMethods(client) { | |||
async function addProjectMethods(client) { |
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.
I think the addProjectMethods function should be synchronous.
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.
👍
I created #991 for the second suggestion. I think the first is also good, could you make an issue for that? |
Great! |
This improves the
client.getAllProjects
function and limits its use to whenever it's necessary.client.getProjects
function inclient.getAllProjects
and make it more readable.client.getAllProjects
also for starred projects to be sure we are not missing projects.fix #986
EDIT: sorry for not making a preview available, I'm running out of test deployments 😞