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

feat: Replaced mobx with zustand #4358

Merged
merged 1 commit into from Nov 28, 2023
Merged

feat: Replaced mobx with zustand #4358

merged 1 commit into from Nov 28, 2023

Conversation

Wishrem
Copy link
Contributor

@Wishrem Wishrem commented Nov 28, 2023

🤖[deprecated] Generated by Copilot at 392443c

Summary

🗑️🎨🚀

This pull request removes some unused files and refactors the frontend code to use Zustand as the state management library instead of MobX. It also improves the user interface and navigation by adding new components and logic. It affects the files overview.tsx, data.store.ts, configmap.store.ts, statefulset.tsx, index.tsx, config-map.store.ts, deployment.store.ts, kube.store.ts, and pod.store.ts.

MobX is no more
Zustand stores and selectors
Spring cleaning the code

Walkthrough

  • Rewrite the Home component to use Zustand stores and selectors, and add layout, sidebar, floating button, and modal components (link)
  • Remove the observer wrapper from the StatefulSetOverviewPage component (link)
  • Add a new file config-map.store.ts that defines a Zustand store for the ConfigMap resource using a helper function createKubeStoreSlice (link)
  • Modify the deployment.store.ts file to use a functional approach and export a helper function getDeploymentsStatuses (link)
  • Modify the pod.store.ts file to use a functional approach and a computed plugin, and export a helper function getPodsByOwnerId (link)
  • Modify the kube.store.ts file to remove the abstract class KubeStore and replace it with a generic type, and add helper functions createKubeStoreSlice, getByLabel, and fetchData (link)
  • Delete the files overview.tsx, data.store.ts, and configmap.store.ts as they are no longer needed (link, link, link)

Copy link

Whoa! Easy there, Partner!

This PR is too big. Please break it up into smaller PRs.

@sealos-ci-robot
Copy link
Member

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 1036
✅ Successful 368
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 667
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Nov 28, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (30b47a8) 65.45% compared to head (392443c) 65.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4358   +/-   ##
=======================================
  Coverage   65.45%   65.45%           
=======================================
  Files           8        8           
  Lines         660      660           
=======================================
  Hits          432      432           
  Misses        180      180           
  Partials       48       48           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c121914yu c121914yu merged commit e84a782 into labring:main Nov 28, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants