From b337c723311b1150c06d69b54678ac0183a94666 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sun, 7 May 2023 16:19:11 -0400 Subject: [PATCH] init --- .vscode/settings.json | 3 ++ app.tsx | 74 +++++++++++++++++++++++++++++++++++++++++++ deep/component.tsx | 23 ++++++++++++++ deno.jsonc | 13 ++++++++ 4 files changed, 113 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 app.tsx create mode 100644 deep/component.tsx create mode 100644 deno.jsonc diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b943dbc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "deno.enable": true +} \ No newline at end of file diff --git a/app.tsx b/app.tsx new file mode 100644 index 0000000..abb53d3 --- /dev/null +++ b/app.tsx @@ -0,0 +1,74 @@ +import React from "react"; +import * as Iso from "@eno/iso"; + +const Comp = React.lazy(()=>import("./deep/component.tsx")); + +export default ()=> +{ + const [countGet, countSet] = React.useState(1); + return
+ +
+ +
+ +
+ + + <> + +

iso: isomorphic typescript is simpler than ever.

+
+ +
+ +
+ + <> +

About

+

Iso puts the Deno runtime and ES modules to work behind the scenes to turn your next single-page React+TypeScript application into an SEO capable website with full hydration.

+

The best part? It's all so simple you won't even even know it's there.

+

Say goodbye to stylesheets and CSS-in-JS bloat. Tailwind classes are available out of the gate so you can hit the ground running, and Iso will keep up the pace with state-preserving hot module reloading.

+

Batteries-included URL routing, page meta, and data fetching APIs are designed from the ground up to be as simple as possible.

+

Get fully featured in seconds.

+ +
+ + <> +

Details

+

+ Iso uses Preact/Compat and Twind in lieu of React and Tailwind so you can keep the API's you know, serve less kilobytes, and gain new ways to simplify your layout code. +

+

While you can always:

+
+                        {`
`} +
+

Now you can just:

+
+                        {`
`} +
+

+ Iso is a Deno project! If you're coming from a Node background be sure to: +

+
    +
  1. Get the latest Deno runtime and extension for your IDE
  2. +
  3. Use file extensions in import statements
  4. +
  5. Add new modules to the deno.jsonc config
  6. +
+ +
+ lol/idk +

404!

+
+
+ +
+ footer +
+ +
; +}; \ No newline at end of file diff --git a/deep/component.tsx b/deep/component.tsx new file mode 100644 index 0000000..39f4ed4 --- /dev/null +++ b/deep/component.tsx @@ -0,0 +1,23 @@ +import React from "react"; +import * as Iso from "@eno/iso"; + +export default ()=> +{ + const [countGet, countSet] = React.useState(1); + const [routeGet, routeSet] = Iso.Router.Consumer(); + + type CatFact = {fact:string, length:number}|undefined; + const [Data, Updating] = Iso.Fetch.Use(`https://catfact.ninja/fact`); + + + console.log("component.tsx render!!") + + return
+ + Component Route is: {routeGet.Path.toString()} + + a link +

Data:{Data && (Data as CatFact)?.fact}

+

Status:{Updating?'loading':'done'}

+
; +}; \ No newline at end of file diff --git a/deno.jsonc b/deno.jsonc new file mode 100644 index 0000000..e6c2c3b --- /dev/null +++ b/deno.jsonc @@ -0,0 +1,13 @@ +{ + "compilerOptions": {"lib": ["deno.window", "dom"]}, + "imports": + { + "react": "https://esm.sh/stable/preact@10.13.2/compat", + "@eno/app": "./app.tsx", + "@eno/iso": "https://gitea.hptrow.me/SethTrowbridge/eno/raw/tag/0.0.2/lib/iso.tsx/" + }, + "tasks": { + "dev": "deno run -A --unstable --no-lock app.tsx --port=3000 --dev", + "run": "deno run -A --unstable --no-lock app.tsx --port=8080" + } +}