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/comparisons/NeoVsAngular.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,12 +38,11 @@ This is where the two frameworks diverge significantly, each offering unique tra
38
38
***DOM Pollution:** Angular often adds numerous internal `data-set` attributes to the real DOM for its own tracking and debugging purposes. While functional, this can lead to a less clean and more verbose DOM structure.
39
39
***Immutability Considerations:** While Angular doesn't enforce immutability, performance optimizations like `OnPush` change detection often benefit significantly from immutable data patterns. This can introduce a cognitive burden for developers to manage data immutably for optimal performance.
40
40
41
-
***Neo.mjs: Virtual DOM (Off-Main-Thread Diffing & Fine-Grained Reactivity)**
42
-
* Neo.mjs uses a Virtual DOM. Your `createVdom()` method (within functional components) returns a plain JavaScript object representing the desired UI structure. **This VDOM is defined using simple nested JavaScript objects and arrays, akin to a JSON-like description of the DOM. Crucially, Neo.mjs's VDOM objects are mutable.**
43
-
***Mutable VDOM & State (By Design):** Unlike Angular, Neo.mjs embraces mutability for both its VDOM and its reactive state (configs and state provider data). Developers can directly modify properties of VDOM objects or state data. This is a deliberate design choice enabled by Neo.mjs's worker architecture. The App Worker sends a *snapshot* (a serialized copy) of the VDOM (or relevant parts of state) to the VDom Worker or Main Thread for diffing or rendering. This allows developers the convenience of direct mutation without sacrificing performance, as the framework handles the efficient snapshotting and communication across workers.
44
-
***Off-Main-Thread Diffing:** The VDOM diffing process occurs in a dedicated **VDom Worker**, offloading this computational work from the Main Thread.
45
-
***Surgical Direct DOM API Updates (`Neo.main.DeltaUpdates` & `DomApiRenderer`):** The VDom Worker sends "deltas" (minimal change instructions) to the Main Thread. `Neo.main.DeltaUpdates` then applies these changes using direct DOM APIs.
46
-
***Fine-Grained Reactivity & Decoupled DOM:** Neo.mjs's `Neo.core.Effect` system precisely tracks dependencies. When a reactive config or state changes, only the specific `createVdom()` effect that depends on it re-executes, leading to highly targeted VDOM updates. Crucially, Neo.mjs components are **completely decoupled from the real DOM**; they reside in the App Worker and never directly read from or write to the DOM. This fundamental architectural choice eliminates the performance bottleneck associated with frequent DOM access, ensuring Main Thread responsiveness and predictable performance. Neo.mjs also strives to keep the real DOM as clean as possible, avoiding the addition of numerous internal framework-specific attributes.
* Neo.mjs uses a Virtual DOM defined by plain JavaScript objects (no JSX/build step needed).
43
+
***Mutability by Design, Immutability in Process:** Neo.mjs allows for convenient, direct mutation of state and VDOM in the App Worker. When an update is triggered, it sends an immutable JSON snapshot of the VDOM to a dedicated VDom Worker for diffing. This provides developer convenience without sacrificing performance.
44
+
***Surgical Updates:** The VDom Worker sends minimal "delta" instructions to the Main Thread, which applies them with efficient, direct DOM APIs.
45
+
***Fine-Grained Reactivity vs. Zone.js:** Instead of Angular's Zone.js, which broadly detects changes by monkey-patching browser APIs, Neo.mjs uses a precise, `Effect`-based system. When a piece of state (`config`) changes, only the `createVdom` functions that *directly depend* on that state are re-executed. This avoids the overhead of Angular's change detection cycles and eliminates the need for manual optimizations like `OnPush` change detection strategy. The result is optimal performance by default.
47
46
48
47
### 3. Component Model & State Management
49
48
@@ -52,7 +51,8 @@ This is where the two frameworks diverge significantly, each offering unique tra
52
51
***State Management:** Often relies on services for shared state, or third-party libraries like NgRx (RxJS-based state management).
53
52
54
53
***Neo.mjs: Class-Based & Functional Components, State Providers**
55
-
* Neo.mjs offers both a robust class-based component system (`Neo.component.Base`) and modern functional components with hooks.
54
+
* Neo.mjs offers a dual component model. Developers can use a robust class-based system (`Neo.component.Base`) for complex, stateful components, or leverage modern, lightweight functional components via the `defineComponent()` API.
55
+
* This functional approach uses hooks like `useConfig()` for state, providing a clean, declarative way to build UI while benefiting from Neo.mjs's underlying fine-grained reactivity.
56
56
***State Management:** Features integrated state providers and a unified config system for managing and sharing bindable data across the component tree, often simplifying cross-component communication compared to traditional DI or prop passing.
* Neo.mjs uses a modern, fine-grained reactivity system based on `Neo.core.Config` and `Neo.core.Effect`. When a
117
-
reactive config or state changes, only the specific parts of the UI that depend on it are re-rendered.
118
-
***Benefit:** This leads to highly efficient and precise updates, reducing unnecessary work. It conceptually aligns
119
-
with the "signals" pattern for granular updates. Developers can directly modify state, and the framework
120
-
automatically handles the updates.
115
+
***Neo.mjs: True, Fine-Grained Reactivity**
116
+
* Neo.mjs is built on a modern, fine-grained reactivity system powered by `Neo.core.Config` and `Neo.core.Effect`. When a reactive config or state changes, only the specific parts of the UI that depend on it are automatically updated.
117
+
* Developers can simply change a value (`this.myConfig = 'new value'`), and the UI updates automatically and efficiently. There is no need for manual event listeners or explicit setter calls to trigger UI changes. This dramatically simplifies development, reduces boilerplate, and eliminates a common source of bugs.
121
118
122
119
### 4. Development Workflow & Modern JavaScript
123
120
@@ -152,20 +149,10 @@ limitations of Ext.js.
152
149
***Class-Based Only:** Ext.js is exclusively class-based. It does not natively support the modern functional
153
150
component paradigm, making it challenging to adopt contemporary UI development patterns.
154
151
155
-
***Neo.mjs: Comprehensive & Technically Superior Component Library & Modern Extensibility (including Functional Components)**
156
-
* Neo.mjs also offers a vast component library, providing a breadth of essential UI components (grids, forms,
157
-
`OffscreenCanvas`, etc.) that achieve **feature parity** with many of Ext.js's offerings. Built on its
158
-
`Neo.core.Base` class, its comprehensiveness stems from providing a broad set of essential UI components that
159
-
are designed for **modularity, composability, and high customizability**. Beyond feature parity, Neo.mjs
160
-
components often offer **technically superior implementations**, such as its highly optimized buffered grid and
161
-
buffered columns, which provide unparalleled performance for large datasets. It supports both traditional
162
-
class-based components and modern functional components with hooks (`defineComponent`, `useConfig`), allowing
163
-
developers to choose the most appropriate paradigm.
164
-
***Superior Extensibility:** Neo.mjs offers a more modern, flexible, and performant level of extensibility.
165
-
Leveraging native ES Modules and ES6+ classes, its clean class hierarchy, **mixins, plugins**, and reactive config
166
-
system simplify extending core functionalities. The worker-based architecture enables extensions that run off the
167
-
Main Thread, opening new possibilities for highly performant features without impacting UI responsiveness.
168
-
Dynamic module loading further enhances its pluggability.
152
+
***Neo.mjs: A Modern, Dual Component Model**
153
+
* Neo.mjs offers a flexible, dual component model. Developers can use a powerful, full-featured class-based system (`Neo.component.Base`) that will feel familiar yet superior to Ext.js developers, or they can adopt a modern, lightweight functional component paradigm using the `defineComponent()` API with hooks.
154
+
* This provides a clear upgrade path and allows teams to choose the best tool for the job, from complex enterprise grids to simple, declarative UI functions. Its component library achieves feature parity with many of Ext.js's offerings, but with technically superior, modular, and more performant implementations.
155
+
***Superior Extensibility:** Leveraging native ES Modules, a clean class hierarchy, mixins, and plugins, Neo.mjs offers a more modern and performant level of extensibility. The worker-based architecture enables extensions that run off the Main Thread, opening new possibilities for high-performance features without impacting UI responsiveness.
169
156
170
157
## Conclusion: Why Neo.mjs is a Modern Successor to Ext.js
0 commit comments