kingces95 / king.linker Goto Github PK
View Code? Open in Web Editor NEWReproduction of linker issues
Reproduction of linker issues
On Android, a user defined PreserveAttribute (see definition) is only honored when applied at the assembly level (see line 8) but has no effect when applied at class or member level (see line 22, 25). The impact of this is significant for a Forms developer because of two common late-bound idioms: [1] types activated late-bound from XAML (see line 17) and [2] properties accessed by BindableProperties on objects used as a BindingContext (see line 44). Without use of a PreserveAttribute these types and properties must be referenced in a much more clunky fashion (see line 16, 31).
On Android, all types declared in the shim dll are preserved (see line 41 in https://github.com/kingces95/King.Linker/blob/master/Application.Android/MainActivity.cs). The impact of this is low. An easy work around is not to include any significant logic in the shim. This is naturally the case with a Forms application where all the logic lives in the PCL. Still, this behavior is not mirrored on iOS so is confusing.
On Android, enums passed as arguments to custom attribute parameters typed as object are not preserved. (see line 13 given attribute definition : https://github.com/kingces95/King.Linker/blob/master/Library.Pcl.Target/MyClass.cs). While the impact of this is generally low (no Forms idioms pass enums to parameters typed as objects -- we encountered this because of testing infrastructure does this [see line 13 : https://github.com/xamarin/Duplo/blob/ff7a3a84a7de2433a2f415516c7d55c8bf1e7d71/Xamarin.Forms.Controls/TestCasesPages/Issue1545.xaml.cs]) I'd love to see this fixed because when building custom loaders its very useful to be able to pass enums to parameters typed as objects.
On iOS, types derived from NSObject are never shaken out by the linker (see line 20 : https://github.com/kingces95/King.Linker/blob/master/Application.iOS/Main.cs). All renders derive from NSObject and so none of them will be shaken out. This will prevent any significant savings on iOS.
Consequently, enabling the linker on a Xamarin.Forms.iOS project will have little effect on the size of 3ed party libraries which supply customer renders which will all derive from NSObject.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.