Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 18, 2026·3 min de lecture

Petite-vue — 6KB Progressive Enhancement Subset of Vue

A lightweight 6KB subset of Vue.js optimized for sprinkling interactivity onto server-rendered HTML.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Petite-vue Overview
Commande d'installation directe
npx -y tokrepo@latest install 87c98544-82a5-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Petite-vue is an alternative distribution of Vue.js created by Evan You, optimized for progressive enhancement of existing HTML pages. At only 6KB gzipped, it provides Vue-style reactivity and directives without a virtual DOM or build step, making it ideal for adding interactivity to server-rendered pages.

What Petite-vue Does

  • Adds reactive data binding to existing HTML with Vue-like template syntax
  • Supports v-if, v-for, v-bind, v-on, v-model, and v-scope directives
  • Initializes directly from script tags with no compilation or bundling needed
  • Uses a DOM-walking approach instead of virtual DOM for minimal overhead
  • Provides component-like reuse through the createApp and v-scope patterns

Architecture Overview

Unlike full Vue which uses a virtual DOM and compiler, petite-vue walks the actual DOM and sets up reactive bindings in place. It uses Vue 3's reactivity system (@vue/reactivity) under the hood for change tracking. Each v-scope creates a reactive scope that automatically updates the DOM when data changes, without diffing or patching.

Self-Hosting & Configuration

  • Load via CDN script tag with defer and init attributes for zero-config setup
  • Alternatively install via npm for use with bundlers
  • Use createApp() for programmatic initialization with root data
  • Register global directives and components via the app instance
  • No build tools, CLI, or dev server required

Key Features

  • Only 6KB gzipped with Vue-compatible template syntax
  • No virtual DOM overhead; binds directly to existing DOM elements
  • Works with server-rendered HTML from any backend (Rails, Django, PHP, etc.)
  • Supports Vue 3 reactivity primitives (reactive, computed, effect)
  • Component reuse via v-scope and template functions

Comparison with Similar Tools

  • Alpine.js — Similar philosophy but different syntax; petite-vue uses Vue's familiar directives
  • Vue.js — Full framework with virtual DOM and SFC support; petite-vue is for light enhancement
  • htmx — Server-driven approach using HTML attributes; petite-vue is client-side reactive
  • Stimulus — Convention-based controllers; petite-vue offers more flexible data binding

FAQ

Q: When should I use petite-vue vs full Vue? A: Use petite-vue for sprinkling interactivity on server-rendered pages. Use full Vue for SPAs.

Q: Can I use Vue components with petite-vue? A: No, it does not support SFCs or the Vue component system. Use v-scope for reuse.

Q: Does it support Vue devtools? A: No, the devtools extension is not supported.

Q: Is petite-vue production-ready? A: Yes, it is published by the Vue core team and used in production.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires