-
Notifications
You must be signed in to change notification settings - Fork 2.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
Button: Migration for text, iconProps, menuProps and split deprecated props #9354
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…their corresponding non-deprecated ones in the Button component.
khmakoto
commented
Jun 5, 2019
buttonToMenuButtonMigration, | ||
splitButtonSplitPropRemovalMigration | ||
], | ||
'button.tsx' |
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.
@jdhuntington Here is the change I made for it to work on Windows. Based on the other examples, this would be path.join('7.0.0', 'button.tsx')
instead. Changing the other examples also makes them work on Windows.
Component perf results:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request checklist
$ npm run change
Description of changes
This PR creates code mods for some
Button
props to aid in the transition of people using the oldButton
in Fabric 7. The code mods do the following things:text
prop tocontent
.iconProps
prop toicon
.menuProps
prop tomenu
.Buttons
that have themenuProps
prop, renameButton
toMenuButton
and addMenuButton
as an import.Buttons
that have thesplit
prop, renameButton
toSplitButton
, remove thesplit
prop and addSplitButton
as an import.In order to do this two custom reusable code mods have been created, one to rename a JSX node to a new name if it has a prop and another one to remove a prop from a JSX node.
index.ts
has also been modified to include accept an array of code mods that are applied in sequence instead of only accepting one code mod at a time.With these code mods applied, the file:
Is transformed into:
Focus areas to test
(optional)
Microsoft Reviewers: Open in CodeFlow