Skip to content

Commit 0651e38

Browse files
committed
gen
1 parent e3cee89 commit 0651e38

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

docs/amdx-0.8.mdx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: amdx-0.8 MDXX => AMDX へ
3+
created: 1589389359440
4+
---
5+
6+
## mdxx => amdx
7+
8+
MDX eXtended => Accelarated MDX
9+
10+
- `mdxx-ssg` => `amdxg`
11+
- `mdxx-*` => `amdx-*`
12+
- `mdxx-parser` => `amdx`
13+
- `mdxx-compiler` => `amdx-runner`
14+
15+
mdxx-parser がほぼ全部の変換を担ってたので、リネームついでに `amdx` というライブラリに変更。
16+
17+
パッケージ名を変えた理由ですが、 mdxx という名前は、MDMA などの合成ドラッグの総称として使われる言葉であんまりイメージがよくなく、また、AMP のフィーチャーが重くなってきたので、A の文字を頭に付けました。
18+
19+
[Urban Dictionary: mdxx](https://www.urbandictionary.com/define.php?term=mdxx)
20+
21+
## 変更
22+
23+
- `amdxg-cli`: `amdxg new:page [slug]` でのページ生成に、必ず日時プレフィックスがつくようにしました。記事が増えたときの
24+
25+
## バグ修正
26+
27+
- `amdxg-components`: tailwind の導入と purgecss の導入で本来必要な CSS を削ってしまっていたのをもとに戻しました。
28+
29+
## 開発中の機能
30+
31+
### next.js 9.4 の SSG Auto generation で now 対応
32+
33+
現在は `next export` する前提で作っているが、9.4 の段階的 SSG で, now にデプロイできるようにしたい。
34+
35+
### `amdxg new:script`
36+
37+
`amp-script` を使った Component の雛形を追加します。amp-sciprt は 150kb 制限があり、また動的コンポーネントの追加には、SSR 相当の処理が必要です。なので今回は React ではなく preact を使うことにしました。
38+
39+
あるいは、 markdown で `tsx:amp-script` のようなコードブロックから自動生成することや、wasm を使った処理を考えています。
40+
41+
```tsx:amp-script
42+
/** @jsx h */
43+
import { h } from "preact";
44+
import { useState } from "preact/hooks";
45+
46+
export default function Counter(props: { initialValue: number }) {
47+
const [state, setState] = useState(props.initialValue);
48+
return (
49+
<div>
50+
<h1>Counter Example</h1>
51+
<span>{String(state)}</span>
52+
<button onClick={() => setState((n) => n + 1)}>+</button>
53+
<button onClick={() => setState((n) => n - 1)}>-</button>
54+
</div>
55+
);
56+
}
57+
```
58+
59+
こういうコードブロックを抽出して、rollup でビルドしたコードを生成できそう

0 commit comments

Comments
 (0)