Neo.mjs vs Vue.js
Neo.mjs is a multi-threaded Application Engine. Vue.js has perfected its architecture for a single-threaded browser environment; Neo.mjs starts from a different one: your application, with its component tree, state and logic, lives in an App Worker, a VDom Worker computes the DOM changes, and the main thread only applies them. It is a self-contained runtime, MIT-licensed and with zero runtime dependencies. It ships a buffered grid that scrolls 100,000 rows, forms, the calendar, timeline, scheduler and Gantt views and dock layouts whose panels move into their own browser windows, and it runs in four development and deployment environments, from a development mode with no build step at all to thread-optimized production bundles.
Neo.mjs has a second hemisphere beside the engine. An Agent OS gives AI maintainers from rival labs persistent memory and peer review, and that team builds and maintains the engine in public. Its Neural Link connects an agent to a running Neo.mjs application, where it reads the component tree and state and changes them while the application keeps running. What Is Neo.mjs? describes that hemisphere; the comparison below is about the engine.
This article provides a focused comparison between the engine and Vue.js. While both systems share a commitment to a superb developer experience and a highly efficient reactive model, their underlying philosophies on how to achieve peak performance and scalability diverge. We will explore their approaches to architecture, rendering, and reactivity, highlighting the trade-offs between Vue's single-threaded model and Neo.mjs's holistic, worker-based paradigm.
Foundational Concepts: A Shared Heritage
Despite their architectural differences, both architectures build upon foundational concepts that have shaped modern UI development:
- Component-Based Architecture: Both architectures champion building UIs as a composition of reusable components. Neo.mjs extends this with
Neo.core.Base, allowing any class-based entity (controllers, models, etc.) to leverage the engine's powerful class system, even without a UI. - Declarative UI: Developers describe what the UI should look like for a given state, and the engine handles how to update the DOM.
- Fine-Grained Reactivity: Both systems feature exceptionally efficient reactivity systems that avoid the "unnecessary re-render" problems found in other libraries. They automatically track dependencies and ensure that only the necessary parts of the UI are updated when state changes.
- Modern APIs: Both support modern development patterns with APIs for managing state and side effects (Hooks in Neo.mjs, Composition API in Vue).
Key Differences: Architectural & Rendering Strategies
This is where the two approaches diverge significantly, each offering unique trade-offs and advantages.
1. Overall Architecture: Main-Thread Optimized vs. Multi-Thread Native
Vue.js: A Master of the Main Thread
- Vue applications run entirely on the Main JavaScript Thread. All component logic, state management (e.g., Pinia), VDOM reconciliation, and direct DOM manipulation occur on this single thread.
- Implication: Vue is exceptionally well-optimized for this environment. Its reactivity system and template compiler are designed to minimize the work done on the main thread. However, it is still fundamentally bound by the single-threaded nature of JavaScript. Very complex computations or large, synchronous state updates can still potentially block the Main Thread, impacting the user experience in data-heavy, high-frequency update scenarios.
Neo.mjs: A "Backend-in-the-Browser" Architecture
- Neo.mjs's defining feature is its multi-threaded architecture, which treats the client-side application with the same rigor as a backend system.
- App Worker (The "Frontend Backend"): Application logic, component instances, state, and business logic run in a dedicated App Worker.
- VDom Worker (The "Rendering Service"): The VDOM diffing occurs in a separate VDom Worker.
- Main Thread (The "Painting Client"): The Main Thread's primary job is to apply pre-calculated DOM patches.
- Benefit: This architecture keeps the Main Thread almost entirely free and responsive, preventing UI freezes even during heavy computations. It's not just an optimization; it's a paradigm shift that leverages multi-core CPUs for true parallelism.
2. Reactivity Model: Pure "Pull" vs. a Hybrid "Push/Pull" System
Vue.js: Elegant and Pure "Pull" Reactivity
- Vue's reactivity system (using
refandreactive) is a masterpiece of developer ergonomics. It is a pure "pull" system: your templates orwatchEffectfunctions "pull" from reactive sources, and Vue automatically tracks these dependencies to trigger updates. - For side effects, developers use
watchorwatchEffect, which are powerful tools for observing state changes and reacting to them.
- Vue's reactivity system (using
Neo.mjs: The Two-Tier Hybrid System
- Neo.mjs's reactivity is arguably more powerful because it's a hybrid system designed for architectural flexibility. Every reactive property simultaneously powers two paradigms:
- The "Pull" System (Declarative): Used in functional components, the
createVdom()function is anEffectthat "pulls" from state dependencies. This is very similar in spirit to Vue'ssetupand is fantastic for expressing the UI as a pure function of its state. - The "Push" System (Imperative): This is the unique part. Every reactive config also has optional
afterSet<PropertyName>()hooks. This is more than just awatcher; it's a powerful, class-based tool for validation, transformation, and orchestrating complex business logic. For example, changing a grid column'sdataIndexcould trigger a store reload, update headers, and recalculate summary rows, all within a clean, predictableafterSetDataIndexhook.
This hybrid approach gives developers the choice between elegant, declarative rendering and powerful, imperative control for any given state change, all within a single, unified model.
3. Component Lifecycle: Optimized for Rendering vs. Built for Persistence
Vue.js: A Rich, Main-Thread Lifecycle
- Vue provides a comprehensive set of lifecycle hooks (
onMounted,onUnmounted, etc.) that give developers fine-grained control over a component's life within the main-thread environment. This is excellent for managing side effects related to the DOM, such as integrating third-party libraries.
- Vue provides a comprehensive set of lifecycle hooks (
Neo.mjs: A Stable Lifecycle for Asynchronous and Multi-Window Apps
- Neo.mjs's lifecycle is designed to solve problems that are architecturally difficult in a single-threaded world.
initAsync(): This hook runs after construction but before the component is considered "ready." It allows for asynchronous setup (like data fetching or lazy-loading modules) to complete before the first render. This eliminates entire classes of UI flicker and race conditions at an architectural level.afterSetMounted()& True Persistence: A Neo.mjs component is a stable, persistent instance. It can be unmounted from the DOM (mounted: false) and later remounted without being destroyed.afterSetMountedfires reliably for both state changes. This persistence is the key to enabling true multi-window applications, where a component instance can be moved from one browser window to another while retaining its full state and logic.
4. Component Mobility: Portals vs. True Persistence
A critical architectural difference emerges when dealing with moving components around the UI, especially those with internal state (like a playing <video> or a complex third-party widget).
Vue.js: The
<Teleport>Component- Vue uses its built-in
<Teleport>component to solve a common CSS layout problem: rendering a component's DOM subtree in a different physical location in the DOM (e.g., a modal at the end of<body>). This is a rendering trick. - The component's logical position in the Vue tree remains the same, but its DOM is "teleported" elsewhere.
- The Limitation: If the component that contains the
<Teleport>tag is unmounted and remounted in a new location (e.g., viav-if), its state is destroyed. The teleported content is completely recreated from scratch. A playing video would jarringly restart.
- Vue uses its built-in
Neo.mjs: True Mobility by Design
- This is not a special feature in Neo.mjs; it is a natural consequence of the architecture.
- Because component instances are stable and persistent, moving a component is a controlled data operation. A developer programmatically modifies the
itemsarrays of the relevant containers, then callsupdate()on the closest common ancestor. This signals the engine to perform a single, efficient reconciliation that correctly identifies the component move. While callingupdate()on a higher-level ancestor would also work, targeting the closest one is a best practice that minimizes the scope of the update, showcasing the engine's focus on performance and developer control. This explicit, batch-friendly approach is a core architectural feature, not a hack. - The engine recognizes that the component's DOM node already exists. It issues a single, efficient
moveNodecommand to the Main Thread. - The Benefit: The existing DOM node, with all its internal state, is simply unplugged from its old parent and plugged into the new one. A playing video continues to play, uninterrupted. This enables a level of UI fluidity and state preservation that is architecturally impossible in a single-threaded model where component identity is tied to its place in the template.
Other Considerations:
Development & Deployment Environments: Neo.mjs offers four distinct environments, providing unparalleled flexibility:
- Zero Builds Development Mode: The primary development workflow, leveraging native ES Modules for instant code reflection and debugging without a build step. This contrasts with Vue's typical SFC-based development which always requires a build process (e.g., Vite).
dist/esm: Deploys as native ES Modules, preserving the dev mode's file structure.dist/production: Generates highly optimized, thread-specific bundles using Webpack.dist/development: A bundled but unminified environment for debugging production-specific issues.
Templates vs. Plain Objects: Vue primarily uses HTML-like templates in SFCs (requiring a build step). Neo.mjs uses plain JavaScript objects for VDOM (no compilation needed for VDOM definition).
Ecosystem & Maturity: Vue has a rich ecosystem with excellent tools (like Vite and Vue Devtools), and much of it exists because Vue ships a view layer and leaves grids, forms, docking and multi-window support to separate packages. Neo.mjs ships all of those in one install: more than 450 classes, maintained and released together. Its community is smaller, and its answers are integrated rather than assembled.
Dependency Management (Batteries Included): Vue projects, while often leaner than React, still rely on
node_modulesand a build toolchain. Neo.mjs is a "batteries included" platform with zero real runtime dependencies outside of its own core. This native ES Module approach significantly reduces complexity and dependency management overhead.
Conclusion: Why Neo.mjs Offers a Different Path to Performance
Vue is one of the most pleasant main-thread view libraries, and its developer experience earns its popularity. Neo.mjs builds the same applications, from standard business apps to data-intensive dashboards and multi-window workspaces, on a foundation that takes the work off the main thread, and it ships the components and tooling Vue projects assemble separately.
- True Parallelism: Neo.mjs doesn't just optimize tasks on the main thread; it runs them in parallel on separate threads, providing a higher performance ceiling.
- Architectural Solutions for Complex Problems: The hybrid reactivity model and the async-aware, persistent lifecycle are designed to solve complex orchestration and asynchronous challenges at the engine level.
- Future-Proofing for Complexity: By building on a multi-threaded foundation, Neo.mjs is architecturally prepared for the increasingly complex and data-intensive applications of the future.
You get a complete platform in one install, zero-build development, a UI that stays fluid under load, applications that span several browser windows, and a Neural Link through which your coding agent works inside your running app. To try it on your next application, start with the Getting Started guide.