@inglorious/web 4.0.5 → 4.0.6

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 (3) hide show
  1. package/LICENSE +9 -9
  2. package/README.md +85 -0
  3. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2025 Inglorious Coderz Srl.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2025 Inglorious Coderz Srl.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -940,6 +940,91 @@ See `src/list.js` in the package for the implementation details and the `example
940
940
 
941
941
  ---
942
942
 
943
+ ## Using Third-Party Web Components
944
+
945
+ 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.
946
+
947
+ ### ⚠️ SSG/SSR Considerations
948
+
949
+ **Inglorious Web's built-in components** (`table`, `list`, `select`, `form`) are fully compatible with [@inglorious/ssx](https://npmjs.com/package/@inglorious/ssx) for static site generation. They render to complete HTML at build time and hydrate seamlessly on the client.
950
+
951
+ **Third-party Web Components** currently have limited SSR/SSG support. Most Web Component libraries (including Shoelace and Material Web Components) require client-side JavaScript to initialize and render, which means:
952
+
953
+ - They won't appear in the pre-rendered HTML
954
+ - They're not SEO-friendly in their initial state
955
+ - They may cause FOUC (Flash of Unstyled Content)
956
+ - They should be treated as client-only enhancements
957
+
958
+ **Recommendation for SSX projects:**
959
+
960
+ - Use Inglorious Web components for content that needs to be pre-rendered (product listings, blog posts, documentation)
961
+ - Use Web Components for interactive, client-only features (color pickers, rich text editors, admin tools)
962
+
963
+ **Use Inglorious Web's built-in components when:**
964
+
965
+ ✅ You want full architectural consistency
966
+ ✅ You need fine-grained control over behavior
967
+ ✅ You want to compose behaviors via type composition
968
+ ✅ You need time-travel debugging of component state
969
+ ✅ You want minimal bundle size
970
+ ✅ You're building a core pattern used throughout your app
971
+ ✅ You want the simplest possible tests
972
+ ✅ You need custom behavior that third-party components don't provide
973
+ ✅ You're using SSX for static site generation
974
+
975
+ **Use Web Components (like Shoelace) when:**
976
+
977
+ ✅ You need complex, battle-tested UI (date pickers, rich text editors)
978
+ ✅ You want a comprehensive design system out of the box
979
+ ✅ Speed of development matters more than architectural purity
980
+ ✅ You need features you don't want to build yourself (color pickers, tree views)
981
+ ✅ The component is isolated or used infrequently
982
+ ✅ You're okay with some state living outside the store
983
+ ✅ You're building a client-only application (not using SSX)
984
+
985
+ ### Example: Hybrid Approach
986
+
987
+ ```javascript
988
+ import { table } from "@inglorious/web/table"
989
+ import "@shoelace-style/shoelace/dist/components/color-picker/color-picker.js"
990
+
991
+ const types = {
992
+ // Inglorious Web component - full store integration
993
+ productTable: {
994
+ ...table,
995
+ data: products,
996
+ columns: [
997
+ { id: "name", label: "Product Name" },
998
+ { id: "price", label: "Price" },
999
+ ],
1000
+ },
1001
+
1002
+ // Web Component - for specialized UI
1003
+ themeEditor: {
1004
+ colorChange(entity, color) {
1005
+ entity.primaryColor = color
1006
+ },
1007
+
1008
+ render(entity, api) {
1009
+ return html`
1010
+ <div>
1011
+ <label>Primary Color</label>
1012
+ <sl-color-picker
1013
+ value=${entity.primaryColor}
1014
+ @sl-change=${(e) =>
1015
+ api.notify("#themeEditor:colorChange", e.target.value)}
1016
+ ></sl-color-picker>
1017
+ </div>
1018
+ `
1019
+ },
1020
+ },
1021
+ }
1022
+ ```
1023
+
1024
+ This hybrid approach gives you the best of both worlds: architectural consistency for core patterns, and battle-tested components for complex UI.
1025
+
1026
+ ---
1027
+
943
1028
  ## API Reference
944
1029
 
945
1030
  **`mount(store, renderFn, element)`**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/web",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
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",