@dynamic-field-kit/angular 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +10 -3
- package/dist/fesm2022/dynamic-field-kit-angular.mjs +7 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @dynamic-field-kit/angular
|
|
2
2
|
|
|
3
|
+
## 1.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ba3538b: Angular 22 is accepted: `@angular/core` and `@angular/common` are now `>=16 <23`. An app on Angular 22 could not install the package before, as npm refused the peer range. `scripts/verify-angular-peer-range.js` now checks Angular 16 and 22, and the demo app was built with the Angular 22 CLI and used in a browser.
|
|
8
|
+
- ba3538b: A registered field component that uses `OnPush` change detection now shows the props the form hands it after the first render. They were assigned to the component without marking it for check, so a value the form set itself, such as a computed field, did not show. From Angular 22 every component that names no strategy is `OnPush`, so on 22 this hit every registered field component.
|
|
9
|
+
- Angular 22 support.
|
|
10
|
+
|
|
3
11
|
## 1.11.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -86,16 +86,23 @@ For a complete UI integration, see the
|
|
|
86
86
|
|
|
87
87
|
## Supported Angular versions
|
|
88
88
|
|
|
89
|
-
The package declares `@angular/core` and `@angular/common` as `>=16 <
|
|
89
|
+
The package declares `@angular/core` and `@angular/common` as `>=16 <23`,
|
|
90
90
|
and `scripts/verify-angular-peer-range.js` proves both ends in CI by installing
|
|
91
|
-
the packed tarballs against Angular 16 and
|
|
91
|
+
the packed tarballs against Angular 16 and 22 outside the workspace.
|
|
92
92
|
|
|
93
93
|
The floor is 16 because the form store is built on `signal` and `computed`,
|
|
94
94
|
which Angular introduced in 16. It read `>=14` until 1.6.0: npm accepted the
|
|
95
95
|
install on 14 and 15 and the package then failed on import.
|
|
96
96
|
|
|
97
97
|
The suite, the build and the demo app all run Angular 21, which is the version
|
|
98
|
-
the setup below is written for.
|
|
98
|
+
the setup below is written for. The setup works unchanged on 22.
|
|
99
|
+
|
|
100
|
+
Angular 22 makes `OnPush` the default for a component that names no change
|
|
101
|
+
detection strategy, and that includes the field components you register. They
|
|
102
|
+
need nothing extra for it: the adapter marks a rendered field component for
|
|
103
|
+
check whenever it hands it new props. Up to 1.11.0 it did not, so on Angular 22
|
|
104
|
+
a value the form set itself, such as a computed field, did not show in a
|
|
105
|
+
registered component.
|
|
99
106
|
|
|
100
107
|
## Basic setup
|
|
101
108
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component, InjectionToken, inject, ViewContainerRef, ViewChild, ChangeDetectionStrategy, HostListener, signal, computed, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Component, InjectionToken, inject, ChangeDetectorRef, ViewContainerRef, ViewChild, ChangeDetectionStrategy, HostListener, signal, computed, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgIf, NgClass, NgFor, JsonPipe } from '@angular/common';
|
|
5
5
|
import { fieldRegistry, makeErrorId, isAsyncOptions, createOptionsLoader, buildFieldRendererProps, makeFieldId, indexGroupPathMap, applyComputedValues, validateFields, canAddGroupItem, canRemoveGroupItem, createGroupItem, createMessageResolver, validateFieldsAsync, collectFieldPaths } from '@dynamic-field-kit/core';
|
|
@@ -209,6 +209,12 @@ class DynamicInput extends BaseInputComponent {
|
|
|
209
209
|
if (changes['extraProps']) {
|
|
210
210
|
this.applyExtraProps(this.inputInstance);
|
|
211
211
|
}
|
|
212
|
+
// The props above are assigned to the instance, which Angular does not
|
|
213
|
+
// see. Checking the host view alone skips an OnPush renderer that is not
|
|
214
|
+
// marked, and from Angular 22 every renderer that names no strategy is
|
|
215
|
+
// OnPush: a value the form set itself (a computed field, a reset) never
|
|
216
|
+
// showed. The renderer's own view is marked first.
|
|
217
|
+
this.compRef?.injector.get(ChangeDetectorRef).markForCheck();
|
|
212
218
|
this.compRef?.changeDetectorRef?.detectChanges();
|
|
213
219
|
}
|
|
214
220
|
cleanup() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-field-kit/angular",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "Angular renderer for dynamic-field-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"CHANGELOG.md"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@angular/common": ">=16 <
|
|
31
|
-
"@angular/core": ">=16 <
|
|
30
|
+
"@angular/common": ">=16 <23",
|
|
31
|
+
"@angular/core": ">=16 <23",
|
|
32
32
|
"@dynamic-field-kit/core": "^1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"lint": "eslint ."
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@analogjs/vite-plugin-angular": "^2.
|
|
48
|
-
"@analogjs/vitest-angular": "^2.
|
|
47
|
+
"@analogjs/vite-plugin-angular": "^2.8.0",
|
|
48
|
+
"@analogjs/vitest-angular": "^2.8.0",
|
|
49
49
|
"@angular-devkit/build-angular": "^21.2.0",
|
|
50
50
|
"@angular/cdk": "^21.2.14",
|
|
51
51
|
"@angular/common": "^21.2.0",
|