@nxtedition/deepstream.io-client-js 25.6.1 → 25.6.3
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/eslint.config.mjs +80 -0
- package/package.json +9 -32
- package/src/event/event-handler.js +1 -1
- package/src/message/connection.js +2 -2
- package/src/record/record.js +4 -2
- package/src/utils/utils.js +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import eslint from '@eslint/js'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
import eslintConfigPrettier from 'eslint-config-prettier'
|
|
4
|
+
import eslintPluginImport from 'eslint-plugin-import'
|
|
5
|
+
import eslintPluginN from 'eslint-plugin-n'
|
|
6
|
+
import eslintPluginPromise from 'eslint-plugin-promise'
|
|
7
|
+
import typescriptEslintParser from '@typescript-eslint/parser'
|
|
8
|
+
import globals from 'globals'
|
|
9
|
+
|
|
10
|
+
const reactFiles = [
|
|
11
|
+
'app/src/renderer/**/*{js,ts,tsx}',
|
|
12
|
+
'hub/src/client/**/*.{js,ts,tsx}',
|
|
13
|
+
'hub/.storybook/**/*.{js,ts,tsx}',
|
|
14
|
+
'plugins/adobe/**/*{js,ts,tsx}',
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
export default tseslint.config(
|
|
18
|
+
eslint.configs.recommended,
|
|
19
|
+
...tseslint.configs.recommended,
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
ignores: [
|
|
23
|
+
'tmp*',
|
|
24
|
+
'benchmarks/**/*',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
// Base config:
|
|
29
|
+
{
|
|
30
|
+
plugins: {
|
|
31
|
+
import: eslintPluginImport,
|
|
32
|
+
promise: eslintPluginPromise,
|
|
33
|
+
},
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parser: typescriptEslintParser,
|
|
36
|
+
parserOptions: {
|
|
37
|
+
tsconfigRootDir: import.meta.dirname,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
'prefer-const': [
|
|
42
|
+
'error',
|
|
43
|
+
{
|
|
44
|
+
destructuring: 'all',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
'no-empty': ['error', { allowEmptyCatch: true }],
|
|
48
|
+
'no-constant-condition': ['error', { checkLoops: false }],
|
|
49
|
+
'@typescript-eslint/no-unused-vars': [
|
|
50
|
+
'error',
|
|
51
|
+
{
|
|
52
|
+
args: 'none',
|
|
53
|
+
ignoreRestSiblings: true,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
'getter-return': 'off',
|
|
57
|
+
'object-shorthand': ['warn', 'properties'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// Node specific
|
|
62
|
+
{
|
|
63
|
+
ignores: [...reactFiles],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
globals: {
|
|
66
|
+
...globals.node,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
plugins: {
|
|
70
|
+
n: eslintPluginN,
|
|
71
|
+
},
|
|
72
|
+
rules: {
|
|
73
|
+
'no-redeclare': 'warn',
|
|
74
|
+
'require-yield': 'off',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// Prettier:
|
|
79
|
+
eslintConfigPrettier
|
|
80
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/deepstream.io-client-js",
|
|
3
|
-
"version": "25.6.
|
|
3
|
+
"version": "25.6.3",
|
|
4
4
|
"description": "the javascript client for deepstream.io",
|
|
5
5
|
"homepage": "http://deepstream.io",
|
|
6
6
|
"type": "module",
|
|
@@ -33,31 +33,6 @@
|
|
|
33
33
|
"semi": false,
|
|
34
34
|
"singleQuote": true
|
|
35
35
|
},
|
|
36
|
-
"eslintConfig": {
|
|
37
|
-
"parserOptions": {
|
|
38
|
-
"ecmaFeatures": {
|
|
39
|
-
"ecmaVersion": 2020
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"extends": [
|
|
43
|
-
"standard",
|
|
44
|
-
"prettier",
|
|
45
|
-
"prettier/prettier"
|
|
46
|
-
],
|
|
47
|
-
"rules": {
|
|
48
|
-
"quotes": [
|
|
49
|
-
"error",
|
|
50
|
-
"single",
|
|
51
|
-
{
|
|
52
|
-
"avoidEscape": true,
|
|
53
|
-
"allowTemplateLiterals": true
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"eslintIgnore": [
|
|
59
|
-
"/__tests__"
|
|
60
|
-
],
|
|
61
36
|
"dependencies": {
|
|
62
37
|
"@nxtedition/json-path": "^1.0.8",
|
|
63
38
|
"bufferutil": "^4.0.8",
|
|
@@ -71,19 +46,21 @@
|
|
|
71
46
|
"xxhash-wasm": "^1.0.2"
|
|
72
47
|
},
|
|
73
48
|
"devDependencies": {
|
|
74
|
-
"eslint": "^
|
|
49
|
+
"eslint": "^9.9.0",
|
|
75
50
|
"eslint-config-prettier": "^9.1.0",
|
|
76
51
|
"eslint-config-standard": "^17.1.0",
|
|
77
52
|
"eslint-plugin-import": "^2.29.1",
|
|
78
|
-
"eslint-plugin-n": "^17.10.
|
|
53
|
+
"eslint-plugin-n": "^17.10.2",
|
|
79
54
|
"eslint-plugin-node": "^11.1.0",
|
|
80
|
-
"eslint-plugin-promise": "^7.
|
|
81
|
-
"husky": "^9.1.
|
|
82
|
-
"lint-staged": "^15.2.
|
|
55
|
+
"eslint-plugin-promise": "^7.1.0",
|
|
56
|
+
"husky": "^9.1.4",
|
|
57
|
+
"lint-staged": "^15.2.8",
|
|
83
58
|
"mitata": "^0.1.11",
|
|
84
59
|
"pinst": "^3.0.0",
|
|
85
60
|
"prettier": "^3.3.3",
|
|
86
|
-
"rxjs": "^7.8.1"
|
|
61
|
+
"rxjs": "^7.8.1",
|
|
62
|
+
"typescript": "^5.5.4",
|
|
63
|
+
"typescript-eslint": "^8.0.1"
|
|
87
64
|
},
|
|
88
65
|
"peerDependencies": {
|
|
89
66
|
"rxjs": ">=6.x"
|
|
@@ -79,7 +79,7 @@ EventHandler.on = function (name, callback) {
|
|
|
79
79
|
EventHandler.once = function (name, callback) {
|
|
80
80
|
const fn = (...args) => {
|
|
81
81
|
this.unsubscribe(fn)
|
|
82
|
-
callback(...args)
|
|
82
|
+
callback(...args)
|
|
83
83
|
}
|
|
84
84
|
this.subscribe(name, fn)
|
|
85
85
|
return this
|
|
@@ -4,6 +4,7 @@ import * as messageBuilder from './message-builder.js'
|
|
|
4
4
|
import * as C from '../constants/constants.js'
|
|
5
5
|
import FixedQueue from '../utils/fixed-queue.js'
|
|
6
6
|
import Emitter from 'component-emitter2'
|
|
7
|
+
import pkg from '../../package.json' with { type: 'json' }
|
|
7
8
|
|
|
8
9
|
const NodeWebSocket = utils.isNode ? await import('ws').then((x) => x.default) : null
|
|
9
10
|
const BrowserWebSocket = globalThis.WebSocket || globalThis.MozWebSocket
|
|
@@ -166,7 +167,7 @@ Connection.prototype._sendAuthParams = function () {
|
|
|
166
167
|
this._setState(C.CONNECTION_STATE.AUTHENTICATING)
|
|
167
168
|
const authMessage = messageBuilder.getMsg(C.TOPIC.AUTH, C.ACTIONS.REQUEST, [
|
|
168
169
|
this._authParams,
|
|
169
|
-
|
|
170
|
+
pkg.version,
|
|
170
171
|
utils.isNode
|
|
171
172
|
? `Node/${process.version}`
|
|
172
173
|
: globalThis.navigator && globalThis.navigator.userAgent,
|
|
@@ -227,7 +228,6 @@ Connection.prototype._onMessage = function (data) {
|
|
|
227
228
|
Connection.prototype._recvMessages = function (deadline) {
|
|
228
229
|
for (
|
|
229
230
|
let n = 0;
|
|
230
|
-
// eslint-disable-next-line no-unmodified-loop-condition
|
|
231
231
|
deadline ? deadline.didTimeout || deadline.timeRemaining() : n < this._batchSize;
|
|
232
232
|
++n
|
|
233
233
|
) {
|
package/src/record/record.js
CHANGED
|
@@ -389,7 +389,7 @@ class Record {
|
|
|
389
389
|
this._version = nextVersion
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
_onUpdate([, version, data]) {
|
|
392
|
+
_onUpdate([, version, data, hasProvider]) {
|
|
393
393
|
const prevData = this._data
|
|
394
394
|
const prevVersion = this._version
|
|
395
395
|
const prevState = this._state
|
|
@@ -422,7 +422,9 @@ class Record {
|
|
|
422
422
|
this._onPatching(false)
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
if (
|
|
425
|
+
if (hasProvider === 'T') {
|
|
426
|
+
this._state = C.RECORD_STATE.PROVIDER
|
|
427
|
+
} else if (this._state < C.RECORD_STATE.SERVER) {
|
|
426
428
|
this._state = this._version.charAt(0) === 'I' ? C.RECORD_STATE.STALE : C.RECORD_STATE.SERVER
|
|
427
429
|
}
|
|
428
430
|
|
package/src/utils/utils.js
CHANGED
|
@@ -129,7 +129,7 @@ function defaultSchedule(fn) {
|
|
|
129
129
|
setTimeout(fn, 0)
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
export const schedule = isNode ? defaultSchedule :
|
|
132
|
+
export const schedule = isNode ? defaultSchedule : globalThis.requestIdleCallback
|
|
133
133
|
|
|
134
134
|
const abortSignals = new WeakMap()
|
|
135
135
|
const onAbort = function () {
|