@inglorious/web 4.0.8 → 4.0.10

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 (2) hide show
  1. package/README.md +114 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -32,8 +32,8 @@ Unlike modern frameworks that invent their own languages or rely on signals, pro
32
32
  - **Zero Component State**
33
33
  All state lives in the store — never inside components.
34
34
 
35
- - **No Signals, No Subscriptions, No Memory Leaks**
36
- Because every render is triggered by the store, and lit-html handles the rest.
35
+ - **No Signals, No Subscriptions, No Framework-Level Memory Leaks**
36
+ Because every render is triggered by the store, and lit-html handles the rest — no subscription cleanup needed.
37
37
 
38
38
  - **No compilation required**
39
39
  Apps can run directly in the browser — no build/compile step is strictly necessary (though you may use bundlers or Vite for convenience in larger projects).
@@ -60,6 +60,8 @@ Use the scaffolder to create a starter app tailored to your workflow.
60
60
 
61
61
  ### ✨ **Inglorious Web re-renders the whole template tree on each state change.**
62
62
 
63
+ **Important:** The DOM itself is not re-created. Only the template function reruns, and lit-html's efficient diffing updates just the changed DOM nodes.
64
+
63
65
  Thanks to lit-html's optimized diffing, this is fast, predictable, and surprisingly efficient.
64
66
 
65
67
  This means:
@@ -93,9 +95,16 @@ This framework is ideal for both small apps and large business UIs.
93
95
 
94
96
  ## When NOT to Use Inglorious Web
95
97
 
96
- - You need fine-grained reactivity for very large datasets (1000+ items per view)
97
- - You're building a library that needs to be framework-agnostic
98
- - Your team is already deeply invested in React/Vue/Angular
98
+ - You're frequently mutating thousands of items without virtualization (though our `list` component handles this elegantly)
99
+ - You need framework-agnostic components for users who might not use Inglorious (use Web Components instead)
100
+ - Your team is already deeply invested in React/Vue/Angular and migration costs outweigh benefits
101
+
102
+ ## When Inglorious Web EXCELS
103
+
104
+ - Building **internal component libraries** - Types are more customizable than React components
105
+ - Creating **design systems** - Spread, override, and compose behaviors freely
106
+ - Building **pattern libraries** - Ship pre-configured entity types that users can adapt
107
+ - Apps where **predictable state flow** matters more than ecosystem size
99
108
 
100
109
  ---
101
110
 
@@ -141,7 +150,23 @@ This makes it especially suitable for:
141
150
 
142
151
  ## Comparison with Other Frameworks
143
152
 
144
- Here's how @inglorious/web compares to the major players:
153
+ ### TL;DR Quick Comparison
154
+
155
+ | Framework | Reactivity | Build Transform | Runtime Compiler | Component State | Bundle Size | Learning Curve |
156
+ | -------------- | -------------- | ---------------- | ---------------- | --------------- | ----------- | -------------- |
157
+ | Inglorious Web | Event-based | None required | No | No (store only) | Tiny | Very Low |
158
+ | React | VDOM diffing | JSX + optional\* | No | Yes | Large | Medium/High |
159
+ | Vue | Proxy-based | SFC (optional) | Available | Yes | Medium | Medium |
160
+ | Svelte | Compiler magic | Required | No | Yes | Small | Medium |
161
+ | SolidJS | Fine signals | JSX only | No | No (runs once) | Tiny | Medium/High |
162
+ | Qwik | Resumable | Required | No | Yes | Small | Very High |
163
+
164
+ \*React Compiler (stable 2024+) provides automatic memoization
165
+
166
+ <details>
167
+ <summary><strong>Click to expand detailed framework comparisons</strong></summary>
168
+
169
+ Here's how @inglorious/web compares to the major players in detail:
145
170
 
146
171
  ---
147
172
 
@@ -220,6 +245,8 @@ Inglorious Web is minimal, predictable, and tiny.
220
245
 
221
246
  Inglorious Web is closer philosophically to **HTMX** and **vanilla JS**, but with a declarative rendering model and entity-based state.
222
247
 
248
+ </details>
249
+
223
250
  ---
224
251
 
225
252
  ## Why Choose Inglorious Web
@@ -231,7 +258,7 @@ Inglorious Web is closer philosophically to **HTMX** and **vanilla JS**, but wit
231
258
  - One render path, no hidden rules
232
259
  - No reactivity graphs
233
260
  - No per-component subscriptions
234
- - No memory leaks
261
+ - No framework-level memory leaks
235
262
  - No build step required (apps can run in the browser)
236
263
  - Works perfectly in hybrid UI/game engine contexts
237
264
  - Uses native ES modules and standards
@@ -1281,6 +1308,86 @@ See `src/list.js` in the package for the implementation details and the `example
1281
1308
 
1282
1309
  ---
1283
1310
 
1311
+ ## Building Component Libraries with Inglorious Web
1312
+
1313
+ **Inglorious types are uniquely suited for component libraries** because they're fully customizable through JavaScript's spread operator.
1314
+
1315
+ ### The Pattern
1316
+
1317
+ **Library publishes types:**
1318
+
1319
+ ```javascript
1320
+ // @acme/design-system/table.js
1321
+ export const table = {
1322
+ render(entity, api) {
1323
+ const type = api.getType(entity.type)
1324
+
1325
+ return html`
1326
+ <table>
1327
+ ${entity.data.map((row) => type.renderRow(entity, row, api))}
1328
+ </table>
1329
+ `
1330
+ },
1331
+
1332
+ renderRow(entity, row, api) {
1333
+ return html`<tr>
1334
+ ${row.name}
1335
+ </tr>`
1336
+ },
1337
+
1338
+ rowClick(entity, row) {
1339
+ entity.selectedRow = row
1340
+ },
1341
+ }
1342
+ ```
1343
+
1344
+ **Users customize freely:**
1345
+
1346
+ ```javascript
1347
+ import { table } from "@acme/design-system/table"
1348
+
1349
+ // Use as-is
1350
+ const simpleTable = { ...table }
1351
+
1352
+ // Override methods
1353
+ const customTable = {
1354
+ ...table,
1355
+ renderRow(entity, row, api) {
1356
+ return html`<tr class="custom">
1357
+ ${row.name} - ${row.email}
1358
+ </tr>`
1359
+ },
1360
+ }
1361
+
1362
+ // Compose with behaviors
1363
+ import { sortable, exportable } from "@acme/design-system/behaviors"
1364
+
1365
+ const advancedTable = [
1366
+ table,
1367
+ sortable,
1368
+ exportable,
1369
+ {
1370
+ rowClick(entity, row) {
1371
+ console.log("Custom click handler", row)
1372
+ },
1373
+ },
1374
+ ]
1375
+ ```
1376
+
1377
+ ### Why This Is Better Than React Components
1378
+
1379
+ | Feature | React Components | Inglorious Types |
1380
+ | -------------------------- | ------------------------------ | ----------------------------------------- |
1381
+ | Customize rendering | Only if `render` prop exposed | Override `render()` method directly |
1382
+ | Customize behavior | Only if callback props exposed | Override any method |
1383
+ | Compose multiple libraries | Wrapper hell / HOCs | Array composition `[type1, type2, {...}]` |
1384
+ | Access internals | Private - must fork | Public - spread and override |
1385
+ | Type safety | Props interface | Entity schema + method signatures |
1386
+
1387
+ **Users get complete control** without forking your library. They can override rendering, behavior, or both—down to individual methods.
1388
+
1389
+ ---
1390
+
1284
1391
  ## Using Third-Party Web Components
1285
1392
 
1286
1393
  Inglorious Web works seamlessly with any Web Component library, such as Shoelace, Material Web Components, or Lion. Thanks to lit-html's efficient diffing algorithm, Web Components maintain their internal state even when the full tree re-renders - the component only updates when its properties change.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/web",
3
- "version": "4.0.8",
3
+ "version": "4.0.10",
4
4
  "description": "A new web framework that leverages the power of the Inglorious Store combined with the performance and simplicity of lit-html.",
5
5
  "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",