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

Bump PatternFly to latest #1546

Merged
merged 1 commit into from
May 14, 2019

Conversation

rhamilto
Copy link
Member

@rhamilto rhamilto commented May 8, 2019

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 8, 2019
@spadgett
Copy link
Member

spadgett commented May 8, 2019

cc @dtaylor113 @rebeccaalpert

frontend/public/components/nav.jsx Outdated Show resolved Hide resolved
frontend/public/components/nav.jsx Outdated Show resolved Hide resolved
frontend/public/components/nav.jsx Outdated Show resolved Hide resolved
@@ -56,7 +56,6 @@ const config: webpack.Configuration = {
},
{
test: /\.s?css$/,
exclude: /node_modules/,
Copy link
Member

Choose a reason for hiding this comment

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

@priley86 I know you needed this in your tables PR... What impact does this have on our builds?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is required due to react-core change in import methodology. CSS will be loaded directly from node_modules/@patternfly from our JS requires.

I used the quick and easy method in the tables PR, but we should probably be more selective so that directories unexpected are not scanned for CSS. Looks we can do something like:

      {
        test: /\.s?css$/,
        exclude: /node_modules\/(?!(@patternfly)\/).*/,
      }

or

      {
        test: /\.s?css$/,
        exclude: function(modulePath) {
          return /node_modules/.test(modulePath) &&
              !/node_modules\/@patternfly/.test(modulePath);
        },
      }

Webpack does not seem to respect:

      {
        test: /\.s?css$/,
        exclude: /node_modules/,
        include: [/node_modules\/@patternfly/],
      }

source: webpack/webpack#2031 (comment)

cc: @dgutride

Copy link
Member

Choose a reason for hiding this comment

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

@priley86 It looks like this change pulls in a bunch of CSS we don't use and increases our total CSS by 50%

Copy link

Choose a reason for hiding this comment

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

@spadgett - I'd agree with that assessment and this is a perfect use case for our more advanced PatternFly css architecture. For OpenShift, my recommendation would be to investigate use of a null loader (https://webpack.js.org/loaders/null-loader/) for the css require statements that have been introduced by react-core. Since your team is importing the full patternfly css from @ patternfly/patternfly - component specific css can be discarded.

Copy link
Member

Choose a reason for hiding this comment

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

@dgutride we're not importing the full patternfly css... unfortunately null loader just results in a bunch of missing styles :/

Copy link

Choose a reason for hiding this comment

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

The end result is that you have the same amount of CSS but it is managed far more efficiently and you don't have to worry about garbage collection between routes or DOM bloat over time (and caching of css files leads to better efficiency).

Copy link
Member Author

Choose a reason for hiding this comment

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

With @priley86's method, we're still seeing the inclusion of CSS for components we're not using. Is this intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

still seeing the inclusion of CSS for components we're not using

It in fact appears to be all components and utilities. This does not seem desirable.

Copy link
Member Author

@rhamilto rhamilto May 10, 2019

Choose a reason for hiding this comment

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

@priley86 confirmed all of PF4 CSS is pulled in only during dev as treeshaking occurs for prod and only relevant CSS is bundled.

The increase in the dist vendor bundle size is expected as the majority of PF4 CSS is no longer being injected in to head via emotion, but instead is being bundled.

@spadgett, this PR is ready for final review.

Copy link
Contributor

Choose a reason for hiding this comment

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

please inspect webpack production build when checking this pf4 upgrade. there may be additional reductions we can add later.

@rhamilto rhamilto force-pushed the bump-patternfly branch 2 times, most recently from c364428 to 5266b39 Compare May 8, 2019 20:15
@rhamilto
Copy link
Member Author

rhamilto commented May 9, 2019

/retest

@rhamilto rhamilto force-pushed the bump-patternfly branch 2 times, most recently from e8635cb to a7be0ae Compare May 9, 2019 15:00
@spadgett spadgett added this to the v4.2 milestone May 9, 2019
@rhamilto
Copy link
Member Author

/retest

@spadgett spadgett changed the base branch from master-next to master May 13, 2019 22:48
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

Let's go ahead with this change. We can continue looking at webpack builds as follow-on work.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 94e19db into openshift:master May 14, 2019
@rhamilto rhamilto deleted the bump-patternfly branch May 14, 2019 17:12
@priley86 priley86 mentioned this pull request May 16, 2019
89 tasks
@spadgett spadgett added the kind/dependency-change Categorizes issue or PR as related to changing dependencies label Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/dependency-change Categorizes issue or PR as related to changing dependencies lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants