-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Rewire all Dart entrypoints when the Dart plugin registrant is used. #91856
Conversation
packages/flutter_tools/test/general.shard/entrypoint_parser.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/general.shard/entrypoint_parser.dart
Outdated
Show resolved
Hide resolved
397b195
to
92b48f2
Compare
92b48f2
to
3977f71
Compare
It turned out that the machinery to rewire entrypoints wasn't necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much simpler =)
@@ -685,6 +685,7 @@ const String _dartPluginRegistryForNonWebTemplate = ''' | |||
|
|||
// @dart = {{dartLanguageVersion}} | |||
|
|||
export '{{mainEntrypoint}}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth putting a comment here explaining that when {{mainEntrypoint}}
defines main
, that definition is expected to be shadowed by the definition of main
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just delete the main
below with this, and the import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I read the engine code correctly, there isn't anything that should prevent removing main
from the generated file. However, that isn't what I'm seeing.
For some reason, if main
isn't defined in this file, then _PluginRegistrant.register
isn't called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches my observation as well. The "entrypoint file" is the file which main
is defined. If you attempt to call a function that is not defined nor exported in the "entrypoint file", then you need to specify its "library path".
Fixes #91841
Fixes #91832