diego3g / electron-typescript-react

:electron: An Electron boilerplate including TypeScript, React, Jest and ESLint.
1.45k stars 295 forks source link

Upgraded boilerplate all package to latest version #90

Open NorthBei opened 2 years ago

NorthBei commented 2 years ago

Descriptio

Upgraded boilerplate to latest version and update some api & config

Change

  1. Updgrade all package to lastest version
  2. Updated react 18 render api, electron-forge config
  3. Change main entry point in pakcage.json

Package upgrade/update

I upgrade all package from current to lastest.

image

and replace eslint-plugin-node with eslint-plugin-n for eslint-config-standard.

Testing

I already try to run these commands to ensure that could work well.

yarn start
image
yarn lint
image
yarn package
image
yarn make
image

and check things going well

image

Issue & Reference

electron-forge

Becasue electron-forge upgarde, we should add devContentSecurityPolicy into forge config, allow electron app load react logo from remote url for this boilerplate.

if you just want to add specific url into whitelist, you could do this:

...
      {
        mainConfig: ...,
        devContentSecurityPolicy: "img-src 'self' https://www.vectorlogo.zone;",
        renderer: { ... },
      },
...

Refs:

React 18

Upgrading react from v17 to v18, should update the render api

image

Refs:

styled-component

Because react and @types/react also upgrade to v18, and styled-component's type package not compatible the lastest version of @types/react, it will leads the createGlobalStyle api error in typescript like below image.

However, it's not affect the app running.

image

eslint-config-standard

Sinece eslint-config-standard v17.0.0, it require eslint-plugin-n instead of eslint-plugin-node.

image

Refs:

System Info

MatanYemini commented 1 year ago

Why don't we merge it?

NorthBei commented 1 year ago

If thers is anything should be modified before merege this PR, feel free to tell me, please.

alanhe421 commented 1 year ago

nice job.