aurelia / dependency-injection

A lightweight, extensible dependency injection container for JavaScript.
MIT License
160 stars 66 forks source link

Backport `resolve` from Aurelia 2 #227

Closed m-gallesio closed 2 months ago

m-gallesio commented 6 months ago

Due to breaking changes in TS decorators, decorators on constructor parameters will not work anymore in Aurelia 2.

Aurelia 2 provides a resolve function which allows constructor parameter injection to be replaced with property injection.

I find this approach more scalable since it removes the need to override constructors when adding new injected services.

Per this discussion following @bigopon's suggestion I propose backporting resolve to Aurelia 1 if the required effort is not overwhelming. This would also help developers to prepare their applications for Aurelia 2.