elit 2.0.1 → 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.
Files changed (82) hide show
  1. package/README.md +275 -128
  2. package/dist/build.d.mts +10 -1
  3. package/dist/build.d.ts +10 -1
  4. package/dist/build.js +670 -1
  5. package/dist/build.mjs +641 -1
  6. package/dist/chokidar.d.mts +134 -0
  7. package/dist/chokidar.d.ts +134 -0
  8. package/dist/chokidar.js +240 -0
  9. package/dist/chokidar.mjs +221 -0
  10. package/dist/cli.js +2792 -495
  11. package/dist/dom.d.mts +10 -3
  12. package/dist/dom.d.ts +10 -3
  13. package/dist/dom.js +676 -1
  14. package/dist/dom.mjs +647 -1
  15. package/dist/el.d.mts +16 -36
  16. package/dist/el.d.ts +16 -36
  17. package/dist/el.js +789 -1
  18. package/dist/el.mjs +583 -1
  19. package/dist/fs.d.mts +255 -0
  20. package/dist/fs.d.ts +255 -0
  21. package/dist/fs.js +513 -0
  22. package/dist/fs.mjs +469 -0
  23. package/dist/hmr.js +112 -1
  24. package/dist/hmr.mjs +91 -1
  25. package/dist/http.d.mts +163 -0
  26. package/dist/http.d.ts +163 -0
  27. package/dist/http.js +632 -0
  28. package/dist/http.mjs +605 -0
  29. package/dist/https.d.mts +108 -0
  30. package/dist/https.d.ts +108 -0
  31. package/dist/https.js +907 -0
  32. package/dist/https.mjs +901 -0
  33. package/dist/index.d.mts +613 -33
  34. package/dist/index.d.ts +613 -33
  35. package/dist/index.js +2589 -1
  36. package/dist/index.mjs +2312 -1
  37. package/dist/mime-types.d.mts +48 -0
  38. package/dist/mime-types.d.ts +48 -0
  39. package/dist/mime-types.js +197 -0
  40. package/dist/mime-types.mjs +166 -0
  41. package/dist/path.d.mts +163 -0
  42. package/dist/path.d.ts +163 -0
  43. package/dist/path.js +350 -0
  44. package/dist/path.mjs +310 -0
  45. package/dist/router.d.mts +3 -1
  46. package/dist/router.d.ts +3 -1
  47. package/dist/router.js +830 -1
  48. package/dist/router.mjs +801 -1
  49. package/dist/runtime.d.mts +97 -0
  50. package/dist/runtime.d.ts +97 -0
  51. package/dist/runtime.js +43 -0
  52. package/dist/runtime.mjs +15 -0
  53. package/dist/server.d.mts +5 -1
  54. package/dist/server.d.ts +5 -1
  55. package/dist/server.js +3267 -1
  56. package/dist/server.mjs +3241 -1
  57. package/dist/state.d.mts +3 -1
  58. package/dist/state.d.ts +3 -1
  59. package/dist/state.js +1036 -1
  60. package/dist/state.mjs +992 -1
  61. package/dist/style.d.mts +47 -1
  62. package/dist/style.d.ts +47 -1
  63. package/dist/style.js +551 -1
  64. package/dist/style.mjs +483 -1
  65. package/dist/{types-DOAdFFJB.d.ts → types-C0nGi6MX.d.mts} +29 -13
  66. package/dist/{types-DOAdFFJB.d.mts → types-Du6kfwTm.d.ts} +29 -13
  67. package/dist/types.d.mts +452 -3
  68. package/dist/types.d.ts +452 -3
  69. package/dist/types.js +18 -1
  70. package/dist/ws.d.mts +195 -0
  71. package/dist/ws.d.ts +195 -0
  72. package/dist/ws.js +380 -0
  73. package/dist/ws.mjs +358 -0
  74. package/dist/wss.d.mts +108 -0
  75. package/dist/wss.d.ts +108 -0
  76. package/dist/wss.js +1306 -0
  77. package/dist/wss.mjs +1300 -0
  78. package/package.json +53 -6
  79. package/dist/client.d.mts +0 -9
  80. package/dist/client.d.ts +0 -9
  81. package/dist/client.js +0 -1
  82. package/dist/client.mjs +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Elit
2
2
 
3
- ⚡ A lightweight TypeScript framework with built-in dev server, HMR, routing, and reactive state management. Minimal dependencies, maximum developer experience.
3
+ ⚡ A lightweight TypeScript framework with built-in dev server, HMR, routing, and reactive state management. **Zero production dependencies**, maximum developer experience.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/elit.svg)](https://www.npmjs.com/package/elit)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -10,21 +10,76 @@
10
10
 
11
11
  ## Why Elit?
12
12
 
13
- - **🎯 Lightweight**: Minimal bundle size with tree-shaking support
13
+ ### Frontend Excellence
14
+ - **🎯 Ultra Lightweight**: Modular design - import only what you need (DOM: 11KB, State: 15KB)
14
15
  - **⚡ Lightning Fast**: Direct DOM manipulation - no virtual DOM overhead
15
- - **🔷 TypeScript First**: Full type safety and IntelliSense out of the box
16
16
  - **🔄 Reactive State**: Simple but powerful reactive state management with `createState` and `computed`
17
- - **🌲 Tree-Shakeable**: Import only what you need for optimal bundle size
18
- - **🚀 Full-Stack Ready**: Built-in dev server, HMR, build tool, and REST API
17
+ - **🎨 CSS-in-JS**: Type-safe styling with `CreateStyle`
18
+ - **🛣️ Client Router**: Hash and history mode routing with dynamic parameters and guards
19
+ - **📱 Virtual Scrolling**: Handle 100k+ items efficiently
20
+ - **🌲 Tree-Shakeable**: Smart ES modules - only bundle what you use
21
+
22
+ ### Backend Performance
23
+ - **🚀 High Performance**: 10,000+ req/s on Node.js with sub-7ms latency
24
+ - **🌐 ServerRouter**: Full-featured routing with only 2.7% overhead vs raw HTTP
25
+ - **🔌 WebSocket**: Built-in real-time communication support
26
+ - **⚡ Cross-Runtime**: Works on Node.js, Bun, and Deno with runtime-specific optimizations
27
+ - **🔧 Middleware Stack**: CORS, logging, rate limiting, compression, and more
28
+ - **🔐 Zero Dependencies**: No production dependencies for maximum security
29
+
30
+ ### Developer Experience
31
+ - **🔷 TypeScript First**: Full type safety and IntelliSense out of the box
32
+ - **📝 TypeScript Imports**: Write `import './file.ts'` - automatically rewritten to `.js` for browsers
19
33
  - **🔥 Hot Module Replacement**: Instant development feedback with automatic HMR
20
34
  - **🏗️ Build System**: Integrated esbuild for fast production builds
21
- - **🌐 ServerRouter**: Built-in server-side routing for REST APIs
22
- - **🔌 WebSocket Support**: Real-time communication via WebSocket
23
- - **🎨 CSS-in-JS**: Type-safe styling with `CreateStyle`
24
- - **🛣️ Client Router**: Hash and history mode routing with guards
25
- - **📦 Modular Exports**: Import from specific paths (`elit/dom`, `elit/router`, `elit/state`)
35
+ - **🎯 Zero Config**: Works out of the box with optional `elit.config.ts`
36
+ - **📦 CLI Tools**: `npx elit dev`, `npx elit build`, `npx elit preview`
37
+ - **🌍 Environment Support**: .env files with VITE_ prefix
38
+
39
+ ## Quick Start
40
+
41
+ The fastest way to get started with Elit is using our scaffolding tool:
42
+
43
+ ```bash
44
+ # With npm
45
+ npm create elit@latest my-app
46
+
47
+ # With yarn
48
+ yarn create elit my-app
49
+
50
+ # With pnpm
51
+ pnpm create elit my-app
52
+
53
+ # With bun
54
+ bun create elit my-app
55
+
56
+ # With deno
57
+ deno run -A npm:create-elit my-app
58
+ ```
59
+
60
+ Then follow the prompts!
61
+
62
+ ```bash
63
+ cd my-app
64
+ npm install
65
+ npm run dev
66
+ ```
67
+
68
+ ### Available Templates
69
+
70
+ Choose a template with the `--template` flag:
71
+
72
+ - **basic** (default) - Full-featured app with styled counter example
73
+ - **full** - Full-stack app with dev server and API routes
74
+ - **minimal** - Minimal setup with just DOM rendering
75
+
76
+ ```bash
77
+ npm create elit@latest my-app --template=full
78
+ ```
79
+
80
+ ## Manual Installation
26
81
 
27
- ## Installation
82
+ If you prefer to set up manually:
28
83
 
29
84
  ```bash
30
85
  npm install elit
@@ -47,74 +102,116 @@ npx elit preview
47
102
 
48
103
  ### Configuration
49
104
 
50
- Create `elit.config.mjs` (or .ts, .js, .json) in your project root:
105
+ Create `elit.config.ts` (or .js, .mjs, .json) in your project root:
51
106
 
52
- ```javascript
53
- import { defineConfig } from 'elit';
54
- import { resolve } from 'path';
107
+ ```typescript
108
+ import { server } from './src/server';
109
+ import { client } from './src/client';
55
110
 
56
- export default defineConfig({
111
+ export default {
57
112
  dev: {
58
- port: 3000,
59
- host: 'localhost',
60
- root: './src',
61
- basePath: '/',
62
- open: true
113
+ port: 3003,
114
+ host: '0.0.0.0',
115
+ open: false,
116
+ logging: true,
117
+ clients: [{
118
+ root: '.',
119
+ basePath: '',
120
+ ssr: () => client, // Server-side rendering
121
+ api: server // API routes
122
+ }]
63
123
  },
64
- build: {
124
+ build: [{
65
125
  entry: './src/main.ts',
66
126
  outDir: './dist',
127
+ outFile: 'main.js',
67
128
  format: 'esm',
68
129
  minify: true,
69
- platform: 'browser',
70
- basePath: '/app',
130
+ sourcemap: true,
131
+ target: 'es2020',
71
132
  copy: [
72
- {
73
- from: 'index.html',
74
- to: 'index.html',
75
- transform: (content, config) => {
76
- // Inject base tag from basePath
77
- return content;
78
- }
79
- }
133
+ { from: './public/index.html', to: './index.html' }
80
134
  ]
81
- },
135
+ }],
82
136
  preview: {
83
- port: 4173,
137
+ port: 3000,
138
+ host: '0.0.0.0',
139
+ open: false,
140
+ logging: true,
84
141
  root: './dist',
85
- basePath: '/app'
142
+ basePath: '',
143
+ index: './index.html'
86
144
  }
87
- });
145
+ };
88
146
  ```
89
147
 
90
- ## Features
148
+ **Server setup (src/server.ts):**
91
149
 
92
- ### Frontend Framework
150
+ ```typescript
151
+ import { ServerRouter } from 'elit/server';
93
152
 
94
- - 🎯 **Ultra Lightweight**: Just 30KB minified, ~10KB gzipped
95
- - ⚡ **Reactive State**: Built-in reactive state management with `createState`
96
- - 🔄 **Computed Values**: Automatic dependency tracking with `computed`
97
- - 🎨 **CSS-in-JS**: Type-safe styling with `CreateStyle`
98
- - 🛣️ **Client-Side Router**: Hash and history mode routing with dynamic parameters
99
- - 📱 **Virtual Scrolling**: Handle 100k+ items efficiently
100
- - 🖥️ **SSR Support**: Full server-side rendering capabilities
101
- - 🎭 **SVG & MathML**: Complete support for all elements
102
- - 🔧 **Performance Utilities**: Throttle, debounce, batch rendering
103
- - 📦 **Tree-Shakeable**: Import only what you need
104
- - 🎮 **DOM Utilities**: Convenient helper functions
153
+ export const router = new ServerRouter();
105
154
 
106
- ### Development Tools
155
+ router.get('/api/hello', async (ctx) => {
156
+ ctx.res.setHeader('Content-Type', 'text/html; charset=UTF-8');
157
+ ctx.res.end("Hello from Elit ServerRouter!");
158
+ });
107
159
 
108
- - 🔥 **Hot Module Replacement**: Instant development feedback with automatic reload
109
- - 🏗️ **Build System**: Integrated esbuild for fast production builds
110
- - 🌐 **ServerRouter**: Built-in REST API routing for server-side logic
111
- - 🔧 **Middleware Support**: Add custom middleware to the ServerRouter
112
- - 🔌 **WebSocket Server**: Built-in WebSocket support for real-time features
113
- - 📁 **Static File Server**: Efficient static file serving with proper MIME types
114
- - 🎯 **Smart Defaults**: Works with minimal configuration
115
- - 📦 **TypeScript Compilation**: Automatic TypeScript compilation with esbuild
160
+ export const server = router;
161
+ ```
116
162
 
117
- ## Quick Start
163
+ **Client SSR template (src/client.ts):**
164
+
165
+ ```typescript
166
+ import { div, html, head, body, title, link, script, meta } from 'elit/el';
167
+
168
+ export const client = html(
169
+ head(
170
+ title('Elit - Full-Stack TypeScript Framework'),
171
+ link({ rel: 'icon', type: 'image/svg+xml', href: 'favicon.svg' }),
172
+ meta({ charset: 'UTF-8' }),
173
+ meta({ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }),
174
+ meta({ name: 'description', content: 'Full-stack TypeScript framework' })
175
+ ),
176
+ body(
177
+ div({ id: 'root' }),
178
+ script({ type: 'module', src: '/src/main.js' })
179
+ )
180
+ );
181
+ ```
182
+
183
+ ## Features
184
+
185
+ ### Frontend Framework
186
+
187
+ - 🎯 **Modular & Lightweight**: DOM (11KB), State (15KB), Router (13KB) - use only what you need
188
+ - ⚡ **Reactive State**: Built-in reactive state management with `createState` and automatic dependency tracking
189
+ - 🔄 **Computed Values**: Automatic dependency tracking with `computed` for derived state
190
+ - 🎨 **CSS-in-JS**: Type-safe styling with `CreateStyle` and support for pseudo-selectors
191
+ - 🛣️ **Client-Side Router**: Hash and history mode routing with dynamic parameters and navigation guards
192
+ - 📱 **Virtual Scrolling**: Handle 100k+ items efficiently with `createVirtualList`
193
+ - 🖥️ **SSR Support**: Full server-side rendering with `renderToString`
194
+ - 🎭 **100+ Elements**: Complete HTML, SVG, and MathML element support
195
+ - 🔧 **Performance Utilities**: Throttle, debounce, batch rendering, chunked rendering
196
+ - 📦 **Tree-Shakeable**: ES modules with excellent tree-shaking support
197
+ - 🎮 **DOM Utilities**: Query selectors, element creation, fragment support
198
+
199
+ ### Backend & Development
200
+
201
+ - 🔥 **Hot Module Replacement**: Instant development feedback with automatic state preservation
202
+ - 🏗️ **Build System**: Integrated esbuild with runtime-specific optimizations (Node.js, Bun, Deno)
203
+ - 🌐 **ServerRouter**: High-performance routing (10,128 req/s) with minimal overhead (2.7%)
204
+ - 🔧 **Rich Middleware**: CORS, logging, rate limiting, compression, security headers, and more
205
+ - 🔌 **WebSocket Server**: Built-in WebSocket with automatic state synchronization
206
+ - 📁 **Static File Server**: Efficient serving with proper MIME types and caching
207
+ - 🎯 **Smart Defaults**: Zero-config development with optional `elit.config.mjs`
208
+ - 📦 **Auto TypeScript**: Automatic TypeScript compilation on all runtimes
209
+ - 🌍 **Environment Variables**: .env file support with VITE_ prefix
210
+ - ⚡ **Cross-Runtime**: Optimized for Node.js, Bun, and Deno with specific adaptations
211
+
212
+ ## Manual Setup
213
+
214
+ If you prefer to set up your project manually:
118
215
 
119
216
  ### 1. Create Your Project
120
217
 
@@ -178,34 +275,6 @@ npx elit dev
178
275
 
179
276
  Your app will automatically reload when you make changes with HMR!
180
277
 
181
- ### NPM Installation
182
-
183
- ```bash
184
- npm install elit
185
- ```
186
-
187
- ```typescript
188
- import { div, h1, p, button, createState, reactive, dom } from 'elit';
189
-
190
- // Create reactive state
191
- const count = createState(0);
192
-
193
- // Create elements with reactive updates
194
- const app = div({ className: 'app' },
195
- h1('Hello Elit! 👋'),
196
- p('A lightweight, reactive DOM library'),
197
- reactive(count, (value) =>
198
- button({
199
- onclick: () => count.value++,
200
- className: 'btn-primary'
201
- }, `Count: ${value}`)
202
- )
203
- );
204
-
205
- // Render to DOM
206
- dom.render('#app', app);
207
- ```
208
-
209
278
  ### CDN Usage
210
279
 
211
280
  ```html
@@ -645,23 +714,62 @@ All MathML elements are prefixed with `math`:
645
714
 
646
715
  ## Bundle Size & Performance
647
716
 
648
- Elit is designed to be extremely lightweight while providing powerful features:
717
+ Elit is designed to be modular and lightweight with excellent tree-shaking support:
718
+
719
+ ### Bundle Sizes (Minified)
720
+
721
+ | Component | ESM | CJS | Description |
722
+ |-----------|-----|-----|-------------|
723
+ | **Full Framework** | 79.52 KB | 80.48 KB | All features included |
724
+ | **DOM Only** | 11.06 KB | 11.07 KB | Just DOM utilities |
725
+ | **State** | 15.34 KB | 15.38 KB | Reactive state management |
726
+ | **Router** | 13.22 KB | 13.22 KB | Client-side routing |
727
+ | **Server** | 51.07 KB | 51.18 KB | Server features + Router |
728
+ | **HTTP** | 7.70 KB | 7.85 KB | HTTP utilities |
729
+ | **CLI** | 127.63 KB | - | Full development toolchain |
730
+
731
+ **Tree-shaking**: Import only what you need! Using modular imports (`elit/dom`, `elit/state`) keeps your bundle minimal.
649
732
 
650
- | Format | Size (Minified) | Size (Gzipped) |
651
- |--------|----------------|----------------|
652
- | ESM | 29KB | ~10KB |
653
- | CJS | 30KB | ~10KB |
654
- | IIFE | 30KB | ~10KB |
733
+ ### Server Performance (Node.js v24.12.0)
655
734
 
656
- **Tree-shaking**: When using ES modules, only the features you import will be included in your bundle.
735
+ | Component | Throughput | Latency (P50) | Latency (Avg) | Description |
736
+ |-----------|-----------|---------------|---------------|-------------|
737
+ | **HTTP Server** | 10,410 req/s | 5.91ms | 6.69ms | Raw HTTP optimized |
738
+ | **ServerRouter** | 10,128 req/s | 6.09ms | 6.94ms | Full routing + middleware |
657
739
 
658
- **Performance Optimizations**:
740
+ **Router Overhead**: Only 2.7% slower than raw HTTP while providing:
741
+ - Route matching with dynamic params
742
+ - Query string parsing
743
+ - Request context
744
+ - Middleware chain support
745
+ - Body parsing
746
+
747
+ ### Cross-Runtime Support
748
+
749
+ Elit works seamlessly on **Node.js, Bun, and Deno** with runtime-specific optimizations:
750
+
751
+ - **Node.js**: Uses native `http` module
752
+ - **Bun**: Ultra-fast `Bun.serve()` with synchronous response detection
753
+ - **Deno**: `Deno.serve()` integration
754
+
755
+ ### Performance Optimizations
756
+
757
+ **Frontend**:
659
758
  - Direct DOM manipulation (no virtual DOM diffing)
660
759
  - Optimized rendering with RAF batching
661
760
  - Smart children rendering with automatic fragment usage
662
761
  - Efficient attribute updates using charCode checks
663
762
  - Minimal function closures and memory allocation
664
763
 
764
+ **Backend**:
765
+ - **Zero-copy headers** for Bun/Deno runtimes
766
+ - **Synchronous response detection** eliminates Promise overhead
767
+ - **String-based body buffering** reduces allocations
768
+ - **Inline Response creation** minimizes object overhead
769
+ - **Pre-compiled route patterns** for fast matching
770
+
771
+ [View detailed benchmarks →](./benchmark)
772
+
665
773
  ## Browser Usage
666
774
 
667
775
  When loaded via script tag, all exports are available on the `window` object:
@@ -843,23 +951,40 @@ const isProd = import.meta.env.PROD;
843
951
 
844
952
  ## Comparison with Other Frameworks
845
953
 
846
- | Feature | Elit | Vite + React | Next.js | SvelteKit |
847
- |---------|----------|--------------|---------|-----------|
848
- | Runtime Size | Lightweight | ~140KB+ | ~200KB+ | ~15KB* |
849
- | Dependencies | Minimal (5) | Many | Many | Many |
850
- | Dev Server | Built-in | Vite | Built-in | Built-in |
851
- | HMR | ✅ | ✅ | ✅ | ✅ |
852
- | Build Tool | ✅ esbuild | ✅ Vite | ✅ Turbopack | ✅ Vite |
853
- | REST API | ✅ Built-in | | ✅ | ✅ |
854
- | Middleware | ✅ Built-in | ❌ | ✅ | ✅ |
855
- | WebSocket | ✅ Built-in | ❌ | | |
856
- | Shared State | ✅ Built-in | ❌ | ❌ | ❌ |
857
- | TypeScript | ✅ | | | |
858
- | SSR | ✅ | ❌ | | ✅ |
859
- | Learning Curve | Easy | Medium | Medium | Easy |
954
+ | Feature | Elit | Vite + React | Next.js | SvelteKit | Express.js |
955
+ |---------|----------|--------------|---------|-----------|------------|
956
+ | **Frontend Size** | 11-15KB (modular) | ~140KB+ | ~200KB+ | ~15KB* | N/A |
957
+ | **Backend Size** | 51KB (Server) | N/A | N/A | N/A | ~200KB+ |
958
+ | **Prod Dependencies** | **0** (Zero!) | Many | Many | Many | Many |
959
+ | **Dev Server** | ✅ Built-in | ✅ Vite | ✅ Built-in | ✅ Built-in | ❌ |
960
+ | **HMR** | ✅ | ✅ | ✅ | ✅ | |
961
+ | **Build Tool** | ✅ esbuild | Vite | ✅ Turbopack | ✅ Vite | ❌ |
962
+ | **REST API** | ✅ 10K+ req/s | ❌ | ✅ | ✅ | ✅ 8K+ req/s |
963
+ | **Middleware** | ✅ Built-in | ❌ | | | ✅ |
964
+ | **WebSocket** | ✅ Built-in | ❌ | ❌ | ❌ | ➕ Via package |
965
+ | **Shared State** | ✅ Auto-sync | | | | ❌ |
966
+ | **Cross-Runtime** | ✅ Node/Bun/Deno | ❌ | | ❌ | Node only |
967
+ | **TypeScript** | ✅ Native | | | | Via setup |
968
+ | **SSR** | ✅ | ❌ | ✅ | ✅ | ➕ Manual |
969
+ | **Tree-Shaking** | ✅ Excellent | ✅ | ✅ | ✅ | ❌ |
970
+ | **Learning Curve** | Easy | Medium | Medium | Easy | Easy |
860
971
 
861
972
  *Svelte requires compilation step
862
973
 
974
+ ### Performance Comparison
975
+
976
+ **Backend (10K requests, 100 concurrent)**:
977
+ - **Elit ServerRouter**: 10,128 req/s (6.94ms avg) on Node.js
978
+ - **Express.js**: ~8,000 req/s (12ms avg) on Node.js
979
+ - **Fastify**: ~12,000 req/s (8ms avg) on Node.js
980
+ - **Elysia (Bun)**: ~100,000 req/s (<1ms avg) on Bun
981
+
982
+ **Frontend Bundle**:
983
+ - **Elit (modular)**: 11KB (DOM) + 15KB (State) = 26KB for typical app
984
+ - **React + React-DOM**: 140KB+ (45KB gzipped)
985
+ - **Vue 3**: 95KB+ (32KB gzipped)
986
+ - **Svelte**: 15KB+ (6KB gzipped) *after compilation*
987
+
863
988
  ## Documentation
864
989
 
865
990
  - 📚 [Full Documentation](https://d-osc.github.io/elit)
@@ -869,30 +994,51 @@ const isProd = import.meta.env.PROD;
869
994
 
870
995
  ## Changelog
871
996
 
872
- ### Elit - Full-Stack Framework
997
+ ### v2.0.0 - Full-Stack Framework with Performance Optimizations
998
+
999
+ **🚀 Backend Performance Enhancements:**
1000
+ - ⚡ **Ultra-Fast HTTP**: 10,410 req/s with sub-7ms latency on Node.js
1001
+ - 🎯 **Optimized ServerRouter**: 10,128 req/s with only 2.7% overhead vs raw HTTP
1002
+ - 🔄 **Synchronous Response Detection**: Eliminates Promise overhead for Bun runtime
1003
+ - 🆓 **Zero-Copy Headers**: Direct headers reference for Bun/Deno runtimes
1004
+ - 📦 **String-Based Body Buffering**: Reduced allocations and faster responses
1005
+ - ⚡ **Cross-Runtime Optimizations**: Runtime-specific code paths for Node.js, Bun, and Deno
1006
+ - 🔧 **Pre-Compiled Routes**: Route patterns compiled once during registration
873
1007
 
874
- **Major Changes:**
875
- - 🚀 **Integrated Build System**: Built-in esbuild with automatic client/server code separation
876
- - 🔥 **CLI Tools**: New commands - `npx elit dev`, `npx elit build`, `npx elit preview`
1008
+ **🏗️ Build System & CLI:**
1009
+ - 🚀 **Integrated Build System**: Built-in esbuild with runtime-specific transpilation
1010
+ - 🔥 **CLI Tools**: `npx elit dev`, `npx elit build`, `npx elit preview`
877
1011
  - 🏗️ **Zero Config**: Works out of the box with optional `elit.config.mjs`
878
- - 🌐 **REST API Router**: Server-side routing with full middleware stack
879
- - 🔄 **Shared State**: Real-time WebSocket state synchronization
880
1012
  - 🎯 **basePath Support**: Configure base paths for subdirectory deployments
881
1013
  - 🔐 **Environment Variables**: .env file support with VITE_ prefix
882
- - 📦 **Gzip Compression**: Automatic compression for production builds
883
- - 💾 **Cache Headers**: Smart caching for static assets
1014
+ - 📦 **Smart Bundling**: Automatic code splitting and tree-shaking
884
1015
  - ⚡ **Hot Module Replacement**: Instant development feedback
885
1016
 
886
- **Core Library:**
887
- - 🎯 Ultra lightweight (~10KB gzipped)
888
- - Reactive state management
889
- - 🎨 CSS-in-JS with CreateStyle
890
- - 🛣️ Client-side router
891
- - 📱 Virtual scrolling
892
- - 🖥️ SSR support
893
- - 🎭 100+ HTML, SVG, and MathML elements
894
- - 🔧 Performance utilities
895
- - 📦 Tree-shakeable ES modules
1017
+ **🌐 Server Features:**
1018
+ - 🌐 **ServerRouter**: High-performance routing with regex pattern matching
1019
+ - 🔧 **Rich Middleware**: CORS, logger, rate limit, compression, security headers
1020
+ - 🔌 **WebSocket Server**: Built-in WebSocket with state synchronization
1021
+ - 🔄 **Shared State**: Real-time auto-sync between server and all clients
1022
+ - 📁 **Static File Server**: Efficient serving with proper MIME types
1023
+ - 💾 **Cache Headers**: Smart caching for static assets
1024
+ - 📦 **Gzip Compression**: Automatic compression for production
1025
+
1026
+ **🎨 Frontend Library:**
1027
+ - 🎯 **Modular Design**: DOM (11KB), State (15KB), Router (13KB) - use only what you need
1028
+ - ⚡ **Reactive State**: Automatic dependency tracking with `createState` and `computed`
1029
+ - 🎨 **CSS-in-JS**: Type-safe styling with `CreateStyle`
1030
+ - 🛣️ **Client Router**: Hash and history mode with navigation guards
1031
+ - 📱 **Virtual Scrolling**: Handle 100k+ items with `createVirtualList`
1032
+ - 🖥️ **SSR Support**: `renderToString` for server-side rendering
1033
+ - 🎭 **100+ Elements**: Complete HTML, SVG, and MathML support
1034
+ - 🔧 **Performance Utilities**: Throttle, debounce, batch rendering
1035
+ - 📦 **Tree-Shakeable**: Excellent ES module tree-shaking
1036
+
1037
+ **📊 Benchmarks:**
1038
+ - HTTP Server: 10,410 req/s (Node.js v24.12.0)
1039
+ - ServerRouter: 10,128 req/s with full routing + middleware
1040
+ - Router Overhead: Only 2.7% vs raw HTTP
1041
+ - [View detailed benchmarks →](./benchmark)
896
1042
 
897
1043
  ## Examples
898
1044
 
@@ -907,7 +1053,8 @@ Example applications demonstrating Elit features:
907
1053
 
908
1054
  ## Links
909
1055
 
910
- - 📦 [npm Package](https://www.npmjs.com/package/elit)
1056
+ - 📦 [npm - elit](https://www.npmjs.com/package/elit)
1057
+ - 🚀 [npm - create-elit](https://www.npmjs.com/package/create-elit)
911
1058
  - 🐙 [GitHub Repository](https://github.com/d-osc/elit)
912
1059
  - 📚 [Documentation](https://d-osc.github.io/elit)
913
1060
  - 💬 Community & Issues: [GitHub Discussions](https://github.com/d-osc/elit/discussions)
package/dist/build.d.mts CHANGED
@@ -1,9 +1,18 @@
1
- import { B as BuildOptions, q as BuildResult } from './types-DOAdFFJB.mjs';
1
+ import { B as BuildOptions, j as BuildResult } from './types-C0nGi6MX.mjs';
2
+ import './http.mjs';
3
+ import 'node:events';
4
+ import './ws.mjs';
5
+ import 'events';
2
6
  import 'http';
3
7
  import 'ws';
4
8
 
5
9
  /**
6
10
  * Build module for bundling applications
11
+ * Pure implementation with cross-runtime support
12
+ * Compatible with standard build tools API
13
+ * - Node.js: uses esbuild
14
+ * - Bun: uses Bun.build
15
+ * - Deno: uses Deno.emit
7
16
  */
8
17
 
9
18
  declare function build(options: BuildOptions): Promise<BuildResult>;
package/dist/build.d.ts CHANGED
@@ -1,9 +1,18 @@
1
- import { B as BuildOptions, q as BuildResult } from './types-DOAdFFJB.js';
1
+ import { B as BuildOptions, j as BuildResult } from './types-Du6kfwTm.js';
2
+ import './http.js';
3
+ import 'node:events';
4
+ import './ws.js';
5
+ import 'events';
2
6
  import 'http';
3
7
  import 'ws';
4
8
 
5
9
  /**
6
10
  * Build module for bundling applications
11
+ * Pure implementation with cross-runtime support
12
+ * Compatible with standard build tools API
13
+ * - Node.js: uses esbuild
14
+ * - Bun: uses Bun.build
15
+ * - Deno: uses Deno.emit
7
16
  */
8
17
 
9
18
  declare function build(options: BuildOptions): Promise<BuildResult>;