# \[New release\] Au v2 beta 20

**URL:** <https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491>\
**Category:** vNext\
**Created:** [July 7, 2024, 2:19pm UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491 "2024-07-07T14:19:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [July 7, 2024, 2:19pm UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/1 "2024-07-07T14:19:43Z")

</div>

Happy Sunday/Monday folks!

Beta 20 has finally arrived [https://github.com/aurelia/aurelia/releases/tag/v2.0.0-beta.20](https://github.com/aurelia/aurelia/releases/tag/v2.0.0-beta.20)

Please help try it out and create issues for any bugs/unexpected behaviors you run into. Also come join the discussion here or on [Discord thread for beta 20](https://discord.com/channels/448698263508615178/448699089513611266/threads/1259513294881034250)

Previous releases discourses:

- Beta 19 [[New release] Au v2 beta 19](https://discourse.aurelia.io/t/new-release-au-v2-beta-19/5445)

* * *

## 2.0.0-beta.20 (2024-07-07)

### BREAKING CHANGES:

- **router-lite:** can\* hook semantics by @Sayan751 (#2002) ([ac5359f](https://github.com/aurelia/aurelia/commit/ac5359f))  
`canLoad`/`canUnload` hooks now only treat `false` as `false`.  
Previously `canLoad` and `canUnload` only consider `true` as can do, means if a routing component has either the hook `canLoad`/`canUnload`,  
those hooks must return `true` to `load`/`unload`. This is not consistent with the rest of the frameowrk, and generally will be easier to miss during refactoring.
- **router:** navigation coordinator refactor by @jwx (#1997) ([1b97340](https://github.com/aurelia/aurelia/commit/1b97340))  
`canLoad`/`canUnload` hooks now only treat `false` as `false`.  
Moves responsibilities and recursive code from routing scope to iterative code in navigation coordinator.  
Refresh and browser back and forward now behave the same way deep links does; if a viewport with a default component/route has been emptied/cleared the mentioned browser actions will now load the default (instead of keeping the viewport empty).
- **tooling:** bindable inheritance ([bb1fe26](https://github.com/aurelia/aurelia/commit/bb1fe26))  
When generating types for `.html` file with convention, `bindables` export will be a record, instead of array now.  
Applications migrating from `beta.15`-`beta.19` will need to change the types for `.html` modules in `resource.d.ts` like the following example:

```ts
...
export const bindables: Record<string, Partial<BindableDefinition>>
...

```

or if it doesn’t matter to your applications, simple having

```ts
...
export const bindables: Record<string, any>
...

```

will also work.
- **metadata:** metadata is defined on the immediate target class, instead of first available metadata source (i.e inherited from parent) by @Sayan751 (#1992) ([bb1fe26](https://github.com/aurelia/aurelia/commit/bb1fe26))

### Bug Fixes:

- **router-lite:** external attribute for href by @Sayan751 (#2000) ([f062ba0](https://github.com/aurelia/aurelia/commit/f062ba0))

### Refactorings:

- **validation:** state rule using record to declare messages by @Sayan751 ([9df93e0](https://github.com/aurelia/aurelia/commit/9df93e0))

---

<div class="post-metadata">

**Author:** ![mario.stopfer](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mario.stopfer/32/2507_2.png) [@mario.stopfer](https://discourse.aurelia.io/u/mario.stopfer)\
**Post date:** [July 7, 2024, 4:15pm UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/2 "2024-07-07T16:15:48Z")

</div>

Thanks for timely updates!

---

<div class="post-metadata">

**Author:** ![sarp](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sarp](https://discourse.aurelia.io/u/sarp)\
**Post date:** [July 9, 2024, 8:06am UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/3 "2024-07-09T08:06:06Z")

</div>

Thanks for the update guys! Looking forward to testing it.

---

<div class="post-metadata">

**Author:** ![nefiavt](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/nefiavt/32/2541_2.png) [@nefiavt](https://discourse.aurelia.io/u/nefiavt)\
**Post date:** [July 12, 2024, 6:38am UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/4 "2024-07-12T06:38:37Z")

</div>

Hello,  
I’ve just made a new webpack project. Added only ` @bindable firstName = '' ;` in MyApp class and got the error bellow:

```
  TS1270: Decorator function return type '(target: unknown, context: ClassDecoratorContext<abstract new (...args: any) => any> | ClassFieldDecoratorContext<unknown, unknown> | ClassGetterDecoratorContext<unknown, unknown>) => void' is not assignable to type 'void | ((this: MyApp, value: string) => string)'.

```

Type ‘(target: unknown, context: ClassDecoratorContext\<abstract new (…args: any) =\> any\> | ClassFieldDecoratorContext\<unknown, unknown\> | ClassGetterDecoratorContext\<unknown, unknown\>) =\> void’ is not assignable to type ‘(this: MyApp, value: string) =\> string’.  
Target signature provides too few arguments. Expected 2 or more, but got 1.

---

<div class="post-metadata">

**Author:** ![ivan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ivan/32/2022_2.png) [@ivan](https://discourse.aurelia.io/u/ivan)\
**Post date:** [July 12, 2024, 10:26am UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/5 "2024-07-12T10:26:41Z")

</div>

> [@nefiavt](#):
>
> @bindable firstName = ‘’

```auto
@bindable() firstName = ''

```

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [July 12, 2024, 10:28am UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/6 "2024-07-12T10:28:08Z")

</div>

This is typescript 5.5 doing, it’s trying to be too smart and “over-infer” the typing for the 2 parameter in the decorator usage. I’m not sure what to do to fix this issue yet.

To fix this, you can change typescript version to `5.4.x`

cc @huochunpeng @Sayan751

---

<div class="post-metadata">

**Author:** ![sarp](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sarp](https://discourse.aurelia.io/u/sarp)\
**Post date:** [July 12, 2024, 4:12pm UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/7 "2024-07-12T16:12:29Z")

</div>

Suffered from that myself and at the moment the only (and relatively easy) solution I came up with is moving the

`export declare function bindable(_: undefined, context: ClassFieldDecoratorContext): void;`

declaration on top of the others. Made a patch with patch-package and it is convenient enough for the time being.

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [July 13, 2024, 7:08pm UTC](https://discourse.aurelia.io/t/new-release-au-v2-beta-20/5491/8 "2024-07-13T19:08:33Z")

</div>

@bigopon It seems that stricter type-checking for decorators is introduced here: [Report grammar errors for invalid decorator grammar by rbuckton · Pull Request #57749 · microsoft/TypeScript · GitHub](https://github.com/microsoft/TypeScript/pull/57749). However, the problem might simply be caused by how TS resolved the method signatures. Considering a method signature with more arguments is more restrictive than the one with fewer arguments, it makes sense when they precede the less-specific ones. Thanks @sarp for drawing attention to that. I’ll push a change for that.
