Fragment Executor Engine

Rapidly develop a maintainable Single Page Application (SPA) using pure HTML,CSS & JS.

Features

  1. No server side execution
  2. Valid URL & SEO friendly
  3. No new syntax
  4. SPA experience
  5. Maintainability
  6. Compatible with existing framwork or library
  7. No build process step
  8. Easy to use
  9. Very lite weight
  10. Efficient & high performance
  11. Reusability
  12. Pure JS cleanup

Version 1.0

NPM
        npm fragmenium 📝
      
CDN
        https://www.cdn.com/fragmenium.engine.js 📝
      

Table of content

Fragmenium

Fragmenium is a fragment execution engine. It executes HTML, CSS, and JS as fragments.

Each fragment is executed according to the reference.js file, which makes the application more dynamic, maintainable, and reusable.

All fragments are 100% cleanable. When a previous fragment is no longer needed—especially JavaScript—it can be removed completely.

Fragments are written in pure HTML, CSS, and JS. There is no fancy syntax or special rules required to get started.

Fragment Types

There are four main types of fragments, each executed at different times. In addition, there are some special fragment types.

Type: Constant

Constant fragments are executed only once when the page loads.

Type: Common

Common fragments are executed when visiting pages within a specific directory.

Type: Unique

Unique fragments are HTML-specific and represent static parts of the application. They are executed on every navigation.

Type: Specific

Specific fragments are CSS and JS-specific, designed exclusively for particular pages.

Special Fragment Types

Type: Every is a JS-specific fragment that executes every time navigation occurs.

Type: Swap is an HTML-specific fragment that supports reusability with parameters. It is not page-specific; instead, it acts like a variable with parameter functionality.

Architecture

Fragmenium is built on a fragment-based architecture that provides a true Single Page Application (SPA) experience while ensuring reusability, SEO friendly and maintainability.

A Fragmenium application is composed of both static and dynamic fragments:

This separation of static and dynamic fragments allows Fragmenium to balance performance and flexibility. Static fragments ensure strong search engine visibility, while dynamic fragments reduce code duplication and make updates easier across the entire application.

By combining these two fragment types, Fragmenium delivers a hybrid architecture: developers can build applications that are both SEO-friendly and highly maintainable, without sacrificing the smooth navigation and responsiveness of an SPA.

Comparison

Fragmenium is a fregment-based execution engine that offers a lightweight alternative to popular frameworks like React and Vue. While React and Vue rely on virtual DOMs, build processes, and custom syntax, Fragmenium focuses on simplicity, direct execution, and maintainability.

Feature Fragmenium React / Vue
Server-side Execution No server-side execution; runs directly in the browser with pure JS fregments Often paired with SSR (Server-Side Rendering) for SEO and performance
SEO & URLs Valid URLs and SEO-friendly by default Requires SSR or extra configuration for SEO-friendly routing
Syntax No new syntax; uses pure HTML, CSS, and JS fregments Introduces JSX (React) or template syntax (Vue)
SPA Experience Built-in SPA navigation with fregments SPA achieved through routing libraries
Maintainability Simple fregment cleanup and reusability Lifecycle management with hooks (React) or directives (Vue)
Module Cleanup Executes JavaScript inside an iframe, making fregments fully cleanable with no residual state Imported modules cannot be removed from source; developers must write manual cleanup functions, and JavaScript is not 100% clean
Compatibility Works alongside existing frameworks or libraries Primarily standalone ecosystems; integration possible but heavier
Build Process No build step required Requires bundlers (Webpack, Vite, etc.)
Ease of Use Very easy to start; no tooling overhead Steeper learning curve with ecosystem tools
Size Ultra lightweight (~10kb) Much larger (React ~100kb+, Vue ~80kb+)
Performance Efficient and high performance with direct Fragment execution Optimized via virtual DOM diffing
Reusability Dynamic fregments (Constant, Common, Swap) enable reuse Reusable components with props/state
Cleanup Pure JS cleanup; fregments removed when no longer needed Component unmounting handled by framework lifecycle

In summary, Fragmenium delivers a minimalistic, fregment-driven architecture that provides SPA-like experiences without build steps, heavy syntax, or large bundle sizes. Its iframe-based execution model ensures true cleanup, something React and Vue cannot achieve natively.

Comparison (Visual)

Fragmenium React Vue
No server-side execution
Fragmenium
React
Vue
Valid URL & SEO friendly
Fragmenium
React
Vue
No new syntax
Fragmenium
React (JSX)
Vue (templates)
SPA experience
Fragmenium
React
Vue
Maintainability
Fragmenium (fregments)
React (hooks)
Vue (directives)
Compatibility
Fragmenium
React
Vue
No build process
Fragmenium
React
Vue
Ease of use
Fragmenium
React
Vue
Bundle size
Fragmenium (~10kb)
React (100kb+)
Vue (80kb+)
Efficiency & performance
Fragmenium (direct DOM)
React (VDOM)
Vue (VDOM)
Reusability
Fragmenium (fregments)
React (components)
Vue (components)
Pure JS cleanup
Fragmenium (iframe isolation)
React (manual cleanup)
Vue (manual cleanup)
Cleanup & module management
Isolation model
Fragmenium (iframe per fregment types)
React (shared runtime)
Vue (shared runtime)
Residual state after removal
Fragmenium
React
Vue
Need for manual cleanup code
Fragmenium
React
Vue

Use Case

Fragmenium is built for developers who want a lightweight, flexible, and cost‑efficient way to deliver modern web applications. Its fregment-based architecture makes it simple to adopt and powerful enough to handle both small and large projects.

Where Fragmenium Shines

Limitations

In summary, Fragmenium shines when projects need to be lightweight, cost‑effective, and easy to maintain. It leverages the existing JavaScript ecosystem without requiring its own, making it both practical and powerful for modern web development.