From b18df9ff8965f68efc580c913ae03f42f9dae092 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sun, 30 Apr 2023 07:31:04 -0400 Subject: [PATCH] plunking (note Deno.mainModule) --- circ/a.tsx | 13 +++++++++++++ circ/b.tsx | 10 ++++++++++ circ/start.tsx | 3 +++ lib/iso.tsx | 12 +++++++++++- lib/mid.tsx | 0 server.tsx | 10 ++++++++++ 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 circ/a.tsx create mode 100644 circ/b.tsx create mode 100644 circ/start.tsx create mode 100644 lib/mid.tsx diff --git a/circ/a.tsx b/circ/a.tsx new file mode 100644 index 0000000..682d4a2 --- /dev/null +++ b/circ/a.tsx @@ -0,0 +1,13 @@ +import { doSomething } from './b.tsx'; + +export function doSomethingElse() { + + if(Deno.env.get("a") && Deno.env.get("b")){return;} + + Deno.env.set("a", "called"); + console.log("a action"); + + doSomething(); +} + +import.meta.main \ No newline at end of file diff --git a/circ/b.tsx b/circ/b.tsx new file mode 100644 index 0000000..a9b326c --- /dev/null +++ b/circ/b.tsx @@ -0,0 +1,10 @@ +import { doSomethingElse } from './a.tsx'; + +export function doSomething() { + + console.log("b main?", Deno.mainModule); + + Deno.env.set("b", "called"); + console.log("b action"); + doSomethingElse(); +} diff --git a/circ/start.tsx b/circ/start.tsx new file mode 100644 index 0000000..f7f41af --- /dev/null +++ b/circ/start.tsx @@ -0,0 +1,3 @@ +import { doSomethingElse } from "./a.tsx"; + +doSomethingElse(); \ No newline at end of file diff --git a/lib/iso.tsx b/lib/iso.tsx index 42b621b..c10e021 100644 --- a/lib/iso.tsx +++ b/lib/iso.tsx @@ -2,15 +2,25 @@ import TWPreTail from "https://esm.sh/v115/@twind/preset-tailwind@1.1.4/es2022/p import TWPreAuto from "https://esm.sh/v115/@twind/preset-autoprefix@1.0.7/es2022/preset-autoprefix.mjs"; import React from "react"; +import {INIT} from "../server.tsx"; + +function wrapper() +{ + INIT(); +} + +wrapper(); + export const CSS = { presets: [TWPreTail(), TWPreAuto()], hash:false }; - +/* if(!window.innerWidth) { import(import.meta.resolve("../../server.tsx")).then(()=>{console.log("...imported!");}); } +*/ type MetasInputs = { [Property in MetaKeys]?: string }; type MetasModeArgs = {concatListed?:boolean; dropUnlisted?:boolean}; diff --git a/lib/mid.tsx b/lib/mid.tsx new file mode 100644 index 0000000..e69de29 diff --git a/server.tsx b/server.tsx index f912b27..f36f489 100644 --- a/server.tsx +++ b/server.tsx @@ -10,6 +10,8 @@ import * as Iso from "@eno/iso"; Deno.env.set("initialized", "true"); +export const INIT =()=> console.log("init!"); + /** * Setup a transpiler. * @param inDevMode When true, starts a file-watcher @@ -282,6 +284,14 @@ Deno.args.forEach(arg=> } }); +let Booted = false; +export function Boot(inApp:React.JSX.Element, inCSS?:object) +{ + if(Booted){return;} + Booted = true; + +} + let DevMode = Flags.dev ? true : false; let hosted = import.meta.resolve("./"); const Path = {