-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Open
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimefeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Several NgRx libraries have features/checks that are only used in development mode (e.g. store runtime checks, component store lifecycle hooks check, store devtools, etc).
Proposed solution
Expose the ngDevMode
/isNgDevMode
variable to the public API, so it can be used in Angular libraries that have dev mode-related functionalities, but also in user codebases if needed.
This feature could significantly reduce the size of production bundles in many Angular codebases.
Alternatives considered
Currently, we can use ngDevMode
to remove dev mode-related logic from the production bundle in the following way:
declare const ngDevMode: boolean;
const isNgDevMode = typeof ngDevMode === 'undefined' || !!ngDevMode;
// ...
if (isNgDevMode) {
console.warn('@ngrx/store: ...');
}
However, this global variable is not part of the public API and it can be risky to rely on it.
timdeschryver, JeanMeche, Jefiozie, brandonroberts, jonz94 and 65 more
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimefeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration