-
Notifications
You must be signed in to change notification settings - Fork 68
Making build/link APIs use String
s to represent filepaths instead of Uri
s
#1506
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
Comments
Pros for
Cons for
Pros for
Cons for
Maybe we should consider using Pros for
Con for
|
I don't really have a strong opinion as long as we're consistent between packages. To me |
So you prefer |
I'm fine with either of the options. One con for |
It's usually very obvious from the name of a variable/parameter (e.g.
We do have |
+1 to
I thought the benefit of a typed language is to not have to infer the type from the name ;) |
Name of variables should signal what the variable represents which may at times be very related to the type of a variable. Of course one shouldn't - just for the sake of it - repeat a type name in the variable name (e.g. a If you strongly prefer to signal it in the type you can consider making an extension type on top of |
I'd prefer not to use URIs. I think their resolving logic is actually pretty confusing, because it's very opinionated about whether a path to a directory must end with a '/': https://dartpad.dev/?id=3ef2336ad73993a8991e45b6ffd0dcf1 My top choice would be Strings + package:path. I haven't used File and Directory for handling paths, but if their resolution utils are as good as package:path I'm fine with them. |
https://pub.dev/packages/path_type seems to do that. Not suggesting we use a 3p package, just FYI. |
We should consider making build/link APIs use
String
s to represent filepaths instead ofUri
s. UsingUri
s indicates that they can be arbitrary uris (e.g. http uris) when in fact they cannot - there's assumptions throughout the code that those are filepaths.The text was updated successfully, but these errors were encountered: