Skip to content

Commit 0dd48e4

Browse files
committed
#7093 WIP
1 parent caa6da0 commit 0dd48e4

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

learn/blog/v10-post1-love-story.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ layout engine, and a millisecond-responsive event handler—all at the same time
3131

3232
The result is a constant, low-grade war for milliseconds. Every developer knows the feeling in their gut: the janky
3333
scroll as a list virtualizer struggles to keep up; the button that feels "stuck" because a complex component is rendering;
34-
the entire UI freezing during a heavy data calculation. This isn't just a technical failure;
35-
it's a breach of trust with the user. Every stutter and freeze erodes their confidence in our creations.
34+
the entire UI freezing during a heavy data calculation.
35+
36+
This isn't just a technical failure; it's a breach of trust with the user. Every stutter and freeze erodes their confidence in our creations.
3637

3738
### Death by a Thousand Optimizations
3839

3940
To compensate for this architectural flaw, we've been given a toolbox of manual overrides. In the React world, this is
4041
the "memoization tax." In other frameworks, it might be manual change detection strategies or complex observable setups.
42+
4143
The result is the same: you, the developer, are forced to write extra code to prevent the framework from doing unnecessary work.
4244

4345
This tax is most obvious when looking at a "performant" component side-by-side with one that is performant by design.
@@ -84,9 +86,8 @@ const App = () => {
8486
<td>
8587

8688
```javascript
87-
import {defineComponent, useConfig} from 'neo.mjs/src/functional/defineComponent.mjs';
89+
import {defineComponent, useConfig} from 'neo.mjs/src/functional/_export.mjs';
8890

89-
// The child component
9091
const MyComponent = defineComponent({
9192
// The user config is passed in from the parent
9293
createVdom({user}) {
@@ -96,7 +97,6 @@ const MyComponent = defineComponent({
9697
}
9798
});
9899

99-
// The parent component
100100
export default defineComponent({
101101
createVdom() {
102102
const [count, setCount] = useConfig(0);
@@ -126,14 +126,26 @@ export default defineComponent({
126126
At first glance, the Neo.mjs syntax might seem more verbose than JSX. That's a deliberate design choice.
127127
Instead of a custom syntax that requires transpilation, Neo.mjs uses plain, structured JavaScript objects to define the UI.
128128
This makes the code more explicit, eliminates a build step, and creates a blueprint that is incredibly easy for LMMs/AIs
129-
to read and manipulate. Because the core is pure JavaScript, it also opens the door for optional, more familiar syntaxes
130-
based on Template Literals in the future, should the community desire it. The real story, however, isn't the syntax, but
131-
the outcome: the elimination of the memoization tax.
129+
to read and manipulate.
130+
131+
Because the core is pure JavaScript, it also opens the door for optional, more familiar syntaxes
132+
based on [Template Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the
133+
future, should the community desire it. The real story, however, isn't the syntax, but the outcome:
134+
the elimination of the memoization tax.
132135

133136
This isn't an advanced optimization strategy; it's a tedious, mandatory chore. It's a tax on our time and a cage for our
134137
creativity. We spend a significant portion of our development cycle simply preventing the framework from doing unnecessary
135138
work, a task that the framework should be doing for us.
136139

140+
While the syntax for these functional components might feel familiar, it's important to understand that this familiarity is
141+
just the tip of the iceberg. Neo.mjs functional components are built on a fundamentally different architecture: they run
142+
entirely within a dedicated Web Worker, completely off the browser's main thread. This architectural choice is what truly
143+
liberates you from the 'memoization tax' and enables a level of performance and predictability impossible in single-threaded
144+
frameworks. The `useConfig` hook, for instance, isn't just a `useState` clone; it's powered by Neo.mjs's advanced two-tier
145+
reactivity system, which automatically tracks dependencies and ensures surgical updates without any manual intervention.
146+
This is just one example of how Neo.mjs 'meets developers where they are' with familiar patterns, but then takes them far
147+
beyond the limitations of traditional frontend development.
148+
137149
### The State Management Labyrinth
138150

139151
Nowhere is this pain more acute than when building a truly complex, stateful UI. Forget a simple login form. Imagine a
@@ -142,7 +154,9 @@ conditional logic, and real-time validation.
142154

143155
How do we even begin to build this in a single-threaded world?
144156

145-
The state management alone is a paralyzing choice. Do we use hundreds of local state hooks and create a component tree
157+
The state management alone is a paralyzing choice.
158+
159+
Do we use hundreds of local state hooks and create a component tree
146160
so riddled with props-drilling that it becomes unmanageable? Or do we build a monolithic state object in a global store,
147161
only to find that every keystroke triggers a performance-killing update across the entire application?
148162

@@ -164,6 +178,7 @@ been faster. SSR is a brilliant strategy for delivering *content*.
164178
But it is a poor strategy for building *applications*.
165179

166180
The promise of SSR quickly becomes a mirage when confronted with the applications we truly want to build.
181+
167182
How do you build a multi-window IDE, where a user can drag a component from one screen to another,
168183
when the server's job is to send you static HTML? How do you manage the persistent, real-time state of a financial trading
169184
dashboard when every update requires a round trip to a serverless function?
@@ -216,7 +231,9 @@ Interacting with powerful AI models requires more than a simple chat window. It
216231
IDE-like environment where a user can write a prompt in one window, see the AI's reasoning in a second, view the
217232
generated code in a third, and see a live preview in a fourth.
218233

219-
This is impossible with traditional frameworks. But it's native to Neo.mjs. Its multi-threaded, multi-window architecture
234+
This is impossible with traditional frameworks.
235+
236+
But it's native to Neo.mjs. Its multi-threaded, multi-window architecture
220237
is the perfect foundation for building the complex, data-intensive UIs that the AI era demands.
221238

222239
### The Framework BY AI: Speaking the Right Language

0 commit comments

Comments
 (0)