-
Notifications
You must be signed in to change notification settings - Fork 367
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
change: [M3-7232] Rename isPropValid and update codebase & documentation #9790
change: [M3-7232] Rename isPropValid and update codebase & documentation #9790
Conversation
[ default export ] | ||
[ exported function component definition ] | ||
[ styles ] (possibly in their own file) | ||
[ utility functions ] (possibly in their own file) |
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.
Some of these documentation changes also cover some of our newest conventions, not just the intent of the PR.
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.
✅ Thanks for the work in doing this. Unit tests work for me as well.
Just a heads up, I merged in the MUIv5 StackScripts pt1 PR, and it uses the old 'isPropValid' in this files:
Pt2 also uses isPropValid, but if your PR gets merged in first, I'll just resolve those conflicts on my end :D |
@coliu-akamai thx for the heads up! for pt2, may the fastest merge win |
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.
Nice rename!
Left a few comments on the docs updates, which are great to see.
/** | ||
* It's often a good idea to move utilities to their own files as well, | ||
* either in the `src/utilities` directory if meant to be portable and reusable, | ||
* or in the feature's directory as a .utils.ts file. ex: `SayHello.utils.ts`. | ||
* Isolation often makes them easier to test and reduce the main file size for better readability. |
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.
++ to this whole comment.
129d62f
to
680042a
Compare
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.
Unit test looks good, not seeing any console issues in Cloud, thanks for the docs updates!
Description 📝
In our styled components, we have the ability to prevent the forwarding of custom props that could end up being passed as an invalid html attribute in the dom. To that effect we have a utility to use in
shouldForwardProp
that was namedisPropValid
but this name caused a bit of confusion since it made some assumption about the validity of the prop itself, while its intent is to only build an array of props to exclude from forwarding regardless of their semantic validity.Note: the
omittedProps
name has been discussed and vetted with @jaalah-akamaiChanges 🔄
isPropValid
toomittedProps
Preview 📷
There is no visual change brought by this PR, nor should there be any functionality change
How to test 🧪
Prerequisites
Verification steps
omittedProps
As an Author I have considered 🤔
Check all that apply
Commit message and pull request title format standards
<commit type>: [JIRA-ticket-number] - <description>
Commit Types:
feat
: New feature for the user (not a part of the code, or ci, ...).fix
: Bugfix for the user (not a fix to build something, ...).change
: Modifying an existing visual UI instance. Such as a component or a feature.refactor
: Restructuring existing code without changing its external behavior or visual UI. Typically to improve readability, maintainability, and performance.test
: New tests or changes to existing tests. Does not change the production code.upcoming
: A new feature that is in progress, not visible to users yet, and usually behind a feature flag.Example:
feat: [M3-1234] - Allow user to view their login history