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

[Improvement] Remove react-spring usage #3645

Open
1 task
mmioana opened this issue Nov 6, 2024 · 0 comments
Open
1 task

[Improvement] Remove react-spring usage #3645

mmioana opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mmioana
Copy link
Contributor

mmioana commented Nov 6, 2024

Specification

Description

Due to using nivo.rocks for our charts, we get also react-spring as a dependency.

Screenshot 2024-11-05 at 21 10 10

However, we already make use of framer-motion, so it doesn't make sense to keep both packages.
We should try to disable the animations for our charts and wherever needed make use of framer-motion.

Implementation

This issue is complete when...

  • react-spring is no longer in our bundle

Suggestions

  • There is no explicit documentation on how or if it is possible to do this. However, you can try using animated=false for the BarChart and Chart components.
  • Then replace the react-spring usage from ChartCustomXAxisStep, ChartCustomBarLabel and ChartCustomYAxisStep with framer-motion
  • Then add in vite.config.mts
defineConfig(({ mode }) => ({
  ...,
  optimizeDeps: {
    exclude ['react-spring']
  }
}))
  • You can use npx vite-bundle-visualizer for checking the bundle

Of course, these suggestions might not work as expected, so please bring patience ✨

@mmioana mmioana added the enhancement New feature or request label Nov 6, 2024
@bassgeta bassgeta self-assigned this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants