Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

Keep your projects up-to-date

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Prochain SlideShare
DevOps for Developers
DevOps for Developers
Chargement dans…3
×

Consultez-les par la suite

1 sur 26 Publicité

Keep your projects up-to-date

Télécharger pour lire hors ligne

If you have an app bootstrapped with [create-react-app](https://github.com/facebook/create-react-app), you may have a certain amount of boilerplate code that came with it, especially if you ejected. Now you may want to sync up with the latest changes in create-react-app. I've ported [ember-cli-update](https://github.com/ember-cli/ember-cli-update) to [create-react-app-updater](https://github.com/kellyselden/create-react-app-updater) to get the same benefits for react apps. You can keep your pojects in sync as well as run codemods based on react version.

If you have an app bootstrapped with [create-react-app](https://github.com/facebook/create-react-app), you may have a certain amount of boilerplate code that came with it, especially if you ejected. Now you may want to sync up with the latest changes in create-react-app. I've ported [ember-cli-update](https://github.com/ember-cli/ember-cli-update) to [create-react-app-updater](https://github.com/kellyselden/create-react-app-updater) to get the same benefits for react apps. You can keep your pojects in sync as well as run codemods based on react version.

Publicité
Publicité

Plus De Contenu Connexe

Diaporamas pour vous (20)

Similaire à Keep your projects up-to-date (20)

Publicité

Plus récents (20)

Keep your projects up-to-date

  1. 1. Keep your projects up-to-date Kelly Selden @kellyselden
  2. 2. • Hiring any skill level (even junior!) • Remote-first w/ offices all over • Open source friendly • Ember.js core team • Working on ember-cli
  3. 3. Why am I here?
  4. 4. •motivation •demo •deep dive create-react-app-updater
  5. 5. ember-cli
  6. 6. ember-cli =>
 
 ember-cli-update
  7. 7. ember-cli-update =>
 
 create-react-app-updater
  8. 8. Do we need an updater?
  9. 9. •automated updates •conflict resolution •runs codemods •and more™ create-react-app-updater
  10. 10. npm i -g create-react-app-updater
 create-react-app-updater
 # or
 cra-update npx create-react-app-updater
  11. 11. cra-update cra-update --run-codemods
  12. 12. Demo Time! (pray to the WiFi gods)
  13. 13. cra-update Would update from 1.0.0 to 2.1.5.
  14. 14. 1. detects your local version 2. goes out to npm to get the latest version 3. generates two apps using your version and the new version (in tmp) 4. generates a git patch between them 5. applies the patch to your repo bonus. applies a JSON patch to package.json What is happening?
  15. 15. • Pros • only changes the code that needs to update • it is aware if git conflicts • Cons • you have to be online to update • can be slow
  16. 16. •resolve any conflicts •fix any broken tests •commit Before next step…
  17. 17. cra-update --run-codemods
  18. 18. •know where to find them •know how to run them (clone, yarn, params) •know if they’re compatible Why not run them yourself?
  19. 19. • uses a downloaded manifest rather than locked dependencies • then downloads and runs the codemods • Pros • always latest codemod fixes • can add new ones • Cons • not protected against bugs in codemods • reliant on internet (slower) --run-codemods
  20. 20. •--from and --to •--resolve-conflicts •--stats-only •--list-codemods Extended options
  21. 21. cra-update --stats-only
  22. 22. --list-codemods
  23. 23. https://github.com/ kellyselden/create-react-app- updater The end.

×