Remove deprecated IconButton API#3745
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 0749e24 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Your packages were publishedPublished Packages:
|
|
Size Change: -186 B (-0.02%) Total Size: 829 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #3745 +/- ##
==========================================
- Coverage 93.35% 93.32% -0.04%
==========================================
Files 197 197
Lines 4351 4329 -22
Branches 1752 1741 -11
==========================================
- Hits 4062 4040 -22
Misses 262 262
Partials 27 27
🚀 New features to boost your workflow:
|
| * one-word object if needed to clarify. | ||
| */ | ||
| children: ReactNode; | ||
| children: string | string[]; |
There was a problem hiding this comment.
I'm debating whether to restrict the children to string or string-like (e.g. numbers, array of strings) values.
Pros: It would ensure that the button label is accessible. It could help catch cases where developers pass an icon as part of the children instead of using the dedicated props.
Cons: Might require significant clean-up efforts in the apps.
There was a problem hiding this comment.
How about we start with a warning in dev environment and change the type in the next major ?
There was a problem hiding this comment.
I'll split this out into a separate PR.
16db009 to
511da54
Compare
3c6ecaa to
e400eb3
Compare
| ); | ||
| } | ||
| if (process.env.NODE_ENV !== 'production' && !props.icon) { | ||
| throw new CircuitError('IconButton', 'The `icon` prop is missing.'); |
There was a problem hiding this comment.
do we need to treat the icon prop differently from any other required prop ? or is this kept intentionally to highlight issues during the migration?
There was a problem hiding this comment.
I initially kept it to help with the migration. I think you're right though that it can be cleaned up since I've completed the migration in all major apps already.
Addresses DSYS-1667
Purpose
The IconButton’s API was updated to match the Button component and to make it easier to pass props to the icon component.
Approach and changes
labelprop in favor ofchildrenand force passing the icon using theiconproparia-labels from the carousel buttonsimport * as) to improve tree-shakingDefinition of done