Repository navigation
Description
Split out of #793 so the Sentry removal could land. The ui-side work is done and merged; only the parent's submodule pointer bump is outstanding.
What is already merged, on Scaffald/ui
- perf(Breadcrumb): drop the lucide-react fork, which shipped a second icon set ui#31 deletes
src/components/Breadcrumb/BreadcrumbIcons.web.tsxand dropslucide-reactfrom that package. The fork existed only to import two icons —Home,ChevronRight— fromlucide-reactinstead oflucide-react-native, while its sibling already exports the same two names from the latter and 369 files across the app use it. Metro tree-shakes neither barrel, so that one file shipped a complete second icon set: 1,439 modules, 1.07 MB (Bundle audit: what the 17.4 MB web entry bundle is actually made of #791). - fix(docs-site): declare lucide-react-native, which it renders but never listed ui#32 declares
lucide-react-nativeindocs-site/package.json, which it had never listed despite 64 components in the package importing it.
What is blocked
Bumping packages/ui in this repo to a3d473c fails @scaffald/ui-docs:build in CI:
Module not found: Error: Can't resolve 'lucide-react-native'
in '<repo>/packages/ui/dist'
Notable, and the reason this needs someone to look rather than guess again:
- It passes locally.
pnpm nx run @scaffald/ui-docs:buildexits 0 in a fresh worktree with the pointer ata3d473c. - It is not flaky. Re-running the failed CI job reproduces it.
- Declaring the dependency on the docs site (ui#32) did not fix CI, though it is correct on its own terms.
- The committed lockfile does record
lucide-react-nativeunderpackages/ui/docs-site. - webpack resolves from
packages/ui/dist, so it walkspackages/ui/node_modules→packages/node_modules→ rootnode_modules.lucide-react-nativeis a dependency of both@scaffald/uiand the root package, so it should be reachable in all of them.
The difference between the two environments is what needs finding. Likely candidates: how actions/checkout with submodules: true lays out the submodule versus a local git submodule update, or pnpm hoisting differing between a cold CI install and a warm local one.
Worth deciding at the same time
lucide-react-native still ships whole — 1.14 MB for the 147 icons actually used, because Metro does not tree-shake its barrel. Options, in rough order of cost:
- Deep imports (
lucide-react-native/dist/esm/icons/<name>) instead of the barrel. ~1 MB, mechanical codemod over 369 files, no visual change. - Migrate to
@expo/vector-icons— not currently installed or imported anywhere. Needs a 147-icon name mapping and changes every icon's appearance across the app; a design decision, not just a perf one.
Acceptance
-
@scaffald/ui-docs:buildpasses in CI with the pointer ata3d473cor later -
packages/uipointer bumped,lucide-reactgone from the bundle (verify by source-map attribution:lucide*should drop 2.20 MB → 1.14 MB) - A decision recorded on whether the remaining icon set stays lucide with deep imports, or moves
Related: #791 (audit), #793 (Sentry half, merged), Scaffald/ui#31, Scaffald/ui#32.
Activity
thinkclay commentedon Sep 17, 2026
Status check on
mainatc67f930d2(2026-09-17):Boxes 1 and 2 appear to have landed without this issue noticing. #794 bumped the
packages/uipointer to91e5fb693, which is aftera3d473c(the compare shows ui#33, #34, #35, #36 on top of it), and CI on that commit is green — includingLint, typecheck & build, whosenx run-many -t buildbuilds@scaffald/ui-docs. At that pointer the ui package.json lists onlylucide-react-native, andsrc/components/Breadcrumb/has noBreadcrumbIcons.web.tsx. So the CI-only resolution failure was fixed by ui#36 ("stop aliasing lucide-react-native to a package #31 removed"), which is what this issue was waiting for.What is still owed before closing boxes 1–2: the bundle proof. One
expo export --platform web --source-mapsonmainand the #791 attribution —lucide*should read ~1.14 MB, not 2.20 MB.On box 3 (what to do about the remaining 1.14 MB), add an option 0 ahead of the deep-import codemod:
lucide-react-nativedeclaressideEffects: false, which is exactly whatEXPO_UNSTABLE_TREE_SHAKING=1 EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH=1 expo exportneeds. One export, one attribution; if it works it is zero code change and also trims zod, awesome-phonenumber and our own barrels. If it does not survive the hydration audit (scripts/audit/hydration-pages.mjs) or breaks the server bundle, fall back to option 1.Note for option 1 if it is needed: the package's
exportsmap exposes only.and./icons(itself a barrel), andmetro.config.js:19hasunstable_enablePackageExports = true, solucide-react-native/dist/esm/icons/<name>would be blocked by the exports map unless the resolver gets an exception. 246 files onmainimport the barrel.