-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Automattic Components: Add form label to package #79256
Conversation
ecb72c9
to
3f6ccbb
Compare
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
3f6ccbb
to
809f806
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.
Thanks again for thinking about these dependencies and resolving as you go.
-
My comment in the other PR also applies here. I don't think we should be replicating stuff without plan to deprecate and remove the original.
-
Concerning "form label", I fail to see this sitting in the root of
@automattc/components
. I can see there is aforms
folder already, should we move and export this from there perhaps?
I can see there is a
forms
folder already, should we move and export this from there perhaps?
Speaking of which, I'm guessing the entirety of client/components/forms/*
should gradually migrate under there. For this change, I'd also consider updating @automattc/components/forms
README to match a little closer to client/components/forms/*
and mention the components living under?
Good observation -- will do this tomorrow. 👍 |
Resolved in c34fa67
I agree with this 👍
Resolved in 52e43fa Form label shim is in this PR. Currently drafting up testing notes #80350 |
949ef6e
to
52e43fa
Compare
52e43fa
to
6528b86
Compare
6528b86
to
709b630
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.
LGTM 🚢
Minor ignorable comment :D
const Template = ( args ) => { | ||
return ( | ||
<form> | ||
<FormLabel { ...args }>Button Label</FormLabel> |
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.
Non essential.
Maybe add the Button Label
as a dynamic arg.
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.
Hey thanks for chiming in Dehan -- I thought about doing so, but wasn't sure how to accomplish this without adding it to Default.args
below.
The issue with adding it to Default.args is that the label is then shown as a "Control", which I believe mistakenly implies that it might be a prop that FormLabel accepts.
If I'm wrong about this though, definitely let me know and I'm happy to include it in a follow-up PR 🙂
To avoid creating another dependency on a non-packaged Calypso component, we want to migrate the dropdown we're using to @automattic/components
We're migrating the form label component because it is a dependency for the dropdown component, and is necessary to render said dropdown.
The entirety of the migration is a 4 step process that creates easily digestible ( and revertible ) PRs to work with. See https://github.com/Automattic/martech/issues/2028. Unfortunately, this process also eliminates the git history from migrated files unless the 4 steps are condensed into a single one. I don't have a great answer to this, but the tradeoff, to me, is worth the added safety of more understandable, compact, iterative pull requests.
Proposed Changes
Adds the form label calypso component into the @automattic/components package
Screenshots
Testing Instructions
Note:
I initially had issues running storybook ( missing dependencies, odd runtime errors, etc. ). I had to blow away npm modules before it behaved as expected
yarn storybook:start
Pre-merge Checklist