flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.56k stars 321 forks source link

Add version control documentation #4425

Open noga-dev opened 2 years ago

noga-dev commented 2 years ago

The docs (https://docs.flutter.dev/development/tools/devtools/overview) don't explain how to switch to another version. Since DevTools is no longer on pub.dev, we can't run dart pub global activate devtools <version> anymore.

E.g. Currently I'm on DevTools 2.15.0. And I'd like to switch to 2.16.0-dev0.

Doctor:

└─Δ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.0, on Microsoft Windows [Version 10.0.22000.856], locale en-US)
    • Flutter version 3.3.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (32 hours ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Agone\AppData\Local\Android\sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32630.192
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[✓] VS Code (version 1.69.1)
    • VS Code at C:\Users\Agone\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.41.20220516

[✓] VS Code (version 1.71.0-insider)
    • VS Code at C:\Users\Agone\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.46.0

[✓] Connected device (4 available)
    • POCO F1 (mobile)  • de412154 • android-arm64  • Android 12 (API 32)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.22000.856]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 104.0.1293.63

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
kenzieschmoll commented 2 years ago

The DevTools version is tied to the Flutter SDK, so to switch DevTools versions, just change your flutter version. To get the latest DevTools, you can use the Flutter master channel. There is no current way to get access to dev versions of DevTools. In the future, we'd like to set up auto-rolling for DevTools so that it can be rolled into the Dart SDK more frequently than the current monthly cadence.

We should improve our documentation to state this.

noga-dev commented 2 years ago

Thanks for the prompt response, Kenzie!

Are there any plans to decouple DevTools from the framework or Dart SDK? Would be a useful feature to be able to switch the version on demand (likeflutter channel master but for DevTools).

kenzieschmoll commented 2 years ago

Are there any plans to decouple DevTools from the framework or Dart SDK? Would be a useful feature to be able to switch the version on demand (like flutter channel master but for DevTools).

No there are not. We used to ship DevTools on pub, but this led to a myriad of problems for both our users and us as developers of the product. For example, users frequently experienced version compatibility issues, start up latency, etc. So coupling DevTools into the Dart SDK was a careful decision we made a little over a year ago because of the benefits it brings to our users and the improvements it made to our team's developer velocity. And switching versions is still supported, it is just done by switching your flutter channel.

If you really want to use bleeding edge DevTools (or DevTools from a specific tag), you could always build it locally :) it is just a Flutter app, so getting it up and running is pretty straight forward: https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md

noga-dev commented 2 years ago

Thank you. You've addressed all my inquiries/concerns.

Will leave it to you to close this issue when it's unneeded internally anymore.

Bless.

kenzieschmoll commented 2 years ago

This issue needs to remain open - it is for adding docs to the DevTools section of the website explaining how DevTools versioning works and docs for how to change devtools versions (i.e. change flutter version to change devtools version).