incubateur-ademe / nosgestesclimat-site

Estimez votre empreinte climat - le code du site
https://nosgestesclimat.fr
MIT License
70 stars 40 forks source link

S'assurer qu'on peut faire évoluer l'UI avec du hot reload #702

Open laem opened 1 year ago

laem commented 1 year ago

The problem

641 introduces changes in the local development workflow. In particular, when editing a <Trans i18nKey="..."> component's content, the modification isn't reflected in the local preview -- a yarn generate:ui must be executed to achieve this.

List of related tasks

Orignal comment in french > L'étape de traduction `yarn run generate:ui` casse le hot reload quand on itère sur des textes de l'interface. > > Il faut qu'on trouve un moyen de pouvoir itérer dans la langue principale du site. > > - [ ] rétablir le hot reload pour le contenu français
laem commented 1 year ago

En guise de solution partielle, je pense qu'il faut qu'on utilise un maximum le markdown, qui évite les problèmes de <0> qui devient <1> et casse la traduction.

image

Dans cette capture :

@EmileRolley un point pas facile

laem commented 1 year ago
EmileRolley commented 1 year ago

Hot reloading quick fix

A first solution to enable hot reloading on <Trans i18nKey="..."> components changes is to use a watching daemon to run yarn generate:ui on file changes.

For example with nodemon you'll just need to run:

npx nodemon --watch source/ --exec "yarn generate:ui"
EmileRolley commented 1 year ago
  • [ ] globalement, la PR trad nous fait perdre le hot reload en général : même un changement de CSS fait recharger toute l'app, ce qui avec le parsing du modèle rend les choses bien moins fluides

I don't get why the #641 modifies the behavior of CSS editing?

laem commented 1 year ago

Also, I believe translating whole blocks of text instead of small fragments makes for better deepl translations :)