Currently, we only switch out the prototype of the ViewModels, from the old ones to the new ones. It would be best if we could re-create them and then copy their state over to the new object. This also creates problems of its own, because we'll need to de-register old instances in the DI Containers and re-register new ones in their places. That will be quite challenging, since Containers do not expose any such capabilities.
A possible solution would be to add a "proxy" feature to Aurelia DI, so that, if enabled, resolved instances could be globally overwritable with a user-defined proxy function.
Currently, we only switch out the prototype of the ViewModels, from the old ones to the new ones. It would be best if we could re-create them and then copy their state over to the new object. This also creates problems of its own, because we'll need to de-register old instances in the DI Containers and re-register new ones in their places. That will be quite challenging, since
Container
s do not expose any such capabilities.A possible solution would be to add a "proxy" feature to Aurelia DI, so that, if enabled, resolved instances could be globally overwritable with a user-defined proxy function.