diff --git a/CHANGELOG.md b/CHANGELOG.md index 212c329..f15b235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 2026-11-21 - version 1.4.8 + +- **Every component is OnPush.** None of the 35 components set a change detection strategy, so every one was checked on every pass. Each now uses `ChangeDetectionStrategy.OnPush`. Before switching, I audited each component for state that changes outside signals and template events, the kind OnPush stops rendering, and found none. The contact form's reset after sending is the closest call, and it now carries a comment saying why it still renders +- **A test keeps it that way.** `architecture.spec.ts` reads every `@Component` decorator with the TypeScript parser and fails, naming the class, on any component that doesn't choose OnPush or an explicit `Eager`. Using the parser rather than a text search means the code samples printed in the lessons don't count as components +- **Angular guide, lesson 09: change detection** (`/thoughts/angular-09-change-detection`). The live demo passes one object to an `Eager` child and an `OnPush` child: mutating it updates only the Eager one, replacing it updates both, and a signal reaches the OnPush child with no input change at all. The lesson covers zoneless scheduling, `markForCheck` vs `detectChanges`, NG0100, and the 21.2 rename of `Default` to `Eager` + ## 2026-11-21 - version 1.4.7 - **fix: the contact form accepted blank messages.** `Validators.required` only rejects an empty string, so a name or message of nothing but spaces got through. Both now use a small `notBlank` validator in `shared/validators.ts` diff --git a/package-lock.json b/package-lock.json index 97c9914..93ce887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "angular-paul", - "version": "1.4.7", + "version": "1.4.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "angular-paul", - "version": "1.4.7", + "version": "1.4.8", "dependencies": { "@angular/common": "^21.2.0", "@angular/compiler": "^21.2.0", diff --git a/package.json b/package.json index ba9469d..b1d14a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-paul", - "version": "1.4.7", + "version": "1.4.8", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src/app/app.ts b/src/app/app.ts index aa9a9ed..16092c2 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -1,5 +1,5 @@ import { NgComponentOutlet } from '@angular/common'; -import { Component, effect, inject, viewChild } from '@angular/core'; +import { ChangeDetectionStrategy, Component, effect, inject, viewChild } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { NavigationEnd, Router, RouterOutlet } from '@angular/router'; import { filter, map } from 'rxjs'; @@ -19,6 +19,7 @@ import { WindowManagerService } from './window-manager/window-manager.service'; @Component({ selector: 'app-root', + changeDetection: ChangeDetectionStrategy.OnPush, imports: [ RouterOutlet, Desktop, diff --git a/src/app/apps/about-app.ts b/src/app/apps/about-app.ts index cf52d40..b62d7f8 100644 --- a/src/app/apps/about-app.ts +++ b/src/app/apps/about-app.ts @@ -1,9 +1,10 @@ -import { Component, output, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, output, signal } from '@angular/core'; export type AboutTab = 'overview' | 'skills' | 'experience'; @Component({ selector: 'app-about', + changeDetection: ChangeDetectionStrategy.OnPush, template: `