From bdc9d380dc92180b4afd4822f05d92ae7f154f00 Mon Sep 17 00:00:00 2001 From: Ubugeeei Date: Thu, 5 Mar 2026 19:46:19 +0900 Subject: [PATCH] feat: composed async --- active-rfcs/0045-composed-async.md | 552 +++++++++++++++++++++++++++++ 1 file changed, 552 insertions(+) create mode 100644 active-rfcs/0045-composed-async.md diff --git a/active-rfcs/0045-composed-async.md b/active-rfcs/0045-composed-async.md new file mode 100644 index 00000000..0aa88618 --- /dev/null +++ b/active-rfcs/0045-composed-async.md @@ -0,0 +1,552 @@ +- Start Date: 2026-03-05 +- Target Major Version: 3.x +- Reference Issues: N/A +- Implementation PR: (leave this empty) + +# Summary + +Stabilize `` by introducing explicit, composable primitives for async rendering: + +1. **` + + +``` + +## Pattern B: Delegated async (` + + +``` + +```vue + + +``` + +## Pattern C: Promise-as-prop (`v-defer`) + +A reusable child component receives a Promise as a prop and defers its own rendering. + +```vue + + + + +``` + +```vue + + + + +``` + +# Motivation + +## Current problems with `` + +### 1. Implicit async dependency detection + +In the current implementation, any ` +``` + +The `async` keyword on the ` +``` + +```vue + + +``` + +## 2. `v-defer` directive - Template-level promise unwrapping + +### Syntax + +``` +v-defer="expression as identifier" +``` + +Where `expression` evaluates to a `Promise` and `identifier` becomes a template variable of type `T` (the resolved value). + +### Usage on SFC root `