native icon indicating copy to clipboard operation
native copied to clipboard

[ffigen] Generate `ResourceIdentifier`s for Objective-C

Open dcharkes opened this issue 10 months ago • 2 comments

For tree-shaking we want to generate ResourceIdentifier annotations.

For C:

  • https://github.com/dart-lang/native/issues/1085

For JNIgen:

  • https://github.com/dart-lang/native/issues/1098

Probably for Objective-C (and Swift?) we could or should do something similar. The idea for C code is to compile to a static lib with all symbols in build.dart and then call the native linker in link.dart and pass the exact list of C symbols to keep based on what @Natives (annotated with @ResourceIdentifier) are reachable after TFA. Would a similar approach work for Objective-C @liamappelbe?

I presume that for the actual classes in Objective-C we might need something more similar to JNIgen, where we generate @ResourceIdentifiers for the classes and instance methods.

Same questions to answer here:

  • What do we need from the resource.json format?

dcharkes avatar Apr 23 '24 20:04 dcharkes