ngx-three
ngx-three copied to clipboard
Angular 19 and Signals support
HI, I was wondering if there will the chance in the next feature to this library to be upgraded to support Angular 19 and the new signal API, if not already implemented.
Hi, in the near future ngx-three will support angular 18 and 19 peer dependencies. You can already use Signals.
All components are already on push. So you already could go zoneless if you want.
The core wrapper components will still use non-signal inputs (with setters / getters). Because the three.js object3d wrappers do actually have quite a lot of inputs and using signal means instantiating a signal for every input upfront (regardless if used or not).
Ok thank you!
Do you think that instantiating a lot of inputs would be a problem? Theoretically you do the same thing by using @Input, and migrating to the new API should improve the performances and allow zoneless in the future..
Of course if we're switching to signals the setters should be migrated to the effect() or ngOnChanges API.
If you want we can try migrating to that API on a experimental branch...
(same person of @giovanni-bertoncelli , using another account)
Been working on it these few hours... it seems like a huge effort to migrate.. @demike do you have plans to progressively migrate to the new API?
@gbertoncelli you already can run zoneless (all components are onPush). An additional problem would be, that you give up on a single source of truth for your data. It would be present in the wrapper in the signal and in the three.js object!
The only propper way would be to use a custom renderer, do not use wrappers and use the signals for "binding" state. But then you would not be able to react on value changes outside of the template. And you would loose strong typing in the template without doing workarounds (custom html types for vscode for example)
I see... that's probably a use case not covered by the signal input API then... Do you think that using Input directives on newer Angular version will have impact on the performances?