xamarin/Xamarin.Forms

[Bug] Fix RenderWith on Android so it properly links out renderers and native components

Open

#7,497 opened on Sep 12, 2019

 (1 comment) (0 reactions) (0 assignees)C# (1,926 forks)batch import
e/6 :clock6:help wantedm/high impact :black_large_square:p/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

The initial intention of the RenderWith attributes were to create a loose coupling from the Xamarin Forms Core components to the Native components. This currently does not work on Android because of two factors

Original RenderWith ticket https://github.com/xamarin/Duplo/pull/2077

Work to be done before going full in on this

We should measure the value of doing this work. For a spike we could just delete all the RenderWith attributes and all the manual registration inside FormsAppCompat. This would effectively give us an idea of what nothing looks like. Once we have a measure of how much nothing differs from everything then we can see if it's worth the effort here.

From the Android team: If adding linking gets shrinks the overall apk by about 1 MB it'd probably be worth it

Testing

We will need to ensure that our UI tests all run with linking turned fully on so that we can catch any linking issues we need to package up with the application

What about iOS?

Currently iOS won't link anything out that inherits from NSObject so it's not (AFAIK) possible to link anything out of iOS

Contributor guide