Aurelia 1 does not appear to be working with the typescript target es2022. Bindings like “on-change.call” are not working.
Repro:
-
Create new aurelia 1 application by running `au new`, use options for webpack and typescript
-
Change target in tsconfig.json to es2022
"compilerOptions": {
...
"target": "es2022",
...
}
- create the following setup:
app.ts
export class App
{
onChange()
{
alert('changed');
}
}
app.html
<template>
<require from="./my-component"></require>
<my-component on-change.call="onChange()"></my-component>
</template>
my-component.html
<template>
<button click.trigger="test()">Test</button>
</template>
my-component.ts
import {bindable} from 'aurelia-framework';
export class MyComponent
{
@bindable
onChange: () => void;
test()
{
this.onChange();
}
}
- When clicking the Test button, the following error appears:
this.onChange is not a function
Could someone have a look or provide any details about the compatibility of aurelia 1 with the es2022 target?
Thank you.
// UPDATE:
Full repro on stackblitz: au1 versuch - StackBlitz