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

chore(build): upgrade webpack and babel #3482

Closed
wants to merge 3 commits into from

Conversation

jpan-box
Copy link
Contributor

@jpan-box jpan-box commented Jan 3, 2024

WIP - other build failures, see circleci

Upgrade webpack, babel-loader, webpack-cli, and other babel packages
Remove legacy openssl options during build

Purposefully did not remove proposal plugins or unused babel packages - should do in another PR.

To test this PR, make sure you remove node_modules and your existing yarn.lock, and run a fresh yarn install. Direct upgrades caused errors (not just warnings).

There are currently warnings about css ordering, e.g.

WARNING in chunk src_components_datalist-item_index_ts-src_components_date-picker_DatePicker_tsx-src_component-cc5de7 [mini-css-extract-plugin]
Conflicting order. Following module has been added:
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/label/Label.scss
despite it was not able to fulfill desired ordering with these modules:
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/selector-dropdown/SelectorDropdown.scss
   - couldn't fulfill desired order of chunk group(s) activity-sidebar
   - while fulfilling desired order of chunk group(s) metadata-sidebar
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/scroll-wrapper/ScrollWrapper.scss
   - couldn't fulfill desired order of chunk group(s) activity-sidebar
   - while fulfilling desired order of chunk group(s) metadata-sidebar
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/datalist-item/DatalistItem.scss
   - couldn't fulfill desired order of chunk group(s) activity-sidebar
   - while fulfilling desired order of chunk group(s) metadata-sidebar
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/flyout/OverlayHeader.scss
   - couldn't fulfill desired order of chunk group(s) activity-sidebar
   - while fulfilling desired order of chunk group(s) metadata-sidebar
 * css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/flyout/Flyout.scss
   - couldn't fulfill desired order of chunk group(s) activity-sidebar
   - while fulfilling desired order of chunk group(s) metadata-sidebar

These errors began after upgrading webpack, babel, and webpack-cli. In other words, these were not triggered or resolved by the various css loader upgrades. There's an informative thread at facebook/create-react-app#5372 which suggests that we could have ambiguous css imports. However, the root cause is unclear, as is any proof of actual impact.

Upgrade webpack, babel-loader, webpack-cli, and other babel packages
Remove legacy openssl options during build
@jpan-box jpan-box requested review from a team as code owners January 3, 2024 16:51
package.json Outdated
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.10",
"webpack-cli": "^4.9.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This upgrade is required due to receiving the error in webpack/webpack-cli#3005, after upgrading webpack and babel-loader

There are higher versions available, but I decided to use the lowest version which includes the fix to avoid any issues. https://github.com/webpack/webpack-cli/releases/tag/webpack-cli%404.9.1

If we want to upgrade more, I think we should do it in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and updated to latest in this PR

@@ -34,12 +34,6 @@ be.activitySidebarFilter.status.tasks = Tasks
be.add = Add
# Text to display when app is disabled by applied access policy
be.additionalTab.blockedByShieldAccessPolicy = Use of this app is blocked due to a security policy.
# Error message when an annotation deletion fails
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why this file was updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It always seems to be updated whenever I run yarn build. I can leave it out if you'd like, since I don't have a good idea of when we include changes from build vs not. When do we want to include changes vs not?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these types of changes should be included when we delete the reference in the code. You can still see the translation used in the code here

[ERROR_CODE_DELETE_ANNOTATION]: messages.errorDeleteAnnotation,
. It's probably deleted when you do yarn:build because it's in an object 🤷‍♀️ We should probably change it so that it's not deleted when you run yarn:build but in a different PR.

replace proposals
upgrade webpack-cli to latest
@jpan-box jpan-box marked this pull request as draft January 3, 2024 18:10
Pin @types/react to resolve mismatches between different versions
@jpan-box jpan-box closed this Jan 11, 2024
@jpan-box jpan-box deleted the wb-min-only branch January 11, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant