Skip to content

Commit b7774c8

Browse files
authored
Merge pull request #198 from takker99:jsx-runtime
build: Add `@jsxRuntime automatic` pragma so that apps can be built without additional jsx settings
2 parents 7cf5cf9 + d4fe46b commit b7774c8

File tree

10 files changed

+20
-21
lines changed

10 files changed

+20
-21
lines changed

App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { Bubble } from "./Bubble.tsx";
24
import { UserCSS } from "./UserCSS.tsx";
35
import { CSS } from "./app.min.css.ts";

Bubble.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { CardList } from "./CardList.tsx";
24
import { useLayoutEffect, useMemo, useState } from "./deps/preact.tsx";
35
import { toTitleLc } from "./deps/scrapbox-std.ts";

Card.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { h, useCallback, useMemo } from "./deps/preact.tsx";
24
import { useKaTeX } from "./useKaTeX.ts";
35
import { encodeTitleURI } from "./deps/scrapbox-std.ts";

CardList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { Card } from "./Card.tsx";
24
import { h, useMemo } from "./deps/preact.tsx";
35
import { useBubbleData } from "./useBubbleData.ts";

Page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import {
24
ComponentChildren,
35
createContext,
@@ -664,7 +666,6 @@ const Youtube = (props: YoutubeNode | YoutubeListNode) => {
664666
<iframe
665667
src={src}
666668
allowFullScreen
667-
type="text/html"
668669
/>
669670
</div>
670671
);
@@ -675,7 +676,6 @@ const Vimeo = ({ videoId }: VimeoNode) => (
675676
<iframe
676677
src={`https://player.vimeo.com/video/${videoId}`}
677678
allowFullScreen
678-
type="text/html"
679679
/>
680680
</div>
681681
);
@@ -686,8 +686,6 @@ const Spotify = (props: SpotifyNode) => (
686686
className={`spotify type-${props.pathType}`}
687687
src={`https://open.spotify.com/embed/${props.pathType}/${props.videoId}`}
688688
allowFullScreen
689-
type="text/html"
690-
scrolling="no"
691689
/>
692690
</div>
693691
);
@@ -698,8 +696,6 @@ const AnchorFM = (props: AnchorFMNode) => (
698696
className="anchor-fm"
699697
src={props.href.replace("/episodes/", "/embed/episodes/")}
700698
allowFullScreen
701-
type="text/html"
702-
scrolling="no"
703699
/>
704700
</div>
705701
);

TextBubble.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import {
24
FunctionComponent,
35
h,

UserCSS.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { useMemo } from "./deps/preact.tsx";
24
import { detectURL } from "./detectURL.ts";
35

deno.jsonc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@
55
"check:all": "deno fmt --check && deno lint && deno task check && deno task test",
66
"fix": "deno fmt && deno lint --fix && deno task check && deno task test"
77
},
8-
"imports": {
9-
"react": "npm:preact@10",
10-
"react/": "npm:preact@10/"
11-
},
128
"compilerOptions": {
139
"lib": [
1410
"dom",
1511
"dom.iterable",
1612
"esnext",
1713
"deno.ns"
18-
],
19-
"jsx": "react-jsx",
20-
"jsxImportSource": "npm:preact@10"
14+
]
2115
}
2216
}

deno.lock

Lines changed: 3 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mod.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jsxRuntime automatic */
2+
/** @jsxImportSource npm:preact@10 */
13
import { render } from "./deps/preact.tsx";
24
import { getWatchList } from "./watchList.ts";
35
import { App, AppProps, userscriptName } from "./App.tsx";

0 commit comments

Comments
 (0)