Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit b51ae06

Browse files
author
Je
committed
v0.2.25
1 parent 9d68654 commit b51ae06

File tree

7 files changed

+45
-9
lines changed

7 files changed

+45
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function Home() {
4343

4444
### Installation
4545
```bash
46-
deno install -A -f -n aleph https://deno.land/x/[email protected].24/cli.ts
46+
deno install -A -f -n aleph https://deno.land/x/[email protected].25/cli.ts
4747
```
4848

4949
### Usage

egg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aleph",
3-
"version": "0.2.24",
3+
"version": "0.2.25",
44
"description": "The React Framework in Deno.",
55
"homepage": "https://alephjs.org",
66
"repository": "https://github.com/alephjs/aleph.js",

examples/hello-world/aleph.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Config } from 'https://deno.land/x/aleph/types.ts'
2+
3+
export default {
4+
ssr: false
5+
} as Config

examples/hello-world/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { ComponentType } from 'https://esm.sh/react'
22
import { Head } from 'https://deno.land/x/aleph/mod.ts'
33

44
export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
5-
return (
5+
return (
66
<>
77
<Head>
88
<title>Hello World - Aleph.js</title>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/// <reference lib="dom" />
2+
import { Component, PropsWithChildren } from 'https://esm.sh/react'
3+
import ReactDOM from 'https://esm.sh/react-dom'
4+
5+
const modalRoot = document.createElement('div')
6+
modalRoot.id="modal-root"
7+
document.body.appendChild(modalRoot)
8+
9+
export default class Modal extends Component {
10+
el: HTMLElement
11+
12+
constructor(props: PropsWithChildren<{}>) {
13+
super(props)
14+
this.el = document.createElement('div')
15+
}
16+
17+
componentDidMount() {
18+
modalRoot.appendChild(this.el)
19+
}
20+
21+
componentWillUnmount() {
22+
modalRoot.removeChild(this.el)
23+
}
24+
25+
render() {
26+
return ReactDOM.createPortal(
27+
this.props.children,
28+
this.el
29+
)
30+
}
31+
}

examples/hello-world/pages/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Import, useDeno } from 'https://deno.land/x/aleph/mod.ts'
1+
import { Import } from 'https://deno.land/x/aleph/mod.ts'
22
import React, { useState } from 'https://esm.sh/react'
33
import Logo from '../components/logo.tsx'
44

55
export default function Home() {
66
const [count, setCount] = useState(0)
7-
const version = useDeno(() => {
8-
return Deno.version
9-
})
7+
// const version = useDeno(() => {
8+
// return Deno.version
9+
// })
1010

1111
return (
1212
<div className="page">
@@ -28,7 +28,7 @@ export default function Home() {
2828
<button onClick={() => setCount(n => n - 1)}>-</button>
2929
<button onClick={() => setCount(n => n + 1)}>+</button>
3030
</p>
31-
<p className="copyinfo">Built by Aleph.js in Deno v{version.deno}</p>
31+
<p className="copyinfo">Built by Aleph.js in Deno v{""}</p>
3232
</div>
3333
)
3434
}

version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = '0.2.24'
1+
export const version = '0.2.25'

0 commit comments

Comments
 (0)