11import van from "mini-van-plate/van-plate"
2+ import { registerEnv } from "mini-van-plate/shared"
23import Hello from "./components/hello.js"
34import Counter from "./components/counter.js"
45
56const { body, div, h1, h2, head, link, meta, option, p, script, select, title} = van . tags
67
8+ registerEnv ( { van} )
9+
710const server = Bun . serve ( {
811 port : Bun . argv [ 2 ] ?? 8080 ,
912 fetch ( req ) {
@@ -19,13 +22,11 @@ const server = Bun.serve({
1922 body (
2023 script ( { type : "text/javascript" , src : `dist/client.js` , defer : true } ) ,
2124 h1 ( "Hello Components" ) ,
22- div ( { id : "hello-container" } ,
23- Hello ( { van} ) ,
24- ) ,
25+ div ( { id : "hello-container" } , Hello ( ) ) ,
2526 h1 ( "Counter Components" ) ,
2627 div ( { id : "counter-container" } ,
2728 h2 ( "Basic Counter" ) ,
28- Counter ( { van , id : "basic-counter" , init : counterInit } ) ,
29+ Counter ( { id : "basic-counter" , init : counterInit } ) ,
2930 h2 ( "Styled Counter" ) ,
3031 p ( "Select the button style: " ,
3132 select ( { id : "button-style" , value : "👆👇" } ,
@@ -36,7 +37,7 @@ const server = Bun.serve({
3637 option ( "📈📉" ) ,
3738 ) ,
3839 ) ,
39- Counter ( { van , id : "styled-counter" , init : counterInit , buttonStyle : "👆👇" } ) ,
40+ Counter ( { id : "styled-counter" , init : counterInit , buttonStyle : "👆👇" } ) ,
4041 ) ,
4142 )
4243 ) , { headers : { "Content-Type" : "text/html; charset=UTF-8" } } )
0 commit comments