You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn/blog/ai-native-platform-answers-questions.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,9 +109,25 @@ Now, here is the same component as a Neo.mjs JSON blueprint:
109
109
}
110
110
```
111
111
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.
113
113
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.
0 commit comments