Skip to content

Commit db9bd1e

Browse files
Merge pull request #23 from PascalHonegger/22-add-support-for-angular-21
Migrate to Angular 21, signals-only and zoneless, closes #22
2 parents 5459d27 + 9686887 commit db9bd1e

29 files changed

+4726
-3359
lines changed

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ng-datatable build and test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: pnpm/action-setup@v4
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: 24
20+
cache: pnpm
21+
- run: pnpm install
22+
- run: pnpm lint
23+
- run: pnpm format:check
24+
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v6
29+
- uses: pnpm/action-setup@v4
30+
- uses: actions/setup-node@v6
31+
with:
32+
node-version: 24
33+
cache: pnpm
34+
- run: pnpm install
35+
- run: pnpm build:lib
36+
- run: pnpm build:demo
37+
38+
test:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v6
42+
- uses: pnpm/action-setup@v4
43+
- uses: actions/setup-node@v6
44+
with:
45+
node-version: 24
46+
cache: pnpm
47+
- run: pnpm install
48+
- run: pnpm test

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11
# Changelog
22

3+
## 21.0.0 (2026-01-01)
4+
5+
Changes
6+
7+
- Support zoneless and signals (closes #21) **Breaking Change**
8+
- Mark input `rowsOnPageSet` of `mfBootstrapPaginator` as required (potentially breaking!)
9+
- Less runtime checks for invalid `sortOrder` (potentially breaking!)
10+
- Deprecate `DataTableModule`
11+
- Use Angular 21 (closes #22)
12+
13+
The main API hasn't changed with signals, but **application code will need minor adjustments**, for example:
14+
15+
```html
16+
<!-- OLD -->
17+
@for (item of mf.data; track item) { }
18+
19+
<!-- NEW -->
20+
@for (item of mf.data(); track item) { }
21+
```
22+
23+
Some order of outputs could also have changed with the new signals based implementation, make sure to verify your application after updating!
24+
325
## 20.0.0 (2025-06-20)
426

527
Changes
628

729
- Use Angular 20 (closes #20)
830

9-
*Note: This library does not work with zoneless at the moment, contributions are welcome!*
31+
_Note: This library does not work with zoneless at the moment, contributions are welcome!_
1032

1133
## 19.0.0 (2025-01-28)
1234

angular.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"cli": {
44
"analytics": false,
5+
"packageManager": "pnpm",
56
"schematicCollections": ["angular-eslint"]
67
},
78
"version": 1,
@@ -28,14 +29,7 @@
2829
"defaultConfiguration": "production"
2930
},
3031
"test": {
31-
"builder": "@angular/build:karma",
32-
"options": {
33-
"polyfills": [
34-
"zone.js",
35-
"zone.js/testing"
36-
],
37-
"tsConfig": "projects/ng-datatable/tsconfig.spec.json"
38-
}
32+
"builder": "@angular/build:unit-test"
3933
},
4034
"lint": {
4135
"builder": "@angular-eslint/builder:lint",
@@ -85,9 +79,6 @@
8579
"outputPath": "dist/demo",
8680
"index": "projects/demo/src/index.html",
8781
"browser": "projects/demo/src/main.ts",
88-
"polyfills": [
89-
"zone.js"
90-
],
9182
"tsConfig": "projects/demo/tsconfig.app.json",
9283
"assets": [
9384
"projects/demo/src/data.json"

eslint.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
// @ts-check
2+
import { defineConfig } from 'eslint/config';
23
import eslint from "@eslint/js";
34
import tseslint from "typescript-eslint";
45
import angularEslint from "angular-eslint";
6+
import eslintConfigPrettier from "eslint-config-prettier/flat";
57

6-
export default tseslint.config(
8+
export default defineConfig(
79
{
810
files: ["**/*.ts"],
911
extends: [
1012
eslint.configs.recommended,
1113
...tseslint.configs.recommended,
1214
...tseslint.configs.stylistic,
1315
...angularEslint.configs.tsRecommended,
16+
eslintConfigPrettier
1417
],
1518
processor: angularEslint.processInlineTemplates,
1619
rules: {
@@ -28,6 +31,7 @@ export default tseslint.config(
2831
extends: [
2932
...angularEslint.configs.templateRecommended,
3033
...angularEslint.configs.templateAccessibility,
34+
eslintConfigPrettier
3135
],
3236
rules: {
3337
"@angular-eslint/template/click-events-have-key-events": "off",

package.json

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"name": "ng-datatable",
3-
"version": "20.0.0",
4-
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac",
3+
"version": "21.0.0-next.1",
4+
"packageManager": "pnpm@10.26.2+sha512.0e308ff2005fc7410366f154f625f6631ab2b16b1d2e70238444dd6ae9d630a8482d92a451144debc492416896ed16f7b114a86ec68b8404b2443869e68ffda6",
55
"scripts": {
66
"ng": "ng",
77
"start": "pnpm run build:lib && ng serve demo",
88
"build:lib": "ng build ng-datatable",
9+
"build:demo": "ng build demo",
910
"test": "ng test",
1011
"lint": "ng lint",
1112
"publish:prod": "pnpm run build:lib && cd dist/ng-datatable && pnpm publish",
12-
"publish:dev": "pnpm run build:lib && cd dist/ng-datatable && pnpm publish --tag dev"
13+
"publish:next": "pnpm run build:lib && cd dist/ng-datatable && pnpm publish --tag next",
14+
"format": "prettier --write projects/",
15+
"format:check": "prettier --check projects/"
1316
},
1417
"author": "git@honegger.dev",
1518
"license": "MIT",
@@ -18,38 +21,48 @@
1821
"url": "git+https://github.com/PascalHonegger/ng-datatable.git"
1922
},
2023
"private": true,
24+
"prettier": {
25+
"printWidth": 100,
26+
"singleQuote": true,
27+
"overrides": [
28+
{
29+
"files": "*.html",
30+
"options": {
31+
"parser": "angular"
32+
}
33+
}
34+
]
35+
},
2136
"dependencies": {
22-
"@angular/animations": "^20.0.4",
23-
"@angular/common": "^20.0.4",
24-
"@angular/compiler": "^20.0.4",
25-
"@angular/core": "^20.0.4",
26-
"@angular/forms": "^20.0.4",
27-
"@angular/platform-browser": "^20.0.4",
28-
"@angular/platform-browser-dynamic": "^20.0.4",
29-
"@angular/router": "^20.0.4",
30-
"bootstrap": "^5.3.7",
37+
"@angular/animations": "^21.0.6",
38+
"@angular/common": "^21.0.6",
39+
"@angular/compiler": "^21.0.6",
40+
"@angular/core": "^21.0.6",
41+
"@angular/forms": "^21.0.6",
42+
"@angular/platform-browser": "^21.0.6",
43+
"@angular/platform-browser-dynamic": "^21.0.6",
44+
"@angular/router": "^21.0.6",
45+
"bootstrap": "^5.3.8",
3146
"rxjs": "~7.8.2",
32-
"tslib": "^2.8.1",
33-
"zone.js": "~0.15.1"
47+
"tslib": "^2.8.1"
3448
},
3549
"devDependencies": {
36-
"@angular/build": "^20.0.3",
37-
"@angular/cli": "^20.0.3",
38-
"@angular/compiler-cli": "^20.0.4",
39-
"@angular/language-service": "^20.0.4",
40-
"@eslint/js": "^9.29.0",
41-
"@types/jasmine": "^5.1.8",
42-
"angular-eslint": "20.1.1",
43-
"eslint": "^9.29.0",
44-
"jasmine-core": "^5.8.0",
50+
"@angular/build": "^21.0.4",
51+
"@angular/cli": "^21.0.4",
52+
"@angular/compiler-cli": "^21.0.6",
53+
"@angular/language-service": "^21.0.6",
54+
"@eslint/js": "^9.39.2",
55+
"@types/jasmine": "^5.1.13",
56+
"angular-eslint": "21.1.0",
57+
"eslint": "^9.39.2",
58+
"eslint-config-prettier": "^10.1.8",
59+
"jasmine-core": "^5.13.0",
4560
"jasmine-spec-reporter": "~7.0.0",
46-
"karma": "~6.4.4",
47-
"karma-chrome-launcher": "~3.2.0",
48-
"karma-coverage": "~2.2.1",
49-
"karma-jasmine": "~5.1.0",
50-
"karma-jasmine-html-reporter": "^2.1.0",
51-
"ng-packagr": "^20.0.1",
52-
"typescript": "~5.8.3",
53-
"typescript-eslint": "^8.34.1"
61+
"jsdom": "^27.4.0",
62+
"ng-packagr": "^21.0.1",
63+
"prettier": "^3.7.4",
64+
"typescript": "~5.9.3",
65+
"typescript-eslint": "^8.50.1",
66+
"vitest": "^4.0.16"
5467
}
5568
}

0 commit comments

Comments
 (0)