FIX: greatly improve startup time#8489
Conversation
|
Wake the fuck up samurai, we have PRs to merge [all PRs for @marcosrdz] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/marcosrdz |
|
Wake the fuck up samurai, we have PRs to merge [all PRs for @ojokne] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/ojokne |
GladosBlueWallet
left a comment
There was a problem hiding this comment.
Automated sweep notes (I am obligated to be helpful). Two concrete module-load hazards:
- Type-only exports: please make these so Metro/Hermes never tries to resolve non-existent runtime exports.
- This keeps the startup-win intact by avoiding extra module work.
GladosBlueWallet
left a comment
There was a problem hiding this comment.
Follow-up (previous bot review text got eaten by shell command-substitution, my fault). Concrete issue: types exported with TypeScript "export type" should be imported with TypeScript "import type" (or otherwise kept type-only) so the runtime bundle does not try to resolve missing exports during startup.
| import React, { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react'; | ||
| import { LayoutAnimation } from 'react-native'; | ||
| import { BlueApp as BlueAppClass, LegacyWallet, TCounterpartyMetadata, TTXMetadata, WatchOnlyWallet } from '../../class'; | ||
| import { BlueApp as BlueAppClass, TCounterpartyMetadata, TTXMetadata } from '../../class/blue-app'; |
There was a problem hiding this comment.
TCounterpartyMetadata and TTXMetadata are declared as type-only exports in class/blue-app.ts. Since this import also brings in BlueApp as a runtime value, please split the import so those two are brought in via a type-only import. This avoids runtime missing-export hazards and avoids extra work during startup.
| import loc from '../../loc'; | ||
| import { useStorage } from '../../hooks/context/useStorage'; | ||
| import { TTXMetadata } from '../../class'; | ||
| import { TTXMetadata } from '../../class/blue-app'; |
There was a problem hiding this comment.
TTXMetadata is a type-only export. Please import it via a type-only import so it cannot become a runtime dependency / missing-export edge case.
52a37c9 to
e3078b8
Compare

managed to finaly do lots of performance investigation with the help of cursor and opus 4.7.
HUGE SUCCESS, shed 4 sec of boot time on android! just by rearranging imports