Skip to content

Conversation

@kittaakos
Copy link
Contributor

Motivation

To speed up the load time of the About dialog in IDE2. As requested in #1572, IDE2 reads the CLI version from the package.json.

Change description

  • 2.0.3:

    Screen Shot 2023-01-06 at 09 59 43
  • A dev build with the changes:

    Screen Shot 2023-01-06 at 10 06 39
  • Local IDE2 build with the changes:

    Screen Shot 2023-01-06 at 10 24 32

Other information

If the CLI version is a pinned commitish and not a semver, IDE2 will show the commitsh.

Assuming the following pinned CLI version:

diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json
index 1b7cc2de..ab4414ea 100644
--- a/arduino-ide-extension/package.json
+++ b/arduino-ide-extension/package.json
@@ -159,7 +159,7 @@
   ],
   "arduino": {
     "cli": {
-      "version": "0.29.0"
+      "version": "alma"
     },
     "fwuploader": {
       "version": "2.2.2"

The expected About dialog (with a dev build) is:

Screen Shot 2023-01-06 at 10 07 45

Closes #1572


It should be possible to run arduino-cli version --no-fetch or similar to avoid checking for updates. I have never used a CLI tool before that does a silent remote fetch when getting the only version. If there is a good example, please let me know. CLIs usually warn about the outdated version (brew, npm, yarn, etc.) when users execute a command that requires the Intenet connection. The Arduino CLI ought to warn the user on core index-update or lib install but not on version.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

the CLI version is retrieved from the `package.json` of the extension:
`arduino.cli.version`

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to Arduino CLI labels Jan 6, 2023
@kittaakos kittaakos requested review from AlbyIanna and per1234 January 6, 2023 09:39
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Akos!

Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

LGTM ✅

On a side note though, I have noticed that this change breaks the localized string "arduino/about/detail" when the ide language is one that has that string already translated. That happens because the number of parameters used the localized string changed from 7 to 5.
For example, if you set the language to "Italiano", you get this dialog
Screenshot 2023-01-10 at 14 22 28

Anyway, I won't request changes in this PR because I'm not sure how we should proceed about this kind of localization issues.

@kittaakos kittaakos merged commit da0fecf into main Jan 11, 2023
@kittaakos kittaakos deleted the #1572 branch January 11, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use more efficient method to get Arduino CLI version

3 participants