Skip to content

Infra/ Incubator.WheelPicker selectedValue #1782

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

Merged
merged 4 commits into from
Jan 25, 2022

Conversation

lidord-wix
Copy link
Contributor

Description

Deprecate Incubator.WheelPicker selectedValue prop in favor of initialValue
(All the relevant changes are in the first commit, the second is only about formatting)
WOAUILIB-2308

Changelog

BREAKING CHANGE - Deprecate Incubator.WheelPicker selectedValue prop in favor of initialValue

activeTextColor={Colors.primary}
inactiveTextColor={Colors.grey20}
items={monthItems}
textStyle={Typography.text60R}
selectedValue={selectedMonth}
/>

<Text h3>Years</Text>
<Text bodySmall grey30>
(Uncontrolled, initialValue passed)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this example? Looks like the days example so we don't really need both now, no?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add an example for changing 'initialValue' to show its effect, like a button that rolls the wheel by changing the prop's value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why we had the months example originally, maybe for string values.
Anyway, I've added two buttons for updating the years value with the initialValue.

children,
items: propItems,
itemHeight,
preferredNumVisibleRows
}: PropTypes): Presenter => {
const value = !_.isUndefined(selectedValue) ? selectedValue : initialValue;
const value = initialValue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like 'value' is unnecessary const now

/**
* The current selected value
*/
selectedValue?: ItemProps | number | string;
Copy link
Collaborator

@Inbal-Tish Inbal-Tish Jan 18, 2022

Choose a reason for hiding this comment

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

This is a breaking change. I know we're in the incubator but I'm thinking that we might want to at least explain to the uses what's wrong. Maybe add a deprecated message or error them when we detect they passed this prop... or we rely on the ts errors alone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have any internal users using this feature, regarding the community - we will add it under Breaking Changes in the release notes (and they also can decide not to update to this version until they fix it on their side)

Copy link
Collaborator

Choose a reason for hiding this comment

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

SectionsWheelPicker is using this component and it is not in the incubator. If someone passed 'selectedValue' to one of the sections (type WheelPickerProps) it will be affected by this change. How do we deal with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, but there's no internal use for SectionsWheelPicker in one app (we wrap it in private with different components), and for the community it's the same answer as before - we'll update it in the release notes, the ts we'll let them know as well, and they can stay with the previous version until they'll migrate to the other implementation.

Copy link
Collaborator

@Inbal-Tish Inbal-Tish Jan 19, 2022

Choose a reason for hiding this comment

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

We usually don't introduce breaking changes in minor versions. Let's discuss this with @ethanshar

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's ok, that's why we have the Incubator components.
We can merge this and as Lidor mention we'll add a breaking changes section for this (also mention the SectionWheelPicker component).

Moreover, this breaking change do offer an easy alternative and the community can also lock version till they handle the change.

@lidord-wix lidord-wix requested a review from Inbal-Tish January 18, 2022 14:23
@lidord-wix lidord-wix added the Important for Next Release PR that must be included in the release version label Jan 25, 2022
@Inbal-Tish Inbal-Tish merged commit 8a22aab into master Jan 25, 2022
@lidord-wix lidord-wix deleted the infra/Incubator_WheelPicker_selectedValue branch January 25, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important for Next Release PR that must be included in the release version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants