Skip to content

Commit bf2a634

Browse files
committed
#7233 section 3: button config & vdom explanation enhancement
1 parent 7edfcc1 commit bf2a634

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

learn/blog/ai-native-platform-answers-questions.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,25 @@ Now, here is the same component as a Neo.mjs JSON blueprint:
109109
}
110110
```
111111

112-
We call this the "JSON Blueprint" advantage. For an AI, the blueprint is immediately parsable data, whereas JSX requires an understanding of JavaScript's syntax, build tools, and React's `createElement` abstraction. There is no ambiguity.
112+
A skeptic might correctly point out that this blueprint is a configuration for a class instance (`Neo.button.Base`), which gets consumed by `Neo.create()` to create the matching instance. This is true. However, the fundamental difference remains: inside a classic Neo.mjs component, the VDOM that gets rendered is *also* a simple, declarative JSON-like object. It is not generated by parsing a template string.
113113

114-
This advantage also extends to raw efficiency and cost. Parsing HTML is a notoriously complex task requiring large libraries like `parse5` (which is over 170KB minified). While LLMs are heavily trained on JSX, it still requires a full transpilation step to be understood as code. In contrast, JSON is parsed natively with extreme efficiency. For an AI, this means fewer tokens are needed to define a component, less computational power is wasted on parsing complex syntax, and the end result is a faster, cheaper, and more reliable generation process, making it incredibly easy and predictable to reason about UI structures.
114+
Here is the default `_vdom` property directly from `src/button/Base.mjs`:
115+
116+
```javascript readonly
117+
// The Button's internal VDOM structure
118+
{
119+
tag: 'button', type: 'button', cn: [
120+
{tag: 'span', cls: ['neo-button-glyph']},
121+
{tag: 'span', cls: ['neo-button-text']},
122+
{cls: ['neo-button-badge']},
123+
{cls: ['neo-button-ripple-wrapper'], cn: [
124+
{cls: ['neo-button-ripple']}
125+
]}
126+
]
127+
}
128+
```
129+
130+
This consistent, data-first approach to UI definition at every level is what makes the platform uniquely transparent to an AI. We call this the "JSON Blueprint" advantage. For an AI, the blueprint is immediately parsable data, whereas JSX requires an understanding of JavaScript's syntax, build tools, and React's `createElement` abstraction. There is no ambiguity.
115131

116132
### 4. Multi-Threading for Unmatched Performance
117133

0 commit comments

Comments
 (0)