AI-Native Rendering Engine (@vue/compiler-json) #14347
likeswinds
started this conversation in
Ideas
Replies: 2 comments
-
|
牛逼 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
支持! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
RFC: AI-Native Rendering Engine (@vue/compiler-json)
Summary
Proposing
@vue/compiler-json, a dedicated core package designed to treat normalized, flattened JSON schemas as high-performance rendering inputs. Unlike standard runtime JSON-to-VDOM mappers, this engine implements Ahead-of-Time (AOT) and Just-in-Time (JIT) optimizations—specifically Static Hoisting and Patch Flags—to bridge the gap between AI-generated data and Vue’s optimized virtual DOM.Motivation
As the industry shifts toward AI-Driven Development, the primary consumer of UI frameworks is increasingly AI models rather than human developers.
Detailed Design
1. The Normalized Flat Schema
To optimize for AI generation and runtime lookup, the compiler utilizes a flat element map:
{ "root": "vnode_1", "elements": { "vnode_1": { "type": "div", "props": { "class": "container" }, "children": ["vnode_2"] }, "vnode_2": { "type": "span", "props": { "content": "{{ user.name }}" } } } }2. Compiler Optimizations
The engine will port core logic from
compiler-domto the JSON context:patchFlag: -1(or detected as static) are hoisted out of the render function to avoid memory re-allocation during re-renders.new Function(), ensuring execution speed is indistinguishable from standard Vue components.3. Proposed API
Drawbacks
new Function) requires a strict security policy and potentially a "no-eval" version for restricted environments.Adoption Strategy
This should be introduced as an experimental, standalone package (
@vue/compiler-json). If the community adopts it as the standard for AI-generated UI or Server-Driven UI (SDUI), it can be integrated deeper into the Vue core.Unresolved questions
抱歉,英文比较差,只能求助AI了,可以看下这个,感觉用vue底层实现优势更大 https://json-render.dev/
Beta Was this translation helpful? Give feedback.
All reactions