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

Add missing prop types #1761

Merged
merged 7 commits into from
May 11, 2020
Merged

Add missing prop types #1761

merged 7 commits into from
May 11, 2020

Conversation

dmtrKovalenko
Copy link
Member

This PR closes #1750

@vercel
Copy link

vercel bot commented May 9, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mui-org/material-ui-pickers/ab57z1k72
✅ Preview: https://material-ui-pickers-git-feature-add-missing-prop-typs.mui-org.now.sh

@cypress
Copy link

cypress bot commented May 9, 2020



Test summary

77 0 1 0


Run details

Project material-ui-pickers
Status Passed
Commit 01d86eb
Started May 10, 2020 12:11 PM
Ended May 10, 2020 12:13 PM
Duration 01:35 💡
OS Linux Debian - 9.11
Browser Chrome 78

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@@ -183,3 +184,5 @@ export const DateRangePickerInput: React.FC<DateRangeInputProps> = ({
</div>
);
};

DateRangePickerInput.propTypes = inputPropTypes;
Copy link
Member

@oliviertassinari oliviertassinari May 9, 2020

Choose a reason for hiding this comment

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

Is the inputPropTypes import pruned from the bundle?
What do you think of duplicating the information in the propTypes (no imports)? This could be one step closer to how we automatically generate the prop types from the typescript definitions in the main repository.

Copy link
Member Author

Choose a reason for hiding this comment

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

process.env.NODE_ENV !== "production" ? PureDateInput.propTypes = inputPropTypes : void 0;

From build code. Do you think we should duplicate it?

Copy link
Member

Choose a reason for hiding this comment

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

I'm asking because, in the core, we are from time to time using prop-types helpers:

  • exactProp
  • chainPropTypes
  • elementAcceptingRef
  • elementTypeAcceptingRef
  • refType
  • deprecatedPropType
  • requiredPropFactory
  • unsupportedProp

It seems that none of the imports are pruned in people bundle (removing X.propTypes = Y not being enough). But to be confirmed.

@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #1761 into next will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1761      +/-   ##
==========================================
+ Coverage   90.70%   90.74%   +0.03%     
==========================================
  Files          77       77              
  Lines        2324     2333       +9     
  Branches      420      439      +19     
==========================================
+ Hits         2108     2117       +9     
  Misses        174      174              
  Partials       42       42              
Impacted Files Coverage Δ
lib/src/DateRangePicker/DateRangePicker.tsx 100.00% <100.00%> (ø)
lib/src/DateRangePicker/DateRangePickerInput.tsx 88.23% <100.00%> (+0.35%) ⬆️
lib/src/DateRangePicker/DateRangePickerView.tsx 84.70% <100.00%> (+0.36%) ⬆️
lib/src/Picker/Picker.tsx 95.65% <100.00%> (ø)
lib/src/_shared/KeyboardDateInput.tsx 96.15% <100.00%> (+0.15%) ⬆️
lib/src/_shared/PureDateInput.tsx 100.00% <100.00%> (ø)
lib/src/constants/prop-types.ts 100.00% <100.00%> (ø)
lib/src/wrappers/DesktopWrapper.tsx 100.00% <100.00%> (ø)

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 7d6525b...01d86eb. Read the comment docs.

@dmtrKovalenko dmtrKovalenko merged commit 02e857e into next May 11, 2020
@dmtrKovalenko dmtrKovalenko deleted the feature/add-missing-prop-typs branch May 11, 2020 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing renderInput prop-type
2 participants