Skip to content

Commit f001b2f

Browse files
committed
Angular v19 upgrades and more
1 parent 6a89c48 commit f001b2f

34 files changed

+4938
-4821
lines changed

app/angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"routesFile": "prerendered-routes.txt"
6565
},
6666
"ssr": {
67-
"entry": "server.ts"
67+
"entry": "src/server.ts"
6868
}
6969
},
7070
"configurations": {
@@ -119,6 +119,7 @@
119119
"test": {
120120
"builder": "@angular-devkit/build-angular:karma",
121121
"options": {
122+
"builderMode": "application",
122123
"polyfills": ["zone.js", "zone.js/testing"],
123124
"tsConfig": "tsconfig.spec.json",
124125
"inlineStyleLanguage": "scss",

app/ngsw-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
33
"index": "/index.csr.html",
4+
"applicationMaxAge": "30d",
45
"assetGroups": [
56
{
67
"name": "app",

app/package.json

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,55 +19,56 @@
1919
},
2020
"private": true,
2121
"dependencies": {
22-
"@angular/animations": "^18.2.12",
23-
"@angular/cdk": "18.2.13",
24-
"@angular/common": "^18.2.12",
25-
"@angular/compiler": "^18.2.12",
26-
"@angular/core": "^18.2.12",
27-
"@angular/forms": "^18.2.12",
28-
"@angular/material": "18.2.13",
29-
"@angular/platform-browser": "^18.2.12",
30-
"@angular/platform-browser-dynamic": "^18.2.12",
31-
"@angular/platform-server": "^18.2.12",
32-
"@angular/router": "^18.2.12",
33-
"@angular/service-worker": "^18.2.12",
34-
"@angular/ssr": "^18.2.12",
35-
"@ngrx/operators": "^18.1.1",
36-
"@ngrx/signals": "^18.1.1",
37-
"consola": "^3.2.3",
38-
"express": "^4.21.1",
39-
"firebase": "^11.0.2",
40-
"ngxtension": "^4.1.0",
41-
"rxfire": "^6.0.6-canary.5cfad21",
22+
"@angular/animations": "^19.1.3",
23+
"@angular/cdk": "19.1.1",
24+
"@angular/common": "^19.1.3",
25+
"@angular/compiler": "^19.1.3",
26+
"@angular/core": "^19.1.3",
27+
"@angular/forms": "^19.1.3",
28+
"@angular/material": "19.1.1",
29+
"@angular/platform-browser": "^19.1.3",
30+
"@angular/platform-browser-dynamic": "^19.1.3",
31+
"@angular/platform-server": "^19.1.3",
32+
"@angular/router": "^19.1.3",
33+
"@angular/service-worker": "^19.1.3",
34+
"@angular/ssr": "^19.1.4",
35+
"@ngrx/operators": "^19.0.0",
36+
"@ngrx/signals": "^19.0.0",
37+
"consola": "^3.4.0",
38+
"express": "^4.21.2",
39+
"firebase": "^11.2.0",
40+
"ngxtension": "^4.2.1",
41+
"rxfire": "^6.1.0",
4242
"rxjs": "~7.8.0",
4343
"tslib": "^2.8.1",
44-
"type-fest": "^4.27.0",
45-
"zone.js": "~0.14.10"
44+
"type-fest": "^4.33.0",
45+
"zone.js": "~0.15.0"
4646
},
4747
"devDependencies": {
48-
"@angular-devkit/build-angular": "^18.2.12",
49-
"@angular/cli": "^18.2.12",
50-
"@angular/compiler-cli": "^18.2.12",
51-
"@ngrx/eslint-plugin": "^18.1.1",
52-
"@types/express": "^4.17.17",
53-
"@types/jasmine": "~5.1.0",
54-
"@types/node": "^22.9.0",
55-
"angular-eslint": "^18.4.1",
48+
"@angular-devkit/build-angular": "^19.1.4",
49+
"@angular/cli": "^19.1.4",
50+
"@angular/compiler-cli": "^19.1.3",
51+
"@ngrx/eslint-plugin": "^19.0.0",
52+
"@types/express": "^5.0.0",
53+
"@types/jasmine": "~5.1.5",
54+
"@types/node": "^22.10.10",
55+
"angular-eslint": "^19.0.2",
5656
"autoprefixer": "^10.4.20",
57-
"eslint": "^9.15.0",
58-
"eslint-config-prettier": "^9.1.0",
59-
"jasmine-core": "~5.4.0",
57+
"eslint": "^9.18.0",
58+
"eslint-config-prettier": "^10.0.1",
59+
"jasmine-core": "~5.5.0",
6060
"karma": "~6.4.4",
6161
"karma-chrome-launcher": "~3.2.0",
6262
"karma-coverage": "~2.2.0",
6363
"karma-jasmine": "~5.1.0",
6464
"karma-jasmine-html-reporter": "~2.1.0",
65-
"ng-mocks": "^14.13.1",
66-
"postcss": "^8.4.49",
67-
"prettier": "^3.3.3",
68-
"prettier-plugin-tailwindcss": "^0.6.8",
65+
"ng-mocks": "^14.13.2",
66+
"postcss": "^8.5.1",
67+
"prettier": "^3.4.2",
68+
"prettier-plugin-tailwindcss": "^0.6.11",
6969
"tailwindcss": "^3.4.15",
70-
"typescript": "~5.5.4",
71-
"typescript-eslint": "^8.15.0"
72-
}
70+
"typescript": "~5.7.3",
71+
"typescript-eslint": "^8.21.0"
72+
},
73+
"packageManager": "[email protected]+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
7374
}

app/pnpm-lock.yaml

Lines changed: 2970 additions & 3139 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/server.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

app/src/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const logger = createLogger('AppComponent');
1010

1111
@Component({
1212
selector: 'app-root',
13-
standalone: true,
1413
imports: [RouterOutlet, MatSnackBarModule],
1514
template: ` <router-outlet /> `,
1615
styles: [],

app/src/app/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ApplicationConfig, isDevMode, provideZoneChangeDetection } from '@angular/core';
22
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
3-
import { provideClientHydration } from '@angular/platform-browser';
3+
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
44
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
55
import { provideRouter, withComponentInputBinding, withRouterConfig } from '@angular/router';
66
import { provideServiceWorker } from '@angular/service-worker';
@@ -14,7 +14,7 @@ export const appConfig: ApplicationConfig = {
1414
withComponentInputBinding(),
1515
withRouterConfig({ paramsInheritanceStrategy: 'always' }),
1616
),
17-
provideClientHydration(),
17+
provideClientHydration(withEventReplay()),
1818
provideAnimationsAsync(),
1919
provideServiceWorker('ngsw-worker.js', {
2020
enabled: !isDevMode(),

app/src/app/logbook/data/entries.store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { computed, effect, inject } from '@angular/core';
22
import { toObservable } from '@angular/core/rxjs-interop';
3-
import { injectAuthStoreHelpers } from '@app-shared/auth/data/auth.store';
3+
import { AuthStore } from '@app-shared/auth/data/auth.store';
44
import { createLogger } from '@app-shared/logger';
55
import {
66
EmptyEntriesFilters,
@@ -111,7 +111,7 @@ export const EntriesStore = signalStore(
111111
};
112112
}),
113113
withMethods((store) => {
114-
const { user$ } = injectAuthStoreHelpers();
114+
const authStore = inject(AuthStore);
115115
const entriesService = inject(EntriesService);
116116

117117
// ---
@@ -186,7 +186,7 @@ export const EntriesStore = signalStore(
186186
tap((action) => (action === 'connect' ? setConnecting() : null)),
187187
switchMap((action) => {
188188
if (action === 'connect') {
189-
return user$.pipe(
189+
return authStore.user$.pipe(
190190
map((user) => user?.id),
191191
distinctUntilChanged(),
192192
combineLatestWith(toObservable(store._pageCursor), toObservable(store.filters)),

app/src/app/logbook/feature/entry-item.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { EntriesUpdateStore } from '../data/entries-update.store';
77
import { EntryItemComponent } from './entry-item.component';
88

99
@Component({
10-
standalone: true,
1110
imports: [EntryItemComponent],
1211
template: `<app-entry-item [entry]="entry" />`,
1312
changeDetection: ChangeDetectionStrategy.OnPush,

app/src/app/logbook/feature/entry-item.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ import { EntryFormComponent } from '../ui/entry-form.component';
99

1010
@Component({
1111
selector: 'app-entry-item',
12-
standalone: true,
1312
imports: [DatePipe, MatCardModule, MatButtonModule, EntryFormComponent],
1413
template: `
1514
<mat-card>
1615
@if (!editing()) {
1716
<mat-card-header>
1817
@let timestamp = entry().timestamp;
1918
<mat-card-subtitle>
20-
<span>{{ timestamp.toDate() | date: "EEE dd MMM yyy 'at' hh:mm a" }}</span>
19+
<span>{{ timestamp?.toDate() | date: "EEE dd MMM yyy 'at' hh:mm a" }}</span>
2120
@let category = entry().category;
2221
@if (category) {
2322
<span class="px-2">•</span>

app/src/app/logbook/feature/logbook-page.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const logger = createLogger('LogbookPageComponent');
2525

2626
@Component({
2727
selector: 'app-logbook-page',
28-
standalone: true,
2928
imports: [
3029
MatProgressBarModule,
3130
MatFormFieldModule,
@@ -42,7 +41,7 @@ const logger = createLogger('LogbookPageComponent');
4241
@if (processing()) {
4342
<mat-progress-bar mode="indeterminate" />
4443
}
45-
<h1 class="mat-headline-medium mt-4 py-2 text-center">My logbook</h1>
44+
<h1 class="mt-4 py-2 text-center">My logbook</h1>
4645
<main class="flex h-full flex-col items-center px-4 py-0">
4746
@if (status() === 'error') {
4847
<div class="flex items-center justify-center px-3 py-8">
@@ -57,7 +56,7 @@ const logger = createLogger('LogbookPageComponent');
5756
5857
@if (!onboarding()) {
5958
<section class="py-6">
60-
<h2 class="mat-title-large my-4 text-center">Entries</h2>
59+
<h2 class="my-4 text-center">Entries</h2>
6160
6261
<div class="mb-3 mt-5 flex w-full flex-col items-center space-y-4">
6362
<mat-form-field class="w-fit">
@@ -121,6 +120,7 @@ export class LogbookPageComponent {
121120
readonly #entriesStore = inject(EntriesStore);
122121
readonly #entriesUpdateStore = inject(EntriesUpdateStore);
123122

123+
// eslint-disable-next-line @angular-eslint/no-input-rename
124124
readonly selectedCategory = input<string | undefined>(undefined, { alias: 'category' });
125125

126126
readonly processing = this.#entriesUpdateStore.processing;

app/src/app/logbook/feature/new-entry-panel.component.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import {
2-
ChangeDetectionStrategy,
3-
Component,
4-
effect,
5-
inject,
6-
input,
7-
signal,
8-
untracked,
9-
} from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, inject, input, linkedSignal } from '@angular/core';
102
import { FormsModule } from '@angular/forms';
113
import { MatCardModule } from '@angular/material/card';
124
import { MatFormFieldModule } from '@angular/material/form-field';
@@ -17,7 +9,6 @@ import { EntryFormComponent } from '../ui/entry-form.component';
179

1810
@Component({
1911
selector: 'app-new-entry-panel',
20-
standalone: true,
2112
imports: [FormsModule, MatCardModule, EntryFormComponent, MatFormFieldModule, MatInputModule],
2213
template: `
2314
<section>
@@ -44,7 +35,6 @@ import { EntryFormComponent } from '../ui/entry-form.component';
4435
<mat-form-field class="w-full">
4536
<input
4637
matInput
47-
(click)="toggleExpanded()"
4838
(focus)="toggleExpanded()"
4939
class="w-full"
5040
placeholder="Click here and start typing..."
@@ -66,14 +56,7 @@ export class NewEntryPanelComponent {
6656
readonly categories = input.required<string[]>();
6757
readonly onboarding = input<boolean>(false);
6858

69-
readonly expanded = signal(false);
70-
71-
constructor() {
72-
// Sync the onboarding input flag with the expanded state
73-
effect(() => {
74-
untracked(() => this.expanded.set(this.onboarding()));
75-
});
76-
}
59+
readonly expanded = linkedSignal(() => this.onboarding());
7760

7861
toggleExpanded() {
7962
this.expanded.update((current) => !current);

app/src/app/logbook/logbook-shell.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { RouterOutlet } from '@angular/router';
33

44
@Component({
55
selector: 'app-logbook-shell',
6-
standalone: true,
76
imports: [RouterOutlet],
87
template: ` <router-outlet /> `,
98
styles: ``,

app/src/app/logbook/ui/entry-form.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';
33
import { EntryFormComponent } from './entry-form.component';
44

55
@Component({
6-
standalone: true,
76
imports: [EntryFormComponent],
87
template: `<app-entry-form [processing]="processing" [categories]="categories" />`,
98
changeDetection: ChangeDetectionStrategy.OnPush,

app/src/app/logbook/ui/entry-form.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const logger = createLogger('EntryFormComponent');
2222

2323
@Component({
2424
selector: 'app-entry-form',
25-
standalone: true,
2625
imports: [
2726
ReactiveFormsModule,
2827
MatFormFieldModule,

app/src/app/login/feature/login-flow.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { LoginFlowStore } from './login-flow.store';
88

99
@Component({
1010
selector: 'app-login-flow',
11-
standalone: true,
1211
imports: [RouterLink, MatButtonModule, MatIconModule, MatSnackBarModule, LoginFormComponent],
1312
providers: [LoginFlowStore],
1413
template: `

app/src/app/login/feature/login-flow.store.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { effect, inject } from '@angular/core';
1+
import { effect, inject, untracked } from '@angular/core';
22
import { ActivatedRoute, Router } from '@angular/router';
33
import { AuthStore } from '@app-shared/auth/data/auth.store';
44
import { createLogger } from '@app-shared/logger';
@@ -165,14 +165,14 @@ export const LoginFlowStore = signalStore(
165165
effect(() => logger.log('State:', getState(store)));
166166

167167
// Listen for changes to the user and trigger completion once we have one.
168-
effect(
169-
() => {
170-
if (store.user()) {
168+
effect(() => {
169+
const user = store.user();
170+
if (user) {
171+
untracked(() => {
171172
void store.completeLogin();
172-
}
173-
},
174-
{ allowSignalWrites: true },
175-
);
173+
});
174+
}
175+
});
176176
},
177177
}),
178178
);

0 commit comments

Comments
 (0)