perf: enable jsx optimize
I think the existing dynamic slots check is too greedy, it marks slots as unstable if they refer to a variable outside the slot scope which the vue template compiler doesn't do.
These tests all pass locally :angry:
When I ran locally here is what I got:
pnpm test:unit: https://bin.vuetifyjs.com/bins/7s94Eg
pnpm test:browser: https://bin.vuetifyjs.com/bins/hBlhPg
:rocket: Nightly release published to @vuetify/[email protected].
This will need real-world testing to ensure it doesn't introduce reactivity problems.
Breaks dynamic slots, with optimize: true the label doesn't change:
<template>
<v-app>
<v-container>
<v-switch v-model="customLabel" />
<v-text-field label="Label">
<template v-if="customLabel" #label="{ label }">Custom {{ label }}</template>
</v-text-field>
</v-container>
</v-app>
</template>
<script setup>
import { ref } from 'vue'
const customLabel = ref(false)
</script>