From 9e7fe002b038b9404e2a474e7b2d5c8f66f1059c Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 14 Oct 2023 23:47:20 -0400 Subject: [PATCH] signal started --- checker.tsx | 4 ++-- deno.jsonc | 2 ++ hmr-signal.tsx | 16 ++++++++++++++++ run-local.tsx | 2 +- run-serve.tsx | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/checker.tsx b/checker.tsx index 53b9d11..c44c7bd 100644 --- a/checker.tsx +++ b/checker.tsx @@ -167,8 +167,8 @@ export async function Check() const importMap = imports.json.imports as Record; 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}`; diff --git a/deno.jsonc b/deno.jsonc index 8e0c78d..8c5bac3 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -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" diff --git a/hmr-signal.tsx b/hmr-signal.tsx index e69de29..5febad0 100644 --- a/hmr-signal.tsx +++ b/hmr-signal.tsx @@ -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}; \ No newline at end of file diff --git a/run-local.tsx b/run-local.tsx index 7042f27..a845712 100644 --- a/run-local.tsx +++ b/run-local.tsx @@ -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; }, diff --git a/run-serve.tsx b/run-serve.tsx index 253f887..cb61263 100644 --- a/run-serve.tsx +++ b/run-serve.tsx @@ -74,7 +74,7 @@ let Configuration:Configuration =
- +