Originally this post was published by my colleague Tonya Smyrnova on Syndicode blog.
Vue 2.6 'Macross' is here! No major updates for the core, but a number of substantial improvements and neat internal changes.
So, here they are:
- The first step is the new syntax of scoped slots. It was experimented with a number of different designs and eventually landed on the new
v-slotsyntax outlined in this RFC.
- Another improvement for slots is the unification of normal vs. scoped slots in terms of implementation, due to the performance advantage of scoped slots.
- All slots using the new
v-slotsyntax are compiled into scoped slots. This means all slots using the new syntax automatically get the performance improvements;
- Vue’s built-in error handling mechanism (in-component
errorCapturedhook and the global
errorHandlerhook) now also captures errors inside
v-onhandlers. In addition, if any of your lifecycle hooks or event handlers performs asynchronous operations.
- Thanks to the stellar pull request by GitHub user @gzzhanghao, starting in 2.6 most template compilation warnings now comes with source range information.
- 2.6 introduces a new global API to explicitly create standalone reactive objects.
- The new
serverPrefetchhook allows any component (instead of just route-level components) to pre-fetch data during server-side rendering, allowing for more flexible usage and reducing the coupling between data fetching and the router.
Read more about the new features here.