Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativePluginLoader: make the class entirely stateless #162110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bartekpacia
Copy link
Member

@bartekpacia bartekpacia commented Jan 23, 2025

I think this caching is not needed (it's already done in flutter.groovy).

Objective: make this class as simple as possible. More context: #161352 (comment)

Pre-launch Checklist

@github-actions github-actions bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 23, 2025
@bartekpacia bartekpacia force-pushed the bartekpacia/chore/native_plugin_loader_make_stateless branch 2 times, most recently from 43b5603 to c35797b Compare January 26, 2025 00:18
@bartekpacia bartekpacia force-pushed the bartekpacia/chore/native_plugin_loader_make_stateless branch from c35797b to 3f664e5 Compare February 5, 2025 15:24
@bartekpacia bartekpacia force-pushed the bartekpacia/chore/native_plugin_loader_make_stateless branch from 3f664e5 to 287a415 Compare March 15, 2025 00:14
@bartekpacia bartekpacia marked this pull request as ready for review March 15, 2025 12:38
Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stateless feels like an improvement that said please hold for @gmackall's approval. @gmackall please make a call about if you want this to land in the middle of our kotlin migration.

Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caching does seem to already be done in flutter.groovy but this method is also called from packages/flutter_tools/gradle/src/main/groovy/app_plugin_loader.groovy and packages/flutter_tools/gradle/module_plugin_loader.gradle, and it doesn't look like it's cached there.

Do we know that

  1. We will never call multiple times from either of those sites and
  2. at the time of first call from those sites we won't have already called the method from another site, triggering the native_plugin_loader.groovy level caching?

I don't know that the answer here needs to be yes to both these questions to land this, but I'd like to at least understand what impact this will have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants