FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(pf4): Use absolute import paths for react core in pf4 packages. by Hyperkid123 · Pull Request #3525 · patternfly/patternfly-react · GitHub

feat(pf4): Use absolute import paths for react core in pf4 packages. - #3525

Merged
evwilkin merged 2 commits into
patternfly:masterfrom
Hyperkid123:use-absolute-imports-pf4
Jan 24, 2020
Merged

feat(pf4): Use absolute import paths for react core in pf4 packages.#3525
evwilkin merged 2 commits into
patternfly:masterfrom
Hyperkid123:use-absolute-imports-pf4

Conversation

Copy link
Copy Markdown
Contributor

What: towards #3155

Hyperkid123 force-pushed the use-absolute-imports-pf4 branch 2 times, most recently from 65c964d to 40a676e Compare January 17, 2020 12:32
Hyperkid123 changed the title feat(pf4): Use absolute import paths for react core in pf4 packages. [WIP] feat(pf4): Use absolute import paths for react core in pf4 packages. Jan 17, 2020
Hyperkid123 force-pushed the use-absolute-imports-pf4 branch from 40a676e to 4d39c02 Compare January 17, 2020 13:15
Hyperkid123 requested a review from redallen January 17, 2020 13:31

Copy link
Copy Markdown
Contributor Author

@redallen everything looks good except with build of react-topology/TopologyControlBar and react-topology/TopologySideBar components.

Typescript props checking is getting crazy and throwing this error:

error TS2741: Property 'css' is missing in type '{ children: (string | number | boolean | {} | ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)> | ReactNodeArray | ReactPortal | Element)[]; ... 5 more ...; variant: "tertiary"; }' but required in type 'Pick<ButtonProps & InjectedOuiaProps, "className" | "children" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | ... 360 more ... | "icon"> 

Adding the css prop to the Button component fixes that, but that is obviously not the solution to the issue. Apparently this is caused by emotion and how it applies the styles to components.

Both components have css imports in the file but removing them has no effect.

I was looking for some solutions online but without luck. They mostly recommend updating emotion ^10.x, but that is a very invasive change.

Have you ever encounter this issue?

Hyperkid123 force-pushed the use-absolute-imports-pf4 branch from 4d39c02 to c2bcaa9 Compare January 23, 2020 09:02
Hyperkid123 changed the title [WIP] feat(pf4): Use absolute import paths for react core in pf4 packages. feat(pf4): Use absolute import paths for react core in pf4 packages. Jan 23, 2020
Hyperkid123 force-pushed the use-absolute-imports-pf4 branch from c2bcaa9 to b62e743 Compare January 23, 2020 09:11

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-3525.surge.sh

codecov-io commented Jan 23, 2020
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #3525 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3525      +/-   ##
==========================================
+ Coverage   67.11%   67.11%   +<.01%     
==========================================
  Files         903      903              
  Lines       25502    25515      +13     
  Branches     2262     2262              
==========================================
+ Hits        17115    17125      +10     
- Misses       7346     7349       +3     
  Partials     1041     1041
Flag Coverage Δ
#misc 95.45% <ø> (ø) ⬆️
#patternfly3 69.29% <ø> (ø) ⬆️
#patternfly4 64.22% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
...on/src/components/TableTextInput/TableTextInput.js 100% <ø> (ø) ⬆️
...ension/src/components/CancelButton/CancelButton.js 100% <ø> (ø) ⬆️
...sion/src/components/ConfirmButton/ConfirmButton.js 100% <ø> (ø) ⬆️
...tension/src/components/CatalogTile/CatalogTile.tsx 91.07% <100%> (+0.87%) ⬆️
...rc/components/PropertiesSidePanel/PropertyItem.tsx 90.9% <100%> (ø) ⬆️
...eact-table/src/components/Table/CollapseColumn.tsx 92.85% <100%> (ø) ⬆️
...rnfly-4/react-table/src/components/Table/Table.tsx 91.35% <100%> (+0.1%) ⬆️
...mponents/Table/utils/decorators/compoundExpand.tsx 93.33% <100%> (ø) ⬆️
...react-table/src/components/Table/ActionsColumn.tsx 79.31% <100%> (+3.31%) ⬆️
...ology/src/components/TopologyView/TopologyView.tsx 95% <100%> (+0.26%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 327402f...b62e743. Read the comment docs.

Copy link
Copy Markdown
Contributor Author

@redallen @evwilkin I've reverted the changes in components that caused the TS issues. This only affects the topology package. I went through the dist files and there are no imports from react-core with the exception of the topology component.

evwilkin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

evwilkin merged commit 65d0b3d into patternfly:master Jan 24, 2020
evwilkin added a commit that referenced this pull request Jan 24, 2020
Hyperkid123 deleted the use-absolute-imports-pf4 branch January 24, 2020 15:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL