teamplay 0.5.0-alpha.7 → 0.5.0-alpha.9

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.
@@ -22,9 +22,6 @@ import { arrayInsertPrivateData, arrayMovePrivateData, arrayPopPrivateData, arra
22
22
  class SignalCompat extends Signal {
23
23
  static ID_FIELDS = ['_id', 'id'];
24
24
  static [GETTERS] = [...DEFAULT_GETTERS, 'getCopy', 'getDeepCopy'];
25
- get root() {
26
- return getRoot(this) || this;
27
- }
28
25
  path() {
29
26
  if (arguments.length > 0)
30
27
  throw Error('Signal.path() does not accept any arguments');
@@ -29,6 +29,8 @@ export declare class Signal<TValue = unknown> extends Function {
29
29
  toString(): string;
30
30
  /** Customize Object.prototype.toString.call($signal) for debugging. */
31
31
  get [Symbol.toStringTag](): string;
32
+ /** Return the owning root signal. */
33
+ root(): this | import("./Root.js").RootSignalRuntime;
32
34
  /**
33
35
  * Return the parent signal `levels` above this signal.
34
36
  * @param levels Number of parent levels to walk upward. Defaults to `1`.
@@ -147,6 +147,12 @@ export class Signal extends Function {
147
147
  get [Symbol.toStringTag]() {
148
148
  return 'Signal';
149
149
  }
150
+ /** Return the owning root signal. */
151
+ root() {
152
+ if (arguments.length > 0)
153
+ throw Error('Signal.root() does not accept any arguments');
154
+ return getRoot(this) || this;
155
+ }
150
156
  /**
151
157
  * Return the parent signal `levels` above this signal.
152
158
  * @param levels Number of parent levels to walk upward. Defaults to `1`.
@@ -94,8 +94,6 @@ function getDefaultProxyHandlers({ useExtremelyLateBindings } = {}) {
94
94
  return undefined;
95
95
  }
96
96
  }
97
- if (key === 'root')
98
- return Reflect.get(signal, key, receiver);
99
97
  return baseHandlers.get
100
98
  ? baseHandlers.get(signal, key, receiver)
101
99
  : Reflect.get(signal, key, receiver);
@@ -2,4 +2,4 @@ export const SEGMENTS = Symbol('path segments targeting the particular node in t
2
2
  export const ARRAY_METHOD = Symbol('run array method on the signal');
3
3
  export const GET = Symbol('get the value of the signal - either observed or raw');
4
4
  export const GETTERS = Symbol('get the list of this signal\'s getters');
5
- export const DEFAULT_GETTERS = ['path', 'id', 'get', 'peek', 'getId', 'map', 'reduce', 'find', 'getIds', 'getExtra', 'getCollection'];
5
+ export const DEFAULT_GETTERS = ['path', 'root', 'id', 'get', 'peek', 'getId', 'map', 'reduce', 'find', 'getIds', 'getExtra', 'getCollection'];
package/dist/server.d.ts CHANGED
@@ -8,4 +8,4 @@ export function initConnection(backend: any, { fetchOnly, publicOnly, ...options
8
8
  wss: any;
9
9
  };
10
10
  export default createBackend;
11
- export { mongo, mongoClient, createMongoIndex, redis, redlock, sqlite } from "@teamplay/backend";
11
+ export { mongo, mongoClient, createMongoIndex, redis, redlock, sqlite, getRedis } from "@teamplay/backend";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamplay",
3
- "version": "0.5.0-alpha.7",
3
+ "version": "0.5.0-alpha.9",
4
4
  "description": "Full-stack signals ORM with multiplayer",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "@nx-js/observer-util": "^4.1.3",
71
71
  "@startupjs/sharedb-mingo-memory": "^4.0.0-2",
72
- "@teamplay/backend": "^0.5.0-alpha.7",
72
+ "@teamplay/backend": "^0.5.0-alpha.9",
73
73
  "@teamplay/cache": "^0.5.0-alpha.7",
74
74
  "@teamplay/channel": "^0.5.0-alpha.7",
75
75
  "@teamplay/debug": "^0.5.0-alpha.7",
@@ -82,7 +82,7 @@
82
82
  "localforage": "^1.10.0",
83
83
  "lodash": "^4.17.20",
84
84
  "pluralize": "^8.0.0",
85
- "sharedb": "^5.0.0",
85
+ "sharedb": "5.2.2",
86
86
  "stream": "npm:readable-stream@^4.7.0"
87
87
  },
88
88
  "devDependencies": {
@@ -134,5 +134,5 @@
134
134
  ]
135
135
  },
136
136
  "license": "MIT",
137
- "gitHead": "a854bf3447232cd732ec55e6a3faf57b094e99d1"
137
+ "gitHead": "4c2afb22bb1b803e7598d641dd566f2dc97dffa3"
138
138
  }