structs: dependency-only: opaque
should apply to ObjC interfaces
#432
Labels
structs: dependency-only: opaque
should apply to ObjC interfaces
#432
Say we have an API that requires an
NSString
as an argument.Say you only want to call that API, not do all the fiddly bits you can do with
NSString
s so you setexlcude-all-by-default
and only include the interface class you want to use.If you happen to run
ffigen
, it will see the API you want to use needs anNSString
, then it will have a look at all its APIs and will go ahead and generate code for all of those. While this is functional, it creates a lot of code (file sizes measured in megabytes). I assume this code does get tree-shaken during compilation, but it's still something that will impact compilation speed, git repo size and all the implications that has over time, package size when pushed to pub.dev (and being downloaded by the package users), etc.I've also tried
structs: dependency-only: opaque
but that doesn't seem to do anything.While the approach to generate all the dependent code is a valid one and it does work, I wonder if we could make
exclude-all-by-default
apply for this as well. Instead, I'd prefer having to specify the methods I need (besides the constructor) - I am excluding everything after all. Alternatively, it could be done so that by just listing the class/interface in the include list would generate all methods (related: #251) but would not go on transitively for each argument - those would be opaque instead.Example:
The text was updated successfully, but these errors were encountered: