question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Elevate messages from `dart pub get`

See original GitHub issue

We put a lot of work into messages coming out of dart pub get.

We have messages like:

  • Current package version have been retracted.
  • Newer a.b.c version available.
  • Package is discontinued.
  • Package is discontinued, replaced by package:foo.
  • Summaries of changes.
  • Content hash from pubspec.lock doesn’t match content from server (new in 2.19)
  • Package version affected by security advisory (coming in the future)

Perhaps we should start a conversation about how we can highlight this information to users. Context: we sometimes discover that users run into issues that were fixed 2 months ago, because they never run dart pub upgrade, even after an SDK upgrade.

Maybe, improving messaging here could help. This is just to open a discussion, maybe we’d want pub to have other output. Or maybe this is better injected through the LSP.

cc @sigurdm, @szakarias

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
devoncarewcommented, Nov 9, 2022

In terms of having a place to display richer information, perhaps we could decorate the pubspec.yaml file when the user opens it? We could use synthetic labels after a package dep to display additional information about the package:

dependencies:
  args: ^1.7.0 # on version 1.7.1; version 1.8.0 is available
  collection: ^1.0.0 # on version 1.2.3; version has been retracted!
  path: ^2.0.0 # on version 2.1.0
1reaction
DanTupcommented, Nov 9, 2022

One possibility is that dart pub get writes a .dart_tool/pub/dependency-summary.json that exposes these messages for analysis_server/lsp or IDEs to consume.

Having it on disk has some advantages - both the LSP server (which can produce diagnostics/quick-fixes) and the IDE (which may want to surface some of these things in specific ways that are UI/editor-specific and never likely to fall inside LSP) can access it without spawning (duplicate) commands (plus it removes some complexity of actually running commands, providing output to the user if the command fails/hangs, etc.). If we did this, we should ensure there’s a timestamp in it so tell how fresh the data is (since unlike invoking a command directly, it could easily be stale and I’m not sure we want to rely on the file timestamps).

For some things (like security advisories), I feel like the status bar with some coloured indicator could be good - however it’s less simple to invoke a quick-fix from there because it’s not driven by the analysis server. We could probably handle this with a well-known server command that could be invoked if you chose to ignore it though (which lets the server produce the pubspec edits).

Is it worth trying to come up with an example of some JSON for the the kind of information you have for each of these? Perhaps some of them can be generalised (so the IDE/server don’t need to quite know the specifics of every item if many of them will generally be treated the same, just with some different text/identifier).

Read more comments on GitHub >

github_iconTop Results From Across the Web

dart pub get
Get is one of the commands of the pub tool. ... This command gets all the dependencies listed in the pubspec.yaml file in...
Read more >
"pub get" consistently fails on Windows · Issue #1798 - GitHub
I am working on a Flutter app on Windows and everything used to work fine. However, today I started to see the following...
Read more >
Flutter: pub get failed (66) - Stack Overflow
To fix this go to their respective folders which are in the flutter folder and the first start with the bin folder and...
Read more >
flash | Flutter Package - Pub.dev
This library allows you to show messages or alerts in your app quickly and easily. It can be used as an alternative to...
Read more >
Flutter Alert Messages, Shaders & Co. - PUB.DEV RELEASES
PUB.DEV RELEASES via EMAIL? Subscribe now at http://follow.syntacops.com/ FULL PLAYLIST at http://releases.syntacops.com/ PREVIOUS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found