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

change: [M3-7232] Rename isPropValid and update codebase & documentation #9790

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Oct 12, 2023

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 named isPropValid 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-akamai

Changes 🔄

  • Rename isPropValid to omittedProps
  • Add unit test to the utility
  • Update imports and instances with new name through the codebase
  • Update documentation

Preview 📷

There is no visual change brought by this PR, nor should there be any functionality change

How to test 🧪

Prerequisites

  • Pull and run code locally

Verification steps

  • Verify there's no regression with the forwarding of our props
  • Confirm documentation reflects our new standards and the usage of omittedProps

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

Commit message and pull request title format standards

Note: Remove this section before opening the pull request
Make sure your PR title and commit message on squash and merge are as shown below

<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


@abailly-akamai abailly-akamai self-assigned this Oct 12, 2023
@abailly-akamai abailly-akamai changed the title change: [M3-7232] Rename isValidProp and update codebase & documentation change: [M3-7232] Rename isPropValid and update codebase & documentation Oct 12, 2023
[ default export ]
[ exported function component definition ]
[ styles ] (possibly in their own file)
[ utility functions ] (possibly in their own file)
Copy link
Contributor Author

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.

@abailly-akamai abailly-akamai marked this pull request as ready for review October 12, 2023 17:36
@abailly-akamai abailly-akamai requested a review from a team as a code owner October 12, 2023 17:36
@abailly-akamai abailly-akamai requested review from carrillo-erik, cpathipa, jaalah-akamai and mjac0bs and removed request for a team October 12, 2023 17:36
@jcallahan-akamai jcallahan-akamai removed the request for review from cpathipa October 12, 2023 17:57
Copy link
Contributor

@jaalah-akamai jaalah-akamai left a 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.

@coliu-akamai
Copy link
Contributor

Just a heads up, I merged in the MUIv5 StackScripts pt1 PR, and it uses the old 'isPropValid' in this files:

  • StackScriptTableHead.styles.ts

Pt2 also uses isPropValid, but if your PR gets merged in first, I'll just resolve those conflicts on my end :D

@abailly-akamai
Copy link
Contributor Author

@coliu-akamai thx for the heads up! for pt2, may the fastest merge win

Copy link
Contributor

@mjac0bs mjac0bs left a 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.

docs/development-guide/02-component-structure.md Outdated Show resolved Hide resolved
docs/development-guide/02-component-structure.md Outdated Show resolved Hide resolved
Comment on lines 44 to 48
/**
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

++ to this whole comment.

docs/development-guide/02-component-structure.md Outdated Show resolved Hide resolved
docs/development-guide/02-component-structure.md Outdated Show resolved Hide resolved
@abailly-akamai abailly-akamai force-pushed the M3-7232-prop-forwarding branch from 129d62f to 680042a Compare October 12, 2023 20:37
Copy link
Contributor

@mjac0bs mjac0bs left a 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!

@mjac0bs mjac0bs added the Approved Multiple approvals and ready to merge! label Oct 12, 2023
@abailly-akamai abailly-akamai merged commit d542062 into linode:develop Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants