Member-only story
3 Most Interesting Vue 3.2.41–45 Bugfixes
Vue team didn’t take a tea break in last month. I was just covering Vue 3.2.40, and we are now after five new minor releases. I will walk you through the most important bug fixes,
Vue throws errors on odd single-file components (SFC)
The code passed to single-file component parser does not have <template>, nor <script>. It is valid HTML code, but most likely passing such code indicates an error of passing the wrong variable. Now, the parser will throw an error, if the component does not contain <template> or <script> tag.
import { parse } from '@vue/compiler-sfc';
const result = parse(`
import a from 'vue'
`);
console.log(result.errors); // []
Stripping HTML comment does not cause whitespace to be removed
Usually, HTML is forgiving about whitespace. Except it is not, and the layout breaks. Unfortunately it happened with that one scenario, where an HTML comment (like below) was stripped without being replaced with a whitespace. It occurred near string interpolations. It is fixed now.
<template>
<div class="foo">
<h1>Message:</h1>
<!-- A comment explaining the interpolation below -->
{{ msg }}
</div>
</template>