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

update node to latest LTS & other packages #919

Merged
merged 16 commits into from
Aug 30, 2023

Conversation

huss
Copy link
Member

@huss huss commented May 24, 2023

Description

Another housekeeping PR that updates node and npm.

Thanks to @spearec for doing the work to figure out how to get rid of a number of issues and upgrade other packages. A substantial part of the work in this PR is due to @spearec. This upgraded React/Redux packages and TypeScript along with needed code changes.

Updated eslint packages for new TypeScript version.

Workaround for GitHub actions issue with git permissions so checks/tests can run.

Fixes #990.

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request

Limitations

Developers will need to delete the web container/image to see this change.

Ignores TS errors for some older, non-hook components but they should go away soon.

@spearec
Copy link
Contributor

spearec commented May 31, 2023

Trying to build this gives me a build fail. I think the only reason the git build is passing is that, as per the comment, the git workflow in build.yml was not updated.

Error from npm:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @formatjs/intl@1.17.0
npm ERR! Found: typescript@4.4.4
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"~4.4.4" from the root project
npm ERR!   peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" from tsutils@3.21.0
npm ERR!   node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils
npm ERR!     tsutils@"^3.21.0" from @typescript-eslint/eslint-plugin@5.10.0
npm ERR!     node_modules/@typescript-eslint/eslint-plugin
npm ERR!       dev @typescript-eslint/eslint-plugin@"~5.10.0" from the root project
npm ERR!   5 more (tsutils, tsutils, react-intl, @formatjs/intl, ts-loader)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^4.5" from @formatjs/intl@1.17.0
npm ERR! node_modules/@formatjs/intl
npm ERR!   @formatjs/intl@"~1.17.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: typescript@4.9.5
npm ERR! node_modules/typescript
npm ERR!   peerOptional typescript@"^4.5" from @formatjs/intl@1.17.0
npm ERR!   node_modules/@formatjs/intl
npm ERR!     @formatjs/intl@"~1.17.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /root/.npm/_logs/2023-05-31T13_21_05_144Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-05-31T13_21_05_144Z-debug-0.log

Deleting the OED container and trying to rebuild also failed, so I think that just changing the node dependency breaks quite a bit.

@huss
Copy link
Member Author

huss commented May 31, 2023

Hi @spearec. Did you delete both the container and the image? If I recall correctly, you will see the build create the new node version after that. I realize now that my comment in the limitation was not completely clear. Let me know and I'll look into this if needed.

- bumps typescript, react, react-dom, react-intl, react-redux, react-select, and their types files to the latest version
- as far as I can tell I've also fixed any breaking migration issues
@spearec
Copy link
Contributor

spearec commented Aug 10, 2023

I believe I have properly installed Node LTS on my fork. The issue seemed to be related to having outdated react and typescript packages, causing conflicting dependencies.
https://github.com/spearec/OED/tree/react_18

spearec and others added 4 commits August 10, 2023 12:17
- react-notification system has not been update in 3 years and does not support react 18
- react-toastify is a much newer and simpler package
- notifications state has been removed, as toastify comes with a system for dispatching notifications
huss added 10 commits August 25, 2023 12:10
The non-hook react code is causing errors in some plotly container
inclusions for missing values. These are suppressed for now.
- upgrade eslint and eslint-plugin-jsdoc to latest (minor update)
- update @typescript-eslint/eslint-plugin to latest (major update)
- add @types/node as devDependencies which upgraded most uses to latest
(major update)
- minor update to node version to match OED one
- patch for git directory ownership issue
@huss huss changed the title update node to latest LTS update node to latest LTS & other packages Aug 27, 2023
@huss
Copy link
Member Author

huss commented Aug 30, 2023

@spearec was able to install but did see an issue with permissions in VSC. If anyone else sees this then please let us know. This is now ready to merge.

@huss huss merged commit 6f84b07 into OpenEnergyDashboard:development Aug 30, 2023
3 checks passed
@huss huss deleted the nodeV1 branch September 1, 2023 15:47
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

Successfully merging this pull request may close these issues.

Cannot find type definition file for 'redux'
2 participants