much better
This commit is contained in:
parent
2b0ba8c9fe
commit
5bb8ba29a4
2
.vscode/settings.json
vendored
Normal file
2
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
13
app.tsx
13
app.tsx
@ -1,15 +1,16 @@
|
||||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
|
||||
console.log(React.useId)
|
||||
|
||||
|
||||
export function App(){
|
||||
console.log(React.useState(1))
|
||||
|
||||
//const [countGet, countSet] = React.useState(0);
|
||||
const [countGet, countSet] = React.useState(0);
|
||||
|
||||
return <>
|
||||
<div>lol hey 12121</div>
|
||||
<p>more</p>
|
||||
<p style={{padding:"2rem", background:"blue", color:"white"}}>test paragraph</p>
|
||||
<button onClick={()=>{countSet(countGet+1)}}>{countGet}</button>
|
||||
</>
|
||||
}
|
||||
|
||||
@ -19,7 +20,7 @@ export const Other =()=>{
|
||||
|
||||
export function Root()
|
||||
{
|
||||
|
||||
return <div><h1>rooted</h1><App/><Other/></div>
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.body).render(<div><App/><Other/></div>);
|
||||
ReactDOM.createRoot(document.body).render(<Root/>);
|
12
deno.json
12
deno.json
@ -5,18 +5,18 @@
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react",
|
||||
"types": ["npm:@types/react", "npm:@types/react-dom"],
|
||||
"lib": [
|
||||
"deno.window", "dom", "dom.asynciterable"
|
||||
]
|
||||
},
|
||||
"imports": {
|
||||
"react":"npm:react",
|
||||
"react-dom/client":"npm:react-dom/client",
|
||||
"@preact/signals":"npm:@preact/signals",
|
||||
|
||||
"react":"https://esm.sh/react@19.2.0",
|
||||
"react/":"https://esm.sh/react@19.2.0/",
|
||||
"react-dom/":"https://esm.sh/react-dom@19.2.0/",
|
||||
|
||||
"@preact/":"npm:@preact/",
|
||||
"signals-original": "npm:@preact/signals",
|
||||
"react-original": "npm:react"
|
||||
"react-original": "https://esm.sh/react@19.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
|
38
deno.lock
38
deno.lock
@ -1,15 +1,7 @@
|
||||
{
|
||||
"version": "5",
|
||||
"specifiers": {
|
||||
"jsr:@std/media-types@*": "1.1.0",
|
||||
"npm:@preact/signals@*": "2.3.2_preact@10.27.2",
|
||||
"npm:react-dom@*": "19.2.0_react@19.2.0",
|
||||
"npm:react@*": "19.2.0"
|
||||
},
|
||||
"jsr": {
|
||||
"@std/media-types@1.1.0": {
|
||||
"integrity": "c9d093f0c05c3512932b330e3cc1fe1d627b301db33a4c2c2185c02471d6eaa4"
|
||||
}
|
||||
"npm:@preact/signals@*": "2.3.2_preact@10.27.2"
|
||||
},
|
||||
"npm": {
|
||||
"@preact/signals-core@1.12.1": {
|
||||
@ -24,37 +16,11 @@
|
||||
},
|
||||
"preact@10.27.2": {
|
||||
"integrity": "sha512-5SYSgFKSyhCbk6SrXyMpqjb5+MQBgfvEKE/OC+PujcY34sOpqtr+0AZQtPYx5IA6VxynQ7rUPCtKzyovpj9Bpg=="
|
||||
},
|
||||
"react-dom@19.2.0_react@19.2.0": {
|
||||
"integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
|
||||
"dependencies": [
|
||||
"react",
|
||||
"scheduler"
|
||||
]
|
||||
},
|
||||
"react@19.2.0": {
|
||||
"integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ=="
|
||||
},
|
||||
"scheduler@0.27.0": {
|
||||
"integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="
|
||||
}
|
||||
},
|
||||
"redirects": {
|
||||
"https://esm.sh/type-detect@^4.0.0?target=denonext": "https://esm.sh/type-detect@4.1.0?target=denonext"
|
||||
},
|
||||
"remote": {
|
||||
"https://esm.sh/deep-eql@4.1.3": "324a95b802d9f87b5ed66afdf079a0c47cd1cac3db59e9face0969be8eb980f7",
|
||||
"https://esm.sh/deep-eql@4.1.3/denonext/deep-eql.mjs": "53319cc47b4be171d3a1aeeef9f3160a818e08b35baf9018cd14093f79e2910c",
|
||||
"https://esm.sh/type-detect@4.1.0/denonext/type-detect.mjs": "ea850c5962bd47b0157c7e4cf38376cb7fb9fb3ad2438be0a724dbbadda5b94e",
|
||||
"https://esm.sh/type-detect@4.1.0?target=denonext": "7257f955377cabc9a54bfa18f3bd16e12e40a090f25bf238299325d562e92fca"
|
||||
},
|
||||
"workspace": {
|
||||
"dependencies": [
|
||||
"npm:@preact/signals@*",
|
||||
"npm:@types/react-dom@*",
|
||||
"npm:@types/react@*",
|
||||
"npm:react-dom@*",
|
||||
"npm:react@*"
|
||||
"npm:@preact/signals@*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
import Default from "react-jsx-runtime-original";
|
||||
const jsx = Default.jsx;
|
||||
const jsxs = Default.jsxs;
|
||||
const Fragment = Default.Fragment;
|
||||
console.log("run is", Default);
|
||||
export { jsx, jsxs, Fragment };
|
@ -174,6 +174,5 @@ const ProxyReducer =(inReducer:(inState:Storelike, inAction:string)=>Storelike,
|
||||
};
|
||||
|
||||
export * from "react-original";
|
||||
const Fragment = ReactParts.Fragment
|
||||
export {ProxyCreate as createElement, ProxyCreate as jsx, Fragment, ProxyState as useState, ProxyReducer as useReducer };
|
||||
export default {...ReactParts, createElement:ProxyCreate, jsx:ProxyCreate, Fragment, useState:ProxyState, useReducer:ProxyReducer};
|
||||
export {ProxyCreate as createElement, ProxyState as useState, ProxyReducer as useReducer };
|
||||
export default {...ReactParts, createElement:ProxyCreate, useState:ProxyState, useReducer:ProxyReducer};
|
10
server.ts
10
server.ts
@ -65,19 +65,9 @@ for(const key in denoBody.imports)
|
||||
}
|
||||
}
|
||||
|
||||
denoBody.imports["react-jsx-runtime-original"] = `${denoBody.imports[denoBody.compilerOptions.jsxImportSource]}/jsx-runtime`;
|
||||
denoBody.imports["react/jsx-runtime"] = "/^/hmr/hmr-jsx-runtime.tsx";
|
||||
|
||||
denoBody.imports["react-original"] = denoBody.imports[denoBody.compilerOptions.jsxImportSource];
|
||||
denoBody.imports["react"] = "/^/hmr/hmr-react.tsx";
|
||||
|
||||
// denoBody.imports["react-original"] = denoBody.imports["react"];
|
||||
// denoBody.imports["react-jsx-runtime-original"] = denoBody.imports[denoBody.compilerOptions.jsxImportSource]+"/jsx-runtime";
|
||||
// denoBody.imports["signals-original"] = denoBody.imports["@preact/signals"];
|
||||
// denoBody.imports["@preact/signals"] = "/^/hmr/hmr-signal.tsx";
|
||||
// denoBody.imports["react"] = "/^/hmr/hmr-react.tsx";
|
||||
// denoBody.imports["react/jsx-runtime"] = "/^/hmr/hmr-react.tsx";
|
||||
|
||||
console.log(denoBody.imports);
|
||||
|
||||
const importMap = `<script type="importmap">{"imports":${JSON.stringify(denoBody.imports)}}</script>`;
|
||||
|
Loading…
Reference in New Issue
Block a user