Closed Meai1 closed 7 years ago
I understand that it produces some amount of overhead, but YAML is a widely-used and well-defined format that's a lot less verbose than manually writing data structures. I don't think this change would ultimately make many peoples' lives that much easier, and it would certainly make plenty of users' lives harder as well.
Problem: Requirement for project configuration in a special extra file called
pubspec.yaml
. This requires maintenance of files in a format that is not native to dart, installation of extra plugins for IDE, learning a new format ('yaml'). It makes the development of simple one-off scripts harder, where I now have to constantly keep another file around so that my script can run.Solution: Move the config in form of a simple map/json into the main.dart file.
Pros:
Cons:
PUB_SPEC
. We could simply require people to name that file (convention over configuration) as 'main.dart', otherwise they use the old pubspec.yaml format. Another possibility is to make people add a comment line at the top that says// pubspec.yaml
and then pub would only have to read the first line of every .dart file to find the right file.