Is there any sense already for using signals in Angular?

1.2k Views Asked by At

According to RFC3 signal-based components with change detection strategy based fully on signals are planned as next thing to be released. So as of now, with zone-based change detection strategy, is there any sense of using signals over the traditional way of setting values to class' properties? Will signals' dependency tree eg. gain performance in zone-based components?

1

There are 1 best solutions below

0
On BEST ANSWER

The answer today is : it depends.

The signals themselves are implemented but are still a developer preview, so expect breaking changes in the APIs without the angular team providing migration support.

The developer preview is here to gather the maximum feedback to finalize the API.

Also there is one important implementation detail. Signals are still hooked to the "old" change detection mecanisms. Updating the value of signal will trigger internally the same code as markForCheck. The same as effect(() => {}) is hooked on ApplicationRef.tick() + detectChanges().

So there are no perfermance advantages right now to use Signals. But there will be in the future. We're not here yet at real zone-less apps. This will like come with the signal components !

If you want to learn how it works, yeah go for it, get on the train ! But I wouldn't implement it today in an enterprise world.