ng-bootstrap / ng-bootstrap

Angular powered Bootstrap

Home Page:https://ng-bootstrap.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signals in ng-bootstrap

bastienmoulia opened this issue · comments

With the arrival of Angular 18 and the maturity of Signals, should we consider migrating the components to Signal?

https://angular.io/guide/signals

Zoneless could probably be achieved by keeping the code as is, but there are usages of NgZone (onStable) that need to be replaced. I started it try doing it by replacing them by afterRender or afterNextRender, but there are places where it's quite hard.

But I agree that, for the long term, using signals where it makes sense would be a good idea.

  • when using ng 18: provideExperimentalZonelessChangeDetection and NgbModal.open(myComponent) is not working
  • in dom I see element, but not rendered propery
  • the same problem with Toast
  • the same problem with Tooltip

Please open separate issues for zoneless support with concrete failures.
I think we should release a major first with Angular 18 support and then add zoneless in a feature release, WDYT?

Please open separate issues for zoneless support with concrete failures.

I think we should release a major first with Angular 18 support and then add zoneless in a feature release, WDYT?

Sure thing, first Angular 18, then we can add signal everywhere, and then activate zoneless!

I would first try to be zoneless and then try to move to signals, for the following reasons:

  • zoneless support should be possible without moving to signals, with a smaller effort
  • moving to signals is a harder task, maybe necessitating breaking changes in the API, and would rely on features that are not stable yet (effect, toSignal, toObservable)

Indeed, I wasn't talking about signals at all in my comment, it should be last for me too for sure.

@bastienmoulia as others are saying, signals are not required for zonless