bertui 1.1.6 β 1.1.7
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 +164 -292
- package/index.js +53 -31
- package/package.json +49 -31
- package/src/build/image-optimizer.js +102 -51
- package/src/client/fast-refresh.js +72 -0
- package/src/client/hmr-runtime.js +59 -0
- package/src/compiler/index.js +25 -0
- package/src/compiler/router-generator-pure.js +104 -0
- package/src/compiler/transform.js +149 -0
- package/src/config/index.js +2 -0
- package/src/css/index.js +46 -0
- package/src/css/processor.js +127 -0
- package/src/image-optimizer/index.js +76 -0
- package/src/images/index.js +102 -0
- package/src/images/processor.js +169 -0
- package/src/router/index.js +3 -0
- package/src/server/dev-handler.js +254 -0
- package/src/server/dev-server-utils.js +289 -0
- package/src/server/dev-server.js +10 -456
- package/src/server/hmr-handler.js +148 -0
- package/src/server/index.js +3 -0
- package/src/server/request-handler.js +36 -0
- package/src/server-islands/extractor.js +198 -0
- package/src/server-islands/index.js +59 -0
- package/src/utils/index.js +11 -0
package/README.md
CHANGED
|
@@ -1,78 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
markdown
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# BertUI v1.1.7 β‘ποΈπ¦
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**The fastest React frontend framework. Now with Rust-powered image optimization.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Zero configuration. 494ms dev server. 265ms builds. Perfect SEO with Server Islands.
|
|
8
|
+
**78% smaller images. 20x faster than Sharp. Zero Rust required.**
|
|
8
9
|
|
|
9
10
|
[](https://github.com/BunElysiaReact/BERTUI)
|
|
10
|
-
[](https://www.npmjs.com/package/bertui)
|
|
11
12
|
[](https://bun.sh)
|
|
13
|
+
[](https://www.rust-lang.org)
|
|
12
14
|
[](LICENSE)
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
# One command. Zero config. Instant speed.
|
|
17
|
+
# One command. Zero config. Instant speed. 78% smaller images.
|
|
16
18
|
bunx create-bertui my-app && cd my-app && bun run dev
|
|
17
|
-
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
π¦ New in v1.1.7: Rust Image Optimization
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
BertUI now ships with a pre-compiled WASM image optimizer written in Rust.
|
|
23
|
+
Before (v1.1.6) After (v1.1.7) Gain
|
|
24
|
+
β No optimization β
PNG: 78% smaller 3.6x smaller
|
|
25
|
+
β Just copy β
JPEG: 75% smaller 4x smaller
|
|
26
|
+
β Large images β
WebP: 70% smaller 3.3x smaller
|
|
27
|
+
β Slow builds β
20x faster than Sharp 2,000% faster
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
And the best part? Users don't need Rust installed. The optimizer is pre-compiled to WASM and ships with BertUI.
|
|
30
|
+
js
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- ποΈ **Server Islands** - Optional SSG for perfect SEO (one line of code)
|
|
28
|
-
- π **File-based routing** - Just create files in `pages/`, that's it
|
|
29
|
-
- πΊοΈ **Auto SEO** - Sitemap and robots.txt generated automatically
|
|
30
|
-
- π **TypeScript ready** - Full type definitions, zero setup required
|
|
31
|
-
- π¨ **CSS built-in** - Global styles with LightningCSS optimization
|
|
32
|
-
- π₯ **30ms HMR** - Instant hot reloading that actually works
|
|
32
|
+
// This just works. No Rust installation. No configuration.
|
|
33
|
+
import { optimizeImage } from 'bertui/image-optimizer';
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
const buffer = await Bun.file('image.png').arrayBuffer();
|
|
36
|
+
const result = await optimizeImage(buffer, { format: 'png', quality: 80 });
|
|
37
|
+
// β
78% smaller image in result.data
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
Automatic fallback: If WASM isn't available (edge cases), BertUI silently falls back to copying. Your builds never break.
|
|
40
|
+
π― What BertUI Is
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
A frontend framework that gives you everything React should have had from day one:
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
β‘ Sub-500ms dev starts - Faster than Vite, Next.js, and everything else
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|--------|--------|------|---------|-----------|
|
|
44
|
-
| Dev Server | **494ms** | 713ms | 2,100ms | 1.4-4.3x faster β‘ |
|
|
45
|
-
| Prod Build | **265ms** | 4,700ms | 8,400ms | 18-32x faster β‘ |
|
|
46
|
-
| Bundle Size | **100KB** | 220KB | 280KB | 2.2-2.8x smaller β‘ |
|
|
47
|
-
| HMR Speed | **30ms** | 85ms | 120ms | 2.8-4x faster β‘ |
|
|
46
|
+
ποΈ Sub-300ms builds - Production builds in the time others compile one file
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
ποΈ Server Islands - Optional SSG for perfect SEO (one line of code)
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
π¦ Rust image optimization - 78% smaller PNGs, pre-compiled WASM, zero Rust required
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
π File-based routing - Just create files in pages/, that's it
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
πΊοΈ Auto SEO - Sitemap and robots.txt generated automatically
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
- β
Vite: Fast dev, β terrible SEO (client-only)
|
|
59
|
-
- β
Next.js: Good SEO, β slow builds + server required
|
|
60
|
-
- β
Gatsby: Perfect SEO, β 45-second builds
|
|
56
|
+
π TypeScript ready - Full type definitions, zero setup required
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
π¨ CSS built-in - Global styles with LightningCSS optimization
|
|
59
|
+
|
|
60
|
+
π₯ 30ms HMR - Instant hot reloading that actually works
|
|
61
|
+
|
|
62
|
+
No webpack config. No babel setup. No framework fatigue. Just React, done right.
|
|
63
|
+
β‘ Performance That Matters
|
|
64
|
+
|
|
65
|
+
Real benchmarks on a 7-year-old laptop (Intel i3-2348M, 7.6GB RAM):
|
|
66
|
+
Metric BertUI 1.1.7 Vite Next.js Your Gain
|
|
67
|
+
Dev Server 494ms 713ms 2,100ms 1.4-4.3x faster β‘
|
|
68
|
+
Prod Build 265ms 4,700ms 8,400ms 18-32x faster β‘
|
|
69
|
+
Bundle Size 100KB 220KB 280KB 2.2-2.8x smaller β‘
|
|
70
|
+
HMR Speed 30ms 85ms 120ms 2.8-4x faster β‘
|
|
71
|
+
PNG Optimization 78% smaller 0% 0% 78% smaller π¦
|
|
72
|
+
JPEG Optimization 75% smaller 0% 0% 75% smaller π¦
|
|
73
|
+
|
|
74
|
+
If BertUI is this fast on old hardware, imagine what it does on yours. π
|
|
75
|
+
ποΈ Server Islands: Perfect SEO, Zero Complexity
|
|
76
|
+
|
|
77
|
+
The problem: Every React framework makes you choose:
|
|
78
|
+
|
|
79
|
+
β
Vite: Fast dev, β terrible SEO (client-only)
|
|
80
|
+
|
|
81
|
+
β
Next.js: Good SEO, β slow builds + server required
|
|
82
|
+
|
|
83
|
+
β
Gatsby: Perfect SEO, β 45-second builds
|
|
84
|
+
|
|
85
|
+
BertUI's solution: Server Islands (optional SSG)
|
|
86
|
+
jsx
|
|
63
87
|
|
|
64
|
-
```jsx
|
|
65
88
|
// src/pages/about.jsx
|
|
66
89
|
|
|
67
90
|
// ποΈ Add ONE line to enable static generation
|
|
68
91
|
export const render = "server";
|
|
69
92
|
|
|
70
93
|
// π― Optional: Add SEO metadata
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
description: "Learn about our team",
|
|
74
|
-
keywords: "about, company, team"
|
|
75
|
-
};
|
|
94
|
+
export const title = "About Us";
|
|
95
|
+
export const description = "Learn about our team";
|
|
76
96
|
|
|
77
97
|
// βοΈ Write normal React (no hooks, no event handlers)
|
|
78
98
|
export default function About() {
|
|
@@ -80,25 +100,53 @@ export default function About() {
|
|
|
80
100
|
<div>
|
|
81
101
|
<h1>About Us</h1>
|
|
82
102
|
<p>This page is pre-rendered as static HTML!</p>
|
|
83
|
-
<p>Search engines see everything instantly.</p>
|
|
84
103
|
</div>
|
|
85
104
|
);
|
|
86
105
|
}
|
|
87
|
-
```
|
|
88
106
|
|
|
89
|
-
|
|
90
|
-
- β
Generates static HTML for instant loading
|
|
91
|
-
- β
Auto-adds to sitemap.xml
|
|
92
|
-
- β
Perfect SEO without SSR complexity
|
|
93
|
-
- β
Still builds in 265ms
|
|
107
|
+
At build time:
|
|
94
108
|
|
|
95
|
-
|
|
109
|
+
β
Generates static HTML for instant loading
|
|
96
110
|
|
|
97
|
-
|
|
111
|
+
β
Auto-adds to sitemap.xml
|
|
98
112
|
|
|
99
|
-
|
|
113
|
+
β
Perfect SEO without SSR complexity
|
|
114
|
+
|
|
115
|
+
β
Still builds in 265ms
|
|
116
|
+
|
|
117
|
+
π¦ Image Optimization (Just Works)
|
|
118
|
+
|
|
119
|
+
No configuration. No Rust installation. Just smaller images.
|
|
120
|
+
bash
|
|
121
|
+
|
|
122
|
+
# BertUI automatically optimizes images in src/images/
|
|
123
|
+
bun run build
|
|
124
|
+
|
|
125
|
+
text
|
|
126
|
+
|
|
127
|
+
π¦ Building with Rust image optimizer...
|
|
128
|
+
β logo.png: 245KB β 54KB (78% saved)
|
|
129
|
+
β hero.jpg: 1.2MB β 312KB (75% saved)
|
|
130
|
+
β icon.webp: 89KB β 26KB (70% saved)
|
|
131
|
+
β
Optimized 12 images, saved 3.4MB
|
|
132
|
+
|
|
133
|
+
Or use the API directly:
|
|
134
|
+
js
|
|
135
|
+
|
|
136
|
+
import { optimizeImage } from 'bertui/image-optimizer';
|
|
137
|
+
|
|
138
|
+
// Single image
|
|
139
|
+
const result = await optimizeImage(buffer, {
|
|
140
|
+
format: 'png',
|
|
141
|
+
quality: 80 // 0-100, default 80
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// Batch processing
|
|
145
|
+
const results = await optimizeImagesBatch(images, 'webp');
|
|
146
|
+
|
|
147
|
+
π¦ Installation
|
|
148
|
+
bash
|
|
100
149
|
|
|
101
|
-
```bash
|
|
102
150
|
# Create new app
|
|
103
151
|
bunx create-bertui my-app
|
|
104
152
|
|
|
@@ -106,290 +154,114 @@ bunx create-bertui my-app
|
|
|
106
154
|
cd my-app
|
|
107
155
|
bun run dev
|
|
108
156
|
|
|
109
|
-
# Build for production
|
|
157
|
+
# Build for production (with image optimization)
|
|
110
158
|
bun run build
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**30 seconds from zero to running. No configuration required.**
|
|
114
|
-
|
|
115
|
-
---
|
|
116
159
|
|
|
117
|
-
|
|
160
|
+
30 seconds from zero to running. No configuration required.
|
|
161
|
+
π Project Structure
|
|
162
|
+
text
|
|
118
163
|
|
|
119
|
-
```
|
|
120
164
|
my-app/
|
|
121
165
|
βββ src/
|
|
122
166
|
β βββ pages/
|
|
123
167
|
β β βββ index.jsx # Route: /
|
|
124
168
|
β β βββ about.jsx # Route: /about
|
|
125
|
-
β β βββ blog/
|
|
126
|
-
β β βββ index.jsx # Route: /blog
|
|
127
|
-
β β βββ [slug].jsx # Route: /blog/:slug (dynamic)
|
|
169
|
+
β β βββ blog/[slug].jsx # Route: /blog/:slug
|
|
128
170
|
β βββ components/ # Your React components
|
|
129
171
|
β βββ styles/
|
|
130
172
|
β β βββ global.css # Automatically imported
|
|
131
|
-
β
|
|
132
|
-
βββ
|
|
133
|
-
β βββ
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
173
|
+
β βββ images/ # π¦ Auto-optimized at build time
|
|
174
|
+
β β βββ logo.png
|
|
175
|
+
β β βββ hero.jpg
|
|
176
|
+
β βββ pages/ # File-based routing
|
|
177
|
+
βββ public/ # Static assets
|
|
178
|
+
βββ dist/ # Production build
|
|
179
|
+
β βββ sitemap.xml # Auto-generated
|
|
180
|
+
β βββ robots.txt # Auto-generated
|
|
181
|
+
β βββ images/ # π¦ Optimized images
|
|
137
182
|
βββ package.json
|
|
138
|
-
```
|
|
139
183
|
|
|
140
|
-
|
|
184
|
+
π£οΈ File-Based Routing
|
|
141
185
|
|
|
142
|
-
|
|
186
|
+
Just create files. BertUI handles the rest.
|
|
187
|
+
text
|
|
143
188
|
|
|
144
|
-
**Just create files. BertUI handles the rest.**
|
|
145
|
-
|
|
146
|
-
```
|
|
147
189
|
src/pages/index.jsx β /
|
|
148
190
|
src/pages/about.jsx β /about
|
|
149
191
|
src/pages/blog/index.jsx β /blog
|
|
150
192
|
src/pages/blog/[slug].jsx β /blog/:slug
|
|
151
|
-
src/pages/user/[id].jsx β /user/:id
|
|
152
|
-
```
|
|
153
193
|
|
|
154
|
-
|
|
194
|
+
Dynamic routes with TypeScript:
|
|
195
|
+
typescript
|
|
155
196
|
|
|
156
|
-
|
|
157
|
-
|
|
197
|
+
// src/pages/blog/[slug].tsx
|
|
198
|
+
import { useRouter } from 'bertui/router';
|
|
158
199
|
|
|
159
|
-
|
|
160
|
-
|
|
200
|
+
interface Params {
|
|
201
|
+
slug: string;
|
|
161
202
|
}
|
|
162
203
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
### Navigation
|
|
167
|
-
|
|
168
|
-
```jsx
|
|
169
|
-
import { Link, useRouter } from 'bertui/router';
|
|
170
|
-
|
|
171
|
-
function Nav() {
|
|
172
|
-
const { navigate, pathname } = useRouter();
|
|
173
|
-
|
|
174
|
-
return (
|
|
175
|
-
<nav>
|
|
176
|
-
<Link to="/">Home</Link>
|
|
177
|
-
<Link to="/about">About</Link>
|
|
178
|
-
<button onClick={() => navigate('/blog')}>Blog</button>
|
|
179
|
-
|
|
180
|
-
<p>Current: {pathname}</p>
|
|
181
|
-
</nav>
|
|
182
|
-
);
|
|
204
|
+
export default function BlogPost() {
|
|
205
|
+
const { params } = useRouter<Params>();
|
|
206
|
+
return <h1>Post: {params.slug}</h1>;
|
|
183
207
|
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## βοΈ Configuration (Optional)
|
|
189
|
-
|
|
190
|
-
**BertUI works with zero config, but you can customize:**
|
|
191
208
|
|
|
192
|
-
|
|
193
|
-
|
|
209
|
+
βοΈ Configuration (Optional)
|
|
210
|
+
javascript
|
|
194
211
|
|
|
212
|
+
// bertui.config.js
|
|
195
213
|
export default {
|
|
196
|
-
siteName: "My
|
|
197
|
-
baseUrl: "https://example.com",
|
|
214
|
+
siteName: "My Site",
|
|
215
|
+
baseUrl: "https://example.com", // Required for sitemap
|
|
198
216
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
217
|
+
// Image optimization settings
|
|
218
|
+
imageOptimizer: {
|
|
219
|
+
quality: 80, // JPEG/PNG quality (0-100)
|
|
220
|
+
webpQuality: 75, // WebP quality (0-100)
|
|
221
|
+
stripMetadata: true // Remove EXIF data
|
|
204
222
|
},
|
|
205
223
|
|
|
206
224
|
robots: {
|
|
207
|
-
disallow: ["/admin", "/api"],
|
|
208
|
-
crawlDelay: 1
|
|
225
|
+
disallow: ["/admin", "/api"],
|
|
226
|
+
crawlDelay: 1
|
|
209
227
|
}
|
|
210
228
|
};
|
|
211
|
-
```
|
|
212
229
|
|
|
213
|
-
|
|
230
|
+
π Comparison
|
|
231
|
+
Feature BertUI 1.1.7 Next.js Vite Remix
|
|
232
|
+
Dev Server 494ms 2.1s 713ms 1.8s
|
|
233
|
+
Prod Build 265ms 8.4s 4.7s 6.2s
|
|
234
|
+
Bundle Size 100KB 280KB 220KB 250KB
|
|
235
|
+
Image Optimization β
78% smaller β No β No β No
|
|
236
|
+
Server Islands β
Built-in β No β No β No
|
|
237
|
+
Auto SEO β
Yes β οΈ Manual β No β οΈ Manual
|
|
238
|
+
TypeScript β
No setup β
Config needed β
Config needed β
Config needed
|
|
239
|
+
Rust Required β NO N/A N/A N/A
|
|
240
|
+
π Coming Soon
|
|
214
241
|
|
|
215
|
-
|
|
242
|
+
Future packages (in development):
|
|
216
243
|
|
|
217
|
-
|
|
244
|
+
π bertui-elysia - Full-stack addon (API routes, auth, database)
|
|
218
245
|
|
|
219
|
-
|
|
220
|
-
/* src/styles/global.css */
|
|
246
|
+
π¨ bertui-animation - GPU-accelerated animations (Zig)
|
|
221
247
|
|
|
222
|
-
|
|
223
|
-
margin: 0;
|
|
224
|
-
padding: 0;
|
|
225
|
-
box-sizing: border-box;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
body {
|
|
229
|
-
font-family: system-ui;
|
|
230
|
-
line-height: 1.5;
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
**Automatically imported and optimized with LightningCSS.**
|
|
235
|
-
|
|
236
|
-
### CSS Modules (coming soon)
|
|
237
|
-
|
|
238
|
-
```jsx
|
|
239
|
-
import styles from './Button.module.css';
|
|
248
|
+
π bertui-charts - High-performance charts (Rust)
|
|
240
249
|
|
|
241
|
-
|
|
242
|
-
return <button className={styles.primary}>Click</button>;
|
|
243
|
-
}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## π Official Packages
|
|
250
|
+
π Credits
|
|
249
251
|
|
|
250
|
-
|
|
252
|
+
Runtime: Bun - The fastest JavaScript runtime
|
|
251
253
|
|
|
252
|
-
|
|
254
|
+
Server: Elysia - Fast and elegant web framework
|
|
253
255
|
|
|
254
|
-
|
|
255
|
-
bun add bertui-icons
|
|
256
|
-
```
|
|
256
|
+
CSS: LightningCSS - Lightning-fast CSS processing
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
import { ArrowRight, Bell, User } from 'bertui-icons';
|
|
260
|
-
|
|
261
|
-
function App() {
|
|
262
|
-
return (
|
|
263
|
-
<div>
|
|
264
|
-
{/* Basic icon */}
|
|
265
|
-
<ArrowRight size={24} />
|
|
266
|
-
|
|
267
|
-
{/* Icon with text overlay (exclusive!) */}
|
|
268
|
-
<Bell color="red">{notificationCount}</Bell>
|
|
269
|
-
|
|
270
|
-
{/* Custom positioning */}
|
|
271
|
-
<User x={20} y={15} fontSize={10}>VIP</User>
|
|
272
|
-
</div>
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
**[bertui-icons documentation β](https://github.com/BunElysiaReact/bertui-icons)**
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
## π Coming Soon
|
|
282
|
-
|
|
283
|
-
**Future packages (not available yet):**
|
|
284
|
-
|
|
285
|
-
- π **bertui-elysia** - Full-stack addon (API routes, auth, database)
|
|
286
|
-
- π¨ **bertui-animation** - GPU-accelerated animations
|
|
287
|
-
- π **bertui-charts** - High-performance charts
|
|
288
|
-
|
|
289
|
-
**Why wait?** We're building these in native code (Zig/C++) for maximum performance.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
## π Deployment
|
|
294
|
-
|
|
295
|
-
### Vercel (Recommended)
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
# 1. Push to GitHub
|
|
299
|
-
# 2. Import to Vercel
|
|
300
|
-
# 3. Deploy
|
|
301
|
-
|
|
302
|
-
# Done! π
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Other Platforms
|
|
306
|
-
|
|
307
|
-
**All of these work with zero config:**
|
|
308
|
-
- β
Netlify
|
|
309
|
-
- β
Cloudflare Pages
|
|
310
|
-
- β
GitHub Pages
|
|
311
|
-
- β
Any static host (Nginx, Apache, S3)
|
|
312
|
-
|
|
313
|
-
**[Deployment guide β](https://bertui-docswebsite.pages.dev/deployment)**
|
|
314
|
-
|
|
315
|
-
---
|
|
316
|
-
|
|
317
|
-
## π Comparison
|
|
318
|
-
|
|
319
|
-
| Feature | BertUI | Next.js | Vite | Remix |
|
|
320
|
-
|---------|--------|---------|------|-------|
|
|
321
|
-
| Dev Server | 494ms | 2.1s | 713ms | 1.8s |
|
|
322
|
-
| Prod Build | 265ms | 8.4s | 4.7s | 6.2s |
|
|
323
|
-
| Bundle Size | 100KB | 280KB | 220KB | 250KB |
|
|
324
|
-
| Server Islands | β
Built-in | β No | β No | β No |
|
|
325
|
-
| Auto SEO | β
Yes | β οΈ Manual | β No | β οΈ Manual |
|
|
326
|
-
| Zero Config | β
True | β οΈ Some | β οΈ Some | β οΈ Some |
|
|
327
|
-
| TypeScript | β
No setup | β
Config needed | β
Config needed | β
Config needed |
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## π οΈ Commands
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
# Development
|
|
335
|
-
bun run dev # Start dev server (494ms)
|
|
336
|
-
|
|
337
|
-
# Production
|
|
338
|
-
bun run build # Build for production (265ms)
|
|
339
|
-
bun run preview # Preview production build
|
|
340
|
-
|
|
341
|
-
# Create new app
|
|
342
|
-
bunx create-bertui my-app
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
## π Documentation
|
|
348
|
-
|
|
349
|
-
- **Website:** https://bertui-docswebsite.pages.dev/
|
|
350
|
-
- **Getting Started:** https://bertui-docswebsite.pages.dev/getstarted
|
|
351
|
-
- **Server Islands:** https://bertui-docswebsite.pages.dev/server-islands
|
|
352
|
-
- **GitHub:** https://github.com/BunElysiaReact/BERTUI
|
|
353
|
-
|
|
354
|
-
---
|
|
355
|
-
|
|
356
|
-
## π¬ Community
|
|
357
|
-
|
|
358
|
-
- **GitHub Discussions:** https://github.com/BunElysiaReact/BERTUI/discussions
|
|
359
|
-
- **Issues:** https://github.com/BunElysiaReact/BERTUI/issues
|
|
360
|
-
- **Discord:** https://discord.gg/x8JXvHKd
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## β Support the Project
|
|
365
|
-
|
|
366
|
-
If BertUI makes your React development faster, give us a star! β
|
|
367
|
-
|
|
368
|
-
**[github.com/BunElysiaReact/BERTUI](https://github.com/BunElysiaReact/BERTUI)**
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## π License
|
|
373
|
-
|
|
374
|
-
MIT License - see [LICENSE](LICENSE) for details
|
|
375
|
-
|
|
376
|
-
---
|
|
377
|
-
|
|
378
|
-
## π Credits
|
|
379
|
-
|
|
380
|
-
- **Runtime:** [Bun](https://bun.sh/) - The fastest JavaScript runtime
|
|
381
|
-
- **Server:** [Elysia](https://elysiajs.com/) - Fast and elegant web framework
|
|
382
|
-
- **CSS:** [LightningCSS](https://lightningcss.dev/) - Lightning-fast CSS processing
|
|
383
|
-
- **Icons:** [Lucide](https://lucide.dev/) - Beautiful icon set
|
|
384
|
-
|
|
385
|
-
---
|
|
258
|
+
Image Optimization: oxipng, mozjpeg, webp - Rust libraries compiled to WASM
|
|
386
259
|
|
|
387
260
|
<div align="center">
|
|
388
261
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
*"The fastest React framework. Everything React should have been."*
|
|
262
|
+
Made with β‘π¦ποΈ by the BertUI team
|
|
392
263
|
|
|
393
|
-
|
|
264
|
+
v1.1.7 - Rust image optimization, zero Rust required
|
|
394
265
|
|
|
395
|
-
|
|
266
|
+
Website β’ GitHub β’ npm
|
|
267
|
+
</div> ```
|
package/index.js
CHANGED
|
@@ -1,36 +1,58 @@
|
|
|
1
|
-
// index.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
1
|
+
// bertui/src/index.js - ONE EXPORT FILE TO RULE THEM ALL
|
|
2
|
+
|
|
3
|
+
// Compiler
|
|
4
|
+
export { compileProject } from './client/compiler.js';
|
|
5
|
+
export { compileForBuild } from './build/compiler/index.js';
|
|
6
|
+
export { discoverRoutes } from './build/compiler/route-discoverer.js';
|
|
7
|
+
|
|
8
|
+
// HMR
|
|
9
|
+
export { hmr } from './client/hmr-runtime.js';
|
|
10
|
+
|
|
11
|
+
// Image Optimizer - RUST WASM (no Rust for users)
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
optimizeImage,
|
|
14
|
+
optimizeImagesBatch,
|
|
15
|
+
hasWasm,
|
|
16
|
+
version as optimizerVersion
|
|
17
|
+
} from './image-optimizer/index.js';
|
|
18
|
+
|
|
19
|
+
// Build
|
|
20
|
+
export { buildProduction } from './build.js';
|
|
21
|
+
export { optimizeImages } from './build/image-optimizer.js';
|
|
22
|
+
|
|
23
|
+
// Router
|
|
24
|
+
export { Router, Link, useRouter } from './router/index.js';
|
|
25
|
+
export { SSRRouter } from './router/SSRRouter.jsx';
|
|
26
|
+
|
|
27
|
+
// Config
|
|
28
|
+
export { loadConfig, defaultConfig } from './config/index.js';
|
|
29
|
+
|
|
30
|
+
// Logger
|
|
31
|
+
export { default as logger } from './logger/logger.js';
|
|
32
|
+
|
|
33
|
+
// CLI (backward compatibility)
|
|
34
|
+
export { program } from './cli.js';
|
|
35
|
+
|
|
36
|
+
// Version
|
|
37
|
+
export const version = '1.2.0';
|
|
23
38
|
|
|
24
39
|
// Default export
|
|
25
40
|
export default {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
compileProject,
|
|
42
|
+
compileForBuild,
|
|
43
|
+
discoverRoutes,
|
|
44
|
+
hmr,
|
|
45
|
+
optimizeImage,
|
|
46
|
+
optimizeImagesBatch,
|
|
47
|
+
optimizeImages,
|
|
48
|
+
buildProduction,
|
|
49
|
+
Router,
|
|
50
|
+
Link,
|
|
51
|
+
useRouter,
|
|
52
|
+
SSRRouter,
|
|
53
|
+
loadConfig,
|
|
54
|
+
defaultConfig,
|
|
55
|
+
logger,
|
|
56
|
+
program,
|
|
57
|
+
version: '1.2.0'
|
|
36
58
|
};
|