Skip to content

Commit d762a44

Browse files
committed
Try working around JSR JSX issue.
See: jsr-io/jsr#24
1 parent 199b3eb commit d762a44

17 files changed

+53
-3
lines changed

deno.jsonc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
},
7070
"compilerOptions": {
7171
// See: https://docs.deno.com/runtime/reference/jsx/#jsx-automatic-runtime-(recommended)
72-
"jsx": "react-jsx",
73-
"jsxImportSource": "preact"
72+
73+
// Can't rely on this when publishing to JSR until this is fixed:
74+
// https://github.com/jsr-io/jsr/issues/24
75+
// So instead, add @jsx pragmas to every file.
76+
77+
// "jsx": "react-jsx",
78+
// "jsxImportSource": "preact"
7479
}
7580
}

src/components/Box.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { type ComponentChildren } from "preact";
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
4+
import type { ComponentChildren } from "preact";
25
import { ArticleBody } from "./customTags.tsx";
36

47

src/components/Coments.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import type { ItemInfoPlus } from "../client.ts";
25
import Item from "./Item.tsx";
36

src/components/Item.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { Signature, UserID } from "@diskuto/client"
25

36

src/components/Nav.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import type { ComponentChildren } from "preact";
25

36
export type Props = {

src/components/OpenGraph.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
13

24
/**
35
* Metadata for the opengraph protocol.

src/components/Page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
13

24
import type { ComponentChildren } from "preact";
35
import Nav, { type NavState } from "./Nav.tsx";

src/components/Progress.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { useMemo } from "preact/hooks";
25
import { computed, ReadOnlySignal, signal } from "../signals.ts";
36
import { ArticleBody } from "./customTags.tsx";

src/components/SPA.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
13

24
export type Props = {
35
title: string

src/components/Signer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
/**
25
* UI to handle signing & sending an item.
36
*/

src/components/Timestamp.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
// @ts-types="@types/luxon"
25
import { DateTime, Duration, FixedOffsetZone, type DurationObjectUnits } from "luxon"
36
import * as pb from "@diskuto/client/types"

src/components/form.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
/**
25
* Common form elements.
36
* @module

src/entrypoints/editProfile.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { Fragment, render } from "preact"
25
import { useComputed, useLoader, useProgressLoader, useSignal, useUpdateSignal, type Signal } from "../signals.ts"
36

src/entrypoints/login.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { render } from "preact"
25
import Nav from "../components/Nav.tsx";
36
import { useComputed, useSignal } from "../signals.ts";

src/entrypoints/newPost.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { render } from "preact"
25
import { useComputed, useLoader, useSignal, useUpdateSignal, type Signal } from "../signals.ts"
36

src/entrypoints/signer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import { render } from "preact"
25
import { useEffect, useRef } from "preact/hooks"
36
import { Signal, useComputed, useSignal, useSignalEffect } from "../signals.ts"

src/server.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* @jsxImportSource preact */
2+
/* @jsxRuntime automatic */
3+
14
import type { Config } from "./config.ts";
25

36
import {oak, serveDir, ServerDirPath} from "@nfnitloop/deno-embedder/helpers/oak"

0 commit comments

Comments
 (0)