Repository navigation
Angular 04: signals - #35
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth lesson in my Angular guide. The feature slice is series navigation in the reader, and adding it exposed a stale-route bug that the signals refactor fixes.
What shipped
Series navigation. Every Angular guide lesson ends with "Part N of M" plus previous/next
routerLinks, which prerender as realhrefs.Fix: the reader went stale on reuse
thought-detail.tsreadroute.snapshotonce, and the router reuses the component when only:slugchanges.toSignal(route.paramMap). The thought, series position and lazy lesson page arecomputed()/resource({ params })off it.Reader specs on
RouterTestingHarness. They now navigate for real. A mocked snapshot can't express a reused component receiving a new param, which is how the bug hid.Dock state is read-only.
DockServicekeeps private writable signals and exposesasReadonly()views. The two hand-rolled "minimize" Map writes inapp.tsandmenu-bar.service.tsnow callminimizeApp().Lesson 04: signals (
/thoughts/angular-04-signals)linkedSignalselection.Version and changelog. 1.4.3, with a matching changelog entry.
Bundle
Initial bundle went from 377.25 kB to 384.14 kB. A measurement build without
RouterLinkcomes out at 377.83 kB, so the link directive is the 6.3 kB. I'm keeping it: real links and correct ⌘-click behaviour beat a hand-rolled click handler, and later lessons reuse it. That leaves 16 kB of headroom under the 400 kB budget.Commits
Verification
scrollTopstayed at 500.ng test: 48 files, 356 tests, exit 0. Lint and bothtsc --noEmitconfigs are clean.href="/thoughts/angular-03-templates".TO-DOs for this PR