@loadbare/app 0.7.3 → 0.8.0

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 (37) hide show
  1. package/dist/build/assemble.d.ts.map +1 -1
  2. package/dist/build/assemble.js +67 -6
  3. package/dist/build/assemble.js.map +1 -1
  4. package/dist/core/lb-constants.d.ts +2 -2
  5. package/dist/core/lb-constants.d.ts.map +1 -1
  6. package/dist/core/lb-constants.js +28 -14
  7. package/dist/core/lb-constants.js.map +1 -1
  8. package/dist/core/lb-types.d.ts +4 -10
  9. package/dist/core/lb-types.d.ts.map +1 -1
  10. package/dist/core/lb-types.js.map +1 -1
  11. package/dist/hub/lb-apply.d.ts +2 -2
  12. package/dist/hub/lb-apply.d.ts.map +1 -1
  13. package/dist/hub/lb-apply.js +98 -8
  14. package/dist/hub/lb-apply.js.map +1 -1
  15. package/dist/hub/lb-hub.browser.d.ts.map +1 -1
  16. package/dist/hub/lb-hub.browser.js +61 -26
  17. package/dist/hub/lb-hub.browser.js.map +1 -1
  18. package/dist/server/lb-express.d.ts.map +1 -1
  19. package/dist/server/lb-express.js +2 -7
  20. package/dist/server/lb-express.js.map +1 -1
  21. package/dist/server/lb-server.d.ts +8 -15
  22. package/dist/server/lb-server.d.ts.map +1 -1
  23. package/dist/server/lb-server.js +0 -3
  24. package/dist/server/lb-server.js.map +1 -1
  25. package/docs/TECHREF-1.0.md +141 -100
  26. package/docs/analysis-closed-set.md +210 -0
  27. package/docs/comparison.md +1124 -0
  28. package/docs/prior-art.md +216 -0
  29. package/docs/reference/custom-elements.md +21 -6
  30. package/docs/reference/data-binding.md +120 -40
  31. package/docs/reference/page-files.md +13 -9
  32. package/docs/reference/widgets.md +2 -2
  33. package/docs/roadmap.md +1 -1
  34. package/docs/testing.md +7 -1
  35. package/docs/theory.md +737 -408
  36. package/docs/tutorials/080-widget-requests.md +9 -28
  37. package/package.json +1 -1
@@ -37,7 +37,7 @@ class NoteInput extends HTMLElement {
37
37
  this.dispatchEvent(
38
38
  new CustomEvent(LB_EVENT_NAME, {
39
39
  bubbles: true,
40
- detail: { action: "lb-cell-change", value: input.value },
40
+ detail: { action: "lb-row-update", value: input.value },
41
41
  }),
42
42
  );
43
43
  });
@@ -49,9 +49,9 @@ customElements.define("note-input", NoteInput);
49
49
 
50
50
  A widget with both a `.html` and a `.browser.ts` file shares one tag name; the
51
51
  build finds each half independently. On change, it dispatches a
52
- `lb-cell-change` carrying the input's value. The hub adds the list, the key
53
- of the row it is in and its own `lb-cell`, the same way it does for a
54
- `lb-row-update` form.
52
+ `lb-row-update` carrying the input's value. The hub adds the list and the key
53
+ of the row it is in, and turns the value into a `values` map holding only
54
+ the widget's own `lb-cell`.
55
55
 
56
56
  ## Using it
57
57
 
@@ -72,30 +72,11 @@ every change, so there's nothing left to batch.
72
72
 
73
73
  ## Answering it server-side
74
74
 
75
- ```ts
76
- // src/pages/about.requests.ts
77
- import { patch } from "@loadbare/app/server";
78
-
79
- export const requests = {
80
- // ...onPageEnter and actions unchanged...
81
- crud: {
82
- notes: {
83
- // ...rowInsert, rowDelete, rowUpdate unchanged...
84
- cellChange: {
85
- run: async (ctx, { key, value }) => {
86
- const note = await ctx.db.updateNote(key, value);
87
- return { notes: patch({ rows: [note] }) };
88
- },
89
- refresh: [],
90
- },
91
- },
92
- },
93
- };
94
- ```
95
-
96
- `cellChange` reuses `updateNote` from [Updating a List Item](./076-updating-a-list-item.md)
97
- — the database doesn't care whether the edit came from a form's values
98
- map or one widget's value.
75
+ There is nothing to add. The request is the same `lb-row-update` the form
76
+ sent in [Updating a List Item](./076-updating-a-list-item.md), with `values`
77
+ holding only `text`, so the `rowUpdate` written there answers it unchanged.
78
+ A `rowUpdate` sets the columns `values` names and leaves the rest alone, as
79
+ an SQL `UPDATE` does, so one handler serves a form and a widget alike.
99
80
 
100
81
  ## Run it
101
82
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loadbare/app",
3
3
  "description": "High performance web app framework for server-bound applications",
4
- "version": "0.7.3",
4
+ "version": "0.8.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",