Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(store): tree-shake development options token #2260

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor(store): tree-shake development options token
Adds `__PURE__` annotation to the `NGXS_DEVELOPMENT_OPTIONS` to drop the code when it's
unused in production.
arturovt committed Nov 18, 2024

Verified

This commit was signed with the committer’s verified signature.
jalaziz Jameel Al-Aziz
commit ab9cc5ef4855dd0295fe51e4ce0291a692af558b
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,10 +6,11 @@ $ npm install @ngxs/store@dev

### To become next patch version

- Refactor: Allow tree-shaking of dev-only code [#2259](https://github.com/ngxs/store/pull/2259)
- Refactor: Use field initializers for injectees [#2258](https://github.com/ngxs/store/pull/2258)
- Refactor: Allow tree-shaking of dev-only code [#2259](https://github.com/ngxs/store/pull/2259)
- Fix(store): Run plugins in injection context [#2256](https://github.com/ngxs/store/pull/2256)
- Fix(websocket-plugin): Do not dispatch action when root injector is destroyed [#2257](https://github.com/ngxs/store/pull/2257)
- Refactor(store): Tree-shake development options token [#2260](https://github.com/ngxs/store/pull/2260)

### 18.1.5 2024-11-12

15 changes: 8 additions & 7 deletions packages/store/src/dev-features/symbols.ts
Original file line number Diff line number Diff line change
@@ -12,10 +12,11 @@ export interface NgxsDevelopmentOptions {
};
}

export const NGXS_DEVELOPMENT_OPTIONS = new InjectionToken<NgxsDevelopmentOptions>(
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NGXS_DEVELOPMENT_OPTIONS' : '',
{
providedIn: 'root',
factory: () => ({ warnOnUnhandledActions: true })
}
);
export const NGXS_DEVELOPMENT_OPTIONS =
/* @__PURE__ */ new InjectionToken<NgxsDevelopmentOptions>(
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NGXS_DEVELOPMENT_OPTIONS' : '',
{
providedIn: 'root',
factory: () => ({ warnOnUnhandledActions: true })
}
);