Context
SubTrackr uses Hermes as the JavaScript engine for React Native, which supports precompilation of JavaScript bundles to Hermes bytecode (.hbc). Currently, the entire JS bundle is compiled as a single unit, missing opportunities for differential loading and critical-path optimization. Key subscription management screens—Home, SubscriptionDetail, Analytics, and Payment—can benefit from precompiled bytecode segments loaded on demand.
\
\
Current Limitation
\
- Single monolithic JS bundle compiled to Hermes bytecode
\
- No lazy loading of precompiled screen-level bytecode chunks
\
- Startup time includes parsing/compilation of infrequently-used screens
\
- Memory usage includes bytecode for all screens, not just active ones
\
- Performance budget for startup (2s) may degrade as screen count grows
\
\
Expected Outcome
Differential Hermes bytecode compilation with lazy-loaded screen chunks: critical path screens are precompiled and loaded eagerly; less-frequently-used screens are compiled on-demand, reducing initial bundle size, startup time, and peak memory usage.
\
\
Acceptance Criteria
\
\
Technical Scope
\
- Files:
metro.config.js, babel.config.js, src/navigation/AppNavigator.tsx, scripts/check-performance-budget.js, app.config.js
\
- APIs: Metro bundler HBC plugin, React.lazy + Suspense, Hermes -emit-binary flag
\
- Edge cases: Screen transitions during chunk load, Hermes engine version mismatch, OTA update bytecode compatibility, debug builds not using bytecode, bytecode cache invalidation
Context
SubTrackr uses Hermes as the JavaScript engine for React Native, which supports precompilation of JavaScript bundles to Hermes bytecode (.hbc). Currently, the entire JS bundle is compiled as a single unit, missing opportunities for differential loading and critical-path optimization. Key subscription management screens—Home, SubscriptionDetail, Analytics, and Payment—can benefit from precompiled bytecode segments loaded on demand.
\
\
Current Limitation
\
\
\
\
\
\
\
Expected Outcome
Differential Hermes bytecode compilation with lazy-loaded screen chunks: critical path screens are precompiled and loaded eagerly; less-frequently-used screens are compiled on-demand, reducing initial bundle size, startup time, and peak memory usage.
\
\
Acceptance Criteria
\
\
\
\
\
\
\
\
\
\
\
Technical Scope
\
metro.config.js,babel.config.js,src/navigation/AppNavigator.tsx,scripts/check-performance-budget.js,app.config.js\
\