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

[Spec] Remove members marked with Obsolete attribute #21

Closed
hartez opened this issue May 18, 2020 · 6 comments
Closed

[Spec] Remove members marked with Obsolete attribute #21

hartez opened this issue May 18, 2020 · 6 comments
Assignees
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert proposal/accepted t/breaking 💥

Comments

@hartez
Copy link
Contributor

hartez commented May 18, 2020

Description

Remove members marked with the Obsolete attribute.

Core

Class Member to Remove Removed? PR
Application LogWarningsToApplicationOutput xamarin/Xamarin.Forms#13813
BindableObject GetValues xamarin/Xamarin.Forms#13813
BindableObjectExtensions SetBinding xamarin/Xamarin.Forms#13813
BindableProperty Create xamarin/Xamarin.Forms#13813
BindableProperty CreateAttached xamarin/Xamarin.Forms#13813
BindableProperty CreateAttachedReadOnly xamarin/Xamarin.Forms#13813
BindableProperty CreateReadOnly xamarin/Xamarin.Forms#13813
Binding Create xamarin/Xamarin.Forms#13813
Button BorderRadius xamarin/Xamarin.Forms#13813
Button Image xamarin/Xamarin.Forms#13813
Button BorderRadiusProperty xamarin/Xamarin.Forms#13813
Button ImageProperty xamarin/Xamarin.Forms#13813
EntryCell XAlign xamarin/Xamarin.Forms#13813
Label XAlign xamarin/Xamarin.Forms#13813
EntryCell XAlignProperty xamarin/Xamarin.Forms#13813
Label XAlignProperty xamarin/Xamarin.Forms#13813
Color Fuschia xamarin/Xamarin.Forms#13813
Device OnPlatform xamarin/Xamarin.Forms#13813
Device OnPlatform xamarin/Xamarin.Forms#13813
Device OpenUri xamarin/Xamarin.Forms#13813
Device OS xamarin/Xamarin.Forms#13813
Element ParentView #1644
Element Platform xamarin/Xamarin.Forms#13813
IElementController Platform xamarin/Xamarin.Forms#13813
Element PlatformSet xamarin/Xamarin.Forms#13813
IElementController PlatformSet xamarin/Xamarin.Forms#13813
Font BoldSystemFontOfSize xamarin/Xamarin.Forms#13813
Font BoldSystemFontOfSize xamarin/Xamarin.Forms#13813
Frame OutlineColor xamarin/Xamarin.Forms#13813
Frame OutlineColorProperty xamarin/Xamarin.Forms#13813
IExtendedTypeConverter ConvertFrom xamarin/Xamarin.Forms#13813
IMenuItemController IsEnabledPropertyName xamarin/Xamarin.Forms#13813
MenuItem IsEnabledPropertyName xamarin/Xamarin.Forms#13813
ItemTappedEventArgs .ctor xamarin/Xamarin.Forms#13813
ItemVisibilityEventArgs .ctor xamarin/Xamarin.Forms#13813
Label Font xamarin/Xamarin.Forms#13813
Label YAlign xamarin/Xamarin.Forms#13813
Label YAlignProperty xamarin/Xamarin.Forms#13813
Layout GetSizeRequest #1644
VisualElement GetSizeRequest #1644
MenuItem Icon xamarin/Xamarin.Forms#13813
Page Icon xamarin/Xamarin.Forms#13813
MenuItem IconProperty xamarin/Xamarin.Forms#13813
Page IconProperty xamarin/Xamarin.Forms#13813
NavigationPage GetTitleIcon xamarin/Xamarin.Forms#13813
NavigationPage SetTitleIcon xamarin/Xamarin.Forms#13813
NavigationPage Tint xamarin/Xamarin.Forms#13813
NavigationPage TintProperty xamarin/Xamarin.Forms#13813
NavigationPage TitleIconProperty xamarin/Xamarin.Forms#13813
OnPlatform<T> Android xamarin/Xamarin.Forms#13813
OnPlatform<T> iOS xamarin/Xamarin.Forms#13813
OnPlatform<T> WinPhone xamarin/Xamarin.Forms#13813
Page DisplayPromptAsync xamarin/Xamarin.Forms#13813
Page BackgroundImage xamarin/Xamarin.Forms#13813
Page BackgroundImageProperty xamarin/Xamarin.Forms#13813
ResourceDictionary MergedWith xamarin/Xamarin.Forms#13813
SelectedItemChangedEventArgs .ctor xamarin/Xamarin.Forms#13813
IShellSectionController SendPopped xamarin/Xamarin.Forms#13813
IShellSectionController SendPopping xamarin/Xamarin.Forms#13813
IShellSectionController SendPopped xamarin/Xamarin.Forms#13813
Slider ThumbImage xamarin/Xamarin.Forms#13813
Slider ThumbImageProperty xamarin/Xamarin.Forms#13813
Span Font xamarin/Xamarin.Forms#13813
Span ForegroundColorProperty xamarin/Xamarin.Forms#13813
TapGestureRecognizer .ctor xamarin/Xamarin.Forms#13813
TapGestureRecognizer .ctor xamarin/Xamarin.Forms#13813
TapGestureRecognizer TappedCallback xamarin/Xamarin.Forms#13813
TapGestureRecognizer TappedCallbackParameter xamarin/Xamarin.Forms#13813
TapGestureRecognizer TappedCallbackProperty xamarin/Xamarin.Forms#13813
TapGestureRecognizer TappedCallbackParameterProperty xamarin/Xamarin.Forms#13813
ToolbarItem Name xamarin/Xamarin.Forms#13813
ToolbarItem Activated xamarin/Xamarin.Forms#13813
TypeConverter ConvertFrom xamarin/Xamarin.Forms#13813
TypeConverter ConvertFrom xamarin/Xamarin.Forms#13813
StyleSheets.StyleSheet FromAssemblyResource xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage BarItemColorProperty xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarSelectedItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarSelectedItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarSelectedItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarSelectedItemColor xamarin/Xamarin.Forms#13813
PlatformConfiguration.AndroidSpecific.TabbedPage BarSelectedItemColorProperty xamarin/Xamarin.Forms#13813
Internals.IPlatform GetNativeSize Don't know, but IPlatform is gone, so...
Internals.NavigationRequestedEventArgs .ctor xamarin/Xamarin.Forms#13813
Internals.NavigationRequestedEventArgs Realize xamarin/Xamarin.Forms#13813
Internals.ResourceLoader CanProvideContentFor #1637
Internals.ResourceLoader ResourceProvider #1637
Internals.PromptArguments .ctor xamarin/Xamarin.Forms#13813
Internals.TypedBinding<TSource, TProperty> .ctor xamarin/Xamarin.Forms#13813

Maps

Class Member to Remove Removed? PR
Maps.Pin SendTap xamarin/Xamarin.Forms#13813
Maps.Pin Id xamarin/Xamarin.Forms#13813
Maps.Pin Clicked xamarin/Xamarin.Forms#13813

Xaml

Class Member to Remove Removed? PR
Xaml.Internals.SimpleValueTargetProvider .ctor(object[]) xamarin/Xamarin.Forms#13813
Xaml.Internals.SimpleValueTargetProvider .ctor(object[], object[]) xamarin/Xamarin.Forms#13813

UWP

Class Member to Remove Removed? PR
Platform.UAP.BoxViewRenderer
Platform.UAP.FormsSlider ThumbImage
Platform.UAP.RendererFactory

iOS

Class Member to Remove Removed? PR
Platform.iOS.RendererFactory
Platform.iOS.WebViewRenderer

Android

Class Member to Remove Removed? PR
Platform.Android.AndroidActivity
Platform.Android.PageExtensions CreateFragment

Android Renderer Constructors

Each renderer which existed as of 2.4 has an obsolete constructor which does not take a Context parameter.
 

Backward Compatibility

Any applications or libraries still using the obsolete properties or methods will have to update.

Difficulty : Low

Mostly this just means deleting methods and properties which already call through to other methods and properties. In a few cases we may also need to remove non-public members which are no longer used.

@domagojmedo
Copy link
Contributor

Should this be done here or in XF repo? I'm asking because #20 was done in XF

@PureWeen
Copy link
Member

XF repo on main branch @domagojmedo

@domagojmedo
Copy link
Contributor

@PureWeen there are many tests that use generic BindableProperty.Create, should those tests be removed or changed to use non-generic version of the method?

@PureWeen
Copy link
Member

I'd say change them to use the non-generic version

All the generic version one does is call through to the non-generic one

		[Obsolete("Create<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static BindableProperty Create<TDeclarer, TPropertyType>(Expression<Func<TDeclarer, TPropertyType>> getter, TPropertyType defaultValue, BindingMode defaultBindingMode = BindingMode.OneWay,
																		ValidateValueDelegate<TPropertyType> validateValue = null, BindingPropertyChangedDelegate<TPropertyType> propertyChanged = null,
																		BindingPropertyChangingDelegate<TPropertyType> propertyChanging = null, CoerceValueDelegate<TPropertyType> coerceValue = null,
																		CreateDefaultValueDelegate<TDeclarer, TPropertyType> defaultValueCreator = null) where TDeclarer : BindableObject
		{
			return Create(getter, defaultValue, defaultBindingMode, validateValue, propertyChanged, propertyChanging, coerceValue, null, defaultValueCreator: defaultValueCreator);
		}

So if we need to add it back (for some reason) we can just add a Unit test specifically there to validate the generic one

@domagojmedo
Copy link
Contributor

Layout and VisualElement have obsolete GetSizeRequest method. It says in obsolete attribute to use OnMeasure instead, but OnMeasure is internal and GetSizeRequest is public so we can't just switch usage.

How should this be resolved?

@PureWeen
Copy link
Member

Hmmmmm @domagojmedo I would leave that one for now

We'll replace that one with the layout updates... I'm not sure off hand with that one because our OnMeasure code calls into that obsolete method :-)

So the fix might just be to make GetSizeRequest internal ? But I'm not really sure off hand

@davidortinau davidortinau unpinned this issue May 26, 2021
@hartez hartez self-assigned this Dec 29, 2021
@hartez hartez added this to the 6.0.200-preview.13 milestone Dec 29, 2021
@hartez hartez closed this as completed Jan 31, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 2, 2022
@samhouts samhouts added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert proposal/accepted t/breaking 💥
Projects
No open projects
Status: Done
Development

No branches or pull requests

7 participants