With the release of Aurelia 2 Beta 15, there are some important changes to be aware of regarding decorators. This update brings Aurelia 2 into compliance with the Stage 4 TC39 decorators proposal, resulting in significant differences in how decorators work compared to previous versions.
One notable change is that inline decorators for injection on constructors are no longer supported. For example, the following syntax is no longer valid:
constructor(@IApi readonly api: IApi, @IRouter private router: IRouter) { }
Instead, to handle injection, you can define a class property and use the resolve
function from the aurelia
package. Here’s an example:
readonly api = resolve(IApi);
Make sure to import the resolve
function from the aurelia
package at the top of your file.
Another important note for TypeScript users: remove the following lines from your tsconfig.json
file:
"emitDecoratorMetadata": true, "experimentalDecorators": true,
These settings are no longer necessary with the updated decorator implementation in Aurelia 2 Beta 15.
I’ll be blunt. Is Aurelia dead? My company runs on Aurelia. We have to either get Aurelia 2 reelased and most importantly adopted by community or we will jump off next year. Be honest please.
Appreciate the bluntness, Andrew. Definitely not dead. Everyone on the core team uses it every day for our day jobs and side projects. I can’t give specifics, but I can tell you there are quite a few large companies and startups using Aurelia and banking their future on it.