Skip to content

Bind classes and host listeners the current way; drop a redundant zone - #418

Merged
adamjohnwright merged 1 commit into
mainfrom
chore/322-class-style-host
Oct 12, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
chore/322-class-style-host

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Part of #322: the remaining mechanical migrations from its table.

Pattern Before Now
*ngIf / *ngFor / @Input() / @ViewChild none left in code (the remaining hits are in comments)
[ngClass] 15 files 0: Angular's ngclass-to-class-migration for most, and the 7 it left by hand. Those were a class named by an expression (connector?.type, side.key, a ternary), a function (innerClasses()), an async pipe, and the NgModule libraries' templates.
[ngStyle] none in code (the migration found nothing; Rhea's are commented out)
@HostListener 8 files 0: moved to each component's host: {} metadata, same events and arguments
NgZone.run 1 0: the DeltaSignal logic graph wrapped a signal set in it, which does nothing without zone.js

[class] with an object or a string merges with a static class attribute, as [ngClass] did. NgClass imports that became unused are removed; the NgModule components get it from CommonModule and are unchanged.

Left: the NgModule libraries (reactome-table, reactome-gsa-form, reactome-table-wc) and their standalone: false components. They're a separate, larger conversion.

A test made honest

The full e2e run caught disease-compare "a second click while it slides out brings it back" failing once under load. It read the button's label the instant the click returned, before change detection had run. It passes 4/4 alone and passes on main, so it was timing-sensitive, not broken. It now waits up to 200ms, well inside the 0.5s slide (transition: 0.5s in the scss), so a label that waited for the slide would still fail it.

Tests

  • Builds: build:libs, npm run build and build:embed all succeed.
  • Unit tests: 689 passed.
  • Full e2e suite: 387 passed, plus the 6 tests that skip themselves. The one failure was the test above; disease-compare then passed 14/14 (--repeat-each=2).
  • Gates: check:lint and check:dead unchanged at their baselines.
  • Render tests: ran live in the pre-push hook: ok.

🤖 Generated with Claude Code

Part of #322's remaining migrations:
- [ngClass] to [class] / [class.x]: Angular's ngclass-to-class migration
  for most, and the seven it left (a class named by an expression, a
  function or an async pipe, and the NgModule libraries' templates) by
  hand. NgClass imports that became unused are removed.
- @HostListener to the component's host metadata, in all eight places.
- The DeltaSignal logic graph's NgZone.run around a signal set did nothing
  in a zoneless app; removed.

The full e2e run caught disease-compare's "a second click while it slides
out" reading the button's label the instant the click returned -- before
change detection, under load. It now waits up to 200ms, well inside the
0.5s slide, so a label that waited for the slide would still fail it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 2fb6302 into main Oct 12, 2026
6 checks passed
@adamjohnwright
adamjohnwright deleted the chore/322-class-style-host branch October 12, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant