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.base: update for new frontend component config - bundlePfModules and htmlPlugin.inject #1342

Merged
merged 4 commits into from
Dec 15, 2021

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Dec 7, 2021

Replaces #1188

As of @redhat-cloud-services/frontend-components-config 4.5.0+, patternfly is removed from the build so as not to clash with other patternfly versions in cloud.
This is not desirable for standalone/standalone-keycloak => disabling for non-insights builds.
But the option only affects config.resolve.alias, which we override in webpack-ts-overrides.js.
So merging the overrides together with base so we can merge the config properly and get both sets of aliases.

As of @redhat-cloud-services/frontend-components-config 4.5.4+, HtmlWebpackPlugin is configured to not inject js & css to html by default.
This is not desirable for standalone/standalone-keycloak => setting inject to true for non-insights builds.

Also added a couple of FIXME comments with things we may want to resolve for cloud config, while things still work without it :)

Cc @ZitaNemeckova , we may want to consider merging with #920. (Or #1373.)

@himdel himdel added backport-4.3 This PR should be backported to stable-4.3 (2.0) backport-4.4 This PR should be backported to stable-4.4 (2.1) dependencies Pull requests that update a dependency file labels Dec 7, 2021
@himdel
Copy link
Collaborator Author

himdel commented Dec 7, 2021

backports

4.4: via #1367
4.3: set to 2.x only for now via #615, but we've since updated webpack to 5 in 4.3 so we could
4.2: no, newer versions need newer webpack, #776

@himdel himdel removed the backport-4.3 This PR should be backported to stable-4.3 (2.0) label Dec 7, 2021
config/webpack.base.config.js Outdated Show resolved Hide resolved
…les and htmlPlugin.inject

Replaces ansible#1188

As of `@redhat-cloud-services/frontend-components-config` 4.5.0+, patternfly is removed from the build so as not to clash with other patternfly versions in cloud.
This is not desirable for standalone/standalone-keycloak => disabling for non-insights builds.
But the option only affects `config.resolve.alias`, which we override in `webpack-ts-overrides.js`.
So merging the overrides together with base so we can merge the config properly and get both sets of aliases.

As of `@redhat-cloud-services/frontend-components-config` 4.5.4+, htmlPlugin is configured to not inject js & css to html by default.
This is not desirable for standalone/standalone-keycloak => setting inject:true for non-insights builds.
between `@redhat-cloud-services/frontend-components-config` 4.5.6 and 4.5.8, the js output filename changed from `js/App.(hash).js` to `js/App.(timestamp).(hash).js`

that breaks BUILD_HASH, setting it to the timestamp, but expecting the timestamp to be the whole string .. and failing

fixing to set BUILD_HASH to both timestamp and hash
@himdel
Copy link
Collaborator Author

himdel commented Dec 15, 2021

Ah, this only passed cypress before updating from 4.5.6 to 4.5.8 :)...
the difference is harmless, App.(hash).js becomes App.(timestamp).(hash).js but fails the curl check .. and I failed to recognize the error and assumed cypress failed downloading :).

So...

  • updated the cypress task to give these checks individual steps, and output more info there (expected vs reality; example)
  • fixed BUILD_HASH parsing to read both timestamp and hash

It should go green this time @ZitaNemeckova :)

Copy link
Member

@ZitaNemeckova ZitaNemeckova left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@himdel himdel removed the backport-4.4 This PR should be backported to stable-4.4 (2.1) label Dec 15, 2021
@himdel himdel merged commit 9ff0b92 into ansible:master Dec 15, 2021
@himdel himdel deleted the f-c-c-456 branch December 15, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants