@flexireact/core 2.5.0 → 3.0.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 +204 -52
- package/cli/index.ts +1 -1
- package/core/index.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,45 +2,62 @@
|
|
|
2
2
|
<img src="./assets/flexireact.webp" alt="FlexiReact Logo" width="400" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center"
|
|
5
|
+
<h1 align="center">⚡ FlexiReact v3</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>The
|
|
8
|
+
<strong>The Future of React Development</strong>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
The Modern React Framework - Better than Next.js with TypeScript, Tailwind CSS, SSR, SSG, Islands, Edge Runtime, and 50+ UI components.<br/>
|
|
13
|
+
<b>Better than Next.js.</b> Simpler. Faster. More powerful.
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<a href="https://www.npmjs.com/package/@flexireact/core"><img src="https://img.shields.io/npm/v/@flexireact/core.svg" alt="npm version" /></a>
|
|
18
|
-
<a href="https://
|
|
17
|
+
<a href="https://www.npmjs.com/package/@flexireact/core"><img src="https://img.shields.io/npm/v/@flexireact/core.svg?color=00FF9C" alt="npm version" /></a>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@flexireact/core"><img src="https://img.shields.io/npm/dm/@flexireact/core.svg?color=00FF9C" alt="npm downloads" /></a>
|
|
19
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-00FF9C.svg" alt="License: MIT" /></a>
|
|
19
20
|
<a href="#"><img src="https://img.shields.io/badge/TypeScript-Native-blue.svg" alt="TypeScript Native" /></a>
|
|
20
|
-
<a href="#"><img src="https://img.shields.io/badge/Tailwind-v4-38B2AC.svg" alt="Tailwind CSS v4" /></a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="#-quick-start">Quick Start</a> •
|
|
25
|
+
<a href="#-features">Features</a> •
|
|
26
|
+
<a href="#-cli-commands">CLI</a> •
|
|
27
|
+
<a href="#-flexi-ui">FlexiUI</a> •
|
|
28
|
+
<a href="#-devtools">DevTools</a>
|
|
29
|
+
</p>
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
- **🌊 Streaming SSR** — Progressive HTML rendering with React 18 `renderToPipeableStream`
|
|
27
|
-
- **⚡ Server Actions** — Call server functions directly from client components
|
|
28
|
-
- **🔗 Link Prefetching** — Automatic prefetch on hover/viewport visibility
|
|
31
|
+
---
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
- **🛠️ Server Helpers** — `redirect()`, `notFound()`, `json()`, `cookies`, `headers`
|
|
32
|
-
- **🚧 Error/Loading Boundaries** — Per-segment `error.tsx` and `loading.tsx`
|
|
33
|
-
- **🔐 Route Middleware** — `_middleware.ts` for per-route logic
|
|
34
|
-
- **📊 Bundle Analyzer** — `flexi build --analyze`
|
|
35
|
-
- **🔄 CI/CD** — GitHub Actions workflow
|
|
33
|
+
## 🚀 Quick Start
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
35
|
+
```bash
|
|
36
|
+
# Create a new project
|
|
37
|
+
npx create-flexireact my-app
|
|
38
|
+
|
|
39
|
+
# Or with a specific template
|
|
40
|
+
npx create-flexireact my-app --template app-router
|
|
41
|
+
|
|
42
|
+
# Start development
|
|
43
|
+
cd my-app
|
|
44
|
+
npm run dev
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Open [http://localhost:3000](http://localhost:3000) 🎉
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🆕 What's New in v3.0
|
|
52
|
+
|
|
53
|
+
### v3.0.0 — The Future of React
|
|
54
|
+
- **🌐 Universal Edge Runtime** — Deploy anywhere: Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge
|
|
55
|
+
- **⚡ Smart Caching** — TTL, stale-while-revalidate, tag-based invalidation
|
|
56
|
+
- **🎯 Partial Prerendering (PPR)** — Static shell + streaming dynamic content
|
|
57
|
+
- **🛠️ CLI Scaffolding** — Generate pages, components, hooks, APIs with `flexi g`
|
|
58
|
+
- **🔧 Advanced DevTools** — Routes, Components, Network, Performance monitoring
|
|
59
|
+
- **🎨 FlexiUI Integration** — 50+ beautiful, accessible React components
|
|
60
|
+
- **📱 Sexy Templates** — Modern, responsive landing pages out of the box
|
|
44
61
|
|
|
45
62
|
## ✨ Features
|
|
46
63
|
|
|
@@ -136,49 +153,161 @@
|
|
|
136
153
|
|
|
137
154
|
## 🆚 Why FlexiReact?
|
|
138
155
|
|
|
139
|
-
| | FlexiReact | Next.js | Remix | Astro |
|
|
156
|
+
| | FlexiReact v3 | Next.js 15 | Remix | Astro |
|
|
140
157
|
|---|:---:|:---:|:---:|:---:|
|
|
141
158
|
| **Zero Config** | ✅ | ⚠️ | ⚠️ | ✅ |
|
|
142
|
-
| **
|
|
159
|
+
| **Edge Runtime** | ✅ | ✅ | ⚠️ | ⚠️ |
|
|
143
160
|
| **Islands Architecture** | ✅ | ❌ | ❌ | ✅ |
|
|
144
|
-
| **
|
|
145
|
-
| **
|
|
146
|
-
| **
|
|
147
|
-
| **
|
|
161
|
+
| **UI Components** | ✅ 50+ | ❌ | ❌ | ❌ |
|
|
162
|
+
| **CLI Scaffolding** | ✅ | ❌ | ❌ | ❌ |
|
|
163
|
+
| **DevTools** | ✅ | ⚠️ | ⚠️ | ⚠️ |
|
|
164
|
+
| **PPR** | ✅ | ✅ | ❌ | ❌ |
|
|
165
|
+
| **Bundle Size** | 🟢 ~90kb | � ~250kb | 🟡 ~150kb | 🟢 ~50kb |
|
|
148
166
|
| **Build Speed** | 🟢 <1s | 🟡 ~5s | 🟡 ~3s | 🟢 <2s |
|
|
149
|
-
| **Learning Curve** | 🟢 Easy | 🟡 Medium | 🟡 Medium | 🟢 Easy |
|
|
150
|
-
| **Plugin System** | ✅ | ⚠️ | ❌ | ✅ |
|
|
151
167
|
|
|
152
|
-
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🖥️ CLI Commands
|
|
153
171
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
172
|
+
```bash
|
|
173
|
+
# Project
|
|
174
|
+
flexi create <name> # Create new project
|
|
175
|
+
flexi dev # Start dev server (HMR)
|
|
176
|
+
flexi build # Build for production
|
|
177
|
+
flexi build --analyze # Build with bundle analysis
|
|
178
|
+
flexi start # Start production server
|
|
179
|
+
flexi doctor # Check project health
|
|
180
|
+
|
|
181
|
+
# Scaffolding (NEW in v3!)
|
|
182
|
+
flexi g page dashboard # Generate a page
|
|
183
|
+
flexi g component Button # Generate a component
|
|
184
|
+
flexi g hook useAuth # Generate a custom hook
|
|
185
|
+
flexi g api users # Generate an API route
|
|
186
|
+
flexi g action submit # Generate a server action
|
|
187
|
+
flexi g context theme # Generate a React context
|
|
188
|
+
flexi g middleware auth # Generate middleware
|
|
189
|
+
flexi g loading # Generate loading.tsx
|
|
190
|
+
flexi g error # Generate error.tsx
|
|
191
|
+
```
|
|
158
192
|
|
|
159
193
|
---
|
|
160
194
|
|
|
161
|
-
##
|
|
195
|
+
## 🎨 FlexiUI — 50+ Components
|
|
196
|
+
|
|
197
|
+
FlexiReact includes [@flexireact/flexi-ui](https://www.npmjs.com/package/@flexireact/flexi-ui), a complete UI library:
|
|
162
198
|
|
|
163
199
|
```bash
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
cd my-app
|
|
167
|
-
npm install
|
|
200
|
+
npm install @flexireact/flexi-ui
|
|
201
|
+
```
|
|
168
202
|
|
|
169
|
-
|
|
170
|
-
|
|
203
|
+
```tsx
|
|
204
|
+
import { Button, Card, Input, Modal, Toast } from '@flexireact/flexi-ui';
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Available Components
|
|
171
208
|
|
|
172
|
-
|
|
173
|
-
|
|
209
|
+
| Category | Components |
|
|
210
|
+
|----------|------------|
|
|
211
|
+
| **Form** | Button, Input, Textarea, Checkbox, Switch, Select, Slider, Radio, Toggle, Rating, DatePicker, FileUpload |
|
|
212
|
+
| **Layout** | Stack, Separator, AspectRatio, ScrollArea, Resizable |
|
|
213
|
+
| **Navigation** | Tabs, Breadcrumb, Pagination, Menubar, Navbar, Sidebar, Stepper |
|
|
214
|
+
| **Data** | Card, Badge, Avatar, Table, Accordion, Calendar, Timeline, Stat, Code, Carousel |
|
|
215
|
+
| **Feedback** | Alert, Toast, Spinner, Skeleton, Progress, Empty |
|
|
216
|
+
| **Overlay** | Modal, Dialog, Drawer, Sheet, Dropdown, Popover, HoverCard, ContextMenu, Command, Collapsible |
|
|
217
|
+
|
|
218
|
+
---
|
|
174
219
|
|
|
175
|
-
|
|
176
|
-
|
|
220
|
+
## 🔧 DevTools
|
|
221
|
+
|
|
222
|
+
Built-in development tools (press `Ctrl+Shift+D`):
|
|
223
|
+
|
|
224
|
+
```tsx
|
|
225
|
+
import { DevToolsOverlay } from '@flexireact/core';
|
|
226
|
+
|
|
227
|
+
// In your layout
|
|
228
|
+
{process.env.NODE_ENV === 'development' && <DevToolsOverlay />}
|
|
177
229
|
```
|
|
178
230
|
|
|
179
|
-
|
|
231
|
+
Features:
|
|
232
|
+
- 🗺️ **Routes** — Navigation history and params
|
|
233
|
+
- 🧩 **Components** — Render counts, props, Islands detection
|
|
234
|
+
- 🌐 **Network** — Fetch/XHR/Actions monitoring
|
|
235
|
+
- 📊 **Performance** — Core Web Vitals (LCP, FID, CLS, TTFB)
|
|
236
|
+
- 📝 **Console** — Centralized logs
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 🌐 Edge Runtime
|
|
241
|
+
|
|
242
|
+
Deploy anywhere with universal edge support:
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { createEdgeHandler, detectRuntime } from '@flexireact/core';
|
|
180
246
|
|
|
181
|
-
|
|
247
|
+
// Automatic runtime detection
|
|
248
|
+
const runtime = detectRuntime();
|
|
249
|
+
// → 'node' | 'bun' | 'deno' | 'cloudflare' | 'vercel-edge' | 'netlify-edge'
|
|
250
|
+
|
|
251
|
+
// Universal handler
|
|
252
|
+
const handler = createEdgeHandler({
|
|
253
|
+
routes: [...],
|
|
254
|
+
middleware: [...],
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
export default handler;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## ⚡ Smart Caching
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
import { smartCache } from '@flexireact/core';
|
|
266
|
+
|
|
267
|
+
const cache = smartCache({
|
|
268
|
+
backend: 'auto', // auto-detect: memory, KV, Redis
|
|
269
|
+
defaultTTL: 60,
|
|
270
|
+
staleWhileRevalidate: true,
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Cache with tags
|
|
274
|
+
await cache.set('user:123', userData, {
|
|
275
|
+
ttl: 300,
|
|
276
|
+
tags: ['users']
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
// Invalidate by tag
|
|
280
|
+
await cache.invalidateTag('users');
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 🎯 Partial Prerendering (PPR)
|
|
286
|
+
|
|
287
|
+
Static shell + streaming dynamic content:
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
import { withPPR, DynamicBoundary } from '@flexireact/core';
|
|
291
|
+
|
|
292
|
+
export default withPPR(function Page() {
|
|
293
|
+
return (
|
|
294
|
+
<div>
|
|
295
|
+
{/* Static - rendered at build time */}
|
|
296
|
+
<Header />
|
|
297
|
+
<Sidebar />
|
|
298
|
+
|
|
299
|
+
{/* Dynamic - streamed at request time */}
|
|
300
|
+
<DynamicBoundary fallback={<Skeleton />}>
|
|
301
|
+
<UserDashboard />
|
|
302
|
+
</DynamicBoundary>
|
|
303
|
+
</div>
|
|
304
|
+
);
|
|
305
|
+
});
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## 📁 Project Structure
|
|
182
311
|
|
|
183
312
|
FlexiReact v2 introduces a new `routes/` directory with enhanced routing capabilities:
|
|
184
313
|
|
|
@@ -192,7 +321,7 @@ myapp/
|
|
|
192
321
|
│ │ └── globals.css # Global styles + Tailwind v4
|
|
193
322
|
│ ├── providers/ # React context providers
|
|
194
323
|
│ └── layout.tsx # Root layout
|
|
195
|
-
├── routes/ # FlexiReact
|
|
324
|
+
├── routes/ # FlexiReact v3 file-based routing
|
|
196
325
|
│ ├── (public)/ # Route groups (don't affect URL)
|
|
197
326
|
│ │ ├── home.tsx # → /
|
|
198
327
|
│ │ └── about.tsx # → /about
|
|
@@ -726,13 +855,36 @@ Islands provide partial hydration:
|
|
|
726
855
|
- Node.js 18+
|
|
727
856
|
- React 18+
|
|
728
857
|
|
|
858
|
+
## 📦 Packages
|
|
859
|
+
|
|
860
|
+
| Package | Version | Description |
|
|
861
|
+
|---------|---------|-------------|
|
|
862
|
+
| [@flexireact/core](https://www.npmjs.com/package/@flexireact/core) |  | Core framework |
|
|
863
|
+
| [@flexireact/flexi-ui](https://www.npmjs.com/package/@flexireact/flexi-ui) |  | UI components |
|
|
864
|
+
| [create-flexireact](https://www.npmjs.com/package/create-flexireact) |  | Project scaffolding |
|
|
865
|
+
|
|
729
866
|
## 🔗 Links
|
|
730
867
|
|
|
731
868
|
- [GitHub Repository](https://github.com/flexireact/flexireact)
|
|
869
|
+
- [FlexiUI Repository](https://github.com/flexireact/flexi-ui)
|
|
732
870
|
- [npm Package](https://www.npmjs.com/package/@flexireact/core)
|
|
871
|
+
- [Discord Community](https://discord.gg/rFSZxFtpAA) 💬
|
|
733
872
|
- [Issues](https://github.com/flexireact/flexireact/issues)
|
|
734
873
|
|
|
874
|
+
## 🙏 Contributing
|
|
875
|
+
|
|
876
|
+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.
|
|
877
|
+
|
|
735
878
|
## 📄 License
|
|
736
879
|
|
|
737
880
|
MIT © [FlexiReact Team](https://github.com/flexireact)
|
|
738
881
|
|
|
882
|
+
---
|
|
883
|
+
|
|
884
|
+
<p align="center">
|
|
885
|
+
<b>Built with ❤️ by the FlexiReact Team</b>
|
|
886
|
+
</p>
|
|
887
|
+
|
|
888
|
+
<p align="center">
|
|
889
|
+
<a href="https://github.com/flexireact/flexireact">⭐ Star us on GitHub</a>
|
|
890
|
+
</p>
|
package/cli/index.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { runGenerate, listGenerators } from './generators.js';
|
|
|
16
16
|
|
|
17
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
18
|
const __dirname = path.dirname(__filename);
|
|
19
|
-
const VERSION = '
|
|
19
|
+
const VERSION = '3.0.0';
|
|
20
20
|
|
|
21
21
|
// ============================================================================
|
|
22
22
|
// ASCII Logo & Branding
|
package/core/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flexireact/core",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "The Modern React Framework
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "The Modern React Framework v3 - SSR, SSG, Islands, Edge Runtime, 50+ UI Components, TypeScript, Tailwind v4",
|
|
5
5
|
"main": "core/index.ts",
|
|
6
6
|
"types": "core/types.ts",
|
|
7
7
|
"type": "module",
|