Skip to content

Commit

Permalink
Next Demoing - React-JSX
Browse files Browse the repository at this point in the history
Unfortunately it didn't work because of ESM challenges, but tried changing the `jsx` flag to use `react-jsx` instead.

https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax (Tried to upgrade from `importsNotUsedAsValues`, but things are still broken in regards to import elision)
https://www.typescriptlang.org/tsconfig#jsx
microsoft/TypeScript#47804
emotion-js/emotion#2742
https://www.typescriptlang.org/tsconfig#paths (Also tried setting `jsxImportSource`, but that breaks in ESM because of the forced module resolution path `_ident_/jsx-runtime` :{ )
  • Loading branch information
Offroaders123 committed Jun 9, 2023
1 parent 9ccff98 commit fc756c7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>dino-jsx</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<script type="module" src="./dist/app.js"></script>
</head>

Expand Down
20 changes: 18 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"name": "dino-tsx",
"type": "module"
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsc -w"
},
"devDependencies": {
"typescript": "^5.1.3"
}
}
2 changes: 1 addition & 1 deletion src/epic.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as JSX from "./index.js";

export class Epic extends HTMLElement {
readonly shadowRoot = this.attachShadow({ mode: "open" });
override readonly shadowRoot = this.attachShadow({ mode: "open" });

constructor() {
super();
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"rootDir": "./src",
"outDir": "./dist",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "NodeNext",
"target": "ESNext",
"jsx": "react",
"jsxFactory": "JSX.createElement",
"jsxFragmentFactory": "JSX.Fragment",
"strict": true,
"noImplicitOverride": true,
"importsNotUsedAsValues": "preserve"
}
}

0 comments on commit fc756c7

Please sign in to comment.