signal started

This commit is contained in:
Seth Trowbridge 2023-10-14 23:47:20 -04:00
parent 2b83a2abe6
commit 9e7fe002b0
5 changed files with 22 additions and 4 deletions

View File

@ -167,8 +167,8 @@ export async function Check()
const importMap = imports.json.imports as Record<string, string>;
const bake =async(obj:ConfigCheck)=> await Deno.writeTextFile(Deno.cwd()+"/"+obj.path, JSON.stringify(obj.json, null, "\t"));
importMap["react"] = `https://esm.sh/preact@10.17.1/compat`;
importMap["react/"] = `https://esm.sh/preact@10.17.1/compat/`;
importMap["react"] = `https://esm.sh/preact@10.18.1/compat`;
importMap["react/"] = `https://esm.sh/preact@10.18.1/compat/`;
importMap["@preact/signals"] = `https://esm.sh/@preact/signals@1.2.1`;
importMap["@twind/core"] = `https://esm.sh/@twind/core@1.1.3`;
importMap[">able/"] = `${RootHost}`;

View File

@ -1,8 +1,10 @@
{
"imports": {
"react": "https://esm.sh/preact@10.17.1/compat",
"react-original": "https://esm.sh/preact@10.17.1/compat",
"react/": "https://esm.sh/preact@10.17.1/compat/",
"@preact/signals": "https://esm.sh/@preact/signals@1.2.1",
"signals-original": "https://esm.sh/@preact/signals@1.2.1",
"@twind/core": "https://esm.sh/@twind/core@1.1.3",
">able/": "http://localhost:4507/",
">able/app.tsx": "./app.tsx"

View File

@ -0,0 +1,16 @@
import * as SignalsParts from "signals-original";
import { Process } from "./hmr-listen.tsx";
const s1 = SignalsParts.signal(true);
const proxySignal =(arg)=>
{
console.log("---hmr---", arg);
return SignalsParts.signal(arg);
}
export * from "signals-original";
export { proxySignal as signal };
// ? export {ProxyCreate as createElement, ProxyState as useState, ProxyReducer as useReducer };
// ? export default {...ReactParts, createElement:ProxyCreate, useState:ProxyState, useReducer:ProxyReducer};

View File

@ -29,7 +29,7 @@ Configure({
inImports["react"] = `/>able/hmr-react.tsx`;
inImports["signals-original"] = inImports["@preact/signals"];
inImports["@preact/signals"] = `/>able/hmr-signals.tsx`;
inImports["@preact/signals"] = `/>able/hmr-signal.tsx`;
return inImports;
},

View File

@ -74,7 +74,7 @@ let Configuration:Configuration =
</head>
<body>
<div id="app"></div>
<script type="importmap">${JSON.stringify(inMap)}</script>
<script type="importmap">${JSON.stringify(inMap, null, " ")}</script>
<script type="module">
import Mount from ">able/run-browser.tsx";
Mount("#app", "${inConfig.Start}");