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

Upgrade to Webpack 5 #584

Open
28 of 31 tasks
BSFishy opened this issue Mar 9, 2023 · 2 comments
Open
28 of 31 tasks

Upgrade to Webpack 5 #584

BSFishy opened this issue Mar 9, 2023 · 2 comments
Labels

Comments

@BSFishy
Copy link
Contributor

BSFishy commented Mar 9, 2023

Webpack v4 is old and outdated and should be upgraded to Webpack v5. Mend already raised a PR (#545) to do this, however that PR simply upgrades the package number and doesn't actually do any migration work. It's possible that migration isn't extremely necessary, however it would be good to make sure we're not using anything that's deprecated.

This issue will be somewhat a copy of the content on Webpack's migration guide with added context for some steps and with some steps removed that have already been done: https://webpack.js.org/migrate/5/

This migration should take place after #578 is merged.

When performing this migration, please make a draft PR and put each top-level step in a separate commit. This will make it easier to see what's going on while the migration is happening, catch any mistakes during the process, and diagnose issues if they arrise.

Steps:

  • Upgrade webpack-cli to ^5.0.1 in package.json and run a yarn install
  • Update plugins and loaders to their latest versions
    • Upgrade babel-loader to ^9.1.2
    • Upgrade style-loader to ^3.3.1
    • Upgrade css-loader to ^6.7.3
    • Upgrade postcss-loader to ^7.0.2
    • Upgrade sass-loader to ^13.2.0
    • Upgrade file-loader to ^6.2.0
    • Upgrade url-loader to ^4.1.1
    • Upgrade html-webpack-plugin to ^5.5.0
    • Upgrade circular-dependency-plugin to ^5.2.2
    • Upgrade terser-webpack-plugin to ^5.3.7
    • Upgrade fork-ts-checker-webpack-plugin to ^8.0.0
  • Run yarn install then both yarn build and yarn build-docs to make sure there are no build warnings or errors
    • If there are warnings or errors in this step, consult help here
  • Change Webpack configuration option optimization.noEmitOnErrors: true to optimization.emitOnErrors: false in src/webpack.config.js
  • Set the following Webpack config options in both Webpack configs (src/webpack.config.js and src-docs/webpack.config.js):
    • node.Buffer: false
    • node.process: false
  • Run yarn build and yarn build-docs again to see if there are any errors
    • If there are warnings or errors in this step, consult help here
  • Remove the Webpack config options from the previous step (node.Buffer and node.process)
  • Upgrade webpack to ^5.76.0 and run yarn install
  • Clean up configuration
    • Replace node.fs: 'empty' with resolve.fallback.fs: false in src-docs/webpack.config.js
    • Change [hash] to [contenthash] in src-docs/webpack.config.js
    • Follow up: replace url-loader and file-loader with Webpack asset loaders
  • Run the following commands again to see if there are any errors
    • yarn build
    • yarn build-docs
    • yarn start
    • yarn test-unit
    • yarn lint
    • If there are warnings or errors in this step, consult help here

If the builds succeeded in the last step, the migration is complete! Mark the PR as ready for review.

@BSFishy
Copy link
Contributor Author

BSFishy commented Apr 27, 2023

This issue is currently at a stand-still and I don't have the bandwidth to finish it. The checklist above is up to date on the work that has been done in #587. For anyone who wants to pick this up: currently, the only thing left is fixing an error when running yarn start or yarn build-docs. Webpack can't seem to find a specific file for some reason. I have no clue why but it might have something to do with a Babel transformation or some sort of dead code elimination, or something related. Once that is figured out, this can be merged.

To pick this up, I recommend adding AbhishekReddy1127/oui as a remote, pulling Upgrade-webpack and pushing it to your own fork to maintain Git history. From there, you should be able to create a new PR as you normally would.

@joshuarrrr
Copy link
Member

@andreymyssak @SergeyMyssak Any interest in picking this up? I know you have some other issues you're working on, so it's no problem if not.

@BSFishy BSFishy mentioned this issue May 18, 2023
6 tasks
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 20, 2023
Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 20, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 20, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 21, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 21, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 21, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 29, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue May 30, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
joshuarrrr pushed a commit that referenced this issue Jun 14, 2023
Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
AMoo-Miki pushed a commit to AMoo-Miki/oui that referenced this issue Jul 2, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Jul 13, 2023
Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
AMoo-Miki added a commit that referenced this issue Jul 15, 2023
* Remove beta badge accent color (#99)

Signed-off-by: Matt Provost <[email protected]>

Signed-off-by: Matt Provost <[email protected]>

* OUI combo box refine (#183)

* Added a prop clearOnBlur

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Added example for prop clearOnBlur

Signed-off-by: AbhishekReddy1127 <[email protected]>

---------

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Update Comment List Docs (#252)

Signed-off-by: Matt Provost <[email protected]>

* Updated the section Collapsable Nav (#330)

Signed-off-by: AbhishekReddy1127 <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>

* Updated the kibana to opensearch_dashboards (#343)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Updated the section drag and drop (#514)

Signed-off-by: AbhishekReddy1127 <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>

* Update @svgr/core and @svgr/plugin-svgo (#594) (#649)

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* Migrate from faker to @faker-js/faker (#594) (#655)

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* Bump @faker-js/faker to v8 (#594) (#768)

Signed-off-by: Andrey Myssak <[email protected]>

* change beta to experimental (#383)

Signed-off-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>

* Normalize interlink URL usage (#698) (#720)

Signed-off-by: Sergey Myssak <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>

* [CCI] Add `useDeprecatedPropWarning` and align with `deprecated` hoc (#762)

* Add useDeprecatedPropWarning and align with deprecated hoc (#761)

Co-authored-by: Andrey Myssak <[email protected]>
Signed-off-by: Sergey Myssak <[email protected]>

* Add multiple props to useDeprecatedPropWarning and pass getMessage to deprecatedComponentWarning (#761)

Co-authored-by: Andrey Myssak <[email protected]>
Signed-off-by: Sergey Myssak <[email protected]>

* Use ExclusiveUnion in interfaces (#761)

Co-authored-by: Andrey Myssak <[email protected]>
Signed-off-by: Sergey Myssak <[email protected]>

---------

Signed-off-by: Sergey Myssak <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>

* Update the default branch (#584) (#798)

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* [OuiComboBox] Add docs for icon and revise example for clearOnBlur (#806)

Signed-off-by: Miki <[email protected]>

* Updated bug issue template (#764)

* Update bug issue template

Signed-off-by: Sirazh Gabdullin <[email protected]>

* Add spacing

Signed-off-by: Sirazh Gabdullin <[email protected]>

---------

Signed-off-by: Sirazh Gabdullin <[email protected]>

* Move OuiBottomBar default inline styles to the CSS file (#693) (#694)

Signed-off-by: Sergey Myssak <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>

* [CCI] Update react-window and react-virtualized-auto-sizer dependencies (#652)

* Update react-window (#594)
* Update react-virtualized-auto-sizer (#594)

Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>

---------

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* Update dropzone (#594) (#651)

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* Updated the section Beta badge (#338)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Add props and examples for the combobox (#660)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Updated the links in the section Markdown Format (#365)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Update Notification event page (#549)

Signed-off-by: manasvinibs <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>

* Updated the content in the section Messages and loading (#350)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Updated the content in the section suggest (#347)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Update affiliation of Andrey and Sergey (#794)

Signed-off-by: Matt Provost <[email protected]>

* [CCI] Update dependencies (#716)

* Update dependencies (#594)

Co-authored-by: Sergey Myssak <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>

* Bump @axe-core/puppeteer to v4.6.1 and puppeteer to v19.11.1

Signed-off-by: Andrey Myssak <[email protected]>

* Bump react-window, tabbable and rimraf patch versions

Signed-off-by: Andrey Myssak <[email protected]>

* Bump @svgr/core, @svgr/plugin-svgo and @svgr/plugin-jsx to v8

Signed-off-by: Andrey Myssak <[email protected]>

---------

Signed-off-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>

* Replace @elastic/datemath with @opensearch/datemath (#204)

* Replace @elastic/datemath with @opensearch/datemath

Signed-off-by: Matt Provost <[email protected]>

* Clean up

Signed-off-by: Matt Provost <[email protected]>

---------

Signed-off-by: Matt Provost <[email protected]>

* Bump semver to 7.5.3 (#855)

* Bump semver to 7.5.3

Signed-off-by: Matt Provost <[email protected]>

* Add resolution to eslint plugin

Signed-off-by: Matt Provost <[email protected]>

---------

Signed-off-by: Matt Provost <[email protected]>

* Remove Split button from OUI docs (#805) (#812)

Signed-off-by: Sergey Myssak <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>

* Updated the text in the section ErrorBoundary (#366)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Docs site changes (#96)

* first change

Signed-off-by: Kroosh Crusius <[email protected]>

* undoing first change

Signed-off-by: Kroosh Crusius <[email protected]>

* making a sample change to test commit success or failure

Signed-off-by: Kroosh Crusius <[email protected]>

* undoes sample change for testing

Signed-off-by: Kroosh Crusius <[email protected]>

* minor changes for tone, deleted references to starter projects as they are not maintained by OSD

Signed-off-by: Kroosh Crusius <[email protected]>

* Delete OUI.iml

Removing as included accidentally.

* Delete oui.iml

Removing as included accidentally.

* Update getting_started.md

Updated link to node version manager to avoid redirect

---------

Signed-off-by: Kroosh Crusius <[email protected]>

* Update getting_started.md to remove elastic reference and other changes (#502)

Signed-off-by: manasvinibs <[email protected]>

* Removed GitHub column from all the tables (#371)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Updated the content and Icons in the section CssUtilityClasses (#368)

Signed-off-by: AbhishekReddy1127 <[email protected]>

* Delete Kibana reference in commands (#535)

* Delete kibana reference in commands

Signed-off-by: abbyhu2000 <[email protected]>

* Change the tgz naming to opensearch

Signed-off-by: abbyhu2000 <[email protected]>

* Updated doc site link and github reference

Signed-off-by: abbyhu2000 <[email protected]>

* Change URL to only include domain

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>

* fixed invalid link in FAQ.md (#751)

Signed-off-by: Aigerim Suleimenova <[email protected]>

---------

Signed-off-by: Matt Provost <[email protected]>
Signed-off-by: AbhishekReddy1127 <[email protected]>
Signed-off-by: Andrey Myssak <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Sergey Myssak <[email protected]>
Signed-off-by: Miki <[email protected]>
Signed-off-by: Sirazh Gabdullin <[email protected]>
Signed-off-by: manasvinibs <[email protected]>
Signed-off-by: Kroosh Crusius <[email protected]>
Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: Aigerim Suleimenova <[email protected]>
Co-authored-by: Matt Provost <[email protected]>
Co-authored-by: Abhishek Reddy <[email protected]>
Co-authored-by: Sean Neumann <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>
Co-authored-by: Sergey Myssak <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Andrey Myssak <[email protected]>
Co-authored-by: Sirazh Gabdullin <[email protected]>
Co-authored-by: Manasvini B Suryanarayana <[email protected]>
Co-authored-by: Kroosh <[email protected]>
Co-authored-by: Qingyang(Abby) Hu <[email protected]>
Co-authored-by: Aigerim Suleimenova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants