-
Notifications
You must be signed in to change notification settings - Fork 207
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
Support custom Resolvers in build.yaml #2345
Comments
I think it might be enough to just provide a custom SDK summary file in your build.yaml? In general everything in a build.yaml should be portable across machines, so it would probably need to be a relative path under the SDK or something. I don't know if flutter ships with a custom summary file or not though today. |
That would work too. How would you approach handling path differences across machines? There are a couple summaries in |
As far as path separators, we would always use The paths would also be relative to the current SDK root to prevent machine specific absolute paths.
Anything under The summary for flutter would have to be shipped somewhere else under the sdk if it isn't already. |
I see. Do you see including that summary as a possibility? |
My assumption is actually that they already do, I just haven't had a chance to check. The analyzer (in your IDE) must be able to somehow resolve |
The analyzer resolves dart:ui through an _embedder.yaml in the Flutter package. You can find it here:
|
I believe actually that this is handled in the analyzer by It is possible though that one of those is generated off of the Also afaik these files are essentially just used when generating a summary file. cc @stereotype441 who would probably know more |
You can even try it! Change that cached file to include a See, That's my understanding anyway. |
But I'm getting off-topic. A summary would be great, but configurable resolvers would still be useful in any case, wouldn't they? Edit: politeness 🙂 |
Every feature incurs a maintenance/complexity cost so we want to make sure we are making the correct long term choices. Especially when it comes to the
Possibly, yes. That is a really large hammer though and also quite easy to get wrong in a way that would be bad for either build performance and/or build correctness. It isn't necessarily a door we want to open. Generally we prefer to work from a problem statement rather than a solution. In this case it sounds like that would be something like " |
Cool. Looking forward to seeing what you come up with. |
@shyndman wrote
Some kinds of code generation could use metadata to make decisions about whether to generate some code, or how to do it, and it could use other data like the value of constant expressions, including default values of parameters, from any reachable library. 'reflectable' does all of these, and it currently does not work with declarations in platform libraries in this respect, because there's no access to metadata, default values, and other So being able to set up a resolver that relies on libraries everywhere (and never uses a summary) might be a bit slower, but the trade-off is that it works. ;-) So that would be very useful indeed! |
#2501 fixes my original issue. Feel free to close this off unless you feel like the feature would be valuable regardless. |
Thanks! Ya I think that resolves the original need here. |
Dart: 2.4.0
build_config: 0.4.1
build_runner: 1.6.2
These packages are almost set up to allow custom
Resolvers
to be specified throughbuild.yaml
, but a couple more pieces are necessary. Would you consider adding them, or accepting a pull?The reason I ask is because there's been a lot of discussion surrounding the analysis of
dart:ui
and Flutter (#733, #1436), and custom resolvers would be an excellent stopgap until you can reworkbuild_resolvers
to be more flexible.Just a thought. Thanks!
The text was updated successfully, but these errors were encountered: