Skip to content

perf(Breadcrumb): drop the lucide-react fork, which shipped a second icon set - #31

Merged
thinkclay merged 1 commit into
mainfrom
perf/drop-lucide-react
Sep 17, 2026
Merged

thinkclay merged 1 commit into
mainfrom
perf/drop-lucide-react

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

BreadcrumbIcons.web.tsx existed only to import two icons — Home and
ChevronRight — from lucide-react instead of lucide-react-native. The
sibling BreadcrumbIcons.tsx already exports exactly those two names from
lucide-react-native, which 369 files across the app use and which renders on
web through react-native-web like everything else. The fork bought nothing.

It cost 1.07 MB. A bundle audit of the web build (Scaffald/SaaS#791) attributed
bytes back through the source map:

lucide-react-native   1,670 files   1.14 MB
lucide-react          1,439 files   1.07 MB

Metro does not tree-shake either barrel, so importing anything from a lucide
package ships the entire icon set. Two packages meant two complete sets — 14%
of a 17.4 MB bundle — and the second one existed for this one file.

Deleting the fork lets the three consumers resolve to ./BreadcrumbIcons, which
is the react-native variant. lucide-react comes out of devDependencies with
it; nothing else in this package referenced it.

Refs Scaffald/SaaS#791


🤖 Generated with Claude Code

…icon set

`BreadcrumbIcons.web.tsx` existed only to import two icons — `Home` and
`ChevronRight` — from `lucide-react` instead of `lucide-react-native`. The
sibling `BreadcrumbIcons.tsx` already exports exactly those two names from
`lucide-react-native`, which 369 files across the app use and which renders on
web through react-native-web like everything else. The fork bought nothing.

It cost 1.07 MB. A bundle audit of the web build (Scaffald/SaaS#791) attributed
bytes back through the source map:

    lucide-react-native   1,670 files   1.14 MB
    lucide-react          1,439 files   1.07 MB

Metro does not tree-shake either barrel, so importing anything from a lucide
package ships the entire icon set. Two packages meant two complete sets — 14%
of a 17.4 MB bundle — and the second one existed for this one file.

Deleting the fork lets the three consumers resolve to `./BreadcrumbIcons`, which
is the react-native variant. `lucide-react` comes out of devDependencies with
it; nothing else in this package referenced it.

Refs Scaffald/SaaS#791

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 27c91b8 into main Sep 17, 2026
@thinkclay
thinkclay deleted the perf/drop-lucide-react branch September 17, 2026 08:12
thinkclay added a commit that referenced this pull request Sep 17, 2026
…er listed (#32)

The Docusaurus build broke with

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

after Scaffald/SaaS dropped the `lucide-react` fork of BreadcrumbIcons (#31).
The docs site has never declared `lucide-react-native` even though 64 components
in this package import it and the site renders them; it had been resolving
through whatever pnpm happened to hoist, and a lockfile regeneration in the
consuming repo moved it out of reach.

The site already aliases react-native → react-native-web through its own
Docusaurus plugin, so the package works there exactly as it does in the app.
This just stops the resolution depending on hoisting luck.

Refs Scaffald/SaaS#791

Co-authored-by: Claude Opus 5 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
The bundle audit in #791 found the web entry bundle was 17.4 MB, and that two
things accounted for over a third of it. Both are now gone.

    entry bundle   17.42 MB  ->  12.07 MB   (-5.35 MB, -30.7%)
    brotli         3.27 MB   ->   1.90 MB   (-42%)

Attribution before and after, through the source map:

    @sentry/*    3.62 MB  ->  0.00 MB
    lucide*      2.20 MB  ->  1.14 MB

## Sentry, removed entirely

22.9% of the bundle, and roughly 2 MB of that was `@sentry/core` bundled **five
times** — one version at the root (10.38.0) and a newer one (10.73.0) nested
under `react`, `replay`, `replay-canvas`, `feedback` and `browser-utils`. The
bundle showed it independently: 293 groups of byte-identical modules, almost all
in ×5 sets.

Removed rather than deduplicated, per the call to drop it. Gone: the
`utils/sentry/` module and its four setup docs, `SentryTestButtons` (defined,
never used), `scripts/setup-sentry.mjs` and its doc, the `setup-sentry` step in
both prebuild scripts, four `@sentry/*` dependencies across three package.json
files, six `EXPO_PUBLIC_SENTRY_DSN_*` entries in eas.json, the DSN types in
environment.d.ts, the `extra.sentry` block in app.config.ts, and the test mock,
validator and validator registration.

**What this costs, stated plainly:** there is no remote error reporting any
more. `logger.error` prints and stops there. Two places were quietly relying on
Sentry to be the real sink, and both are corrected rather than left:

* `ErrorBoundary.componentDidCatch` logged only under `__DEV__` and otherwise
  handed the error to Sentry. That branch would have made every caught error in
  production silent, so it now logs unconditionally.
* `logger.warn` sent production warnings to Sentry and printed nothing. It now
  prints in development and does nothing in production — by design rather than
  by accident, and the comment says so.

Two compliance documents named Sentry as a processor and would have been false:

* `PrivacyScreen` listed "Crash data — Sentry crash reporting", a "Performance
  data" row that was Sentry's, and Sentry among service providers.
* `play-store-assets/metadata/data-safety.md` used it in the reasoning for why
  "Shared" is No everywhere.

Both updated. **If the privacy text is version-controlled in
`core.legal_documents`, this needs a published version per migration 342's
runbook — flagging rather than assuming.**

## The second icon set

`lucide-react` was imported in exactly one file, for two icons, while 369 files
use `lucide-react-native`. Metro tree-shakes neither barrel, so that one import
shipped a complete second icon set: 1,439 modules, 1.07 MB.

The fix was deleting `BreadcrumbIcons.web.tsx` — its sibling already exports the
same two names from `lucide-react-native`, and the three consumers import
`./BreadcrumbIcons` without an extension. Scaffald/ui#31, merged; the submodule
pointer moves to 27c91b8.

`lucide-react-native` still ships whole at 1.14 MB for the 147 icons actually
used. That is the next question and is deliberately not answered here.

Verified: typecheck clean on scf-core and scaffald-app, scf-core suite
1097 passed / 0 failed, production export green.

Refs #791

Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
… the ui package

Pulled in by the pointer bumps; CI's frozen install refused the stale lockfile.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
`@scaffald/ui-docs:build` fails in CI on the ui pointer bump:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

The same build passes locally, and re-running the CI job reproduces it, so it is
environmental rather than flaky and I have not yet found the difference.
Scaffald/ui#32 declaring the dependency on the docs site was not enough.

Sentry removal does not depend on any of that, is verified, and is the larger
half of the saving. So the pointer goes back to what main has and the icon work
moves to its own PR, where the docs build can be debugged without holding this
up. Scaffald/ui#31 and #32 are already merged on the ui side; only the pointer
bump is deferred.

Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
* perf: remove Sentry, and the duplicate icon set — 17.4 MB → 12.1 MB

The bundle audit in #791 found the web entry bundle was 17.4 MB, and that two
things accounted for over a third of it. Both are now gone.

    entry bundle   17.42 MB  ->  12.07 MB   (-5.35 MB, -30.7%)
    brotli         3.27 MB   ->   1.90 MB   (-42%)

Attribution before and after, through the source map:

    @sentry/*    3.62 MB  ->  0.00 MB
    lucide*      2.20 MB  ->  1.14 MB

## Sentry, removed entirely

22.9% of the bundle, and roughly 2 MB of that was `@sentry/core` bundled **five
times** — one version at the root (10.38.0) and a newer one (10.73.0) nested
under `react`, `replay`, `replay-canvas`, `feedback` and `browser-utils`. The
bundle showed it independently: 293 groups of byte-identical modules, almost all
in ×5 sets.

Removed rather than deduplicated, per the call to drop it. Gone: the
`utils/sentry/` module and its four setup docs, `SentryTestButtons` (defined,
never used), `scripts/setup-sentry.mjs` and its doc, the `setup-sentry` step in
both prebuild scripts, four `@sentry/*` dependencies across three package.json
files, six `EXPO_PUBLIC_SENTRY_DSN_*` entries in eas.json, the DSN types in
environment.d.ts, the `extra.sentry` block in app.config.ts, and the test mock,
validator and validator registration.

**What this costs, stated plainly:** there is no remote error reporting any
more. `logger.error` prints and stops there. Two places were quietly relying on
Sentry to be the real sink, and both are corrected rather than left:

* `ErrorBoundary.componentDidCatch` logged only under `__DEV__` and otherwise
  handed the error to Sentry. That branch would have made every caught error in
  production silent, so it now logs unconditionally.
* `logger.warn` sent production warnings to Sentry and printed nothing. It now
  prints in development and does nothing in production — by design rather than
  by accident, and the comment says so.

Two compliance documents named Sentry as a processor and would have been false:

* `PrivacyScreen` listed "Crash data — Sentry crash reporting", a "Performance
  data" row that was Sentry's, and Sentry among service providers.
* `play-store-assets/metadata/data-safety.md` used it in the reasoning for why
  "Shared" is No everywhere.

Both updated. **If the privacy text is version-controlled in
`core.legal_documents`, this needs a published version per migration 342's
runbook — flagging rather than assuming.**

## The second icon set

`lucide-react` was imported in exactly one file, for two icons, while 369 files
use `lucide-react-native`. Metro tree-shakes neither barrel, so that one import
shipped a complete second icon set: 1,439 modules, 1.07 MB.

The fix was deleting `BreadcrumbIcons.web.tsx` — its sibling already exports the
same two names from `lucide-react-native`, and the three consumers import
`./BreadcrumbIcons` without an extension. Scaffald/ui#31, merged; the submodule
pointer moves to 27c91b8.

`lucide-react-native` still ships whole at 1.14 MB for the 147 icons actually
used. That is the next question and is deliberately not answered here.

Verified: typecheck clean on scf-core and scaffald-app, scf-core suite
1097 passed / 0 failed, production export green.

Refs #791

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(deps): bump the ui pointer for the docs-site dependency fix

`@scaffald/ui-docs:build` failed on the previous commit:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

Dropping the `lucide-react` fork moved the Breadcrumb's web path onto
`lucide-react-native`, and the Docusaurus site had never declared that package —
64 components in @scaffald/ui import it and the site renders them, so it had been
resolving through whatever pnpm hoisted, and regenerating the lockfile here moved
it out of reach. Scaffald/ui#32 declares it; the site already aliases
react-native → react-native-web, so it resolves the same way the app does.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore: split the icon change out of this PR

`@scaffald/ui-docs:build` fails in CI on the ui pointer bump:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

The same build passes locally, and re-running the CI job reproduces it, so it is
environmental rather than flaky and I have not yet found the difference.
Scaffald/ui#32 declaring the dependency on the docs site was not enough.

Sentry removal does not depend on any of that, is verified, and is the larger
half of the saving. So the pointer goes back to what main has and the icon work
moves to its own PR, where the docs build can be debugged without holding this
up. Scaffald/ui#31 and #32 are already merged on the ui side; only the pointer
bump is deferred.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
thinkclay added a commit that referenced this pull request Sep 17, 2026
…moved (#36)

The alias pointed at lucide-react, which is no longer declared anywhere
after #31; #32 declared lucide-react-native for the docs site, so it now
resolves as itself through the react-native-svg mock. A warm webpack cache
hid this locally; every clean install failed (Scaffald/SaaS#794 CI).

Co-authored-by: Claude Fable 5.1 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
… as cards on an iPad (#794)

* fix(native): no cookie sheet on iOS/Android — native answers consent implicitly, and the privacy answers are written down

Fixes #764. Also the pre-submit checklist line #765 asked for.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ui): bump @scaffald/ui to Scaffald/ui#33 — Table stacks on native, percentage widths

Part of #768.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ui): bump @scaffald/ui to Scaffald/ui#34 — stacked lines wrap bare strings in Text

Part of #768.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(table-columns): call formatter cells directly so their strings reach a <Text>

flexRender turns any function into a React component, so a formatter's
string return came back inside an element that isValidElement waved through
and native then rendered as a bare child of the stacked <View>. Every Office
table on an iPad. Part of #768.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ui): bump @scaffald/ui to Scaffald/ui#35 — stacked rows paint on native

Part of #768.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(lockfile): drop lucide-react, which Scaffald/ui#31 removed from the ui package

Pulled in by the pointer bumps; CI's frozen install refused the stale lockfile.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ui): bump @scaffald/ui to Scaffald/ui#36 — docs-site no longer aliases to the removed lucide-react

Part of #768; unblocks CI on #794.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant