[package_info_plus]: Use Flutter's compile-time build name/number on web instead of version.json
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
調査の方向性
Start in the package_info_plus web implementation and review its current version.json loading path. Verify the compile-time build values are preferred when available, version.json remains the fallback, and native behavior is unchanged; the linked PR #3990 indicates work is already underway.
索引モデルが issue の本文から書いたものです。
説明
Plugin
package_info_plus
Use case
On the web, PackageInfo.fromPlatform() reads version / buildNumber from version.json, fetched from the server at runtime. That file describes the currently deployed bundle, not the one running. A client on a stale cached bundle therefore reports the new version, so update gates and "running version" displays fail for exactly the users they exist for (#2675, closed as not planned). The fetch can also fail outright (#456, #3028).
Since Flutter 3.47.0 (flutter/flutter#187935), flutter_tools injects the app's pubspec version (or --build-name / --build-number) as the dart-defines FLUTTER_BUILD_NAME / FLUTTER_BUILD_NUMBER, exposed as appBuildName / appBuildNumber in package:flutter/services.dart. They are compiled into the bundle, so they always describe the code that is executing.
Proposal
In the web implementation, prefer the compile-time values when present and keep version.json as the fallback:
const _buildName = bool.hasEnvironment('FLUTTER_BUILD_NAME')
? String.fromEnvironment('FLUTTER_BUILD_NAME')
: null;
const _buildNumber = bool.hasEnvironment('FLUTTER_BUILD_NUMBER')
? String.fromEnvironment('FLUTTER_BUILD_NUMBER')
: null;
Reading the defines through bool.hasEnvironment (instead of importing appBuildName) keeps the current minimum Flutter version: older SDKs just don't define them, and behaviour is unchanged. On native platforms nothing changes.
This fixes #2675 transparently for every consumer, including SDKs that derive their release from package_info_plus (for example sentry_flutter's release name).
PR: #3990 (replaces the opt-in approach of #3874, which I closed once the Flutter side landed).
- 主要言語
- Dart
- スター
- 1.9k
- フォーク
- 1.3k
- 平均マージ
- 6日 16時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluttercommunity/plus_plugins のほかの issue
-
[Bug]: (share_plus) iOS drops the subject when sharing a uri対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fluttercommunity/plus_plugins#3994 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
fluttercommunity/plus_plugins#3976 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
fluttercommunity/plus_plugins#3974 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage
難易度 5/5 1週間以上 初心者へのやさしさ 48/100
fluttercommunity/plus_plugins#3973 ·
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
fluttercommunity/plus_plugins#3968 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
fluttercommunity/plus_plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
DarkFlippers/qUnleashed#240 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quickemu-project/quickgui#328 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ApplETS/Notre-Dame#1393 ·
-
(fix) Wrong dateオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Solvro/mobile-topwr#1239 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
linagora/twake-on-matrix#3435 ·
メンテナーはふだん 3 日以内に返信