Skip to content
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

Add "check in pubspec.lock" advice to troubleshooting #262

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/content/docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ This can be caused by a number of things. The most common causes are:
use caution when publishing patches that include changes to native code from
plugins. In the worst case, these changes may cause your patched app to
crash.**
:::tip
Add your `pubspec.lock` file to version control so you're always aware of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dart has a great guide about the lock file, should we link it too?

https://dart.dev/guides/libraries/private-files#pubspec-lock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there were a Flutter-specific guide, I'd say yes. The dart guide is a little less clear/direct than I'd like (basically, I just want to tell users "Yes, check it in" rather than "don't check it in unless your package is an application package" and then having the users wonder what an application package is and whether their Flutter app is one of those, etc.). I'll copy some of the text from those docs over.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, my suggestion was more in the lines that this guide corroborate for what we are suggesting the users.

But no strong opinions, the content is already good!

updates to your dependencies.

Versioning your `pubspec.lock` file ensures changes to transitive
dependencies are explicit. Each time the dependencies change due to
`dart pub upgrade` or a change in `pubspec.yaml`, the difference will be
apparent in the lock file.
:::

2. A dependency/plugin produces a different output on every build. This can
happen if the dependency it includes a timestamp indicating when it was
built, for example. This kind of change is usually safe to publish, but you
Expand Down