VueUse 12 Released: New Composables and Tree-Shaking Improvements

VueUse 12 Released: New Composables and Tree-Shaking Improvements

VueUse 12 Released: New Composables and Tree-Shaking Improvements

VueUse — the collection of Vue Composition API utilities — has released version 12 with over 20 new composables and important bundle size improvements.

New Composables Highlights

  • useScreenWakeLock — prevent the screen from sleeping during video playback or presentations
  • useWebBluetooth — interact with Bluetooth devices from the browser
  • useClipboardItems — read and write rich clipboard content (images, HTML)
  • useTextareaAutosize — automatically resize a textarea to fit its content

Improved Tree-Shaking

VueUse 12 refactored its internal utilities so that each composable is fully tree-shakeable. Projects that import only a few composables will see significantly smaller bundles:

// Only useDark and useLocalStorage end up in your bundle
import { useDark, useLocalStorage } from '@vueuse/core'

Install / Upgrade

npm install @vueuse/core@latest
All Comments