teamplay 0.4.0-alpha.89 → 0.4.0-alpha.90
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.90",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
"license": "MIT",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "12533f048e5ff251867b559532e3ae43900a4eee"
|
|
87
87
|
}
|
|
@@ -15,7 +15,7 @@ class RenderAttemptDestroyer {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
getDestructor () {
|
|
18
|
-
if (!this.compatArmed
|
|
18
|
+
if (!this.compatArmed) {
|
|
19
19
|
this.reset()
|
|
20
20
|
return undefined
|
|
21
21
|
}
|
|
@@ -23,6 +23,7 @@ class RenderAttemptDestroyer {
|
|
|
23
23
|
const fns = [...this.fns]
|
|
24
24
|
this.reset()
|
|
25
25
|
return async () => {
|
|
26
|
+
if (fns.length === 0) return
|
|
26
27
|
await Promise.allSettled(fns.map(fn => fn()))
|
|
27
28
|
fns.length = 0
|
|
28
29
|
}
|
package/react/trapRender.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import executionContextTracker from './executionContextTracker.js'
|
|
4
4
|
import * as promiseBatcher from './promiseBatcher.js'
|
|
5
5
|
import renderAttemptDestroyer from './renderAttemptDestroyer.js'
|
|
6
|
-
import { isCompatComponent } from './compatComponentRegistry.js'
|
|
7
6
|
|
|
8
7
|
export default function trapRender ({ render, cache, destroy, componentId }) {
|
|
9
8
|
return (...args) => {
|
|
@@ -26,7 +25,7 @@ export default function trapRender ({ render, cache, destroy, componentId }) {
|
|
|
26
25
|
throw err
|
|
27
26
|
}
|
|
28
27
|
const destroyAttempt = renderAttemptDestroyer.getDestructor()
|
|
29
|
-
if (destroyAttempt
|
|
28
|
+
if (destroyAttempt) {
|
|
30
29
|
throw Promise.resolve(err).then(() => destroyAttempt?.())
|
|
31
30
|
}
|
|
32
31
|
|
package/react/useSuspendMemo.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import executionContextTracker from './executionContextTracker.js'
|
|
2
2
|
import { useCache, useId } from './helpers.js'
|
|
3
3
|
import { markCompatComponent } from './compatComponentRegistry.js'
|
|
4
|
+
import renderAttemptDestroyer from './renderAttemptDestroyer.js'
|
|
4
5
|
|
|
5
6
|
const IN_FLIGHT_BY_KEY = new Map()
|
|
6
7
|
|
|
@@ -27,6 +28,7 @@ export default function useSuspendMemo (factory, deps) {
|
|
|
27
28
|
if (entry.status === 'done') return entry.value
|
|
28
29
|
if (entry.status === 'pending') {
|
|
29
30
|
markCompatComponent(componentId)
|
|
31
|
+
renderAttemptDestroyer.armCompat()
|
|
30
32
|
throw entry.promise
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -45,6 +47,7 @@ export default function useSuspendMemo (factory, deps) {
|
|
|
45
47
|
entry.status = 'pending'
|
|
46
48
|
entry.promise = promise
|
|
47
49
|
markCompatComponent(componentId)
|
|
50
|
+
renderAttemptDestroyer.armCompat()
|
|
48
51
|
throw promise
|
|
49
52
|
}
|
|
50
53
|
}
|