Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !1253

Install React, ReactDOM and React-Scripts at the same time

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/n3tr/install-deps-at-same-time into master Dec 12, 2016
  • Overview 11
  • Commits 8
  • Pipelines 0
  • Changes 2

Created by: n3tr

to fixes #1239 (closed)

Current Scenario

  • create-react-app my-app will invokes create-react-app/index to create app folder, package.json and install react-scripts as devDependencies (--save-dev). (Use latest version if not specific).
  • Use react-scripts to init project and install react and react-dom as dependencies (--save)

New

  • create-react-app/index create app folder, package.json, and install react, react-dom, and react-scripts as a dependencies (--save) at the same time.
  • Since react-scripts should be in devDependencies, we modify the package.json to move it to devDependencies.
  • Use react-scripts to init project and check if there're react and react-dom have been installed yet. If no react and react-dom inside node_modules, install them. (this would happen when user use old CRA to create project and receive the latest version of react-scripts)

This should backward compatible with old version of CRA, in case user use previous version of CRA which won't install react and react-dom along with react-scripts.

Test plans

Both new version

  • Test Scenario: Use new create-react-app with react-scripts
  • Expected result:
    • Install react, react-dom, and react-scripts at the same time (by CRA)

Old CRA + new react-scripts

  • Test Scenario: Use old create-react-app with new react-scripts
  • Expected result:
    • Install react-scripts by CRA then install react and react-dom by react-scripts

New CRA + old version of react-scripts

  • Test Scenario: Use new create-react-app with old react-scripts
  • Expected result:
    • Install react, react-dom, and react-scripts by CRA.
    • And install react and react-dom again by react-scripts.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/n3tr/install-deps-at-same-time