Sinwan gives you signals, component lifecycle hooks, a direct DOM renderer, and a React-shaped JSX runtime without a virtual DOM.
npm install sinwanbun add sinwanUse the automatic JSX runtime:
import { createComponent, mount, signal } from "sinwan";
const Counter = createComponent(() => {
const count = signal(0);
return (
<button onClick={() => (count.value += 1)}>
Count: {count}
</button>
);
});
mount(Counter, document.getElementById("app")!);- Fine-grained reactivity:
signal,computed,effect,batch,nextTick - JSX runtime:
sinwan/jsx-runtimeandsinwan/jsx-dev-runtime - Components:
createComponent, lifecycle hooks, provide/inject,<Show>,<For> - DOM renderer: reactive text, attributes, events, refs, namespaces, and cleanup
- Server rendering:
renderToString,streamPage, hydratable strings and streams - Hydration: reuse server-rendered DOM with
hydrate
// Server
import { renderToHydratableString } from "sinwan/server";
const html = await renderToHydratableString(App, { initial: 5 });// Client
import { hydrate } from "sinwan";
hydrate(App, document.getElementById("app")!, { initial: 5 });bun test
bun run typecheck
bun run buildMohammed Ben Cheikh
MIT - see LICENSE.
{ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "sinwan" } }