@emberkit/core 0.1.2-alpha.0 → 0.1.2
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 +73 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @emberkit/core
|
|
2
|
+
|
|
3
|
+
The core runtime for EmberKit — a minimalist, TypeScript-first JSX framework built for speed, minimal bundle size, and zero JavaScript by default.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @emberkit/core
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @emberkit/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What's Included
|
|
14
|
+
|
|
15
|
+
- **Runtime** — `createElement`, `render`, `hydrate`
|
|
16
|
+
- **Signals** — `createSignal`, `createMemo`, `createEffect`, `batch`, `untrack`
|
|
17
|
+
- **Context** — `createContext`, `useContext`
|
|
18
|
+
- **Navigation** — `navigate`, `preload`, `useNavigate`
|
|
19
|
+
- **Router** — `createRouter`, `matchRoute`
|
|
20
|
+
- **SSR** — `renderToString`, `createHtmlDocument`
|
|
21
|
+
- **Meta/SEO** — `Head` component, `generateMeta`, `generateBreadcrumbs`
|
|
22
|
+
- **Markdown** — `parseMarkdown`, `renderMarkdown`, `createMarkdownParser`
|
|
23
|
+
- **MDX** — `compileMDX`, `compileSync`, `useMDX`
|
|
24
|
+
- **Boundaries** — `createErrorBoundary`, `createLoadingBoundary`
|
|
25
|
+
- **Cache** — `DataCache`, `createCache`, `prefetch`
|
|
26
|
+
- **Vite Plugin** — `emberkitVitePlugin` (import from `@emberkit/core/vite-plugin`)
|
|
27
|
+
- **JSX Runtime** — `@emberkit/core/jsx-runtime` and `@emberkit/core/jsx-dev-runtime`
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { render, createSignal } from '@emberkit/core';
|
|
33
|
+
|
|
34
|
+
function Counter() {
|
|
35
|
+
const [count, setCount] = createSignal(0);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<button onClick={() => setCount(c => c + 1)}>
|
|
39
|
+
Count: {count()}
|
|
40
|
+
</button>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
render(<Counter />, document.getElementById('app'));
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// emberkit.config.ts
|
|
51
|
+
import { defineConfig } from '@emberkit/core';
|
|
52
|
+
|
|
53
|
+
export default defineConfig({
|
|
54
|
+
mode: 'ssr',
|
|
55
|
+
build: { target: 'esnext' },
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Vite Plugin
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// vite.config.ts
|
|
63
|
+
import { defineConfig } from 'vite';
|
|
64
|
+
import { emberkitVitePlugin } from '@emberkit/core/vite-plugin';
|
|
65
|
+
|
|
66
|
+
export default defineConfig({
|
|
67
|
+
plugins: [emberkitVitePlugin()],
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Apache-2.0
|