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

MAJ React + Typescript #1174

Merged
merged 4 commits into from Nov 20, 2020
Merged

MAJ React + Typescript #1174

merged 4 commits into from Nov 20, 2020

Conversation

mquandalle
Copy link
Contributor

@mquandalle mquandalle commented Oct 27, 2020

Attendons TS 4.1 stable pour merger (sortie mi-novembre)
Enzyme: enzymejs/enzyme#2429

@mquandalle
Copy link
Contributor Author

Enzyme ne fonctionne pas encore avec React 17 et l'implémentation d'Enzyme est critiquée car elle repose sur les noms internes au code React pour venir le patcher. J'ai l'impression qu'une partie de la communauté est partie sur react-testing-library https://testing-library.com/docs/react-testing-library/migrate-from-enzyme. Si la migration est facile et rapide, je l'ajouterai à cette PR.

Pas de changement de fonctionnalités
Plus besoin d'importer React pour utiliser JSX
Plein de nouveautés et notamment la possibilité de "programmer" les
types chaînes littérales qui nous sera utile par exemple pour vérifier
statiquement la validité d'une *expression* publicode dans
`engine.evaluate`.
https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/

⬆ MAJ ESLint-typescript pour la compatibilité
Utilisation d'un fork en attendant que React 17 soit supporté par
Enzyme.

J'ai essayé rapidement la librairie
https://testing-library.com/docs/react-testing-library/migrate-from-enzyme
vers laquelle certains utilisateurs d'Enzyme semblent maintenant se
tourner, mais la migration est non triviale (alors même que nous n'avons
qu'un seul fichier qui utilise les tests Enzyme !)
@mquandalle mquandalle force-pushed the react-17 branch 3 times, most recently from 0c4de27 to 044954b Compare November 20, 2020 10:07
@mquandalle mquandalle marked this pull request as ready for review November 20, 2020 10:11
@mquandalle mquandalle merged commit 8df1f5d into master Nov 20, 2020
@mquandalle mquandalle deleted the react-17 branch November 20, 2020 11:08
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

Successfully merging this pull request may close these issues.

None yet

1 participant