@@ -15,7 +15,7 @@ Angular has adopted a new reactive primitive, signals. Signals have various impr
1515performance, simplicity, and deeper integrations into the rest of the framework.
1616
1717RxJS will become an optional dependency of Angular. Certain asynchronous workflows will still
18- benefit from RxJS-- signals are synchronous. Furthermore, being a part of the core Angular library,
18+ benefit from RxJS ( signals are synchronous) . Furthermore, being a part of the core Angular library,
1919Angular signals cannot readily be used in non-Angular environments.
2020
2121As such, Signals should be the default when operating _ in the view layer_ : components, directives,
@@ -33,9 +33,18 @@ linting:
3333- ` @ViewChild ` /` @ContentChild ` → ` viewChild() ` /` contentChild() `
3434
3535Services tightly coupled to Angular should use signals. Services with business logic should prefer
36- RxJS for portability. Use ` toSignal() ` and ` toObservable() ` to bridge between the two when needed.
36+ RxJS for portability. Use ` toSignal() ` and ` toObservable() ` to bridge between RxJS and signals when
37+ necessary.
3738
38- Existing code will be migrated gradually. New code must use signal-based APIs.
39+ ## Implementation Plan
40+
41+ New code must use signal-based APIs; existing code will be migrated gradually. Angular provides
42+ automatic code migrations for signal
43+ [ inputs] ( https://angular.dev/reference/migrations/signal-inputs ) and
44+ [ queries] ( https://angular.dev/reference/migrations/signal-queries ) .
45+
46+ Much of ` libs/components ` was updated using these migrators:
47+ https://github.com/bitwarden/clients/pull/15340
3948
4049## Consequences
4150
@@ -57,7 +66,7 @@ Existing code will be migrated gradually. New code must use signal-based APIs.
5766
5867- Disallow usage of signals and only use RxJS for reactivity.
5968 - This is a non-starter. Signals are being built into Angular.
60- - Continue the status quo of adhoc usage.
69+ - Continue the status quo of ad hoc usage.
6170 - Having multiple ways to do the same thing leads to analysis paralysis and complicated code.
6271 - Signals + OnPush change detection provide a clear path to removing Zone.js. With that comes
6372 notable performance and debugging improvements.
0 commit comments