a small incremental UI library for the web
javascript web ui
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add createElement

garrison 8da6c3fb 3288b96e

+24 -2
+8 -1
config/config.exs
··· 4 4 config :esbuild, 5 5 version: "0.27.2", 6 6 default: [ 7 - args: ~w(todo/todo.tsx --watch --bundle --target=es2016 --outdir=../priv/static/assets/js), 7 + args: ~w( 8 + todo/todo.tsx 9 + --jsx-factory=createElement 10 + --watch 11 + --bundle 12 + --target=es2016 13 + --outdir=../priv/static/assets/js 14 + ), 8 15 cd: Path.expand("../demos", __DIR__), 9 16 ] 10 17 end
+9 -1
demos/todo/todo.tsx
··· 1 - console.log('Noir!'); 1 + import { createElement } from '../../js/noir.ts'; 2 + 3 + const element = ( 4 + <div class="foo"> 5 + <p>foo</p> 6 + <span>bar</span> 7 + </div> 8 + ); 9 + console.log(JSON.stringify(element, null, 2));
+7
js/noir.ts
··· 1 + export function createElement(type, props, ...children) { 2 + return { 3 + type: type, 4 + props: props, 5 + children: children, 6 + }; 7 + }