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

fix ts spread props issue #20107

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Conversation

garrettbear
Copy link
Contributor

@garrettbear garrettbear commented Jul 19, 2023

Explanation

TS has not been liking us spreading props and at first it seemed like it was strictly a Box component issue but it appears that we just need to Typecast on the spread props for a component. So if it's built using the Text component, you'll need to use the TextProps for typecasting.

Screenshots/Screencaps

Before

Screenshot 2023-07-20 at 9 05 58 AM

After

Screenshot 2023-07-20 at 9 05 41 AM

Manual Testing Steps

Go to a TS component in the component library and toggle between the before and after:
Before: {...props}
After: {...(props as BoxProps<C>)} make sure BoxProps is imported

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Jul 19, 2023
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #20107 (d277f3d) into develop (6ce80fe) will increase coverage by 0.12%.
The diff coverage is 100.00%.

❗ Current head d277f3d differs from pull request most recent head e4971dd. Consider uploading reports for the commit e4971dd to get more accurate results

@@             Coverage Diff             @@
##           develop   #20107      +/-   ##
===========================================
+ Coverage    69.34%   69.46%   +0.12%     
===========================================
  Files          986      992       +6     
  Lines        37299    37453     +154     
  Branches     10011    10042      +31     
===========================================
+ Hits         25864    26014     +150     
- Misses       11435    11439       +4     
Impacted Files Coverage Δ
ui/components/component-library/text/text.tsx 100.00% <100.00%> (ø)

... and 23 files with indirect coverage changes

@metamaskbot
Copy link
Collaborator

Builds ready [d277f3d]
Page Load Metrics (1815 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1132201572914
domContentLoaded14962220181520799
load14962220181520799
domInteractive14962220181520799
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 4 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@garrettbear garrettbear force-pushed the fix/ts-box-spread-props-issue branch from d277f3d to 3e407b9 Compare July 20, 2023 16:03
@garrettbear garrettbear force-pushed the fix/ts-box-spread-props-issue branch from e6d7a42 to e4971dd Compare July 20, 2023 16:05
@garrettbear garrettbear marked this pull request as ready for review July 20, 2023 16:12
@garrettbear garrettbear requested a review from a team as a code owner July 20, 2023 16:12
@garrettbear garrettbear changed the title fix Box ts spread props issue fix ts spread props issue Jul 20, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [e4971dd]
Page Load Metrics (1541 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint991881292612
domContentLoaded1361173215418943
load1361173215418943
domInteractive1361173215418943
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Excellent work 💯

@georgewrmarshall georgewrmarshall merged commit 26d7520 into develop Jul 20, 2023
10 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/ts-box-spread-props-issue branch July 20, 2023 22:06
@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2023
@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Jul 20, 2023
@Gudahtt Gudahtt added release-11.1.0 Issue or pull request that will be included in release 11.1.0 and removed release-10.36.0 Issue or pull request that will be included in release 10.36.0 labels Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.1.0 Issue or pull request that will be included in release 11.1.0 team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants