All Projects → loreanvictor → callbag-jsx

loreanvictor / callbag-jsx

Licence: MIT License
callbags + JSX: fast and tiny interactive web apps

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to callbag-jsx

Preact
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
Stars: ✭ 30,527 (+44142.03%)
Mutual labels:  dom, jsx
Nativejsx
JSX to native DOM API transpilation. 💛 <div> ⟹ document.createElement('div')!
Stars: ✭ 145 (+110.14%)
Mutual labels:  dom, jsx
Hyperawesome
A curated list of awesome projects built with Hyperapp & more.
Stars: ✭ 446 (+546.38%)
Mutual labels:  dom, jsx
Preact Markup
⚡️ Render HTML5 as VDOM, with Components as Custom Elements!
Stars: ✭ 167 (+142.03%)
Mutual labels:  dom, jsx
hsx
Static HTML sites with JSX and webpack (no React).
Stars: ✭ 15 (-78.26%)
Mutual labels:  dom, jsx
prax
Experimental rendering library geared towards hybrid SSR+SPA apps. Focus on radical simplicity and performance. Tiny and dependency-free.
Stars: ✭ 18 (-73.91%)
Mutual labels:  dom, jsx
Jsx Dom
Use JSX to create DOM elements.
Stars: ✭ 117 (+69.57%)
Mutual labels:  dom, jsx
string-dom
Create HTML strings using JSX (or functions).
Stars: ✭ 13 (-81.16%)
Mutual labels:  dom, jsx
recks
🐶 React-like RxJS-based framework
Stars: ✭ 133 (+92.75%)
Mutual labels:  dom, jsx
vanilla-jsx
Vanilla jsx without runtime. HTML Tag return DOM in js, No virtual DOM.
Stars: ✭ 70 (+1.45%)
Mutual labels:  dom, jsx
Prakma
Prakma is a framework to make applications using JSX, focusing on writing functional components.
Stars: ✭ 16 (-76.81%)
Mutual labels:  dom, jsx
Openrunner
Computest Openrunner: Benchmark and functional testing for frontend-heavy web applications
Stars: ✭ 16 (-76.81%)
Mutual labels:  dom
jsxmock
使用 JSX 来定义 Mock Server
Stars: ✭ 31 (-55.07%)
Mutual labels:  jsx
pablopunk.com
Blazing fast personal website with Jamstack
Stars: ✭ 16 (-76.81%)
Mutual labels:  dom
dom-navigator
⚓️ JS library that allow keyboard navigation through DOM elements (←↑→↓).
Stars: ✭ 36 (-47.83%)
Mutual labels:  dom
snabbdom-pragma
'NotReact.createElement' jsx pragma although for snabbdom
Stars: ✭ 47 (-31.88%)
Mutual labels:  jsx
zaftig
~2kB css in js: z`display flex` // .zjsdkk43-1
Stars: ✭ 15 (-78.26%)
Mutual labels:  jsx
xmlresolver
The xmlresolver project provides an advanced implementation of the SAX EntityResolver (and extended EntityResolver2), the Transformer URIResolver, the DOM LSResourceResolver, the StAX XMLResolver, and a new NamespaceResolver. It uses the OASIS XML Catalogs V1.1 Standard to provide a mapping from external identifiers and URIs to local resources.
Stars: ✭ 31 (-55.07%)
Mutual labels:  dom
ElementFinder
Fetch data from HTML and XML via xpath/css and prepare it with regexp
Stars: ✭ 29 (-57.97%)
Mutual labels:  dom
pityWeb
🎉一个持续迭代的开源接口测试平台(前端),欢迎大家多提issue多给反馈。 求star⭐,我会努力更新下去的!
Stars: ✭ 25 (-63.77%)
Mutual labels:  jsx

tests coverage version docs Join the chat at https://gitter.im/callbag-jsx/community


Callbags + JSX. No virtual DOM, compile-time invalidation, or other magic tricks.
👉 Read the Docs


Sample Todolist app:

import { makeRenderer, List } from 'callbag-jsx';
import { state } from 'callbag-state';

const renderer = makeRenderer();

const todos = state([{title: 'Do this'}, {title: 'Do that'}]);
const next = state('');

const add = () => {
  todos.set(todos.get().concat([{title: next.get()}]));
  next.set('');
};

renderer.render(
  <>
    <h1>Todos</h1>
    <ol>
      <List of={todos} each={todo => <li>{todo.sub('title')}</li>}/>
    </ol>
    <input type='text' _state={next} placeholder='What should be done?'/>
    <button onclick={add}>Add</button>
  </>
).on(document.body);

►TRY IT!



Why?

👉 Long Answer Here

Main purpose of callbag-jsx is to provide full control over DOM while being as convenient as tools like React. In other words, unlike other frameworks and tools, callbag-jsx DOES NOT infer when and how to update the DOM, it gives you the tools to conveniently outline that.

As a result:

  • It gives you full control and gets out of your way whenever it cannot help.
  • It is faster than most popular frameworks (it does less)
  • It is smaller than most popular frameworks (it needs less code)
  • It is pretty straight-forward, i.e. it just bind given callbags to DOM elements. So no weird hooks rules.
  • It is pretty robust, e.g. modify the DOM manually if you need to.

👉 Comparison with Other Frameworks



Installation

Easiest way is to use one of these templates:

You can also just install the package:

npm i callbag-jsx

and use the following jsx pragmas in your .jsx/.tsx files:

/** @jsx renderer.create */
/** @jsxFrag renderer.fragment */

👉 Read the docs for more info/options



Usage

import { makeRenderer } from 'callbag-jsx';

const renderer = makeRenderer();
renderer.render(<div>Hellow World!</div>).on(document.body);
import expr from 'callbag-expr';
import state from 'callbag-state';

const count = state(0);

const add = () => count.set(count.get() + 1);
const color = expr($ => $(count) % 2 ? 'red' : 'green');

renderer.render(
  <div onclick={add} style={{ color }}>
    You have clicked {count} times!
  </div>
).on(document.body);

👉 Read the Docs



Contribution

There are no contribution guidelines or issue templates currently, so just be nice (and also note that this is REALLY early stage). Useful commands for development / testing:

git clone https://github.com/loreanvictor/callbag-jsx.git
npm i                   # --> install dependencies
npm start               # --> run `samples/index.tsx` on `localhost:3000`
npm test                # --> run all tests
npm run cov:view        # --> run tests and display the code coverage report
npm i -g @codedoc/cli   # --> install CODEDOC cli (for working on docs)
codedoc install         # --> install CODEDOC dependencies (for working on docs)
codedoc serve           # --> serve docs on `localhost:3000/render-jsx` (from `docs/md/`)



Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].