Skip to content

react-radio: add migration guide#22719

Merged
spmonahan merged 4 commits into
microsoft:masterfrom
spmonahan:radio/migration-guide
May 2, 2022
Merged

react-radio: add migration guide#22719
spmonahan merged 4 commits into
microsoft:masterfrom
spmonahan:radio/migration-guide

Conversation

@spmonahan

@spmonahan spmonahan commented Apr 29, 2022

Copy link
Copy Markdown
Contributor

Current Behavior

No migration guide from v8/v0 to v9 for Radio/RadioGroup.

New Behavior

Migration guide from v8/v0 to Radio/RadioGroup

Related Issue(s)

Fixes #22678

Adds a migration guide from v8 ChoiceGroup to v9 RadioGroup. This
migration guide provides two examples plus prop tables that show
how props from v8 map to v9 props and/or concepts like slots.
@codesandbox-ci

codesandbox-ci Bot commented Apr 29, 2022

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dd2d7d4:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam

fabricteam commented Apr 29, 2022

Copy link
Copy Markdown
Collaborator

📊 Bundle size report

🤖 This report was generated against faf92d23bc6c2e21f1769e5ce210e17c7ebc9587

@size-auditor

size-auditor Bot commented Apr 29, 2022

Copy link
Copy Markdown

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: faf92d23bc6c2e21f1769e5ce210e17c7ebc9587 (build)


This table maps v8 `ChoiceGroup` props to the v9 `RadioGroup` equivalent.

| Purpose | v8 | v9 | Details |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider combining the v9 column and the details column to more concisely describe the replacement. (When we did the documentation scrub, Levi asked us to make the documentation as minimal as possible to convey understanding without re-documenting things. For example, re-documenting that in v9 className should be populated with style from Griffel wouldn't be called out everywhere we mention className).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this. It wasn't too much to write here and since I don't see it changing I wasn't worried about it but less is definitely preferable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ending up dropping the purpose column and changing "details" to "notes". I like the visual separation keeping this last column gives the props from any supporting info.

@spmonahan spmonahan marked this pull request as ready for review April 29, 2022 22:31
@spmonahan spmonahan requested review from a team as code owners April 29, 2022 22:31
@spmonahan spmonahan requested a review from a team April 29, 2022 22:32

@miroslavstastny miroslavstastny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

v0 LGTM

@spmonahan spmonahan merged commit 71bae42 into microsoft:master May 2, 2022
Pick One
</Label>
<RadioGroup aria-labelledby={labelId} defaultValue="B">
<Radio value="A" label="A" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A small nitpick, but if the v8 option has text: 'Option A', then the equivalent v9 <Radio> should have label="Option A" too

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additionally, since the v8 example uses required, I think the v9 radio example should probably set it too.


This table maps v8 `IChoiceGroupOption` props to the v9 `Radio` equivalent.

| v8 | v9 | Notes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This table is missing native HTML props like required, checked, and name. It's also missing some other props like focused, hasImage, etc. Were these left intentionally, or referenced somewhere else?


This table maps v8 `ChoiceGroup` props to the v9 `RadioGroup` equivalent.

| v8 | v9 | Notes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The parent ChoiceGroup props extends React.InputHTMLAttributes<HTMLElement | HTMLInputElement>, which means it previously supported setting required or disabled directly on the <ChoiceGroup> wrapper. Is it worth calling out here that those should now be set directly on the <Radio> components?

marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
* react-radio: add v8 to v9 migration guide

Adds a migration guide from v8 ChoiceGroup to v9 RadioGroup. This
migration guide provides two examples plus prop tables that show
how props from v8 map to v9 props and/or concepts like slots.

* react-radio: update v8->v9 migration guide based on feedback.

* react-radio: minor v8->v9 migration guide updates

* react-radio: add v0->v9 migration guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radio: Write Migration Guide

7 participants