client boot as file
This commit is contained in:
parent
70a0c2e96f
commit
f5d7ca2e95
@ -4,9 +4,8 @@
|
||||
]},
|
||||
"imports": {
|
||||
"react": "https://esm.sh/preact@10.13.2/compat",
|
||||
|
||||
"preact": "https://esm.sh/preact@10.13.2/compat",
|
||||
"react-original": "https://esm.sh/preact@10.13.2/compat",
|
||||
"@eno/app": "./example/app.tsx",
|
||||
"@eno/iso": "./lib/iso.tsx"
|
||||
},
|
||||
"tasks":
|
||||
|
@ -5,10 +5,9 @@
|
||||
"react": "https://esm.sh/stable/preact@10.13.2/compat",
|
||||
"preact": "https://esm.sh/stable/preact@10.13.2/",
|
||||
"@deep/": "./deep/",
|
||||
"@eno/app": "./app.tsx",
|
||||
"@eno/iso": "http://localhost:4507/lib/iso.tsx"
|
||||
},
|
||||
"tasks": {
|
||||
"dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx --dev"
|
||||
"dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx"
|
||||
}
|
||||
}
|
20
server.tsx
20
server.tsx
@ -305,25 +305,7 @@ async function Server(App:React.FunctionComponent, AppPath:string, TwindInst:Twi
|
||||
}
|
||||
else if(url.pathname == "/server.tsx")
|
||||
{
|
||||
body = `
|
||||
|
||||
import {hydrate, createElement as H} from "react";
|
||||
import * as Twind from "https://esm.sh/v115/@twind/core@1.1.3/es2022/core.mjs";
|
||||
import {Router, CSS, Meta} from "@eno/iso";
|
||||
export function Boot(inApp, inCSS)
|
||||
{
|
||||
console.log(inApp, inCSS);
|
||||
Twind.install(inCSS ? {...CSS, ...inCSS} : CSS);
|
||||
|
||||
const hmrWrap = H( ()=>H(inApp) );
|
||||
hydrate(
|
||||
H(Router.Provider, {url:window.location},
|
||||
H(Meta.Provider, null, hmrWrap)
|
||||
),
|
||||
document.querySelector("#app")
|
||||
);
|
||||
|
||||
}`;
|
||||
body = await TranspileURL(`${Path.Hosted}/${Path.LibDir}/boot-client.tsx`, url.pathname, true);
|
||||
}
|
||||
else if(DevMode && !url.searchParams.get("reload"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user