Repository navigation
iOS plugin registry - #9818
iOS plugin registry#9818
Conversation
|
Last minute out-of-nowhere no-context ambush ninja PR comment :) We were looking at the contents of the user's source tree in #9826. Is it possible to have generated files be transient intermediaries in the build outputs (and consequently for iOS, perhaps let them be linked frameworks instead of user space source files)? |
|
@xster Sounds reasonable to me (SRTM?). I'll check with @jakobr-google if this is a small enough change that we can do it as part of this PR. |
|
Cool, awesome! |
|
I don't think moving the generated files is a small change, especially on iOS, and especially not if you're planning to have them in a separate framework. I would not mix it in with this change. |
There was a problem hiding this comment.
This instance will now be leaked :(
There was a problem hiding this comment.
Nit: I have tried to avoid new as much as possible and write the more verbose alloc - init incantation to be more explicit. If you don't mind, can we stick to using it here and elsewhere? If you have in any way a strong opinion for new however, then go ahead and stick to it. At this point, it is more of a personal preference really.
There was a problem hiding this comment.
We should use [[{{pluginClass}} alloc] init] here, as you say. Or make this an instance method (initWithRegistrar:?), and have the generated registry alloc - initWithRegistrar:.
We used [[{{pluginClass}} alloc] initWithController:] before.
There was a problem hiding this comment.
I don't see a good reason to insist that instances can be created of all plugins? At least, we don't need that on the Java side.
The instance in question was supposed to have a life-span identical to the block that is given (via the MethodChannel) to the underlying BinaryMessenger---which means it should be kept alive until someone calls setMethodHandler(nil) on an identically named channel. As this doesn't happen, it will be alive for as long as the process runs. Which is as I intended. Am I holding it wrong?
Please note that this auto-generated code is part of the user plugin and is compiled with ARC. I cannot use autorelease or the like.
There was a problem hiding this comment.
Has this file been through the formatter?
There was a problem hiding this comment.
Has now. Thanks.
|
@chinmaygarde PTAL |
9603ae1 to
7ec0226
Compare
Add gearing between plugins and the application context defined by custom AppDelegate class supplied by the app author. Design constraints/goals:
iOS only in this PR. Accompanying flutter/engine PR: flutter-team-archive/engine#3645.
Android side: #9715
Partially addresses #9682 and #9161