Electron with React - update packages


#1

Hello, I found this boilerplate of Electron with React from GitHub Universe 2016. So as you can see it is 2 years old. But I love Electron and React, so I want to use it and it works.

But packages are outdated, so I wonder if there is anybody who could check it and update it to latest packages, or ideally teach me how to do it. I know that I have to open package.json file and change versions of packages, but how can I know which packages are compatible between each other?

Boilerplate: https://github.com/mnquintana/electron-compile-universe

Sorry if it is wrong forum.


#2

There’s really not much to that project. I strongly doubt that any of the small amount of JS in those files will have been broken by the standard process of React updating. To update packages in an NPM project on your computer, you can use npm update.


#3

I run npm update and nothing happens.


#4

And what versions of the packages are installed?


#5

Same as on https://github.com/mnquintana/electron-compile-universe/blob/master/package.json

Interesting thing is that in package.json file is not electron package.


#6

I can see that GitHub repo. What I can’t see is what’s on your computer. What versions of the packages do you have installed?

The developer likely has electron installed globally.


#7

How can I check versions of that packages?

My package.json contains:

{
  "name": "electron-compile-universe",
  "version": "1.0.0",
  "description": "Bare-bones project to demonstrate the powers of electron-compile at GitHub Universe 2016",
  "main": "src/app.js",
  "author": "Machisté N. Quintana <mnquintana@users.noreply.github.com",
  "license": "MIT",
  "dependencies": {
    "react": "^15.1.0",
    "react-dom": "^15.1.0"
  },
  "private": true,
  "scripts": {
    "start": "electron ."
  },
  "devDependencies": {
    "babel-preset-es2016-node5": "^1.1.2",
    "babel-preset-react": "^6.5.0",
    "electron-prebuilt-compile": "^1.1.3"
  }
}

#8

The easiest way to look at your NPM packages is through the CLI.

$ npm ls --depth=0

which should return something like this:

electron-compile-universe@1.0.0 D:\github\electron-compile-universe
+-- babel-preset-es2016-node5@1.1.2
+-- babel-preset-react@6.24.1
+-- electron-prebuilt-compile@1.8.4
+-- react@15.6.2
`-- react-dom@15.6.2

You can jump to the next major version using npm install as normal, specifying the version number. In this case, npm install react@16 react-dom@16.


#9

This si result:

F:\Documents\electron\electron-react>npm ls --depth=0
electron-compile-universe@1.0.0 F:\Documents\electron\electron-react
+-- babel-preset-es2016-node5@1.1.2
+-- babel-preset-react@6.24.1
+-- electron-prebuilt-compile@1.8.4
+-- react@15.6.2
`-- react-dom@15.6.2

Thank you for command for updating, but how can I know if it doesn’t break something, for example babel-preset-react don’t have to support new version of react.


#10

You should see see an error. If not, then the display will be messed up. It probably won’t break anything.

for example babel-preset-react don’t have to support new version of react.

You already have the latest version of babel-preset-react. Since the package.json calls for ^6.5.0, NPM freely updates to 6.24.1 because there’s no major version change.


#11

Thank you and last question, is there any command which takes all packages listed in package.json and updates them to latest stable version?


#12

I don’t see one.


#13

One more question, how can I know what does package electron-prebuilt-compile do?


#14

You can read its documentation.