@softwarity/livewire 0.1.1 → 0.2.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 +9 -14
- package/fesm2022/softwarity-livewire.mjs +723 -0
- package/fesm2022/softwarity-livewire.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/live-indicator.component.d.ts +36 -0
- package/lib/live-list.d.ts +36 -0
- package/lib/live-topic.d.ts +51 -0
- package/lib/live-window.datasource.d.ts +122 -0
- package/lib/livewire.client.d.ts +99 -0
- package/{src/lib/provide-livewire.ts → lib/provide-livewire.d.ts} +1 -5
- package/package.json +15 -25
- package/{src/public-api.ts → public-api.d.ts} +1 -13
- package/jest.config.js +0 -11
- package/ng-package.json +0 -6
- package/src/lib/live-indicator.component.ts +0 -118
- package/src/lib/live-list.ts +0 -94
- package/src/lib/live-topic.ts +0 -83
- package/src/lib/live-window.datasource.ts +0 -364
- package/src/lib/livewire.client.ts +0 -215
- package/test/end-to-end.spec.ts +0 -166
- package/test/live-window.datasource.spec.ts +0 -221
- package/test/repaint.spec.ts +0 -226
- package/test/setup.ts +0 -6
- package/tsconfig.json +0 -18
- package/tsconfig.spec.json +0 -5
package/README.md
CHANGED
|
@@ -23,7 +23,6 @@ readonly source = new LiveWindowDataSource<MessageRow>(
|
|
|
23
23
|
(total) => this.total.set(total),
|
|
24
24
|
() => this.messages.resync(),
|
|
25
25
|
100,
|
|
26
|
-
inject(ChangeDetectorRef), // what repaints a zoneless screen - see rule 1
|
|
27
26
|
);
|
|
28
27
|
|
|
29
28
|
constructor() {
|
|
@@ -50,19 +49,15 @@ constructor() {
|
|
|
50
49
|
|
|
51
50
|
Each of these cost a debugging session in the application this came from.
|
|
52
51
|
|
|
53
|
-
**1.
|
|
54
|
-
schedules no change detection at all in a
|
|
55
|
-
right and the screen is wrong.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
injection context, where there is no `ChangeDetectorRef` to inject.
|
|
63
|
-
|
|
64
|
-
`ApplicationRef.tick()` is the third way and the wrong one: it throws when it
|
|
65
|
-
lands inside a cycle already in progress.
|
|
52
|
+
**1. Build the data source in the component that shows the list.** A row
|
|
53
|
+
arriving from a socket callback schedules no change detection at all in a
|
|
54
|
+
zoneless application: the field is right and the screen is wrong. Built in a
|
|
55
|
+
component field, the data source injects that view's `ChangeDetectorRef` and
|
|
56
|
+
calls `markForCheck()` on every publication — which marks the view dirty *and*
|
|
57
|
+
notifies the zoneless scheduler. Built outside an injection context it throws,
|
|
58
|
+
and that is the intended answer: a data source with no view to repaint has
|
|
59
|
+
nobody to answer. (`ApplicationRef.tick()` is the other way and the wrong one:
|
|
60
|
+
it throws when it lands inside a cycle already in progress.)
|
|
66
61
|
|
|
67
62
|
**2. The window size is a constant per screen, never derived from the
|
|
68
63
|
viewport.** Deriving it loops: publish → the viewport re-measures → a new window
|