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
{{ message }}
Repository navigation
perf(packaging): reduce production bundle size by scoping googleapis / @googleapis/drive #417
During build artifact analysis of the cross-platform packaging workflow, uncompressed bundle sizes across platforms were measured:
macOS (Flo Cafe.app): ~377–379 MB
Windows (win-unpacked): ~166 MB
Linux (linux-unpacked): ~147 MB
A disk usage audit of production node_modules packaged into app.asar revealed that googleapis alone accounts for 202 MB (out of ~760 MB total node_modules):
Package
Size on Disk
Role in FloCafe
googleapis
202 MB
Google Drive backups (main/services/google-drive.ts)
better-sqlite3
26 MB
SQLite offline DB engine (required)
@whiskeysockets/baileys
14 MB
WhatsApp receipt notifications (required)
decimal.js / bcryptjs / pino / libphonenumber-js
~5 MB
Core utilities
Root Cause
The monolithic googleapis package includes generated API definitions and schemas for 150+ Google Cloud & Workspace services (BigQuery, YouTube, Compute Engine, AI Platform, etc.).
FloCafe currently only uses:
Google Drive API (v3) for encrypted backup upload and restoration (main/services/google-drive.ts)
OAuth2 client for user authentication and token refresh (main/services/google-drive.ts)
Proposed Remediation
Option A (Recommended): Replace googleapis dependency with targeted scoped packages:
google-auth-library (already bundled as standard sub-dependency)
Option B (Packaging Filter): Configure package.jsonbuild.files / electron-builder ignore rules to exclude unused googleapis/build/src/apis/* subfolders other than drive and oauth2.
Expected Impact
~190 MB reduction in unpacked application footprint.
Faster electron packaging times in CI and release workflows.
Smaller download/installation footprint for end users.
Research is underway. The implementation will follow the scout recommendation through a no-mistakes-validated PR, with dependency/runtime compatibility, package footprint, and Google Drive backup/restore behavior covered before merge.
Implementation is ready in #493. The no-mistakes run is green with 13 checks passed. It replaces the monolithic googleapis dependency with @googleapis/drive, preserves OAuth/token/backup behavior, and adds offline API-contract and refreshed-token regression coverage.
Completed: #493 is now squash-merged. FloCafe now uses the scoped @googleapis/drive package while preserving OAuth/token refresh, Drive backup/retention, local restore boundaries, and the added offline contract coverage.
Completed by #493 (squash-merged). FloCafe now uses the scoped @googleapis/drive package, preserving OAuth/token refresh, Drive backup/retention, local restore boundaries, and offline/refreshed-token regression coverage.
Activity
khaira777 commentedon Aug 23, 2026
Research is underway. The implementation will follow the scout recommendation through a no-mistakes-validated PR, with dependency/runtime compatibility, package footprint, and Google Drive backup/restore behavior covered before merge.
khaira777 commentedon Aug 23, 2026
Implementation is ready in #493. The no-mistakes run is green with 13 checks passed. It replaces the monolithic
googleapisdependency with@googleapis/drive, preserves OAuth/token/backup behavior, and adds offline API-contract and refreshed-token regression coverage.khaira777 commentedon Aug 23, 2026
Completed: #493 is now squash-merged. FloCafe now uses the scoped
@googleapis/drivepackage while preserving OAuth/token refresh, Drive backup/retention, local restore boundaries, and the added offline contract coverage.khaira777 commentedon Aug 23, 2026
Completed by #493 (squash-merged). FloCafe now uses the scoped
@googleapis/drivepackage, preserving OAuth/token refresh, Drive backup/retention, local restore boundaries, and offline/refreshed-token regression coverage.