Which runtimeChecks should be enabled after upgrading from NgRx v13 to v14?
0 reputation · 14 Mar 2025, 09:04 UTC
Goal
The goal is to determine the appropriate configuration for NgRx Store’s runtimeChecks when migrating an application from v13 to v14, ensuring that immutability enforcement aligns with the development and production environments.
Context & Constraints
NgRx v13 enabled strictStateImmutability and strictActionImmutability by default, regardless of environment. In v14, these checks are only active in development mode unless explicitly set. Upgrading can therefore silently remove runtime protection in production builds, potentially masking mutation bugs that would otherwise surface during development.
Unresolved Decision
There is no consensus on whether to re‑enable the default immutability checks in production after an upgrade, or to rely on the new environment‑specific defaults. The decision impacts application stability, debugging effort, and build performance.
Specific Questions
- Can we safely rely on the v14 default runtimeChecks in production, or should we explicitly enable
strictStateImmutabilityandstrictActionImmutability? - Which environments should explicitly set these checks to avoid silent mutation bugs after an upgrade?
- What are the performance implications of keeping runtimeChecks enabled in production builds?