Skip to content

Reduce 3.4MB solar system generated file impact #36

@rustydb

Description

@rustydb

Priority: P2

Source

Senior Architect Code Review (2026-04-03)

Problem

packages/shared-types/src/solarSystems.generated.ts is 3.4MB of bundled solar system catalog data. This file is imported by the dashboard and API via the shared-types package. The size impacts:

  • bun install and node_modules bloat
  • IDE performance (indexing, autocomplete)
  • Potentially client-side bundle size if not properly tree-shaken
  • CI cache sizes

Affected Files

  • packages/shared-types/src/solarSystems.generated.ts (3,457,433 bytes)
  • packages/shared-types/src/solarSystems.ts
  • scripts/update-solar-systems.ts

Recommendation

Options to evaluate:

  1. Lazy-load the data — export the catalog as a function that dynamically imports the data, so it is only loaded when needed
  2. Separate data package — move the generated catalog to its own packages/solar-system-data package so the core shared-types remain lightweight
  3. JSON instead of TS — store as .json and import with resolveJsonModule, which may be more IDE-friendly
  4. Compress + decompress — store as a compressed binary and decompress at runtime (extreme, probably not worth it)
  5. API-served — serve the catalog from the API and remove it from the client bundle entirely

Acceptance Criteria

  • The shared-types package is under 100KB excluding the solar system data
  • Solar system lookups still work in both dashboard and API
  • IDE performance is not degraded by the data file
  • Client bundle size is verified to not include unused solar system entries

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance-related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions