Skip to content

Commit 5f8ed15

Browse files
Update angular template to v22 (#976)
* Update angular template to v22 * Skip deno angular * Add change file * Too much copy pastes from test project
1 parent 5bf2822 commit 5f8ed15

8 files changed

Lines changed: 24 additions & 23 deletions

File tree

.changes/angular-22.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"create-tauri-app": patch
3+
"create-tauri-app-js": patch
4+
---
5+
6+
Updated angular template to v22 and typescript to v6

.github/workflows/templates-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ jobs:
155155
working-directory: tauri-app
156156

157157
- run: ${{ matrix.settings.run_cmd }} tauri build ${{ matrix.settings.no_bundle_flag }}
158-
if: matrix.settings.manager != 'npm'
158+
# Skip deno angular test for now, `ng build` stucks on deno
159+
if: matrix.settings.manager != 'npm' && !(matrix.settings.manager == 'deno' && matrix.settings.template == 'angular')
159160
working-directory: tauri-app
160161

161162
- run: ${{ matrix.settings.run_cmd }} tauri build -- ${{ matrix.settings.no_bundle_flag }}

templates/template-angular/angular.json.lte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"builder": "@angular/build:application",
2222
"options": {
2323
"browser": "src/main.ts",
24-
"polyfills": ["zone.js"],
2524
"tsConfig": "tsconfig.app.json",
2625
"inlineStyleLanguage": "scss",
2726
"assets": [

templates/template-angular/package.json.lte

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/common": "^20.1.4",
14-
"@angular/compiler": "^20.1.4",
15-
"@angular/core": "^20.1.4",
16-
"@angular/forms": "^20.1.4",
17-
"@angular/platform-browser": "^20.1.4",
18-
"@angular/router": "^20.1.4",
13+
"@angular/common": "^22.0.1",
14+
"@angular/compiler": "^22.0.1",
15+
"@angular/core": "^22.0.1",
16+
"@angular/forms": "^22.0.1",
17+
"@angular/platform-browser": "^22.0.1",
18+
"@angular/router": "^22.0.1",
1919
"rxjs": "~7.8.2",
2020
"tslib": "^2.8.1",
21-
"zone.js": "~0.15.1",
2221
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
2322
"@tauri-apps/plugin-opener": "^2"{% endif %}
2423
},
2524
"devDependencies": {
26-
"@angular/build": "^20.1.4",
27-
"@angular/cli": "^20.1.4",
28-
"@angular/compiler-cli": "^20.1.4",
25+
"@angular/build": "^22.0.1",
26+
"@angular/cli": "^22.0.1",
27+
"@angular/compiler-cli": "^22.0.1",
2928
"@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}",
30-
"typescript": "~5.8.3"
29+
"typescript": "~6.0.3"
3130
}
3231
}

templates/template-angular/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Welcome to Tauri + Angular!</h1>
1515
<input #greetInput id="greet-input" placeholder="Enter a name..." />
1616
<button type="submit">Greet</button>
1717
</form>
18-
<p>{{ greetingMessage }}</p>
18+
<p>{{ greetingMessage() }}</p>
1919

2020
<router-outlet />
2121
</main>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from "@angular/core";
1+
import { Component, signal } from "@angular/core";
22
import { RouterOutlet } from "@angular/router";
33
import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
44

@@ -9,14 +9,14 @@ import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %
99
styleUrl: "./app.component.css",
1010
})
1111
export class AppComponent {
12-
greetingMessage = "";
12+
greetingMessage = signal("");
1313

1414
greet(event: SubmitEvent, name: string): void {
1515
event.preventDefault();
1616

1717
// Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
1818
invoke<string>("greet", { name }).then((text) => {
19-
this.greetingMessage = text;
19+
this.greetingMessage.set(text);
2020
});
2121
}
2222
}
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import {
22
ApplicationConfig,
33
provideBrowserGlobalErrorListeners,
4-
provideZoneChangeDetection,
54
} from "@angular/core";
65
import { provideRouter } from "@angular/router";
76

87
import { routes } from "./app.routes";
98

109
export const appConfig: ApplicationConfig = {
11-
providers: [
12-
provideBrowserGlobalErrorListeners(),
13-
provideZoneChangeDetection({ eventCoalescing: true }),
14-
provideRouter(routes),
15-
],
10+
providers: [provideBrowserGlobalErrorListeners(), provideRouter(routes)],
1611
};

templates/template-angular/tsconfig.app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
"extends": "./tsconfig.json",
55
"compilerOptions": {
6+
"composite": true,
67
"outDir": "./out-tsc/app",
78
"types": []
89
},

0 commit comments

Comments
 (0)