If you are only interested in the changelog: Release v2.0.0-beta.24 · aurelia/aurelia
This release further enhances our template type checking capabilities, together with other changes and improvements.
As usual, please help report any issues/unexpected behavior you run into either here, Github issue or here. If you wanna have a chat, come to our discord thread for beta 24 at (Discord | #announcements | Aurelia)
Do you perhaps know if there are any updates scheduled for the Google chrome extension? In the web store there is still the outdated manifest v2 version.
So I updated to Beta 24 and I’m getting this error when enhancing multiple components (caused by this PR - remove controller host).
Node already associated with a controller, remove the ref “au:resource:custom-element” first before associating with another controller
So I assumed that I had to make sure components are disposed before re-enhancing them but that doesn’t seem to make a difference. What am I doing wrong?
So how can I fix my error? Also why was that decided that we can’t re-enhance a VM? I’m asking because my lib Aurelia-Slickgrid does something very similar in a bunch of other frameworks that I support like Angular, React, Vue and none of them ever throw such errors when re-enhancing or recreating the same component on the same DOM target, so why is Aurelia becoming so strict all of a sudden? This seems like a huge breaking change that I’m not sure how to go around it.
Here’s 2 examples of where I’m using enhancing in Aurelia-Slickgrid:
throw such errors when re-enhancing or recreating the same component on the same DOM target
Maybe we don’t have to be strict, but we need to be very clear about the behavior of the framework before we support such feture. We can start with a simple question: what should it do/not do when enhancing the same DOM element?
The minimum would be to warn the user of which component got re-enhanced multiple times (“au:resource:custom-element” doesn’t tell me anything since I don’t have any custom element with that name). Because at the moment, I’m just stuck with this new major breaking change. I’m blocked without knowing what to do in order to fix all of these. Does the code I provided above make any sense or is it totally wrong?
Also like I said, any other frameworks are totally fine with recreating/re-rendering the same components (leaking DOM elements is the end user’s problem), loosing up this strictness and possibly send improved console warnings could certainly help to make this transition a bit smoother because re-enhancing components in a datagrid (like in Aurelia-Slickgrid) can happen a lot of times when associated to a row or a cell of thegrid, and trying to find how to fix them at the moment is a pain and I just don’t understand what I need to do… I could drop that feature from Aurelia-Slickgrid (Example 19 and 26 as linked in comment above) but that would mean less features for the end users.
Is 2025 going to be the year for Aurelia 2 official release?
thanks @ghiscoding , in the code above, I only see the part related to enhance + after. How do you prepare the content of the host element being enhanced?
thanks, so just to be clear for the topic we already have: the use case is to wash away existing content of an element with .innerHTML = html and call .enhance on that element again and again. I do think it’s a valid case, probably we should have some tweaks to make it support such scenario.