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

Simplification des imports #1665

Open
ptbrowne opened this issue Nov 18, 2020 · 1 comment
Open

Simplification des imports #1665

ptbrowne opened this issue Nov 18, 2020 · 1 comment

Comments

@ptbrowne
Copy link
Contributor

ptbrowne commented Nov 18, 2020

Plusieurs points font que les imports de cozy-ui sont plus compliqués que nécessaire.

  • transpiled/react: on ne devrait pas avoir en général à l'écrire
- import Button from 'cozy-ui/transpiled/react/Button
+ import Button from '@cozy/ui/Button`
  • MuiCozyTheme: vu qu'on se base en majorité sur MUI, on devrait pouvoir l'enlever
- import ExpansionPanel from 'cozy-ui/transpiled/react/MuiCozyTheme/ExpansionPanel
+ import ExpansionPanel from '@cozy/ui/ExpansionPanel'
  • helpers/withBreakpoints -> cozy-ui/withBreakpoints
- import withBreakpoints from 'cozy-ui/transpiled/react/helpers/withBreakpoints'
+ import withBreakpoints from '@cozy/ui/withBreakpoints'
  • hooks/useBreakpoints -> @cozy/ui/useBreakpoints ? Pareil pour les autres hooks ?
- import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
+ import useBreakpoints from '@cozy/ui/useBreakpoints'
  • stylus: le dossier stylus reste à sa place cozy-ui/stylus
  • On garderait dans un premier temps des composants non transpilés dans cozy-ui/src
- import Button from 'cozy-ui/react/Button'
+ import Button from '@cozy/ui/src/react/Button'

Bien sûr, il y aurait un codemod pour migrer. Qu'en pensez vous ? A mon avis ca n'est pas urgent mais ca irait dans la bonne direction.

EDIT: Used @cozy/ui instead of cozy-ui

@JF-Cozy
Copy link
Collaborator

JF-Cozy commented Mar 20, 2024

lié à la carte #2363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants