Signals and change detection
AngularLynx updates the screen when your signals change. There's no Zone.js, so signals are how Angular knows what to re-render. If you already write signal-based Angular, nothing here changes how you code.
Signals drive the UI
count.update()changes the value.- Angular sees that
countchanged and re-renders the template parts that read it. doubleis recalculated because it readscount.
You never call markForCheck() or detectChanges() after changing a signal.
Every Angular signal API works
signal, computed, effect, linkedSignal, resource, input, output, model, viewChild and the other queries, toSignal and toObservable all behave as on the web. See Angular's signals guide for how to use them.
One rule comes from Angular itself: signal-based properties such as input(), output(), model() and viewChild() must be public. Angular can't read them from #private or private fields.
Zoneless only
Every AngularLynx app uses zoneless change detection. It's Angular's default without Zone.js, so app.config.ts has no provider for it, as Angular 22's ng new writes it:
Zone.js can't run on Lynx, because the APIs it patches don't exist there. Don't add zone.js or provideZoneChangeDetection(): the app fails at startup.
Code written for Zone.js can still inject NgZone. As in any zoneless Angular app, Angular gives it a zone that does nothing: run() and runOutsideAngular() call the function they're given, and onStable and onMicrotaskEmpty never emit. So a library that works in a zoneless web app works here too. Angular's zoneless guide has the details.
Angular 22 also makes OnPush the default for every component, so you don't need to set changeDetection.
Observables
Under zoneless change detection, a value that arrives in a bare subscribe() callback doesn't update the screen. Pick one of these instead:
Updates arrive together
AngularLynx sends the screen all the changes from one render at once. If a handler sets five signals, the screen updates once, with all five. You never see a half-updated view.
How it compares to the web
Related
- Threads: where your code runs: what runs on which thread, and what event handlers can do.
- Renderer internals: how a render is scheduled and sent to the screen.
