Create-react-app: [Question] Why a CLI over a Yeoman generator?

Created on 30 Nov 2016  路  2Comments  路  Source: facebook/create-react-app

Not intended to sound snarky. My question comes from a place of interest and ignorance.

Most helpful comment

I don鈥檛 know enough about Yeoman but we had a few constraints:

  • The "ejection" feature. It seems a bit tricky to implement on top of a generator that wasn鈥檛 designed for it in the first place.
  • There is no intention of code generation. We give you a project with npm start, npm test and npm run build, and we don't want to make an impression that we will scaffold any code for you.
  • Versioning. We want a very particular way of versioning: Create React App is a global CLI but it uses the latest version of react-scripts (which is the actual code). So you don't need to update the CLI when starting new projects: you always use latest react-scripts by default. For this to work, we need CLI to call init.js inside react-scripts so that we can safely change it in future versions without breaking backwards compat with the CLI.

I鈥檓 not sure if Yeoman satisfies them and we didn鈥檛 want to lock ourselves into something that would be hard to change. Does this help?

All 2 comments

I don鈥檛 know enough about Yeoman but we had a few constraints:

  • The "ejection" feature. It seems a bit tricky to implement on top of a generator that wasn鈥檛 designed for it in the first place.
  • There is no intention of code generation. We give you a project with npm start, npm test and npm run build, and we don't want to make an impression that we will scaffold any code for you.
  • Versioning. We want a very particular way of versioning: Create React App is a global CLI but it uses the latest version of react-scripts (which is the actual code). So you don't need to update the CLI when starting new projects: you always use latest react-scripts by default. For this to work, we need CLI to call init.js inside react-scripts so that we can safely change it in future versions without breaking backwards compat with the CLI.

I鈥檓 not sure if Yeoman satisfies them and we didn鈥檛 want to lock ourselves into something that would be hard to change. Does this help?

Yes, thank you for taking the time to answer this @gaearon. :)

Closing...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stopachka picture stopachka  路  3Comments

rdamian3 picture rdamian3  路  3Comments

Aranir picture Aranir  路  3Comments

fson picture fson  路  3Comments

dualcnhq picture dualcnhq  路  3Comments