-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 TypeScript annotations to MultiSelect #13144
Add TypeScript annotations to MultiSelect #13144
Conversation
DCO Assistant Lite bot All contributors have signed the DCO. |
I have read the DCO document and I hereby sign the DCO. |
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@awarrier99 Thank you so much for the contribution! Do you mind resolving the merge conflicts please :) |
@andreancardona Sure, they should be resolved now! |
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 once the all-contributors
merge conflict is fixed! 👍 ✅
Resolved! |
@andreancardona @tw15egan I noticed with the previous run of the workflows that there was an error with a snapshot saying that the public API shouldn't be changed without a new semver bump - do I need to do something to resolve that? |
@awarrier99 usually means snapshots need to be updated due to the changes made. If the changes are intentional (in this case, yes we are modifying the component footprint quite a bit), you can update snapshots with |
Got it, sounds good! I'll leave the snapshots as is then |
bd71c83
to
d25d9ac
Compare
@tw15egan sorry I misunderstood, I thought you were saying we were good to go without needing to update the snaps - thanks for taking care of that |
@awarrier99, no worries, I could have worded it better! I just meant it was okay to update them because we are knowingly making changes to the API 👍🏻 Thanks for contributing 🎉 |
Convert existing propType definitions to Typescript annotations on the MultiSelect component. This is part of a broader effort to add Typescript annotations to components, tracked in carbon-design-system#12513. Closes carbon-design-system#12547. Only type annotations, no breaking feature changes
Convert existing propType definitions to Typescript annotations on the MultiSelect component. This is part of a broader effort to add Typescript annotations to components, tracked in carbon-design-system#12513. Closes carbon-design-system#12547. Only type annotations, no breaking feature changes
d25d9ac
to
ccd3a5d
Compare
@@ -4820,127 +4820,10 @@ Map { | |||
"type": "bool", | |||
}, | |||
"downshiftProps": Object { | |||
"args": Array [ |
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.
@awarrier99 circling back, is there a way to retain the downshiftProps
here? Looking at the Dropdown ts conversion, I do not see any snapshot changes to the downshiftProps
. I'm trying to parse the difference in implementation to see what may be causing it 🤔
Reference PR: https://github.com/carbon-design-system/carbon/pull/13022/files
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.
The other snapshot changes are intentional and are fine 👍🏻
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.
Sure, let me take a look at this
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.
@tw15egan this should be resolved now - I had changed the prop type to match what was in the Dropdown
component originally, but I've now reverted that change
Closes #12547
Convert existing propType definitions to TypeScript annotations on the MultiSelect component. This is part of a broader effort to add TypeScript annotations to components, tracked in #12513.
Changelog
Changed
MultiSelect.js
has been converted toMultiSelect.tsx
MultiSelect
story to include required proplabel
MultiSelect
test to return an empty span instead of an empty string foritemToElement
(a string is not valid as a JSX constructor, which is how the prop is used in the component)MultiSelect
sorting options to uselocale
prop, rather than hardcoded 'en'Testing / Reviewing
packages/react
directory, runyarn build
,yarn storybook
. In the storybook, navigate toMultiSelect
and confirm that the component's behavior remains unchanged.MultiSelect.stories.js
andMultiSelect-test.js
, add// @ts-check
as the first line in the file (temporarily, for the sake of this test). Confirm that the files do not have compilation errors (related to theMultiSelect
component). Make changes to the components in those files - change number to string, etc - and confirm that compilation errors appear.