mono-jsx 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # mono-jsx
2
2
 
3
- ![`<html>` as a `Response`](./.github/html-as-a-response.png)
3
+ ![`<html>` as a `Response`](./.github/og-image.png)
4
4
 
5
5
  mono-jsx is a JSX runtime that renders `<html>` element to a `Response` object in JavaScript runtimes like Node.js, Deno, Bun, Cloudflare Workers, etc.
6
6
 
@@ -11,16 +11,6 @@ mono-jsx is a JSX runtime that renders `<html>` element to a `Response` object i
11
11
  - ⏳ Streaming rendering
12
12
  - 🌎 Universal, works in Node.js, Deno, Bun, Cloudflare Workers, etc.
13
13
 
14
- ```jsx
15
- export default {
16
- fetch: (req) => (
17
- <html>
18
- <h1>Hello World!</h1>
19
- </html>
20
- ),
21
- };
22
- ```
23
-
24
14
  ## Installation
25
15
 
26
16
  mono-jsx supports all modern JavaScript runtimes including Node.js, Deno, Bun, Cloudflare Workers, etc.
@@ -43,8 +33,7 @@ To use mono-jsx as JSX runtime, add the following configuration to your `tsconfi
43
33
  {
44
34
  "compilerOptions": {
45
35
  "jsx": "react-jsx",
46
- "jsxImportSource": "mono-jsx",
47
- "allowJs": true // required for supporting `.jsx` extension in Node.js
36
+ "jsxImportSource": "mono-jsx"
48
37
  }
49
38
  }
50
39
  ```
@@ -112,7 +101,7 @@ serve({
112
101
  });
113
102
  ```
114
103
 
115
- and you will need [tsx](https://www.npmjs.com/package/tsx) to start the app.
104
+ and you will need [tsx](https://www.npmjs.com/package/tsx) to start the app without a build step.
116
105
 
117
106
  ```bash
118
107
  npx tsx app.tsx
@@ -260,7 +249,7 @@ function App() {
260
249
  mono-jsx provides a minimal state runtime that allows you to update view based on state changes in client-side.
261
250
 
262
251
  ```tsx
263
- function App(
252
+ function Counter(
264
253
  this: FC<{ count: number }>,
265
254
  props: { initialCount?: number },
266
255
  ) {
package/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  // index.ts
2
- console.log("Weclome to mono-jsx!");
2
+ console.log("Welcome to mono-jsx!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mono-jsx",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "`<html>` as a `Response`.",
5
5
  "type": "module",
6
6
  "module": "./index.mjs",
package/types/jsx.d.ts CHANGED
@@ -9,7 +9,7 @@ export type Children = ChildType | (ChildType | ChildType[])[];
9
9
  export type VNode = readonly [
10
10
  tag: string | symbol | FC<any>,
11
11
  props: Record<string, any>,
12
- nodeType: symbol,
12
+ $vnode: symbol,
13
13
  ];
14
14
 
15
15
  export interface FC<P = {}> {