From f561e15611ba977c9d0c79b6a9440d6f40a522b2 Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Mon, 24 Oct 2022 02:45:48 +0200 Subject: [PATCH] chore: release v0.2.0 (#279) - Bump major prerelease version to reflect breaking changes - Add release notes with migration guides to the changelog --- CHANGELOG.md | 83 ++++++++++++++++++++ packages/router-component-store/package.json | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cca9b0d..542f860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,88 @@ # Router Component Store changelog +## 0.2.0 (2022-10-24) + +### Features + +- Remove type parameter from `selectQueryParam` +- Specify observable type returned from `selectQueryParam` +- Remove type parameter from `selectRouteParam` +- Specify observable type returned from `selectRouteParam` + +### **BREAKING CHANGES** + +#### Stricter signature for selectQueryParam + +Signature before: + +```typescript +selectQueryParam(param: string): Observable; +``` + +Signature after: + +```typescript +selectQueryParam(param: string): Observable; +``` + +##### Migration + +Loose types now yield compilation errors. Remove the type parameter to use the +actual emitted type of `string | undefined` and optionally use operators to +change or narrow the type. + +Before: + +```typescript +// Actual emitted values are of type `string | undefined` regardless of what we specify +const filter$ = routerStore.selectQueryParam('filter'); +``` + +After: + +```typescript +// Emitted values are implicitly of type `string | undefined` and are only changeable through operators +const filter$ = routerStore + .selectQueryParam('filter') + .pipe(map((filter) => filter ?? null)); +``` + +#### Stricter signature for selectRouteParam + +Signature before: + +```typescript +selectRouteParam(param: string): Observable; +``` + +Signature after: + +```typescript +selectRouteParam(param: string): Observable; +``` + +##### Migration + +Loose types now yield compilation errors. Remove the type parameter to use the +actual emitted type of `string | undefined` and optionally use operators to +change or narrow the type. + +Before: + +```typescript +// Actual emitted values are of type `string | undefined` regardless of what we specify +const id$ = routerStore.selectRouteParam('id'); +``` + +After: + +```typescript +// Emitted values are implicitly of type `string | undefined` and are only changeable through operators +const id$ = routerStore.selectRouteParam('id').pipe( + map(id => id === undefined ? undefined : Number(id), +); +``` + ## 0.1.1 (2022-10-21) ### Features diff --git a/packages/router-component-store/package.json b/packages/router-component-store/package.json index cf4a7e6..d8fb824 100644 --- a/packages/router-component-store/package.json +++ b/packages/router-component-store/package.json @@ -1,6 +1,6 @@ { "name": "@ngworker/router-component-store", - "version": "0.2.0-alpha.0", + "version": "0.2.0", "description": "An Angular Router-connecting NgRx component store.", "license": "MIT", "peerDependencies": {