Code Monkey home page Code Monkey logo

config-react-app's Introduction

๐Ÿงช

This project is me taking Create React App for a spin and ejecting to learn more about configuring the build

  • npm start to run the app

What I learnt ๐ŸŽ“

CRA makes a decision on my behalf to use Yarn (because I have Yarn installed, otherwise it would use npm?) and will generate a yarn.lock. But I can set a flag to choose npm as a package manager:

  • npx create-react-app config-react-testing --use-npm

The script also attempts initialize git and commit. That fails because of my gitconfig setup which suits me fine, I find it kinda rude that the script tries to automatically make a commit in my name. ๐Ÿคจ

Let's measure dependencies!

git ls-files package-lock.json | xargs wc -l

There are 38155 lines of code in the initial package-lock.json and it's 1.46 MB ๐Ÿคช

About ejecting react-scripts

Running npm run eject results in:

  • 14 changed files with 1,936 additions and 6 deletions
  • 58 new dependencies to replace the single react-scripts in package.json
  • config/webpack.config.js that is too large a diff for github to render ๐Ÿ™ˆ
  • Check out the whole commit

No changes to the lock file. At first I expected there would be, but makes sense when I think about it. Ejecting react-scripts doesn't change which packages are used in the project and installed in my node_modules โ€” the eject changes how they are referenced in package.json

When running eject, there is a warning and then if you insist anyway, an invitation to a survey. Nice! I get to answer questions around my experience with Create React App and questions like: โ€œhow comfortable are you with configuring Webpack, Babel, and ESLint manually on your own?โ€ and

How do you feel after running eject?
I feel frustrated because I didnโ€™t want to give up the defaults but I needed to change something
I feel empowered because I am comfortable with the underlying tools

Neither of those two. I feel curious and excited ๐Ÿฅณ because I want to take responsibility and ownership of configuring a new application. Not always, but sometimes. I don't understand why CRA is trying so hard to persuade me against doing that. I'm sceptical of abstracting away too much in a magical react-scripts that is a one-size-fits-all config, but equally unconvinced that ejecting is a path I want to take.

config-react-app's People

Contributors

elisabethirgens avatar

Stargazers

Sabrina Boumaiza avatar Richie Seputro avatar Selim Horri avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.