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

Webpack 5 upgrade #153

Closed
ntarocco opened this issue Nov 1, 2022 · 3 comments
Closed

Webpack 5 upgrade #153

ntarocco opened this issue Nov 1, 2022 · 3 comments
Assignees

Comments

@ntarocco
Copy link
Contributor

ntarocco commented Nov 1, 2022

Necessary to safely use Node.js v18

PRs

  1. upgrade to webpack 5 #152
  2. webpack: upgrade deps invenio-previewer#166
  3. wip: change webpack cmds after upgrade invenio-cli#331

Current output with these 3 PRs:

WARNING in ./js/invenio_app_rdm/user_dashboard/requests.js 414:32-56
export 'RequestCancelButtonModal' (imported as 'RequestCancelButtonModal') was not found in '@js/invenio_requests/components/Buttons' (possible exports: CancelButton, RequestAcceptButton, RequestCancelButton, RequestDeclineButton, SaveButton)

WARNING in ./js/invenio_communities/requests/index.js 117:32-56
export 'RequestCancelButtonModal' (imported as 'RequestCancelButtonModal') was not found in '@js/invenio_requests/components/Buttons' (possible exports: CancelButton, RequestAcceptButton, RequestCancelButton, RequestDeclineButton, SaveButton)

WARNING in ./node_modules/semantic-ui-less/semantic.less (./node_modules/semantic-ui-less/semantic.less.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./node_modules/semantic-ui-less/semantic.less)
Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "less/site/globals/site.variables"
 @ ./node_modules/semantic-ui-less/semantic.less
 @ ./js/invenio_theme/theme.js 13:0-40

webpack 5.74.0 compiled with 3 warnings in 63745 ms

The arg --unsafe has been removed from the webpack install cmd. This also allows to use directly webpack buildall instead of the 3 separate cmds create, install, build.

To test

  1. invenio-cli assets build fails for me. Running manually npm i and
    It looks like that the npm prefix is not correct and the build fails because node-pre-gyp is not searched/found in .../var/instane/assets/node_modules/.bin/
  2. linking and having a JS module with watcher and autorebuild
  3. all files previewer available in https://github.com/inveniosoftware/invenio-previewer
  4. verify the chunks that should be part of the output, to optimize and decrease each dist js file.

To check

  1. Fix clean-webpack-plugin #137
  2. less-loader: latest version breaks alias resolution #130
@utnapischtim
Copy link
Contributor

Following PR's would upgrade all javascript dependencies:

PR's

inveniosoftware/invenio-app-rdm#1958
#154
inveniosoftware/invenio-communities#833
inveniosoftware/invenio-rdm-records#1124
inveniosoftware/invenio-requests#296
inveniosoftware/invenio-theme#339
inveniosoftware/react-invenio-deposit#592
inveniosoftware/react-invenio-forms#171
inveniosoftware/react-searchkit#239
indico/react-overridable#18

NOTES:

  • webpack: upgrade deps invenio-previewer#166 is also necessary.

  • Those PR's are mainly updating ckeditor to version >=35 (previous v16), axios to version >=1 (previous v0.23), react to version >= 18 (previous v16), i18next to version >= 22.

  • this fixes the node-pre-gyp problem.

  • to test the PR's the react packages have to be installed by a package. linking was possible to build the js-files, but using the javascript files within the browser produces a error. (ckeditor would be imported twice)

Open Problems

  • linking and having a JS module with watcher and autorebuild
  • all files previewer available in https://github.com/inveniosoftware/invenio-previewer
  • ververify the chunks that should be part of the output, to optimize and decrease each dist js file.ify the chunks that should be part of the output, to optimize and decrease each dist js file.
  • some javascript code has to be updated due to react upgrade.

@ThiefMaster
Copy link

@utnapischtim At least regarding indico/react-overridable#18 we won't merge a PR that breaks the testing infrastructure and REQUIRES react 18+ (indico still uses react 17). If you update the PR to simply loosen the react peer dependency to include newer versions we're fine with it though.

@utnapischtim
Copy link
Contributor

closed by #152

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

3 participants