Stacked-Org/stacked

[bug]: "stacked create app" creates a pubspec.yaml with old versions and using ^

Closed this issue · 2 comments

Describe the bug

There is a significant risk in using ^ for versions in pubspec.yaml. There is no guarantee whatsoever on which versions actually are used per deployment. Removing ^ would make versions explicit and would always result in exactly the same versions for dependencies used at any point in time.
Reverting back to previous version, replaying a bug in older version of app, etc, would always give same build.
Using ^ will break this guarantee and can (will?!) cause different behaviour for exact same project version over time.
As en example: All of a sudden "stacked generate" seems broken at this moment in time. It would not surprise me if this is caused by some dependency releasing a breaking minor version.

To reproduce

  1. stacked create app any_name
  2. see pubspec.yaml

Expected behavior

No response

Screenshots

image

Additional Context

No response

For some reason I was running an old version of dart on my macOS:
brew info dart
==> dart-lang/dart/dart: stable 2.18.3, HEAD

I did: "brew unlink dart" and rerun "dart pub global activate stacked_cli".
This solved the issues I had, but does not change my opinion on using ^ in pubspec.yaml :)

I appreciate the concern.

You can remove them from your project since you won't be using create app every day :D but for new projects I'd like to keep it there.

I'd rather leave those decisions in the hands of the developer.

I'm only opinionated about how to build and structure Flutter apps, I have no opinion on best practice of dependencies.