aurelia / aurelia/hot-module-reload
ViewModels are being patched, not re-created
- Dominant language
- TypeScript
- Stars
- 26
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Research direction
Start by reviewing the current ViewModel hot-reload flow and the Aurelia DI Container API, which the issue identifies as lacking de-registration and re-registration capabilities. Define whether the work should recreate ViewModels and copy their state, add proxy support, or both, then verify that old instances are replaced without breaking dependency injection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100