Skip to content

feat(vue-lang): run on lang-core's renderer runtime - #1802

Open
Aditya-thesys wants to merge 59 commits into
mainfrom
surfaces/web-vue
Open

Aditya-thesys wants to merge 59 commits into
mainfrom
surfaces/web-vue

Conversation

@Aditya-thesys

@Aditya-thesys Aditya-thesys commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1800: this PR targets surfaces/web-core, so it shows only the vue-lang changes. After #1800 merges, GitHub retargets it to main.

What

Rebuilds vue-lang as a thin view layer over @openuidev/lang-core/runtime. It reaches react-lang's feature set: $state, queries and mutations, action plans, custom actions, library functions, form validation, structured errors through onError, renderer slots and an element error boundary that keeps the last valid render.

Changes

  • Render functions instead of SFCs (Renderer.ts, RenderNode.ts); no .vue files ship. One renderer runtime per Renderer (useRendererRuntime.ts).
  • The element boundary keeps the last valid render, including for errors thrown in onMounted.
  • Kept from 0.4: attributes on <Renderer> land on its root div; createFormValidation().errors stays current when destructured; a component without a props option receives props and renderNode as attrs; a server render calls onParseResult and onError.
  • A new library starts a new message: its state resets and its queries run again. Build the library once at module scope.
  • No longer re-exports lang-core's ActionConfig, LibraryJSONSchema, TriggerAction, DefaultValueRequest and FieldErrors; import them from @openuidev/lang-core.
  • Depends on the workspace lang-core (published as ~1.3.0) instead of 0.4. Declarations are emitted through tsconfig.build.json.
  • vue-lang keeps its own version line, outside the lang-core / react-lang fixed group (.changeset/config.json is as on main). Its version is aligned to 1.2.1, so the minor changeset releases it as 1.3.0.
  • README: "Migrating from 0.4 to 1.3" and "Known differences and limits".

Test Plan

  • lint, format, 67 tests, test typecheck, vue-tsc --noEmit, build, verify-peer-windows; lang-core (371) and react-lang (92) tests pass on this branch.
  • Differential fuzz against react-lang: 5,000 random streamed, rendered and interacted cases. Remaining known differences are listed under Follow-ups.

Checklist

Notes

  • pnpm-lock.yaml conflicts with the Svelte and Angular PRs once one of them is merged. Regenerate it with pnpm install --lockfile-only.

Follow-ups

  • Known differences from react-lang found by the fuzz: the number of library function calls per update (accepted: library functions must be pure), and two same-named fields both writing a default.
  • Not ported from react-lang yet: provenance (readSourceTarget, bindSource), useDataSources, WithPreviewRenderer / useRendererPreview, observability publishing.
  • As in react-lang, state initializes after mount, so server HTML does not show declared $var defaults or restored initialState.

@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
openui-docs Skipped Skipped Dec 6, 2026 6:29pm UTC

Request Review

Base automatically changed from surfaces/web-core to main December 6, 2026 16:00
…"field.value" binds an input (lang-core's StateField types value as writable; the getter-only object threw on the first keystroke); README shows v-model
…r its own error is the first message; vue peer range ^3.5.0
…orted through onError as render-error (last render kept, errorHandler not called); event handlers, watchers run by other state and async code go to the app's errorHandler (tested)
…penuidev/vue-lang explicitly (Nuxt auto-imports Vue's versions)
… from lang-core again; Vue's SFC compiler from 3.5.28 resolves defineProps<ComponentRenderProps<…>>() through lang-core's declarations
…rer and cleared once it has left the Renderer's boundaries, so a later render that throws the same value is reported (tested)
…derNode :value> renders children in templates, and Renderer and Renderer.Root are generic over the library so @action's event is typed by its custom actions (types only)
…, RenderNode for children, @action/@error/@state-update on Renderer; render functions move to an appendix
…yJSONSchema exported again; ci type-checks the .vue type tests with vue-tsc
…dererContent/... names in the slots example; ActionConfig and LibraryJSONSchema from @openuidev/vue-lang; field.value is live, a destructured value is a snapshot; with server rendering, $state defaults and initialState apply on the client
…h custom actions pass to Renderer and h(Renderer, props) (type test)
…t task, also when a component on the way stops it, so a later render that throws the same value is caught (tested)
…ed, also undefined from an element not yet streamed in full (tested)
…ck the element it showed; the new element stays and the error names the removed component until the element changes. A plain Vue child that throws re-rendering itself is caught by its element's boundary (tested)
… local named h for Vue's h when the example links the package
…, so @action's event is typed by its custom actions (type test)
…Props, children with <RenderNode>, @action on the Renderer, Button's action is action() from vue-lang, zod/v4
… Angular examples; the examples move to 1.3 from npm once it is published
….4; ComponentRenderProps is declared in vue-lang again, so the SFC compiler before 3.5.28 resolves defineProps<ComponentRenderProps<typeof Schema>>() (checked in a Vue 3.5.0 Vite app)
… resolve lang-core's declarations in any project

This branch was previously deployed

1 inactive deployment
Preview — 6d6ae00f Deployed Dec 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant