Skip to content
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

Expose showRemoveButton on ExtendedPeoplePicker #7904

Conversation

Adjective-Object
Copy link
Contributor

@Adjective-Object Adjective-Object commented Feb 5, 2019

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Adjust types to expose the SuggestionItem X button to the
ExtendedPicker. Parameterize the extended people picker to
accurately reflect its usage + the type constraints on it.

Not sure if this should be a breaking change -- an API consumer will need to update their code iff they directly reference the relevant type. I've seen different libraries treat type incompatibilities w/o functional changes as both major and minor changes.

Focus areas to test

ExtendedPeoplePicker demo

Microsoft Reviewers: Open in CodeFlow

Adjust types to expose the SuggestionItem X button to the
ExtendedPicker. Parameterize the extended people picker to
accurately reflect its usage + the type constraints on it.
@Adjective-Object Adjective-Object changed the title Selection remove button export showRemoveButton on ExtendedPeoplePicker Feb 5, 2019
@Adjective-Object Adjective-Object changed the title export showRemoveButton on ExtendedPeoplePicker Expose showRemoveButton on ExtendedPeoplePicker Feb 5, 2019
@size-auditor
Copy link

size-auditor bot commented Feb 5, 2019

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

@amyngu
Copy link
Contributor

amyngu commented Feb 6, 2019

Not sure if major changes are encouraged at this time? I thought all major changes were batched, hence why we're on 6.1XX

@natalieethell can you comment on if this should be a major change?

@natalieethell
Copy link
Contributor

@amyngu @Adjective-Object yes, usually if we're making major changes like this to a props interface, we will mark the old prop as deprecated in the comments. Like this:

https://github.com/OfficeDev/office-ui-fabric-react/blob/179eac03255642b34f0cc3ba03b490d49c01ab8e/packages/office-ui-fabric-react/src/components/Coachmark/Coachmark.types.ts#L50-L55

We'll support use of either prop until we remove the old one in a major version bump.

@natalieethell
Copy link
Contributor

@joschect correct me if I'm wrong on the above!

@Adjective-Object
Copy link
Contributor Author

I think we could get away with setting the default for the type parameter to Any, since that's effectively what it was before if we wanted to be backward compatible

Copy link
Contributor

@natalieethell natalieethell left a comment

Choose a reason for hiding this comment

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

I spoke with @KevinTCoughlin and we think this is a good change, but it may be best to hold off on it until a major version bump. @Adjective-Object re: your idea to set the default type to any, @JasonGore I think we could use your input here since you've been doing a lot of work with generics. What do you think?

@Adjective-Object
Copy link
Contributor Author

(To be clear, we'd want to get rid of the 'any' at the next major version bump)

*/
pickerSuggestionsProps?: IBaseFloatingPickerSuggestionProps;
pickerSuggestionsProps?: IBaseFloatingPickerSuggestionProps<T | any>;
Copy link
Member

@JasonGore JasonGore Feb 8, 2019

Choose a reason for hiding this comment

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

Tied to my other comment, if we don't need to expose this type then this wouldn't actually be a breaking API change.

@@ -86,6 +86,8 @@ export interface IBaseFloatingPickerProps<T> extends React.ClassAttributes<any>
className?: string;
/**
* The properties that will get passed to the Suggestions component.
*
* TODO (adjective-object) remove the '| any' before the next major version
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, thought I cleaned this up but I guess I forgot to push

Copy link
Contributor

@natalieethell natalieethell left a comment

Choose a reason for hiding this comment

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

These changes look good to me!

@natalieethell
Copy link
Contributor

One thing to note is that with this change, IBaseFloatingPickerSuggestionProps will no longer show up in the implementation section of FloatingPeoplePicker, as it does now. This is because the current parser that generates this section on the page doesn't handle these types. However, this will (hopefully soon) be fixed with the documentation re-vamp we've been working on, with the help of api-extractor 7, which we're tracking here: #6780.

@msft-github-bot
Copy link
Contributor

Hello @natalieethell!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

@msft-github-bot msft-github-bot merged commit 3551e64 into microsoft:master Feb 14, 2019
@msft-github-bot
Copy link
Contributor

🎉[email protected] has been released which incorporates this pull request.:tada:

Handy links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants