You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(performance): replace npx with yarn; trim to installed/Expo-native tools
Addresses PR review (supply-chain risk from npx):
- react-native / expo: already deps -> `yarn <tool>` (no npx).
- expo-atlas: kept as the one bundle analyzer; install via `yarn expo install`
(SDK-pinned) + `EXPO_ATLAS=1 yarn expo export` + `yarn expo-atlas`. Never npx.
- Excluded source-map-explorer, bundle-stats, bundle-phobia-cli (use
bundlephobia.com), and react-compiler-healthcheck (use the installed ESLint
react-compiler plugin instead) — none are installed and they overlap.
- Rewrote bundle-analyze-js.md around Expo Atlas, dropping the source-map-explorer,
bundle-stats, and Re.Pack/webpack sections (not used in this Metro/Expo app).
No remaining `npx` except an explicit "don't npx" note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# One-time: add the Atlas viewer (Expo pins the SDK-compatible version)
18
+
yarn expo install expo-atlas
19
+
20
+
# Emit bundle data, then open the treemap viewer
21
+
EXPO_ATLAS=1 yarn expo export --platform ios
22
+
yarn expo-atlas
25
23
```
26
24
25
+
> Don't `npx expo-atlas` — `npx` fetches and runs an unpinned remote version on
26
+
> every call. `yarn expo install` pins the SDK-compatible version once.
27
+
27
28
## When to Use
28
29
29
30
- JS bundle seems too large
30
31
- Want to identify heavy dependencies
31
32
- Investigating startup time issues
32
33
- Before/after optimization comparison
33
34
34
-
> **Note**: This skill involves visual treemap output (source-map-explorer, Expo Atlas). When regression checks include device flows, use `agent-device` for app evidence; install it through the environment's approved/trusted path or ask the user if verification needs it and it is missing. Treemap analysis itself may still require exported reports, browser screenshots, or human review.
35
+
> **Note**: Atlas produces a visual treemap (browser UI). Treemap analysis may
36
+
> require exported reports, browser screenshots, or human review.
35
37
36
38
## Understanding Hermes Bytecode
37
39
38
40
Modern React Native (0.70+) uses Hermes bytecode, not raw JavaScript:
41
+
39
42
- Skips parsing at runtime
40
43
- Still benefits from smaller bundles
41
44
- Heavy imports still execute on startup
42
45
43
46
**Impact of bundle size:**
47
+
44
48
- Larger bytecode = longer download from store
45
49
- More imports on init path = slower TTI
46
50
47
-
## Method 1: source-map-explorer
51
+
## Expo Atlas
48
52
49
-
### Generate Bundle with Source Map
53
+
The Atlas **data emission** is built into the Expo CLI (the `EXPO_ATLAS` env var
54
+
on `expo export` / `expo start`); the `expo-atlas` package provides the
55
+
**viewer**. Add it once with `yarn expo install expo-atlas`.
0 commit comments