-
Notifications
You must be signed in to change notification settings - Fork 45
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
[native_assets_cli] BuildConfig.linkingEnabled
#1273
Conversation
PR HealthBreaking changes ✔️Details
Changelog Entry ✔️Details
Changes to files need to be accounted for in their respective changelogs. License Headers ✔️Details
All source files should start with a license header. Unrelated files missing license headers
Package publish validation ✔️Details
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
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.
LGTM!
Mandatory bikeshedding:
Between the options, I also prefer hasLinkPhase
.
One possible confusion with the name might be that we're using two words, "phase" and "hook". Of course these are different concepts. XYZ hook gets run in the XYZ phase. But we don't mention "phase" in the docs that often.
Another option is to go with an enum with two options (buildStrategy
/linkStrategy
?):
buildOnly
/noLink
buildAndLink
/willLink
pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart
Outdated
Show resolved
Hide resolved
IMO, |
Good point, but the same thing could be said about the other names. The only way to mitigate this confusion completely would be to use verbs that show possibility instead of down right stating that things will be linked. For example |
I agree, I think my proposed |
Much better! Bouncing off this with some other wording that feels slightly more natural:
I think, I lean towards the first. |
To me, it sounds like there is already a link hook and it is "enabled" not that it's "possible to be enabled". Some other suggestions:
|
For me, +1 for |
Hooks are called/invoked/run or not called/invoked/run. I think the "enabled" is whether they will be called/invoked/run. "allow" is for access control, "enable" is for possibility. So, I think
I like this, together with |
I don't want to keep bike-shedding, so feel free to go with that name. However "enabled" suggests that there already is a linking step involved, so I "must", build linkable things. Something like |
I also like this one! "available" and "enabled" is maybe better than "can", because can leaves it open if you as hook author can invoke linking or if the system might possibly be linking. "available" is maybe better than "enabled" because it clearly states that you can use something from your hook. While enabled could mean something has already happened. (Okay, I'm going to keep changing my mind in this conversation.) @mosuem |
There is a distinction between the link.dart file and the linking step. The link.dart file is certainly always available, but not always enabled, and the linking step is not always available. So I would say that either I do think |
I was asking our trusty assistant earlier:
The Dart and Flutter SDK have the capability to link in some configurations (the configurations in which Dart is build in AOT mode). So seeing from the point of view that build hooks are invoked with a variety of different
I will add a doc comment to clarify that one "may" build linkable things instead of "must". Thanks for all the input! |
Good point, I didn't think of it that way.
I think we all like |
BuildConfig.hasLinkPhase
BuildConfig.linkingEnabled
Step 1 of
Naming bike shedding:
BuildConfig.hasLinkPhase
?BuildConfig.willLink
?BuildConfig.isLinkHookEnabled
?