Skip to content

Performance: Optimize Bundle Size #16

@karandeepsingh7070

Description

@karandeepsingh7070

Description

The current bundle size of overwatch-ts can be further optimized to reduce install and runtime footprint for consuming projects.

Current Package bundle size is 4.4Kib
Code Bundle folder dist is 50.8Kib

Acceptance Criteria

✅ Investigate potential replacements for heavy utilities (e.g., consider conditional immer usage or lighter alternatives).
✅ Consider dual ESM/CJS + conditional exports to allow ESM consumers to fully tree-shake unused parts.
✅ Ensure server-only utilities (createServerStore) are excluded from client bundles.

Here is a clean, actionable GitHub issue draft for your Overwatch-TS repository:


Possible Approaches

  • Analyze current bundle with:

    npx rollup-plugin-visualizer dist/overwatch.es.js
  • Review:

    • Is immer contributing a significant portion? Explore lighter immutability options or optional peer dependency for advanced users.
    • Are unused helpers being included in all bundles?
  • Confirm Vite + Rollup config uses

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions