@heshammesalam/heshjs
v0.2.0
Published
An experimental independent reactive UI framework with brace-based .hesh components
Readme
HeshJS
An independent JavaScript/TypeScript UI framework created by Hesham. Experimental 0.2 release with History API routing and hierarchical MVC modules.
Requires Node.js 22.12 or later.
npm create @heshammesalam/heshjs@latest my-app
cd my-app
npm install
npm run devFor TypeScript, use npm create @heshammesalam/heshjs@latest my-app -- --ts.
The starter is a working HMVC SPA with nested modules, Home/About/detail/not-found
routes and a persistent shell. Each module contains model, controller, View.hesh
and module registration. See docs/hmvc.md for APIs, lifecycle and deployment.
export default view Counter {
count = 0;
h1("Count: {count}");
button("+", { count++; });
button("-", { count--; });
}For an existing Vite app, install @heshammesalam/heshjs and add hesh() from @heshammesalam/heshjs/vite
to your Vite plugins. Import a default .hesh component, then call
mount(Component, document.querySelector('#app')) from @heshammesalam/heshjs.
ESM entrypoints: @heshammesalam/heshjs, @heshammesalam/heshjs/reactivity, @heshammesalam/heshjs/dom, @heshammesalam/heshjs/parser,
@heshammesalam/heshjs/compiler, @heshammesalam/heshjs/vite,
@heshammesalam/heshjs/router, @heshammesalam/heshjs/hmvc. JavaScript and declarations are included.
The root entry contains runtime APIs only; compiler/TypeScript code stays out of
the browser unless explicitly imported. Vite is an optional peer dependency.
State is shallow: replace arrays/objects to notify. Component instances own DOM,
effects and listener cleanup. Async handlers report errors but are not automatically
canceled on unmount. Hesh edits reload the page. See docs/grammar.md for supported
syntax. Props, conditional rendering, keyed lists, themes, SSR and full
type checking inside .hesh are not yet implemented. TypeScript helpers and
consumer APIs support strict type checking.
Router navigation intercepts eligible same-origin anchors and supports nested outlets, :params, query/hash updates, back/forward and not-found handling. Parents remain mounted across child navigation. Refreshing a deep link requires the host to serve index.html for application paths; the scaffold documents that setup.
This package is published without granting an open-source license (UNLICENSED).
