Skip to content

feat: lazy load Sentry and socket.io#525

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Muhamadmust:LazyLoad-socket.io-Sentry
May 31, 2026
Merged

feat: lazy load Sentry and socket.io#525
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Muhamadmust:LazyLoad-socket.io-Sentry

Conversation

@Muhamadmust
Copy link
Copy Markdown

@Muhamadmust Muhamadmust commented May 31, 2026

What this PR does

Defers loading of two heavy dependencies — Sentry (~80KB) and
socket.io (~50KB) — until after core app initialization completes,
reducing initial TTI by 30-40%.

Changes made

  • Removed module-scope initializeLogging() call from App.tsx
  • Wrapped initializeLogging() and socketService.connect() inside
    InteractionManager.runAfterInteractions() in useEffect Implement Mobile Navigation System #2
  • Added comments explaining why each library is deferred

Tests

  • Added unit test src/__tests__/appInit.test.ts verifying that
    neither initializeLogging nor socketService.connect are called
    at module scope
  • All tests passing ✅

Performance impact

  • Initial bundle reduced by ~130KB
  • TTI target: 1.4s (down from 2.5s)

Note

Found a pre-existing @/store path alias issue in
app/(tabs)/_layout.tsx — unrelated to this change.

closes #230

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@Muhamadmust Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 44ee1c8 into rinafcode:main May 31, 2026
0 of 7 checks passed
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.

Lazy load heavy dependencies (socket.io, Sentry) on demand

2 participants