Targets
Unframework compiles each component to eight targets. Each one writes a component in its framework's own format, and imports nothing but its framework. solid@2 is opt-in: a project selects it in targets, and the default is the other seven (Configuration).
| Target | File | Component |
|---|---|---|
| React | ProductTile.tsx | A function component |
| Vue | ProductTile.vue | A single-file component with <script setup lang="ts"> |
| Svelte | ProductTile.svelte | A component in runes mode, with <script lang="ts"> |
| Angular | product-tile.ts | A component class with signal inputs and an inline template |
| Solid | ProductTile.tsx | A function component |
| Solid 2 | ProductTile.tsx | A function component, for Solid 2 (solid@2) |
| Qwik | ProductTile.tsx | A component$ |
| Astro | ProductTile.astro | A component with its props in the frontmatter |
Props shows the files for one component.
Capabilities
A capability is a feature a component can use: a kind of node, a kind of attribute, or something a framework does at run time. Each target declares, for every capability, how it supports it:
- native: the framework has the feature, and the output uses it;
- emulated: the output adds a small inline helper, named in the cell, because the framework lacks the feature;
- unsupported: the framework renders the feature differently, or not at all. The compiler reports UF4001 at the feature's first use, with the target's reason, and the cell sets its severity;
sheet-orderreports its own code, UF4002, Angular'schild-root-scopeUF4003, Angular'sgeneric-slot-propsUF4004, and React's, Solid's and Solid 2'scomposable-effect-orderUF4005.
So a difference between frameworks is declared here, never found only in a test.
| Capability | What it covers | React | Vue | Svelte | Angular | Solid | Solid 2 | Qwik | Astro |
|---|---|---|---|---|---|---|---|---|---|
element | HTML elements | native | native | native | native | native | native | native | native |
text | Static text | native | native | native | native | native | native | native | native |
static-attribute | Attributes with a literal value | native | native | native | native | native | native | native | native |
listbox | A <select> shown as a single-selection list box | native | unsupported | native | native | native | native | native | native |
interactivity | Listeners, template refs, watchers and hooks | native | native | native | native | emulated createWatcher | emulated createWatcher | native | unsupported |
event-capture | A listener in the capture phase, onClickCapture | native | native | native | emulated uf<Event>Capture | native | native | native | unsupported |
event-once | A listener that runs once, onClickOnce | emulated useOnce | native | emulated once | emulated uf<Event>Once | native | native | emulated once<Event> | unsupported |
event-passive | A passive listener, onWheelPassive | native | native | native | emulated uf<Event>Passive | native | native | native | unsupported |
event-semantics | A listener hears the DOM's event of its name | emulated listen | native | native | native | native | native | native | unsupported |
conditional-event-control | An event control that runs on more than the event | native | native | native | native | native | native | unsupported | unsupported |
use-id | useId(): ids unique on the page | native | native | native | emulated idCounter | native | native | native | emulated uniqueId |
next-tick | nextTick(): waiting for the DOM to update | emulated useNextTick | native | native | emulated nextTick | emulated nextTick | emulated nextTick | emulated nextTick | unsupported |
late-prop | A prop the parent passes only after the mount | native | native | native | native | native | native | unsupported | native |
props | A component with props | native | native | native | native | native | native | native | native |
interpolation | Expressions rendered as text | native | native | native | native | native | native | native | native |
conditional | c ? <A /> : <B /> and c && <A /> | native | native | native | native | native | native | native | native |
list | .map with a key: the items' content and order | native | native | native | native | native | native | native | native |
fragment | A root fragment with several nodes | native | native | native | native | native | native | native | native |
bound-attribute | Attributes bound to an expression | native | native | native | native | native | emulated enumeratedValue | native | native |
class-binding | A class of names, toggles and expressions | emulated cx | native | native | emulated classNames | emulated cx | emulated cx | native | native |
style-binding | A style of static and bound declarations, or bound to a value | emulated styleObject | native | emulated styleText | emulated styleObject | emulated styleProperties | emulated styleProperties | emulated styleObject | emulated styleObject |
attribute-spread | A spread of an object whose type declares its keys | native | native | native | native | native | emulated enumeratedValue | native | native |
raw-html | innerHTML={markup}: markup set as an element's content | native | native | native | emulated TrustedHtmlPipe | native | native | native | native |
svg | An <svg> and the SVG inside it | native | native | native | native | native | native | native | native |
component | A component element, <Field /> | native | native | native | native | native | native | native | native |
component-event | A listener of a child's event, onClear | native | native | native | native | native | native | native | unsupported |
default-slot | The default slot: children, {slots.default?.()} | native | native | native | native | native | native | native | native |
named-slot | A named slot without props | native | native | native | emulated uf<Component><Slot> | native | native | emulated <slot>$ | native |
scoped-slot | A slot with props, {slots.item?.({ item })} | native | native | native | emulated uf<Component><Slot> | native | native | emulated <slot>$ | emulated <slot> |
slot-fallback | A slot's fallback content, after ?? | native | native | native | native | native | native | native | native |
default-slot-presence | slots.default as a condition, or forwarded | native | native | native | unsupported | native | native | unsupported | native |
slot-forwarding | A parent's slot passed on, {{ title: slots.title }} | native | native | native | emulated uf<Component><Slot> | native | native | native | native |
model | defineModel, and v-model:name on a component | native | native | native | native | native | native | native | native |
two-way-binding | v-model on a form control | native | native | native | native | native | native | native | unsupported |
model-array | v-model of a checkbox group or a multiple select | emulated toggle | native | native | emulated toggle | emulated toggle | emulated toggle | emulated toggle | unsupported |
model-modifiers | v-model_trim, _lazy, _number, a number input | emulated modelText | native | emulated modelText | emulated modelText | emulated modelText | emulated modelText | emulated modelText | unsupported |
fallthrough | A class or style on a component | native | native | emulated mergeStyle | emulated fallthrough | native | native | native | native |
contextual-root | A root element tied to its parent: <li>, <tr>, … | native | native | native | unsupported | native | native | native | native |
expose | defineExpose, and a ref on a component | native | native | native | native | native | native | emulated exposeRef | unsupported |
context | provide and inject with an injection key | native | native | native | native | native | native | native | unsupported |
reactive-context | A provided ref or computed value | emulated refObject | native | emulated refObject | emulated refObject | emulated refObject | emulated refObject | native | unsupported |
dynamic-component | <component is> over a known set | native | native | native | emulated @switch | native | native | native | native |
teleport | <Teleport to>: one element mounted into to once the component has mounted | emulated teleport | native | emulated teleport | emulated Teleport | emulated Teleport | emulated Teleport | emulated teleport | unsupported |
transition | <Transition>: Vue's enter and leave classes on one element or a conditional's | emulated Transition | native | emulated enter | emulated Transition | emulated Transition | emulated Transition | emulated transition | unsupported |
directive | v-name={value}: a directive's hooks run on its element, in the browser | emulated useDirective | native | native | emulated runDirective | emulated queueHook | emulated queueHook | emulated runDirective | unsupported |
scoped-styles | A sibling stylesheet the compiler scopes | native | native | native | native | native | native | native | native |
child-root-scope | A child's root taking a styled parent's scope | emulated scopeAttributes | native | emulated scopeAttributes | unsupported | emulated scopeAttributes | emulated scopeAttributes | emulated scopeAttributes | emulated scopeAttributes |
slotted-styles | Slot content a :slotted() rule styles | native | native | native | native | native | native | native | native |
sheet-order | The order sheets cascade in: Vue's import order | native | native | native | unsupported | native | native | unsupported | native |
generic-components | A component with type parameters, function List<T> | native | native | native | native | native | native | native | native |
generic-slot-props | A scoped slot whose props name a type parameter | native | native | native | unsupported | native | native | native | native |
composables | A call of a composable from a .uf.ts module | native | native | native | native | native | native | native | native |
composable-effect-order | A composable's effects in the caller's order | unsupported | native | native | native | unsupported | unsupported | native | unsupported |
hydration | A server render that hydrates into the client's DOM, with its ids, and stays interactive | native | native | native | native | native | native | unsupported | unsupported |
keyed-identity | A keyed item keeps its element while its list reorders or replaces it | native | native | native | native | emulated KeyedFor | emulated KeyedFor | native | unsupported |
async-setup | An async setup: the server renders what it awaited, and a hydrated page keeps the server's DOM while it runs again | emulated SetupPending | native | native | native | native | native | native | native |
The cells that are not native:
- React,
class-binding: React'sclassNametakes one string, so an inline helper,cx, joins the static names, toggles and dynamic parts. Where a part may be an array or an object at run time,cxreads an array's entries too, as Vue'snormalizeClassdoes. - React,
style-binding: React'sstyletakes an object, so astylebound to a value goes through an inline helper,styleObject, which splits a declaration list into an object as Vue'sparseStringStyledoes, with camel-case keys. An object passes as it is. Declarations print as an object. - React,
event-once: React has no once listener, so a guard,useOnce, remembers each element the listener ran for, as{ once: true }removes a listener from its own element only. - React,
event-semantics: where React's synthetic event differs from the DOM's (changeon a text field, a checkbox or a radio,select,beforeinput, awheelor touch listener that is not passive, the events React has no prop for, andfocusorblurbeside a nativefocusinorfocusout), the element's ref callback, declared once, listens natively, throughlisten. - React,
next-tick: React has nonextTick, so a hook,useNextTick, asks for a render at the priority of the code that calls it, and resolves once React has rendered it, run its effects and rendered what the component's watchers wrote. After a click's or a key's handler it resolves in the event's task, as on Vue; after a watcher's write, in an effect, in a timer or after anawait, in a later task (Semantics). It resolves when the component unmounts too. - React,
model-array: React's checkbox takes one boolean, so a checkbox group's array goes through an inline helper,toggle, which adds or removes the box'svalue, as Vue'svModelCheckboxdoes. - React,
model-modifiers: React has nov-modelmodifiers, so an inline helper,modelText, a hook nameduseModelTextin the output, trims and casts as Vue'svModelTextdoes, and writes alazyfield as it loses focus. - React,
child-root-scope: a child cannot know the scope attributes its styled parents pass it,data-uf-<id>, since each name is a parent's id, so an inline helper,scopeAttributes, picks thedata-uf-*keys out of the rest of its props and spreads them on its root, on each branch of a root conditional and on a root<component is>too, as Vue's fallthrough reaches them. No other undeclared prop reaches the root. - React,
reactive-context: a context passes its value once per render of the provider, so a provided ref is an object with avaluegetter,refObject, made again at each render. Descendants render each change, and code that runs later, after anawaitor in a timer, reads the value of their last render. - React,
composable-effect-order(for information): a composable is a custom hook, and React runs a component's effects in its own order, so a composable's watchers, effects and hooks cannot take their place among the caller's own, and code that relies on that order may see another. The compiler reports UF4005 at the composable's call. - React,
directive: React has no directive, so an element's directive goes through an inline hook,useDirective, called once per use at the component's top level. Its ref callback records each element it receives, so a callback written in place keeps the directive and each element one use renders gets its own hooks, and its layout effect runsmounted,updatedwhen the value changes andunmounted. A directive whose value reads a list's row or a scoped fill's props callsuseElementDirectiveinstead, whose function makes each element's ref callback from its value as the row renders,withTrace(item.label), joined with the element's other callbacks through an inlinemergeRefs. The hooks go through an inline queue,queueHook, which runs them in Vue's order once the turn ends (ADR-0099, ADR-0108). - React,
transition: React has no transition primitive, so an inline component,Transition, renders the child, whose branches each take a key. A change of key keeps the old element, as it last rendered, beside the new one until its leave ends. It owns the classes in state, since React writes the wholeclassattribute whenclassNamechanges, keeps the child's own ref, and renders no class on the server or while the client hydrates (ADR-0100). - React,
async-setup: a component can't await in React, so a function of the module,profileSetupforProfile, runs the awaits, and the component starts it once and renders an inner one,ProfileResolved, which reads the result withuseinside a<Suspense>. Its fallback, an inline component,SetupPending, renders nothing and tells the component once the setup settles, so React shows the content at once rather than after its fallback throttle. A prop update that arrives while the component hydrates and its setup is pending makes React render it on the client: the server's DOM goes, and nothing shows until the setup resolves, with no mismatch reported. UnderStrictModein development the setup runs twice (ADR-0101). - Svelte,
event-once: a once listener's handler goes through an inline wrapper,once, whose guard is set when the handler first runs, never the DOM's{ once: true }: Svelte'sonruns the handlers it delegated below the element inside its own listener, so the option would be used up by an event one of them stopped. - Svelte,
style-binding: Svelte'sstyletakes a declaration list, so astylebound to a value goes through an inline helper,styleText, which writes an object's present values as declarations, in kebab case, as Vue'sstringifyStyledoes. A string passes as it is. Declarations print asstyle:directives. - Svelte,
fallthrough: a component'sstyleprop is a string, which cannot unset a property, so an inline helper,mergeStyle, merges the consumer's declarations over the root's own and drops the root's declaration of a property the consumer's style sets to a nullish value, as an object merge does. - Svelte,
child-root-scope: a child cannot know the scope attributes its styled parents pass it,data-uf-<id>, since each name is a parent's id, so an inline helper,scopeAttributes, picks thedata-uf-*keys out of its$props()and spreads them on its root, on each branch of a root conditional and on a root<component is>too, as Vue's fallthrough reaches them. A parent passes them in an object spread,{...{ "data-uf-<id>": "" }}, since svelte-check rejects a prop the child does not declare. - Svelte,
model-modifiers:bind:valuehas no modifiers, so an inline helper,modelText, trims, casts and waits forchangeas Vue'svModelTextdoes. - Svelte,
reactive-context:setContextpasses a value once, so a provided ref is an object with avaluegetter,refObject, which descendants read as it changes. - Svelte,
teleport: Svelte has no portal, so the element renders once the component has mounted, in an{#if}of its own, and an attachment,teleport, moves it intoto, gives back the focus the move takes, and removes it on teardown. Svelte still delegates its events, sincemount()listens ondocumenttoo (ADR-0098). - Svelte,
transition: Svelte's transitions run their own CSS or ticks, never Vue's classes, so each element of the conditional takes a localin:enterandout:leave, whose functions run the classes in a config Svelte calls for every run, and give Svelte the element's duration. A run stops what the element's other phase still runs, as when Svelte reverses a leave. Svelte ends both elements of a swap by that duration, and the classes go then, atintroendandoutroend. Withappear,in:is global, so the enter runs as the element first mounts too (ADR-0100). - Solid,
class-binding: Solid'sclasstakes one string, so an inline helper,cx, joins dynamic parts with the static names and toggles. Static names and toggles alone print asclassandclassList. Where a part may be an array or an object at run time,cxreads an array's entries too, as Vue'snormalizeClassdoes. - Solid,
style-binding: Solid'sstyletakes an object with kebab-case keys, so astylebound to a value goes through an inline helper,styleProperties, which writes an object's camel-case keys in kebab case and splits a declaration list as Vue'sparseStringStyledoes. Declarations print as an object. - Solid,
child-root-scope: a child cannot know the scope attributes its styled parents pass it,data-uf-<id>, since each name is a parent's id, so an inline helper,scopeAttributes, picks thedata-uf-*keys out of its props by name and spreads them on its root, on each branch of a root conditional and on a root<component is>too, as Vue's fallthrough reaches them. It reads no prop's value, so it runs no getter. - Solid,
interactivity: state, derived values, listeners and hooks are Solid's own. Solid runs what a write triggers as the write is made, so a watcher goes through an inline helper,createWatcher, and awatchEffectthroughcreateWatchEffect, over a scheduler:createReactionqueues a watcher when a value it read is written, and a microtask runs each queued watcher once, those before the DOM updates first, with Vue's previous value, change test and cleanup timing. Client code is copied as written, with nobatch: the watchers, not the writes, keep the contract's timing. - Solid,
next-tick: Solid applies writes to the DOM as it makes them, and the watchers run in a microtask queued at the first write, so an inlinenextTickresolves a promise. - Solid,
model-array,model-modifiersandreactive-context: Solid has nov-model, so inline helpers bind a checkbox group's array (toggle), a multiple select's (selectedValues), the options of a select that a component, a slot or an interpolation renders (selectOptions) and a text field's modifiers (modelText), as Vue does; a provided ref is an object with avaluegetter,refObject, which descendants read as it changes. - Solid,
keyed-identity: Solid's<For>follows the items themselves, so an item replaced by a copy of the same key would get a new element, and lose its focus and typed text. So a list goes through an inline helper over<For>,KeyedFor, whose rows follow the source'skey, as Vue's do. A row is an object of getters named as the item,item.valueanditem.index, which TypeScript narrows as it narrows a prop, and follows the latest item of its key. - Solid,
composable-effect-order(for information): a composable's watchers coalesce in its own module's queue,createWatcher, apart from the caller's, so its watchers, effects and hooks cannot take their place among the caller's own, and code that relies on that order may see another. The compiler reports UF4005 at the composable's call. - Solid,
teleport: Solid's<Portal>wraps its content in a<div>, so an inline helper,Teleport, inserts the element intotoonce the component has mounted, as<Portal>does in<head>, in a root its owner owns, so the element reads the component's context (ADR-0098). - Solid,
transition: Solid's own transitions are a package, which no output imports, so an inline component,Transition, resolves the child and keeps a leaving element among the nodes it renders until its leave ends. The server renders the child as it is (ADR-0100). - Solid,
directive: a directive is a ref factory,ref={vFocusTrap(() => open())}, Solid 2's own form. Solid runs an element's ref before its children's, so the hooks go through an inline queue,queueHook, which runs them in Vue's order once the turn ends (ADR-0099). - Solid 2,
interactivity: Solid 2 lets a read see a write only once it flushes, on a microtask or atflush(), which an effect's callback oronSettledcannot call, and Vue's read sees a write at once. So state goes through an inline helper,createState, a signal whose read returns the value last written and tracks the signal where something observes it; a derived value is a function,() => count() * 2, which reads the latest values too. Solid applies what a write changes when it flushes, as Vue renders after a tick. A watcher goes throughcreateWatcher, and awatchEffectthroughcreateWatchEffect, over a scheduler queued at the write, which applies Solid's writes and runs each queued watcher once, those before the DOM updates first, with Vue's previous value, change test and cleanup timing. Hooks run fromonSettled, and a template ref is emptied with its element throughclearedRef, which registers the cleanup as therefis evaluated, since Solid 2 refusesonCleanupin arefcallback. - Solid 2,
next-tick: Solid 2 applies writes on a microtask queued at the first write, which queues the watchers' run, so an inlinenextTickresolves two microtasks on. - Solid 2,
bound-attributeandattribute-spread: Solid 2 writes a boolean as an attribute's presence, where Vue writes the boolean of an ARIA attribute and ofcontenteditable,draggableandspellcheckas its name,aria-expanded="false". So such a value, bound or from a spread's key, goes through an inline helper,enumeratedValue, that writes"true"or"false"and passes any other value as it is. - Solid 2,
class-binding: static names and toggles print as Solid 2's ownclassarray,class={["tab", { active: active() }]}, which replacesclassList. A dynamic part, or the class of a spread, goes throughcx, which joins them into one string, as a component'sclassprop takes it. - Solid 2,
style-binding,child-root-scope,model-array,model-modifiersandreactive-context: as on Solid.modelTextandselectOptionsare factories that return the element'srefcallback, since Solid 2 creates no computation inside one. - Solid 2,
keyed-identity: as on Solid, a list goes throughKeyedFor, whose rows follow the source'skey. - Solid 2,
composable-effect-order(for information): as on Solid, a composable's watchers coalesce in its own module's queue. The compiler reports UF4005 at the composable's call. - Solid 2,
teleport: Solid 2's<Portal>inserts its content with no wrapper, but it throws on the server and renders where it is created, so an inline helper,Teleport, renders a<Portal>intotoonce the component has mounted, the teleports in the order they rendered (ADR-0098). - Solid 2,
transition: as on Solid, an inline component,Transition, keeps a leaving element until its leave ends. It resolves the child on the server too, so the child takes the same hydration keys on both sides (ADR-0100). - Solid 2,
directive: as on Solid, a ref factory whose hooks go throughqueueHook. Itsmountedhook runs fromonSettled, itsupdatedfrom an effect whose compute reads the value, and Solid 2's server runs the factory too, where its primitives do nothing (ADR-0099). - Angular,
event-capture,event-onceandevent-passive: a template's(event)binding takes no listener options, so the file declares an attribute directive for each event and option,[ufClickCapture], which listens withRenderer2.listenand emits the event again. Aoncelistener beside another listener of its event on its element runs with it in one template listener, in attribute order, under a guard instead,once(clickOnce, $event) && …: a method that remembers the elements it ran for. - Angular,
use-id: Angular has no id API, so a counter,idCounter, makes each instance's ids,uf-id-<component>-<n>, as Angular Material makes its own. It is one per application, so a server render and the browser that hydrates it count the same ids. - Angular,
class-binding:[class]reads no nested array and drops an entry that holds a space, so aclasspart that may be an array or an object at run time goes through an inline helper,classNames, which reads it as Vue'snormalizeClassdoes. Every otherclassis Angular's ownclassand[class]. - Angular,
style-binding: astylebound to a value is Angular's own[style], but where an object spread merges it, on the root beside the consumer'sstyleand on a component or a<component is>, whose root spreads it, an inline helper,styleObject, first splits a declaration list into an object as Vue'sparseStringStyledoes. - Angular,
raw-html: Angular sanitises a boundinnerHTML, which dropsid,data-*andstyleattributes, form controls and SVG, so the markup goes through an inline pure pipe,TrustedHtmlPipe, which marks it trusted withDomSanitizer.bypassSecurityTrustHtml, and renders as written. - Angular,
next-tick: Angular renders a change in a later task, so a privatenextTickmethod renders the pending change itself in a microtask,ApplicationRef.tick(), as Vue does, and resolves after it. - Angular,
named-slot,scoped-slotandslot-forwarding: each named slot is a directive the component's file exports,ng-template[uf<Component><Slot>], which the component reads withcontentChildand renders withngTemplateOutletunder@if; a scoped one types the consumer'slet-variables withngTemplateContextGuard, and a forwarded one re-declares the child's template with the parent's as its content. - Angular,
model-array,model-modifiersandreactive-context: a native control'sv-modelis a property binding and a listener, so inline helpers bind a checkbox group's array (toggle), a multiple select's (selectedValues) and a text field's modifiers (modelText); a provided ref is an object with avaluegetter,refObject. - Angular,
fallthrough: a component that inheritsclassandstyledeclares them as inputs, merges them into its root element and clears them from its host, which keeps onlydisplay: contents. - Angular,
dynamic-component: a strict template cannot choose a component by value, so an@switchrenders each candidate. - Angular,
default-slot-presence(an error): Angular has no API for whether<ng-content>received content, and forwarding the default slot would re-project<ng-content />, which always counts as content. - Angular,
child-root-scope(for information): a child cannot know the scope attributes its styled parents write on its host,data-uf-<id>, since each name is a parent's id, and the host must keep onlydisplay: contents. So each root node binds an inline attribute directive to the host,[ufScope]="this.host", which takes the host'sdata-uf-*attributes off it as the node renders and sets them on the node: on each branch of a root conditional and each candidate of a root<component is>too, as Vue's fallthrough reaches them. A root component passes them on to its own root. But the root renders inside its host element, which selectors see: a parent's rule that reaches the root through a combinator (>,+,~) or a structural pseudo-class (:first-child,:nth-child(), …) matches the host's place, not the root's, and may match differently. And a root Angular binds nothing on ({{in an attribute) takes no scope attribute. The compiler reports UF4003 at the first child a styled component renders. - Angular,
sheet-order(for information): Angular adds a component's sheet to the page as the component first renders: a parent's before its children's, and siblings in the order they render, where the other targets load them in import order, a child's first. Where two sheets' rules of equal specificity meet on one element (a child's root, content filled into a slot,:deep(),:global()), the winner can differ. The compiler reports UF4002 at a component's first stylesheet import, and a test whose captures depend on the winner requiressheet-order. - Angular,
contextual-root(an error): a root element HTML or ARIA ties to its parent (li,dt,dd,tr,td,th,thead,tbody,tfoot,caption,colgroup,col,option,optgroup,summary,legend) renders inside the host element, which breaks the parent's content model: axe reportslistandlistitem, and the HTML parser moves a host out of a table. Keep the<li>in the parent and render its content in the component. - Angular,
generic-slot-props(for information): Angular infers a component's type parameter from its inputs alone, and a slot's directive cannot infer it, so a scoped slot's context takes the parameter's constraint, where the other targets type the consumer's fill by the type argument. The component renders the same. The compiler reports UF4004 at the slot, or at a consumer's fill of it. - Angular,
teleport: the CDK's portals are no framework import, so the element is an<ng-template>whose inline directive,Teleport, creates its view after a render that leaves the template's anchor in the document, attaches it to the application, moves its nodes intoto, and refreshes it after every render. The view is in no view container, so a slot's projection never moves its nodes, and a template projected into a slot that isn't rendered waits for it. A render's teleports mount in the document's order, and a component whose whole render is a teleport takes its parents' scope attributes off its host (ADR-0098). - Angular,
transition:animate.enterandanimate.leavetake one class list, which can't run Vue's three phases, so the element takes an inline directive,Transition. A conditional child sits in an<ng-container>whose inline directive,TransitionRegion, is created with the transition and holds the branch shown. The element's directive runs the enter once its region has rendered, or withappear, so an element a condition around the transition shows again enters only withappear. One element of a transition without a conditional enters only withappear. It runs the leave through(animate.leave)'s function form, which holds the element's removal until the leave ends. Angular runs that function too when something around the element removes it, so the directive lets the element go at once while its region still shows its branch (ADR-0100). - Angular,
directive: a directive is a standalone attribute directive,[vFocusTrap], whoseafterRenderEffectpasses its value to an inline helper,runDirective. Angular creates projected content before a child puts it in the document, and keeps it while the child takes it out, so the helper runsmountedandunmountedas aMutationObserversees the element come and go. Angular mounts a parent before its child in one view and a child in an@ifbefore its parent, so the hooks go through an inline queue,queueHook, which runs them in Vue's order (ADR-0099). - Qwik,
event-once: Qwik's listeners have noonce, so a module-level set of the elements a once listener ran for,once<Event>, is checked first in its handler, which also takes the element'spreventdefault:andstoppropagation:attributes off after its first run, unless another listener of the element still needs them. - Qwik,
style-binding: astylebound to a value is Qwik's ownstyle, but where an object spread merges it, on the root beside the consumer'sstyleand on a component or a<component is>, whose root spreads it, an inline helper,styleObject, first splits a declaration list into an object as Vue'sparseStringStyledoes. - Qwik,
next-tick: Qwik has no public way to wait for a render, sonextTickresolves after the next task, by which time the render its writes scheduled, in a microtask, has run. - Qwik,
conditional-event-control(an error): Qwik runs a handler once its code has loaded, after the event is dispatched, so it runspreventDefault()andstopPropagation()apart, while the event is dispatched. A control at the top of a template listener runs on every event, as the element'spreventdefault:click; one there under a test of the event alone, or after guard clauses on the event, runs in async$handler, which captures nothing. Qwik cannot run any other control at dispatch: one after another statement, in a block beside other statements, in anelseor aswitchcase, after a test of state or of what a control changes (event.defaultPrevented), or in a function the listener calls anywhere but at its top. Nor can it run aoncelistener's control under a condition or on an element that listens to the event in both phases (async$handler cannot tell whether the listener already ran), a capture listener's control where an element of the component listens to the event in both phases (Qwik runs those capture listeners from the window), or a control in a local function that reads the component's state and that client code hands toaddEventListeneror calls outside a template listener. Make the control the first statement of the listener, or the only statement under anifthat tests only the event, and keep aoncelistener's control unconditional; in a listener that client code adds, make the control in the listener itself, before it calls a local function. The keyboard handler of a list box, aswitchonevent.keywith a control in each case, has no Qwik output (Events). - Qwik,
late-prop(a warning): Qwik subscribes auseComputed$or a task only to the props the component holds when it reads them. A derived value or a watcher that reads an optional prop the parent did not pass at mount, and passes later (a spread that gains the key), does not see it, though the template does. Pass the prop from the start,undefinedwhile it has no value. - Qwik,
named-slotandscoped-slot: Qwik's<Slot>takes no props and has no presence API, and a plain function prop does not serialise, so a named slot is a QRL render prop,<slot>$. - Qwik,
model-arrayandmodel-modifiers: Qwik has nov-model, so inline helpers bind a checkbox group's array (toggle), a multiple select's (selectedValues) and a text field's modifiers (modelText), as Vue does. - Qwik,
expose: Qwik has no component instance, so a component ref is a signal the child fills with what it exposes, through an inline helper,exposeRef. - Qwik,
default-slot-presence(an error): Qwik's<Slot />has no presence API, and forwarding the default slot needs it. - Qwik,
child-root-scope: a child cannot know the scope attributes its styled parents pass it,data-uf-<id>, since each name is a parent's id, so an inline helper,scopeAttributes, picks thedata-uf-*keys out of the rest of its props and spreads them on its root, on each branch of a root conditional and on each candidate of a root<component is>too, as Vue's fallthrough reaches them. - Qwik,
sheet-order(for information):useStyles$adds a component's sheet to the page as the component first renders: a parent's before its children's, and siblings in the order they render, where the other targets load them in import order, a child's first. Where two sheets' rules of equal specificity meet on one element (a child's root, content filled into a slot,:deep(),:global()), the winner can differ. Qwik's server render also writes the sheet as a<style>element before the component's root, which:first-child,:nth-child()and+count in the server's markup. The compiler reports UF4002 at a component's first stylesheet import, and a test whose captures depend on the winner requiressheet-order. - Qwik,
hydration(for information): Qwik resumes a server render instead of hydrating it. It runs no render, keeps no state for a component without client code, and runs visible tasks once the loader sees them, so the tests can't check a resumed page against a client render yet. A server render still resumes, unchecked. - Qwik,
teleport: Qwik has no portal, so the element renders once a visible task says the component has mounted, after an empty text in a fragment, which Qwik inserts a sibling before in its place. A ref,teleport, moves the element intoto, puts it back there when Qwik moves it with its component, makes it stand in for its Qwik container there, so its handlers still find it, and removes it once the element that held it leaves the document (ADR-0098). - Qwik,
transition: Qwik removes a node at once and has no transition primitive, so a signal lists the branches the transition renders, starting at the condition's value. A visible task that tracks the branch shown runs the old element's leave, drops it at the leave's end unless it is shown again first, which stops the leave, and adds the new one, whose ref,transition, runs its enter as Qwik creates it. An element a condition around the transition shows again enters only withappear, since a branch's mark goes if no element took it within two frames (ADR-0100). - Qwik,
directive: Qwik has no directive, so an element's directive is areffunction that adds each element one use renders to a signal of them, and a visible task that tracks them and the value, and calls an inline helper,runDirective, for each. A directive whose value reads a list's row or a scoped fill's props takes it from the element: itsrefiscollectValues, which lists the element with the values it reads as the row renders, and the task runs each element with its own. AMutationObserversees an element come into the document, where a slot may put it after Qwik calls the ref, and leave it, since a conditional's removal runs no task, and an inline queue runs the hooks in Vue's order (ADR-0099, ADR-0108). - Vue,
listbox(an error): Vue's client setsmultiplebut notsizebefore it inserts the options, so it selects the first option, as a drop-down does, where HTML selects none. - Astro,
interactivity(for information): Astro components render on the server only, and each render is a new instance: event handlers, template refs, watchers and lifecycle hooks never run, and state keeps its initial value. A test that relies on client code is skipped on Astro, and the parity matrix shows the skip with this reason. - Astro,
event-capture,event-once,event-passive,event-semantics,conditional-event-controlandnext-tick(for information): they refineinteractivity, so the compiler reportsinteractivityalone, once, at the first listener, ref, watcher or hook. - Astro,
use-id: a counter onAstro.locals,uniqueId, which lives for one request, makes ids unique on the page and the same for every request. - Astro,
style-binding: astylebound to a value is Astro's ownstyle, but where an object spread merges it, on the root beside the consumer'sstyleand on a component or a<component is>, whose root spreads it, an inline helper,styleObject, first splits a declaration list into an object as Vue'sparseStringStyledoes. - Astro,
component-event,two-way-binding,model-array,model-modifiers,exposeandcomposable-effect-order(for information): they refineinteractivity, so the compiler reportsinteractivityalone. A child's listener never runs, av-modelrenders its initial state, nothing calls what a component exposes, and a composable's watchers, effects and hooks never run. - Astro,
scoped-slot: Astro loses a slot's arguments behind the<Fragment slot>its compiler writes, so a scoped slot is a render prop named as the slot,<slot>. - Astro,
child-root-scope: a child cannot know the scope attributes its styled parents pass it,data-uf-<id>, since each name is a parent's id, so an inline helper,scopeAttributes, picks thedata-uf-*keys out ofAstro.propsand spreads them on its root, on each branch of a root conditional and on a root<component is>too, as Vue's fallthrough reaches them. - Astro,
contextandreactive-context(warnings): Astro renders each component on its own, with no tree of instances to provide to, soinjectgives its fallback, and a provided ref reaches no descendant. - Astro,
hydration(for information): Astro components render on the server only, with no client runtime, so nothing hydrates. - Astro,
keyed-identity(for information): Astro renders a list once on the server, so nothing reorders it in the page. No list reports it: a test that reorders or replaces a list's items requireskeyed-identity, and is skipped on Astro. - Astro,
teleport(for information): a static page has no client to mount the content once the component has mounted, and printing it in place would put it in the server HTML, so the output prints nothing for it. A test that reads teleported content requiresteleport, and is skipped on Astro. - Astro,
transition(for information): a static page runs no transition, so the child prints as it would without one, settled, with no class. A test that sees a transition requirestransition, and is skipped on Astro. - Astro,
directive(for information): a static page runs no hook, so the element renders without its directive. A test that reads what a hook does requiresdirective, and is skipped on Astro.
A native cell takes no note, so these are declared here (ADR-0060):
- React,
two-way-binding(native): a checkbox's or a radio'sv-modelis controlledcheckedwith React'sonChange, which React fires on the DOM'sclick, beforeinput, so a listener of the control'sinputreads the model the click wrote, where Vue's reads the value from before the click (Semantics). react-dom also writes a box's or an option's first state as itscheckedorselectedattribute and never updates it; the live state still compares, so the parity tests leave that attribute out on React. A<textarea>'sv-modelputs the caret after the text once the field is mounted, as Vue's set value does, since react-dom fills the field as its default value, which leaves the caret at the start. The one exception is a<textarea>with a native listener that reads a list's row or a narrowed value: its ref callback runs at every render, so it leaves the caret at the start. - React,
teleport: React 19's server render throws on a portal, so the element iscreatePortalfrom react-dom, through an inline helper,teleport, onceuseSyncExternalStoresays the component has mounted: false on the server and while the client hydrates. The helper renders nothing wheretomatches no element. A React package peers onreact-domfor it (ADR-0098). - Vue,
async-setup(native): Vue renders an async setup only under a<Suspense>, so a.uf.tsxparent wraps each use of an async child in one, and a hand-written Vue parent must do the same. A component whose whole render is an async child turnsinheritAttrsoff and binds$attrson the child, since<Suspense>drops fallthrough (ADR-0101). - Svelte,
async-setup(native): Svelte awaits in the instance script only in its async mode, so the host setscompilerOptions.experimental.async, which Svelte labels experimental, for each file whose instance script awaits or for the whole app. Svelte's async runtime is then on for the whole page. Template refs,mountedhooks and aprovideof props, module values and globals move above the awaits, since Svelte allows them only while a component starts. Aprovidethat reads an awaited value or a later item can't move, so the compiler reports it as UF1002 (ADR-0101). - Solid,
async-setup(native): a resource runs the awaits, and the rest of the setup renders inside a<Show>once it resolves. After hydration Solid creates that subtree again once the setup resolves: the new nodes read the same, but focus and selection inside them reset. With the data Solid's server render ships by default, the client hydrates in place and doesn't run the setup again, which the tests don't cover, since their server render leaves that data out (ADR-0101). - Solid 2,
async-setup(native): an asynccreateMemoruns the awaits, and the rest of the setup renders inside a keyed<Show>under<Loading>once it resolves. Solid 2 hydrates that subtree in place only with the values its server render serializes, so after hydration the awaits don't run again on the client, and the rest of the setup does. The contract allows either: a component depends neither on its setup running once nor twice (ADR-0102).
Every other difference between the frameworks is either handled by the target that has it, or rejected for every target by the compiler, with a code that names the framework. Attributes, Templates and Events list them, and Semantics states what every target guarantees at run time, and the differences that the compiler cannot see (Outside the contract).
Component events
A component declares its events with defineEmits (Events), and each target takes them in its framework's convention, keeping the event's name, apart from Angular's prefix for the names of DOM events:
| Target | A parent listens to change with | The listener receives |
|---|---|---|
| React | the prop onChange | the payload's members, as arguments |
| Vue | @change | the payload's members, as arguments |
| Svelte | the prop onchange | the payload's members, as arguments |
| Angular | the output (ufChange) | nothing for an empty payload, the value for one required member, and a tuple for any other payload |
| Solid | the prop onChange | the payload's members, as arguments |
| Qwik | the prop onChange$ | the payload's members, as arguments; the listener may run after the emit |
| Astro | nothing | nothing: Astro components render on the server only, and emit nothing |
Angular's output() emits one value, so a payload of two members or more, or with an optional member, is a tuple of exactly the arguments the emit gives: share: [path: string, note?: string] emits ["a.txt"] or ["a.txt", "Please review"]. React, Solid and Qwik type their event props with an exported interface beside the props, <Name>Events, and Svelte joins them to its Props type. Angular declares an output for each event under the event's name. An event named like a DOM event, such as change, select or progress, takes the uf prefix, ufChange, because an Angular output also hears the DOM's event of its name when that bubbles out of the host element: angular-eslint's no-output-native rule lists the names. Where a setup binding has that name, the class renames its own member: a local function save that emits save becomes the method onSave, and a state status the signal currentStatus.
The Angular host
Angular renders every component inside a host element, which wraps the template's root. The other frameworks render the root directly. Unframework gives each Angular component an element selector, uf- and its name in kebab case, and styles its host display: contents:
@Component({
selector: "uf-product-tile",
host: { "[attr.class]": "null", "[attr.style]": "'display: contents;'" },
preserveWhitespaces: false,
A consumer writes <uf-product-tile>, Angular's ordinary element syntax. display: contents keeps the host out of layout, so the component's geometry and pixels match the other targets'. Its accessibility tree differs in one place: Playwright's ARIA snapshot puts a space at every element whose display isn't inline, the host included, so inline content on either side of a host reads "Build passing" where the other targets read "Buildpassing". The parity tests take Angular's snapshot with its hosts set to display: inline, so they add no space (ADR-0060). The template holds the whole render tree: a single root, the roots of a root fragment, and the conditionals and lists beside them all render inside the one host.
The host keeps nothing a consumer writes on it: [attr.class] and [attr.style] clear any class and style there, apart from its own display: contents. A consumer's class and style reach the component's root element through two inputs instead (Fallthrough), and a static prop is bound, [label]="'Name'", so that no attribute stays on the host.
Attribute selectors, which would make the consumer's own element the host, are left to a decision of their own, outside M3. Until they land, a component whose root must sit directly inside its parent, such as an <li> in a consumer's list or a <tr> in a consumer's table, cannot be written for Angular (contextual-root, an error): keep that element in the parent, and render the component inside it (Child components).
The decisions behind this page are ADR-0010, ADR-0012, ADR-0015, ADR-0033, ADR-0047, ADR-0055, ADR-0056 and ADR-0060.