[Bug]: Android launch spends ~2 s in formatjs polyfill checks before the first render
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, react-native, typescript
調査の方向性
apps/mobile/src/i18n/intl-polyfills.ts から始めてください。このファイルでは DisplayNames と PluralRules のポリフィルを既定のエントリポイントからインポートしています。Issue によると、強制エントリポイント (polyfill-force) は、起動を遅くしているロケール一致チェックを行わずに同じ API をインストールするとのことです。インポートを切り替え、Intl.DisplayNames.polyfilled が true であること、PluralRules('en').select(1) が 'one' を返すこと、'fr' に対する DisplayNames が 'French' を返すことを確認してください。リリース版 Android ビルドでインポートの評価時間が短くなったことを am start -W で計測して確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Install a release Android build.
- Force-stop the app, then launch it (
adb shell am start -W -n <package>/.MainActivity). - Time the splash screen.
Expected behavior
The splash hides within about a second or two of the first JS line on a current phone.
Actual behavior
On a Pixel 9 Pro the splash stays up 5.3 to 6.1 s. Timing logs in a release build show about 3.0 s spent evaluating the JS import graph before App renders anything.
Timing each module's first evaluation (a profiling polyfill around Metro's __d) puts the two largest costs in apps/mobile/src/i18n/intl-polyfills.ts:
| Module | Self time (emulator, production bundle) |
|---|---|
@formatjs/intl-displaynames/polyfill.js |
619 ms |
@formatjs/intl-pluralrules/polyfill.js |
243 ms |
Both default entries call shouldPolyfill() at import. With no native Intl.DisplayNames or Intl.PluralRules (Hermes has neither), that runs @formatjs/intl-localematcher's match(['en'], <~700 supported locales>, 'en'). Every comparison goes through the JS getCanonicalLocales polyfill, and the result is always "polyfill".
Importing the forced entries instead (@formatjs/intl-displaynames/polyfill-force and @formatjs/intl-pluralrules/polyfill-force) installs the same polyfills without the check. Measured on the same phone:
| Default entries | polyfill-force |
|
|---|---|---|
| JS import evaluation | 2.98 to 3.08 s | 0.75 to 0.96 s |
Tap to splash gone (am start -W) |
5.3 to 6.1 s | 1.7 s warm, 2.5 to 3.6 s cold |
Both APIs still install and work afterwards (Intl.DisplayNames.polyfilled === true, new Intl.PluralRules('en').select(1) === 'one', new Intl.DisplayNames(['en'], { type: 'language' }).of('fr') === 'French').
Impact
Major degradation or frequent failure
Version or commit
apps/mobile/src/i18n/intl-polyfills.ts as of c3a330d834 (unchanged in the fork build measured)
Environment
Pixel 9 Pro, Android 17 (GrapheneOS), Battery Saver on, release build; module timings from a production bundle on an Android 17 emulator
Logs or stack traces
Next-largest import costs after the change: React Native's BridgelessUIManager collecting legacy view-manager constants (~400 ms on the emulator), global.css, and Effect / packages/contracts schema setup.
- 主要言語
- TypeScript
- スター
- 24.8k
- フォーク
- 6.4k
- 平均マージ
- 2時間 18分
- マージ済み PR(30日)
- 448
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pingdotgg/t3code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pingdotgg/t3code#40678 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Gitea/Forgejo mergeable:false maps to unknown, so PR watch never reports merge conflicts再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Link dialog copy uses "here"/"there" instead of host names, so the access direction is ambiguous再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
pingdotgg/t3code の issue をすべて見る
似ている issue
-
[Docs] CONTRIBUTING points the Backend Remake milestone at a branch that does not exist対応中かも @franpts2 が今日担当しました。 オープンdocs
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ever-co/ever-teams#5741 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melgarafael/DeskcommCRM#5142 ·
メンテナーはふだん 1 日以内に返信
-
bug size:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信