-
Notifications
You must be signed in to change notification settings - Fork 134
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
Use direct imports of PF4 components #814
Conversation
Codecov Report
@@ Coverage Diff @@
## master #814 +/- ##
=======================================
Coverage 61.05% 61.05%
=======================================
Files 45 45
Lines 873 873
Branches 169 169
=======================================
Hits 533 533
Misses 277 277
Partials 63 63
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really aweseom! Kudos to you @Hyperkid123 for taking the time to look into this.
@@ -113,7 +114,7 @@ | |||
"@babel/polyfill": "^7.8.7", | |||
"@babel/runtime": "^7.9.6", | |||
"@patternfly/patternfly": "^2.71.5", | |||
"@patternfly/react-core": "^3.153.13", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to use at least version 3.153.7
due to this bug fix patternfly/patternfly-react#3990 I think we can be fine with the extra bundle size for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 ok I will put It back. Hopefully they will fix it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i used the latest version of PF. That added around 0.5MB to the inventory frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's in inventory frontend then it's no big deal.
72179db
to
ca77a3d
Compare
* Update all deps (#795) * Update PF and FEC deps to newest stable versions * Update all other deps to latest stable version * Fix linting errors * update case and split logout (#799) Co-authored-by: Karel Hala <[email protected]> * use a skeleton instead of logging in text (#792) * add en-us to automation platform link (#808) per james bailey on the customer portal side, this addition should resolve the issue with doc link in automation platform going to dead page. Co-authored-by: Ryan Long <[email protected]> * Bump @redhat-cloud-services/frontend-components-inventory (#809) * update sentry and add more apps (#802) * update sentry and add more apps * lint * Use direct imports of PF4 components (#814) * Bump @redhat-cloud-services/frontend-components from 1.0.24 to 1.0.28 (#815) * Add Catalog, Approval and Sources to about modal app list. (#834) * Update inv package to newest version 33 (#835) * Fix highlight of duplicate sub-nav items (#836) * Fix highlight of duplicate sub-nav items * Add parentId verification to highlight condition * Add appNavClick - parentId param to docs Co-authored-by: Ryan Long <[email protected]> Co-authored-by: Chris Budzilowicz <[email protected]> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Martin Maroši <[email protected]> Co-authored-by: Filip Hlavac <[email protected]>
This changes how we are importing PF components to improve the build size of JS chunks
I have also locked the PF version to
3.141.4
due to a bug withing the pagination component which causes an additional 0.5MB of react-tokens assets to be bundled with the component and it was not fixed yet. (issue here: patternfly/patternfly-react#4184). We could ever that I have not found any critical piece of code in the newer version that would affect these bundles.I have tried and use babel transform plugin to do this import transformation while building, but parcel does not support
babel.config.js
files, because PF requires some fs searching to actually find correct files and that cannot be done in.babelrd
orbabel.json
:(There is an eslint plugin from PF that checks the imports, but as I tried to add it to this project it completely messed up the linter and I did not want to change every single file in order to fix this issue (plugin: https://github.com/patternfly/patternfly-react/tree/master/packages/eslint-plugin-patternfly-react).
Before (only including the JS and CSS files because its relevant don't care about map files and images)
After
cc @karelhala @ryelo