Skip to content

Use ngDevMode instead of isDevMode() to facilitate tree-shaking #3579

Closed
@amakhrov

Description

@amakhrov

Which @ngrx/* package(s) are relevant/related to the feature request?

component-store, entity, router-store, store

Information

The packages have a bunch of run-time warnings, guarded by Angular's isDevMode() check. While this guard suppresses respective warnings at run time, the related code is still included in the generated bundles.

Angular's own approach for this is using the global ngDevMode constant, that is replaced with a concrete value at compile time (by webpack), and allows to eliminate the dev code from the resulting prod bundle.

It would be nice to have the same optimization for NgRx.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions