Repository navigation
perf: remove Sentry — 17.4 MB → 13.6 MB - #793
Merged
Merged
Conversation
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]>
`@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]>
thinkclay
force-pushed
the
perf/drop-sentry-and-duplicate-icons
branch
from
September 17, 2026 08:37
4e34803 to
29444d4
Compare
`@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]>
Contributor
Author
|
Scope narrowed to Sentry only. The icon half is split out. Bumping the ui submodule pointer broke The same build passes locally, and re-running the CI job reproduces it, so it is environmental rather than flaky and I have not found the difference yet — Scaffald/ui#32 declaring the dependency on the docs site was not enough. Sentry removal does not depend on any of that and is the larger half, so the pointer goes back to what main has and the icons move to their own PR. Scaffald/ui#31 (deleting the Measured, this PR alone: The icon change is worth a further ~1.07 MB when the docs build is sorted. |
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Attribution before and after, through the source map:
Sentry, removed entirely
22.9% of the bundle, and roughly 2 MB of that was
@sentry/corebundled fivetimes — one version at the root (10.38.0) and a newer one (10.73.0) nested
under
react,replay,replay-canvas,feedbackandbrowser-utils. Thebundle 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.mjsand its doc, thesetup-sentrystep inboth prebuild scripts, four
@sentry/*dependencies across three package.jsonfiles, six
EXPO_PUBLIC_SENTRY_DSN_*entries in eas.json, the DSN types inenvironment.d.ts, the
extra.sentryblock 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.errorprints and stops there. Two places were quietly relying onSentry to be the real sink, and both are corrected rather than left:
ErrorBoundary.componentDidCatchlogged only under__DEV__and otherwisehanded the error to Sentry. That branch would have made every caught error in
production silent, so it now logs unconditionally.
logger.warnsent production warnings to Sentry and printed nothing. It nowprints 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:
PrivacyScreenlisted "Crash data — Sentry crash reporting", a "Performancedata" row that was Sentry's, and Sentry among service providers.
play-store-assets/metadata/data-safety.mdused 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'srunbook — flagging rather than assuming.
The second icon set
lucide-reactwas imported in exactly one file, for two icons, while 369 filesuse
lucide-react-native. Metro tree-shakes neither barrel, so that one importshipped a complete second icon set: 1,439 modules, 1.07 MB.
The fix was deleting
BreadcrumbIcons.web.tsx— its sibling already exports thesame two names from
lucide-react-native, and the three consumers import./BreadcrumbIconswithout an extension. Scaffald/ui#31, merged; the submodulepointer moves to 27c91b8.
lucide-react-nativestill ships whole at 1.14 MB for the 147 icons actuallyused. 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
🤖 Generated with Claude Code