RegularFramework is a new framework for building web pages that is simple, powerful, and elegant.
pnpm i regular-framework
import { NewElement /*, ... */ } from 'regular-framework/client';
// or directly from the CDN
import { NewElement /*, ... */ } from 'https://esm.sh/regular-framework/client';
NewElement
: Create the root elementconst root = NewElement('div');
WatchRootElement
: Watch all events on the root elementWatchRootElement(
root,
// Optional callback
(e) => {}
);
AddElement
: Append the root element(, such as appending to document.body
)AddElement(document.body, root);
AddElement(root, NewElement('h1', {}, 'Hello, world!'));
AddElement
: ae
NewElement
: ne
WatchRootElement
: wre
NewSignal
: Bring reactivity to your appconst signal = NewSignal('Hi!');
AddElement(root, NewElement('h1', {}, signal));
signal.value = 'Bye!';
Final<T>
& GetValue
: Understand what makes RegularFramework so powerfulGetValue(() => () => 'Powerful') === 'Powerful' // true
GetValue(() => signal) === 'Bye!' // true
GetValue(114514) === 114514 // true, of course
The source code of the example site is available at example/vite
.
Hope you enjoy using RegularFramework! If you have any questions or suggestions, feel free to open an issue or pull request. Thanks!