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

refactor: replace useProject with useProjectOverview #7087

Merged
merged 3 commits into from
May 20, 2024
Merged

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented May 20, 2024

About the changes

  • useProject replaced with useProjectOverview which doesn't fetch all project features
  • added client side feature counting based on flag types
  • removed project list on hover that was making 3 requests on every tile hover. We don't need to prefetch all this information (especially all the project features)

Important files

Discussion points

Copy link

vercel bot commented May 20, 2024

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 0:57am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 0:57am

@@ -50,4 +50,12 @@ export const useProjectOverviewNameOrId = (id: string): string => {
return useProjectOverview(id).project.name || id;
};

export const featuresCount = (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backend doesn't return all features for the overview, but it already counts features by feature type so we can sum all types

onHover={() =>
handleHover(project.id)
}
onHover={() => {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why empty? make it optional or remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

underlying component makes it required and I'd like to remove it in a separate PR

@kwasniew kwasniew merged commit 8a6daee into main May 20, 2024
10 checks passed
@kwasniew kwasniew deleted the remove-use-project branch May 20, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants