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

Different package.json files #10

Closed
TheoMer opened this issue Jul 27, 2016 · 6 comments
Closed

Different package.json files #10

TheoMer opened this issue Jul 27, 2016 · 6 comments

Comments

@TheoMer
Copy link
Contributor

TheoMer commented Jul 27, 2016

Ok, so I've just seen the new package.json (Fix #9 - https://github.com/kriasoft/react-app/blob/master/package.json ), but this differs from the package.json file as described in the features section (https://github.com/kriasoft/react-app/blob/master/template/package.json).

Why the difference? Isn't package.json described in the features section the correct package file, as it has the app-tools dev dependency?:

"devDependencies": { "react-app-tools": "^0.2.0"

@koistya
Copy link
Member

koistya commented Jul 27, 2016

Just to clarify, what's the difference between react-app and react-app-tools packages:

  • react-app - CLI tool and templates for scaffolding a new React project (install globally)
  • react-app-tools - a bunch of build/run configurations (Webpack, PostCSS, Browsersync, HMR etc.)

The react-app-tools is going to be updated more often. If there is a minor version difference such as react-app-tools v0.2.0 vs v0.2.1, it means that there are no any breaking changes or major improvements. All the major version changes are going to be documented, so you could get an idea by looking at the changelog what's actually changed, what benefits you get and whether you need to change any of your React components to comply with the changes.

It's sort of like JSX code that you can use for the most part as it is for the last 2 years, but the underlying React engine that runs your app has undergone lots of great improvements. You just pull the new React version and automatically gain all the benefits it brings to the table without refactoring your JSX code much. Same with react-app-tools, over time it will bring more cool stuff into your project, which hopefully won't force you to refactor any of the source code of your React app.

Pro tip: you can use npm-check-updates npm module for checking if all the dependencies in your project are up to date:

$ npm install -g npm-check-updates@latest
$ ncu           # shows which dependencies are outdated
$ ncu -a        # updates all the dependencies in package.json to the latest versions
$ npm install   # installs outdated/missing npm packages based on package.json

@TheoMer
Copy link
Contributor Author

TheoMer commented Jul 27, 2016

@koistya Thanks for the update. My confusion stems from:

  1. ☝️ July 23, 2016 2:11 AM

Here, on gitter, instructions were given to install react-app-tools as follows:


> react-app new
> react-app start```

but when I go to `https://www.npmjs.com/package/react-app-tools` instructions are given to:

```> npm install -g react-app

> react-app new
> react-app start```

So, if the correct instructions, as described on the npm page, to installing react-app-tools is `npm install -g react-app`, what exactly is `npm install -g react-app-tools`? Or should `npm install -g react-app-tools` be ignored as it is part of the install process of `npm install -g react-app`?

@koistya
Copy link
Member

koistya commented Jul 27, 2016

@TheoMer, npm install -g react-app-tools was in the initial version (it contained both build configs and CLI tools), which later was changed to npm install -g react-app (only CLI tools). Only CLI tools need to be installed globally.

@TheoMer
Copy link
Contributor Author

TheoMer commented Jul 27, 2016

Ok, understood.

react-static-boilerplate, via run.js,. allowed for project deployment to firebase, whose functionality is missing from react-app:

const config = {
title: 'React Static Boilerplate', // Your website title
url: 'https://rsb.kriasoft.com', // Your website URL
project: 'react-static-boilerplate', // Firebase project. See README.md -> How to Deploy
trackingID: 'UA-XXXXX-Y', // Google Analytics Site's ID
};

Can you port this over to react-app as well?

@koistya
Copy link
Member

koistya commented Jul 27, 2016

Yep, sure, will do.

@TheoMer
Copy link
Contributor Author

TheoMer commented Jul 27, 2016

Excellent.

@koistya koistya closed this as completed Feb 18, 2018
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

No branches or pull requests

2 participants