teamplay 0.0.1 → 0.1.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/CHANGELOG.md +9 -0
- package/README.md +3 -1
- package/package.json +9 -8
- package/react/helpers.js +2 -2
- package/react/wrapIntoSuspense.js +2 -2
- package/utils/isServer.js +17 -0
- package/utils/useIsomorphicLayoutEffect.js +4 -0
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TeamPlay
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Full-stack signals ORM with multiplayer
|
|
4
4
|
|
|
5
5
|
Features:
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ Features:
|
|
|
9
9
|
- ORM
|
|
10
10
|
- auto-sync data from client to DB and vice-versa __***__
|
|
11
11
|
- query DB directly from client __***__
|
|
12
|
+
- works in pure JS, on server (Node.js) and integrates with React
|
|
12
13
|
|
|
13
14
|
> __*__ deep signals -- with support for objects and arrays\
|
|
14
15
|
> __**__ concurrent changes to the same data are auto-merged using [OT](https://en.wikipedia.org/wiki/Operational_transformation)\
|
|
@@ -40,6 +41,7 @@ server.on('upgrade', upgrade) // Node's 'http' server instance
|
|
|
40
41
|
## Usage
|
|
41
42
|
|
|
42
43
|
TBD
|
|
44
|
+
...
|
|
43
45
|
|
|
44
46
|
## Examples
|
|
45
47
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|
|
9
9
|
"./connect": "./connect/index.js",
|
|
10
10
|
"./server": "./server.js",
|
|
11
|
-
"./connect-test": "./connect/test.js"
|
|
11
|
+
"./connect-test": "./connect/test.js",
|
|
12
|
+
"./cache": "./cache.js"
|
|
12
13
|
},
|
|
13
14
|
"publishConfig": {
|
|
14
15
|
"access": "public"
|
|
@@ -21,10 +22,9 @@
|
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"@nx-js/observer-util": "^4.1.3",
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@startupjs/utils": "^0.56.0-alpha.64",
|
|
25
|
+
"@teamplay/cache": "^0.1.1",
|
|
26
|
+
"@teamplay/channel": "^0.1.1",
|
|
27
|
+
"@teamplay/debug": "^0.1.1",
|
|
28
28
|
"diff-match-patch": "^1.0.5",
|
|
29
29
|
"json0-ot-diff": "^1.1.2",
|
|
30
30
|
"lodash": "^4.17.20",
|
|
@@ -56,5 +56,6 @@
|
|
|
56
56
|
"<rootDir>/test_client/helpers"
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
|
-
"license": "MIT"
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"gitHead": "92d813418e21743183fa0f0dc85a235b34eead2f"
|
|
60
61
|
}
|
package/react/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useContext, createContext } from 'react'
|
|
2
|
-
import { CACHE_ACTIVE, getDummyCache } from '@
|
|
3
|
-
import useIsomorphicLayoutEffect from '
|
|
2
|
+
import { CACHE_ACTIVE, getDummyCache } from '@teamplay/cache'
|
|
3
|
+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js'
|
|
4
4
|
|
|
5
5
|
export const ComponentMetaContext = createContext({})
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, forwardRef as _forwardRef, memo, createElement as el, Suspense } from 'react'
|
|
2
|
-
import { createCaches } from '@
|
|
3
|
-
import { __increment, __decrement } from '@
|
|
2
|
+
import { createCaches } from '@teamplay/cache'
|
|
3
|
+
import { __increment, __decrement } from '@teamplay/debug'
|
|
4
4
|
import { pipeComponentMeta, pipeComponentDisplayName, ComponentMetaContext, useUnmount } from './helpers.js'
|
|
5
5
|
|
|
6
6
|
export default function wrapIntoSuspense (
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let isServer = checkIsServer()
|
|
2
|
+
|
|
3
|
+
function checkIsServer () {
|
|
4
|
+
if (typeof process === 'object' && process.__mockBrowser) {
|
|
5
|
+
return false
|
|
6
|
+
} else if (typeof Deno !== 'undefined' && Deno?.version?.deno) { // eslint-disable-line no-undef
|
|
7
|
+
return true
|
|
8
|
+
} else if (typeof process === 'object' && process.versions && process.versions.node) {
|
|
9
|
+
return true
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function setIsServer (value) {
|
|
14
|
+
isServer = value
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default isServer
|