Conversation
BundleMonUnchanged files (2)
No change in files bundle size Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
|
This seems to increase to size of the build significantly. Perhaps every type packages should be in |
| "react-popper": "^2.2.3", | ||
| "react-remove-scroll": "^2.4.0", | ||
| "react-select": "^4.3.0", | ||
| "react-select": "^5.4.0", |
There was a problem hiding this comment.
To be checked because there is a few BC in the lib, no? https://react-select.com/upgrade
There was a problem hiding this comment.
We may be impacted by the changes on refs since we indeed use one on ReactSelect in SelectBox to measure some height. Further investigation is needed for it. The remaining BCs look ok for us.
There was a problem hiding this comment.
Quel besoin d'upgrade cette lib ?
There was a problem hiding this comment.
This brings types without needing to install a @types package:
Convert to TypeScript - TypeScript types now come packaged with react-select so you no longer need to have @types/react-select installed; we no longer include Flow types
There was a problem hiding this comment.
J'ai finalement retiré la montée de version de ce paquet et installé @types/react-select, ça évite d'avoir à gérer le breaking change dans cette PR, et ça évite d'avoir à mettre à jour les snapshots.
| import Icon from '../Icon' | ||
| import CheckIcon from '../Icons/Check' | ||
| import { dodgerBlue, silver, coolGrey, paleGrey } from '../palette' | ||
| import palette from '../palette' |
There was a problem hiding this comment.
@PolariTOON are you sure that this is not this line that create this big impact on the bundle size?
There was a problem hiding this comment.
We are already importing the palette in this way at other places and the file doesn't weight so much, thus i don't think so.
| import Icon from '../Icon' | ||
| import CheckIcon from '../Icons/Check' | ||
| import { dodgerBlue, silver, coolGrey, paleGrey } from '../palette' | ||
| import palette from '../palette' |
There was a problem hiding this comment.
pourquoi ce changement ici ? Quel intérêt ?
| echo "// GENERATED FILE, DO NOT EDIT THIS FILE BY HAND" > $outfile | ||
| echo "// Use yarn sprite to regenerate" >> $outfile | ||
| echo "module.exports = \``cat /tmp/icons-sprite.svg`\`" >> $outfile | ||
| echo "export default \``cat /tmp/icons-sprite.svg`\`" >> $outfile |
There was a problem hiding this comment.
on s'est dit y'a quelques jours qu'on n'était pas chaud pour ces modifs, pourquoi le faire à nouveau maintenant ? 🤔
There was a problem hiding this comment.
Pourquoi on n'est pas chaud de faire ce changement ? Ça va dans le bon sens, non ?
There was a problem hiding this comment.
@PolariTOON peux-tu retrouver la PR de référence stp ?
Cela posait des soucis il me semble au niveau des tests.
A part une écriture plus moderne, que cela apporte t-il de "mieux" ? 🤔 Y'a t-il un intérêt autre qu’esthétique ?
There was a problem hiding this comment.
J'avais initialement proposé les changements ici : #2342 et on avait décidé de ne pas inclure ce commit (les commentaires ont disparu apparemment, sans doute dû au retrait du commit ?).
Effectivement ça posait un problème de test, parce que je n'avais pas fait attention que le fichier généré par make-palette.sh exporte un type de valeur bien précis : un objet, qu'on importait soit directement (import palette from '../palette') soit en destructurant (import {...} from '../palette') selon l'endroit.
Quand on utilise la syntaxe ESM pour exporter quelque chose, on doit l'importer de la même manière. Donc si on utilise un export par défaut on doit faire un import par défaut, d'où le changement dans SelectBox qui était le seul fichier à faire un import nommé jusque là.
Par rapport à l'intérêt, l'idée était juste d'avoir une base de code plus cohérente en terme de syntaxe et qu'ensuite TS puisse bien identifier les imports erronés.
| '../react/SwipeableDrawer', | ||
| '../react/TextareaAutosize', | ||
| '../react/Toolbar', | ||
| '../react/Zoom' |
There was a problem hiding this comment.
attention il me semble que certains fichier nécessitent l’extension car plusieurs fichiers index dans le dossier
There was a problem hiding this comment.
Effectivement j'ai eu des soucis avec ça, mais le message d'erreur du styleguide n'est pas bien clair dont je n'ai pas identifié précisément où était le problème.
J'ai adapté ce commit pour conserver le /index partout et juste retirer l'extension, car c'était plutôt ça l'objectif à la base.
There was a problem hiding this comment.
J'ai parlé trop vite. Je pensais que c'était réglé parce que je n'avais plus d'erreur, mais une fois une démo de la documentation déployée, je me suis rendu compte qu'elle était complètement cassée. Je retire le commit de cette PR, ça a l'air bien plus complexe que je ne le croyais.
| "react-popper": "^2.2.3", | ||
| "react-remove-scroll": "^2.4.0", | ||
| "react-select": "^4.3.0", | ||
| "react-select": "^5.4.0", |
There was a problem hiding this comment.
Quel besoin d'upgrade cette lib ?
8ea2d99 to
1684799
Compare
b54b9f7 to
691f24d
Compare
This mainly moves each hook, `Figure` and `FigureBlock` to a dedicated folder.
691f24d to
937419f
Compare
|
This should be ready for a review (here's the demo link https://polaritoon.github.io/cozy-ui/react/ to show it builds the doc fine). |
|
Stale, feel free to close. |
This is kept as a draft, as this is not meant to be merged as is.
The changes are not needed to migrate to TypeScript, but should ease gradually renaming files from
*.js{x}to*.ts{x}.This also updates and adds some packages to get types on which to build upon to declare ours.
On another note, while exploring what could be done to migrate, I also faced another issue that is we are not able to import
*.stylfiles from*.ts{x}files apparently.This is not handled in this PR.
Demo link : https://polaritoon.github.io/cozy-ui/react/ (just to show it builds)