Back to Blog

What's New in Aurelia 2 Beta 21?

Dwayne Charrington Dwayne Charrington August 8, 2024

We’re excited to announce the release of Aurelia 2 Beta 21! This release brings several highly requested features and important bug fixes to improve your development experience. Let’s dive into what’s new! πŸš€

✨ New Features

Increment/Decrement Assignment Operators

One of our most requested features is finally here! Beta 21 introduces support for unary increment/decrement and assignment operators (++, --, +=, -=, /=, *=). This allows for more concise and expressive code in your templates.

Example:

<button @click="value++">Increment</button>
<button @click="value += 2">Increment by 2</button>

Important Note: Using these operators in non-trigger bindings will result in an error (AUR0113) to prevent infinite update-eval loops.

<!-- ❌ These will throw AUR0113 -->
<div>${value++}</div>
<my-component :prop="value++"></my-component>

🐞 Bug Fixes

State Plugin Improvements

The state plugin received a critical fix ensuring all queued actions are properly executed. Previously, the last action in a queue might not be called if an action handler returned a promise that resolved after the second action was dispatched. ( #2023 )

Router Enhancements

  • Router-Lite: Fixed element injection for routed view-models ( #2012 )
  • Default Child Routes: Resolved issues with filtering available endpoints ( #2013 )
  • History Strategy: Fixed router-lite behavior when historyStrategy is set to none ( #2005 )

Task Queue Refinements

  • Fixed timing issues with multiple persistent delayed tasks ( #2007 )
  • Improved task queue processing loop for better reliability

Development Experience

  • Vite Plugin: Resolved vitest issues on Windows with HTML files ( #2006 )
  • Types: Improved bindable definitions for better TypeScript support ( #2010 )

πŸ”„ Refactorings

  • Task Queue: Removed the ‘reusable’ parameter for simpler implementation ( #2008 )
  • Binding: Enhanced handling of binding glitches ( #2020 )

πŸ“₯ How to Upgrade

To upgrade to Aurelia 2 Beta 21:

  1. Update your project dependencies to the latest version
  2. Test your application thoroughly, particularly if you’re using the state plugin or router features
  3. Take advantage of the new increment/decrement operators in your templates!

πŸ”— Additional Resources

For a complete list of changes, check out the full changelog .


We’re continuously working to make Aurelia 2 better with each release. Thank you to all our contributors and community members for your ongoing support and feedback! πŸ’ͺ

Comments

comments powered by Disqus

Gold Sponsors

Hogia

Silver Sponsors

Movavi - Screen Recorder