@nxtedition/lib 23.17.15 → 23.17.17

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/app.js CHANGED
@@ -38,6 +38,7 @@ import { isTimeBetween } from './time.js'
38
38
  import makeUnderPressure from './under-pressure.js'
39
39
  import undici from '@nxtedition/undici'
40
40
  import { isPrimary } from 'node:cluster'
41
+ import { doYield } from './yield.js'
41
42
 
42
43
  export function makeApp(appConfig, onTerminate) {
43
44
  let ds
@@ -397,7 +398,7 @@ export function makeApp(appConfig, onTerminate) {
397
398
  {
398
399
  userAgent,
399
400
  url: isProduction ? 'ws://deepstream:6020/deepstream' : 'ws://127.0.0.1:6020/deepstream',
400
- schedule: (fn) => setImmediate(fn),
401
+ schedule: (fn) => doYield(fn),
401
402
  },
402
403
  appConfig.deepstream,
403
404
  config.deepstream,
package/couch.js CHANGED
@@ -1100,6 +1100,13 @@ export function request(url, opts) {
1100
1100
 
1101
1101
  const ureq = {
1102
1102
  ...opts,
1103
+ dns:
1104
+ opts.dns !== false && opts.dns !== null
1105
+ ? {
1106
+ balance: 'hash',
1107
+ ...opts.dns,
1108
+ }
1109
+ : opts.dns,
1103
1110
  origin,
1104
1111
  path,
1105
1112
  method: opts.method ?? (opts.body ? 'POST' : 'GET'),
package/fixed-queue.js CHANGED
@@ -56,7 +56,7 @@ class FixedCircularBuffer {
56
56
  constructor() {
57
57
  this.bottom = 0
58
58
  this.top = 0
59
- this.list = new Array(kSize)
59
+ this.list = new Array(kSize).fill(undefined)
60
60
  this.next = null
61
61
  }
62
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.17.15",
3
+ "version": "23.17.17",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -65,12 +65,12 @@
65
65
  "singleQuote": true
66
66
  },
67
67
  "dependencies": {
68
- "@aws-sdk/client-s3": "3.670.0",
68
+ "@aws-sdk/client-s3": "3.873.0",
69
69
  "@elastic/elasticsearch": "^8.17.1",
70
70
  "@elastic/transport": "^8.9.3",
71
- "@nxtedition/nxt-undici": "^6.3.4",
72
- "@smithy/node-http-handler": "^4.0.4",
73
- "@swc/wasm-web": "^1.11.22",
71
+ "@nxtedition/nxt-undici": "^6.4.0",
72
+ "@smithy/node-http-handler": "^4.1.1",
73
+ "@swc/wasm-web": "^1.13.5",
74
74
  "date-fns": "^4.1.0",
75
75
  "diff": "5.2.0",
76
76
  "fast-querystring": "^1.1.2",
@@ -83,11 +83,11 @@
83
83
  "mime": "^4.0.7",
84
84
  "mitata": "^1.0.34",
85
85
  "moment-timezone": "^0.5.48",
86
- "nconf": "^0.12.1",
86
+ "nconf": "^0.13.0",
87
87
  "nested-error-stacks": "^2.1.1",
88
88
  "object-hash": "^3.0.0",
89
89
  "p-queue": "^8.0.1",
90
- "pino": "^9.6.0",
90
+ "pino": "^9.9.0",
91
91
  "qs": "^6.14.0",
92
92
  "request-target": "^1.0.2",
93
93
  "smpte-timecode": "^1.3.6",
@@ -97,25 +97,25 @@
97
97
  "yocto-queue": "^1.2.1"
98
98
  },
99
99
  "devDependencies": {
100
- "@nxtedition/deepstream.io-client-js": ">=28.1.15",
101
- "@types/lodash": "^4.17.16",
102
- "@types/node": "^22.15.1",
100
+ "@nxtedition/deepstream.io-client-js": ">=31.0.14",
101
+ "@types/lodash": "^4.17.20",
102
+ "@types/node": "^24.3.0",
103
103
  "canvas": "^3.1.0",
104
- "eslint": "^9.25.1",
105
- "eslint-config-prettier": "^10.1.2",
104
+ "eslint": "^9.34.0",
105
+ "eslint-config-prettier": "^10.1.8",
106
106
  "eslint-config-standard": "^17.0.0",
107
- "eslint-plugin-import": "^2.31.0",
108
- "eslint-plugin-n": "^17.17.0",
107
+ "eslint-plugin-import": "^2.32.0",
108
+ "eslint-plugin-n": "^17.21.3",
109
109
  "eslint-plugin-node": "^11.1.0",
110
110
  "eslint-plugin-promise": "^7.2.1",
111
111
  "husky": "^9.1.7",
112
- "lint-staged": "^15.5.1",
112
+ "lint-staged": "^16.1.5",
113
113
  "pinst": "^3.0.0",
114
- "prettier": "^3.5.3",
114
+ "prettier": "^3.6.2",
115
115
  "rxjs": "^7.8.2",
116
116
  "send": "^1.1.0",
117
117
  "tap": "^21.1.0",
118
- "typescript-eslint": "^8.31.0"
118
+ "typescript-eslint": "^8.40.0"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@elastic/elasticsearch": "^8.6.0",
@@ -4,6 +4,7 @@ import { initSync } from '@swc/wasm-web'
4
4
  import { makeTemplateCompiler as commonMakeTemplateCompiler } from './index-common.js'
5
5
  import { hashSync } from 'hasha'
6
6
  import { request } from '@nxtedition/nxt-undici'
7
+ import { doYield } from '../../yield.js'
7
8
 
8
9
  export * from './index-common.js'
9
10
 
@@ -28,7 +29,7 @@ export function makeTemplateCompiler({
28
29
  fetch: (resource, options) =>
29
30
  request(resource, options && dispatcher ? { dispatcher, ...options } : defaultOptions),
30
31
  ...platform,
31
- schedule: (fn) => setImmediate(fn),
32
+ schedule: (fn) => doYield(fn),
32
33
  },
33
34
  })
34
35
  }
package/yield.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { FixedQueue } from './fixed-queue.js'
2
2
 
3
- const yieldQueue = new FixedQueue()
4
3
  const yieldSchedule = globalThis.setImmediate ?? ((fn) => setTimeout(fn, 0))
5
4
 
5
+ let yieldQueue = new FixedQueue()
6
6
  let yieldTimeout = 40
7
7
  let yieldActive = false
8
8
  let yieldScheduled = false
@@ -62,8 +62,11 @@ function dispatchYield() {
62
62
  yieldTime = performance.now()
63
63
  yieldActive = false
64
64
 
65
- while (!yieldQueue.isEmpty()) {
66
- const resolve = yieldQueue.shift()
65
+ const queue = yieldQueue
66
+ yieldQueue = new FixedQueue()
67
+
68
+ while (!queue.isEmpty()) {
69
+ const resolve = queue.shift()
67
70
 
68
71
  resolve(null)
69
72
 
@@ -73,5 +76,9 @@ function dispatchYield() {
73
76
  }
74
77
  }
75
78
 
76
- yieldScheduled = false
79
+ if (yieldQueue.isEmpty()) {
80
+ yieldScheduled = false
81
+ } else {
82
+ yieldSchedule(dispatchYield)
83
+ }
77
84
  }