vuejs

rfcs

RFCs for substantial changes / feature additions to Vue core

by vuejs

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
37
✓README○License○Contributing○Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Quiet · Last activity 1y ago
See all on GitHub →
ubugeeei

ref impl: https://github.com/vuejs/core/pull/15885 Summary Unify Vue's asynchronous reads and optimistic writes around the reactive graph while preserving the broader Composed Async motivation. explain why the current `computed()ComputedRef>optimistic(target, { update, run, commit })v-deferpnpm dlx prettier@3.6.2 --single-quote false --check active-rfcs/0045-composed-async.mdgit diff --check` verified all linked reference pages return HTTP 200

ubugeeei · 1mo ago
ubugeeei

Summary Adds an RFC proposing a compiler-reserved `name` option or SFC filename-based name inference. Links Full Rendered Proposal Discussion Thread Important: Do NOT comment on this PR. Please use the discussion thread linked above to provide feedback, as it provides branched discussions that are easier to follow. This also makes the edit history of the PR clearer.**

ubugeeei · 1mo ago
ubugeeei

Start Date: 2026-03-05 Target Major Version: ? Reference Issues: N/A Implementation PRs (Draft reference implementation): compiler / SSR / Vapor, language-tools, docs Summary Introduce and for declarative pattern-based conditional rendering in Vue templates. evaluates a subject expression once. Each direct child declares a pattern, optional bindings (including object and array rest), and an optional guard. Branches are checked from top to bottom, only the first matching branch renders, and no fallthrough is possible. Template type checking requires exhaustive coverage, with available as the fallback pattern. The initial syntax keeps in its long form. Shorthand candidates and their trade-offs are recorded below for future discussion. The proposed syntax intentionally follows the vocabulary of the TC39 ECMAScript Pattern Matching proposal ( / , pattern guards, declaration bindings) while also catching up with Flow's shipped feature ( variable declaration patterns, guards, wildcard, alternatives, bindings, and exhaustiveness-aware tooling). Basic example The above is equivalent in behavior to a / chain that first evaluates , checks each branch in order, introduces branch-local template bindings such as and , and renders the fallback only if no previous branch matched. Motivation Chained is repetitive for one subject When rendering different content based on a single reactive value, developers currently repeat the same expression in every branch: This has several drawbacks: 1. The discriminant expression is repeated in every branch. 2. Branches that conceptually belong to one match are only implicitly grouped by adjacency. 3. Nested data has to be re-addressed manually instead of being bound where it is matched. 4. Type tooling has to recover intent from arbitrary boolean expressions. makes the subject explicit, and makes each branch an arm of the same match. Vue code increasingly models UI state as tagged data Vue applications commonly consume typed state from composables, loaders, data-fetching libraries, state stores, routers, and RPC clients. These values are often modeled as discriminated unions or tagged objects: Templates need an ergonomic way to render these states without repeatedly indexing into the same object and without losing branch-specific type information. Prior art is converging on patterns plus bindings The TC39 ECMAScript Pattern Matching proposal uses expressions with arms, declaration patterns such as , rest binding patterns, and guard patterns. Flow's has shipped with object, array, wildcard, , , , instance, guard, exhaustiveness, and unused-pattern checks. Rust, Swift, Kotlin, Scala, F#, Python, and Elixir all demonstrate that pattern matching is most valuable when it can both test a shape and bind useful parts of the matched value. This RFC does not attempt to add JavaScript pattern matching to Vue. It proposes a template-level feature that borrows the parts that map cleanly to rendering: arm syntax, structural patterns, branch-local bindings, guard conditions, and type-tooling hooks. Detailed design Recommended syntax: / evaluates the subject expression. declares a pattern arm. declares an unconditional fallback arm. An optional suffix acts as a branch guard. The name is recommended over the previous direction because it directly mirrors TC39's vocabulary and avoids suggesting JavaScript fallthrough behavior. SFC top-level template An SFC may place directly on its top-level `@v-on:v-bind#v-slotv-when??condition ? consequent : alternate=?v-if?="true"trueasv-ifv-else-ifv-elsev-matchv-whenv-matchv-ifv-matchv-when......const identifierletconstinSymbol.customMatcherv-when` long-form and defers symbol selection.

ubugeeei · 1mo ago
Structured data for AI agents

Repository: vuejs/rfcs. Description: RFCs for substantial changes / feature additions to Vue core Stars: 4925, Forks: 525. Open PRs: 32, open issues: 30. Last activity: 1y ago. Community health: 37%. Top contributors: yyx990803, posva, wenfangdu, antfu, dobromir-hristov, mrienstra, xPaw, petr001, chenxsan, smolinari and others.