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

[web] Update dependencies (2023-03-02) #449

Merged
merged 11 commits into from
Mar 3, 2023
Merged

Conversation

dgdavid
Copy link
Contributor

@dgdavid dgdavid commented Mar 2, 2023

Problem

A bunch of node packages has released new versions after the latest dependencies update we did in #331

Click to show/hide npm outdated output
Package                                Current        Wanted    Latest  Location                                       Depended by
@babel/core                             7.20.2        7.21.0    7.21.0  node_modules/@babel/core                       web
@material-symbols/svg-400                0.4.2         0.4.6     0.4.6  node_modules/@material-symbols/svg-400         web
@patternfly/patternfly                 4.221.2       4.224.2   4.224.2  node_modules/@patternfly/patternfly            web
@patternfly/react-core                 4.264.0       4.276.6   4.276.6  node_modules/@patternfly/react-core            web
@patternfly/react-table               4.111.45      4.112.39  4.112.39  node_modules/@patternfly/react-table           web
@testing-library/react                  12.1.5        12.1.5    14.0.0  node_modules/@testing-library/react            web
@types/jest                             29.2.3        29.4.0    29.4.0  node_modules/@types/jest                       web
@typescript-eslint/eslint-plugin        5.44.0        5.54.0    5.54.0  node_modules/@typescript-eslint/eslint-plugin  web
@typescript-eslint/parser               5.44.0        5.54.0    5.54.0  node_modules/@typescript-eslint/parser         web
ajv                                     8.11.2        8.12.0    8.12.0  node_modules/ajv                               web
babel-jest                              29.3.1        29.4.3    29.4.3  node_modules/babel-jest                        web
babel-loader                             9.1.0         9.1.2     9.1.2  node_modules/babel-loader                      web
chrome-remote-interface                 0.31.3        0.31.3    0.32.1  node_modules/chrome-remote-interface           web
core-js                                 3.26.1        3.29.0    3.29.0  node_modules/core-js                           web
css-loader                               6.7.2         6.7.3     6.7.3  node_modules/css-loader                        web
eslint                                  8.28.0        8.35.0    8.35.0  node_modules/eslint                            web
eslint-config-standard-react            12.0.0        12.0.0    13.0.0  node_modules/eslint-config-standard-react      web
eslint-plugin-import                    2.26.0        2.27.5    2.27.5  node_modules/eslint-plugin-import              web
eslint-plugin-n                         15.5.1        15.6.1    15.6.1  node_modules/eslint-plugin-n                   web
eslint-plugin-react                    7.31.11        7.32.2    7.32.2  node_modules/eslint-plugin-react               web
eslint-webpack-plugin                    3.2.0         3.2.0     4.0.0  node_modules/eslint-webpack-plugin             web
jest                                    29.3.1        29.4.3    29.4.3  node_modules/jest                              web
jest-environment-jsdom                  29.3.1        29.4.3    29.4.3  node_modules/jest-environment-jsdom            web
jsdoc                                    4.0.0         4.0.2     4.0.2  node_modules/jsdoc                             web
mini-css-extract-plugin                  2.7.0         2.7.2     2.7.2  node_modules/mini-css-extract-plugin           web
po2json                           1.0.0-beta-3  1.0.0-beta-3     0.4.5  node_modules/po2json                           web
qunit                                   2.19.3        2.19.4    2.19.4  node_modules/qunit                             web
react                                   17.0.2        17.0.2    18.2.0  node_modules/react                             web
react-dom                               17.0.2        17.0.2    18.2.0  node_modules/react-dom                         web
react-router-dom                         6.4.3         6.8.2     6.8.2  node_modules/react-router-dom                  web
sass                                    1.56.1        1.58.3    1.58.3  node_modules/sass                              web
sizzle                                   2.3.8        2.3.10    2.3.10  node_modules/sizzle                            web
stylelint                              14.16.1       14.16.1    15.2.0  node_modules/stylelint                         web
stylelint-config-standard-scss           5.0.0         5.0.0     7.0.1  node_modules/stylelint-config-standard-scss    web
stylelint-webpack-plugin                 3.3.0         3.3.0     4.1.0  node_modules/stylelint-webpack-plugin          web
ts-jest                                 29.0.3        29.0.5    29.0.5  node_modules/ts-jest                           web
typedoc                                0.23.21       0.23.26   0.23.26  node_modules/typedoc                           web
typescript                               4.9.3         4.9.5     4.9.5  node_modules/typescript                        web
webpack-cli                              5.0.0         5.0.1     5.0.1  node_modules/webpack-cli                       web

Solution

To update them using the npm update and npm install package-name@latest commands.

Notes

  • The --lockfile-version 2 option has been used with mentioned commands to avoid touching the lockfileVersion in the package-lock.json file. This option was introduced in npm 8.1.0, see the announcement in its changelog.

  • Most of the packages got directly update with npm update --lockfile-version 2

  • The rest of packages were updated manually by running npm install --lockfile-version 2 package-name@latest command

  • Only the po2json has not been changed because looks more like a downgrade than an update (?)

  • This time, the project has been updated to React 18 because the testing-library issue mentioned in [web] Update dependencies #331 has been fixed, see https://github.com/testing-library/react-testing-library/releases/tag/v14.0.0

  • Some tests needed to be fixed: they were mocking useEffect return values to jest.fn()/Promises, making the suite fails with a TypeError: destroy is not a function message.

  • The --skipLibCheck option has been passed to the check-types for not checking types from node_modules. At this moment we are not using types definitions from other packages but getting errors from @patternfly/react-core.

    Click to show/hide errors found by check-types in patternfly/core

    check-types
    tsc

    Error: node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelContent.d.ts(3,18): error TS2430: Interface 'DrawerPanelContentProps' incorrectly extends interface 'HTMLProps'.
    Types of property 'onResize' are incompatible.
    Type '(width: number, id: string) => void' is not assignable to type 'ReactEventHandler'.
    Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(4,35): error TS2304: Cannot find name 'SVGIconProps'.
    Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(5,34): error TS2304: Cannot find name 'SVGIconProps'.
    Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(6,35): error TS2304: Cannot find name 'SVGIconProps'.
    Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(7,32): error TS2304: Cannot find name 'SVGIconProps'.
    Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(8,35): error TS2304: Cannot find name 'SVGIconProps'.
    Error: Process completed with exit code 2.

  • Because of the above, the --skipErroChecking typedoc's option has been added to the npm run jsdoc task

  • This PR has been created on top of add-missing-section branch because it contains more tests and I wanted to have them tested with the update. I'll happily adapt it to master as soon as [web] Move each section to its own page #443 is merged

Testing.

All relevant tasks were executed without problems.

dgdavid added 9 commits March 2, 2023 22:27
Actually via `node update --lockfile-version 2` for not changing the
lockfileVersion.

This option was introduce in npm 8.1.0, see
https://github.com/npm/cli/blob/v8.19.4/CHANGELOG.md#v810-2021-10-14
Most of new test complaint were because we were mocking useEffect return
functions to promises, which is not allowed.
And also fix mixed indentation style in the stylelintrc.json file.

For more info about the Stylelint migration visit
https://stylelint.io/migration-guide/to-15
At this moment we are not using types definitions from other packages but
getting errors from @patternfly/react-core

```
> check-types
> tsc

Error: node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelContent.d.ts(3,18): error TS2430: Interface 'DrawerPanelContentProps' incorrectly extends interface 'HTMLProps<HTMLDivElement>'.
  Types of property 'onResize' are incompatible.
    Type '(width: number, id: string) => void' is not assignable to type 'ReactEventHandler<HTMLDivElement>'.

...
Error: node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts(8,35): error TS2304: Cannot find name 'SVGIconProps'.
```

See https://www.typescriptlang.org/tsconfig#skipLibCheck
@dgdavid dgdavid force-pushed the update-dependencies-20230302 branch from 21ad2a6 to 30e4509 Compare March 2, 2023 22:58
@coveralls
Copy link

Coverage Status

Coverage: 79.394% (-0.04%) from 79.438% when pulling 05502ce on update-dependencies-20230302 into 4755b87 on add-missing-sections.

@imobachgs
Copy link
Contributor

It looks good. We can merge when the #443 is merged.

Base automatically changed from add-missing-sections to master March 3, 2023 11:31
@dgdavid dgdavid marked this pull request as ready for review March 3, 2023 11:32
@dgdavid dgdavid merged commit 05e4674 into master Mar 3, 2023
@dgdavid dgdavid deleted the update-dependencies-20230302 branch March 3, 2023 11:46
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.

3 participants