README.md

February 1, 2025 · View on GitHub

State Management Bundle Size Comparison Angular

Checking the app bundle sizes for different state management solutions with source-map-explorer.

The project is based on https://github.com/DeborahK/Angular-NgRx-GettingStarted.

See the branches for the different setups.

Run npm run build:stats to let source-map-explorer calculate the prod bundle size.

Results

The measured size represents the total size of the app, which is build with production configuration.

Angular 19.1.3

LibraryVersionSize (KB)CommentsBranch
🚦DIY Signal State Service-374.34ng@19.1.3--diy-signal-state-service
DIY RxJS State Service-376.77ng@19.1.3--diy-rxjs-state-service
Elf2.5.1379.22Uses ngneat/effects for effectsng@19.1.3--elf@2.5.1
🚦NgRx Signal Store19.0.0380.15ng@19.1.3--ngrx-signals@19.0.0
MiniRx Store (Feature Store API)6.0.0384.13ng@19.1.3--mini-rx-store@6.0.0--feature-store-api
MiniRx Store (Component Store API)6.0.0384.37ng@19.1.3--mini-rx-store@6.0.0--component-store-api
🚦MiniRx Signal Store (Feature Store API)3.0.0385.38ng@19.1.3--mini-rx-signal-store@3.0.0--feature-store-api
🚦MiniRx Signal Store (Component Store API)3.0.0385.64ng@19.1.3--mini-rx-signal-store@3.0.0--component-store-api
🚦MiniRx Signal Store (Redux Store API)3.0.0385.69Uses ts-action for actionsng@19.1.3--mini-rx-signal-store@3.0.0--redux-store-api
NgRx Component Store19.0.0385.64ng@19.1.3--ngrx-component-store@19.0.0
MiniRx Store (Redux Store API)6.0.0390.31Uses ts-action for actionsng@19.1.3--mini-rx-store@6.0.0--redux-store-api
NgRx Store19.0.0408.33Uses ngrx/effects for effectsng@19.1.3--ngrx-store@19.0.0

Angular 17.0.3

LibraryVersionSize (KB)CommentsBranch
DIY RxJS State Service-377.05ng@17.0.3--diy-rxjs-state-service
🚦DIY Signal State Service-377.20ng@17.0.3--diy-signal-state-service
Elf2.4.0379.48Uses ngneat/effects for effectsng@17.0.3--elf@2.4
🚦NgRx Signal Store17.0.1382.83ng@17.0.3--ngrx-signals@17.0.1
MiniRx Store (Component Store API)5.1.0382.91ng@17.0.3--mini-rx-store@5.1--component-store-api
MiniRx Store (Feature Store API)5.1.0383.53ng@17.0.3--mini-rx-store@5.1--feature-store-api
🚦MiniRx Signal Store (Component Store API)0.0.24386.08ng@17.0.3--mini-rx-signal-store@0.0.21--component-store-api
🚦MiniRx Signal Store (Feature Store API)0.0.24386.66ng@17.0.3--mini-rx-signal-store@0.0.21--feature-store-api
🚦MiniRx Signal Store (Redux Store API)0.0.24387.76Uses ts-action for actionsng@17.0.3--mini-rx-signal-store@0.0.21--redux-store-api
NgRx Component Store17.0.0-rc.0388.93ng@17.0.3--ngrx-component-store@17.0.0-rc.0
MiniRx Store (Redux Store API)5.1.0390.55Uses ts-action for actionsng@17.0.3--mini-rx-store@5.1--redux-store-api
Akita8.0.1401.79ng@17.0.3--akita@8.0.1
NgRx Store17.0.0-rc.0408.18Uses ngrx/effects for effectsng@17.0.3--ngrx-store@17.0.0-rc.0

Angular 16.1

LibraryVersionSize (KB)CommentsBranch
🚦DIY Signal State Service-371.98ng@16.1--diy-signal-state-service
DIY RxJS State Service-372.08ng@16.1--diy-rxjs-state-service
Elf2.3.2374.59Uses ngneat/effects for effectsng@16.1--elf@2.3
MiniRx Store (Component Store API)5.1.0378.08ng@16.1--mini-rx-store@5.1--component-store-api
MiniRx Store (Feature Store API)5.1.0378.72ng@16.1--mini-rx-store@5.1--feature-store-api
🚦MiniRx Signal Store (Component Store API)0.0.5380.53ng@16.1--mini-rx-signal-store@0.0.5--component-store-api
🚦MiniRx Signal Store (Feature Store API)0.0.5380.97ng@16.1--mini-rx-signal-store@0.0.5--feature-store-api
🚦MiniRx Signal Store (Redux Store API)0.0.5382.54Uses ts-action for actionsng@16.1--mini-rx-signal-store@0.0.5--redux-store-api
NgRx Component Store16.1.0383.98ng@16.1--ngrx-component-store@16.1
MiniRx Store (Redux Store API)5.1.0385.49Uses ts-action for actionsng@16.1--mini-rx-store@5.1--redux-store-api
Akita8.0.1396.68ng@16.1--akita@8.0
NgRx Store16.1.0402.90Uses ngrx/effects for effectsng@16.1--ngrx-store@16.1

Contributing

You are welcome to add your favourite state management library as well!

You can follow these steps:

  1. Fork and clone the repo
  2. Create a branch based on master (or based on another branch with a familiar state management lib (e.g. "ng@17.0.3--diy-signal-state-service")
  3. Specify the Angular version and the state management library (and version) in the branch name: e.g. "ng@17.0.3--ngrx-signals@17.0.0")
  4. Now refactor to your favourite state management solution (to have equal conditions: try to follow the facade pattern for the state management code, and use something for effects)
  5. Run npm run build:stats to check the bundle size
  6. Create the PR
    • add the bundle size in the PR description
    • target of the PR is this repo and the branch which you initially used as the base for your refactor-branch (e.g. "ng@17.0.3--diy-signal-state-service")
  7. I will review your PR and add your results to the README on the master branch
  8. Finally, I will merge your work to another branch which I will create (e.g. "ng@17.0.3--ngrx-signals@17.0.0") and link that branch in the README