teamplay 0.4.0-alpha.5 → 0.4.0-alpha.7
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/orm/Compat/modelEvents.js +2 -4
- package/orm/Signal.js +2 -5
- package/orm/compatEnv.js +4 -0
- package/orm/getSignal.js +10 -1
- package/package.json +2 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getRefLinks } from './refRegistry.js'
|
|
2
|
+
import { isCompatEnv } from '../compatEnv.js'
|
|
2
3
|
|
|
3
4
|
const modelListeners = {
|
|
4
5
|
change: new Map(),
|
|
@@ -6,10 +7,7 @@ const modelListeners = {
|
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export function isModelEventsEnabled () {
|
|
9
|
-
return (
|
|
10
|
-
globalThis?.teamplayCompatibilityMode ??
|
|
11
|
-
(typeof process !== 'undefined' && process?.env?.TEAMPLAY_COMPAT === '1')
|
|
12
|
-
)
|
|
10
|
+
return isCompatEnv()
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export function normalizePattern (pattern, methodName) {
|
package/orm/Signal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Signal } from './SignalBase.js'
|
|
2
2
|
import SignalCompat from './Compat/SignalCompat.js'
|
|
3
|
+
import { isCompatEnv } from './compatEnv.js'
|
|
3
4
|
|
|
4
5
|
export {
|
|
5
6
|
Signal,
|
|
@@ -18,8 +19,4 @@ export {
|
|
|
18
19
|
|
|
19
20
|
export { SignalCompat }
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
globalThis?.teamplayCompatibilityMode ??
|
|
23
|
-
(typeof process !== 'undefined' && process?.env?.TEAMPLAY_COMPAT === '1')
|
|
24
|
-
|
|
25
|
-
export default compatEnv ? SignalCompat : Signal
|
|
22
|
+
export default isCompatEnv() ? SignalCompat : Signal
|
package/orm/compatEnv.js
ADDED
package/orm/getSignal.js
CHANGED
|
@@ -5,6 +5,7 @@ import { LOCAL } from './$.js'
|
|
|
5
5
|
import { ROOT, ROOT_ID, GLOBAL_ROOT_ID } from './Root.js'
|
|
6
6
|
import { QUERIES } from './Query.js'
|
|
7
7
|
import { AGGREGATIONS } from './Aggregation.js'
|
|
8
|
+
import { isCompatEnv } from './compatEnv.js'
|
|
8
9
|
|
|
9
10
|
const PROXIES_CACHE = new Cache()
|
|
10
11
|
const PROXY_TO_SIGNAL = new WeakMap()
|
|
@@ -69,7 +70,15 @@ export default function getSignal ($root, segments = [], {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
function getDefaultProxyHandlers ({ useExtremelyLateBindings } = {}) {
|
|
72
|
-
|
|
73
|
+
const baseHandlers = useExtremelyLateBindings ? extremelyLateBindings : regularBindings
|
|
74
|
+
if (!isCompatEnv() || baseHandlers !== extremelyLateBindings) return baseHandlers
|
|
75
|
+
return {
|
|
76
|
+
...baseHandlers,
|
|
77
|
+
get (signal, key, receiver) {
|
|
78
|
+
if (key === 'root') return Reflect.get(signal, key, receiver)
|
|
79
|
+
return baseHandlers.get(signal, key, receiver)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
function hashSegments (segments, rootId) {
|
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.7",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -80,6 +80,5 @@
|
|
|
80
80
|
"<rootDir>/test_client/helpers"
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"license": "MIT"
|
|
84
|
-
"gitHead": "93822e92cb6810848482286b41a14c47bfda8393"
|
|
83
|
+
"license": "MIT"
|
|
85
84
|
}
|