@nxtedition/lib 23.15.2 → 23.15.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/app.js +1 -0
- package/package.json +1 -1
- package/util/template/index-web.js +1 -0
- package/util/template/index.js +4 -7
- package/util/template/javascript.js +3 -1
package/app.js
CHANGED
|
@@ -391,6 +391,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
391
391
|
{
|
|
392
392
|
userAgent,
|
|
393
393
|
url: isProduction ? 'ws://deepstream:6020/deepstream' : 'ws://127.0.0.1:6020/deepstream',
|
|
394
|
+
schedule: (fn) => setImmediate(fn),
|
|
394
395
|
},
|
|
395
396
|
appConfig.deepstream,
|
|
396
397
|
config.deepstream,
|
package/package.json
CHANGED
package/util/template/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs'
|
|
|
3
3
|
import { initSync } from '@swc/wasm-web'
|
|
4
4
|
import { makeTemplateCompiler as commonMakeTemplateCompiler } from './index-common.js'
|
|
5
5
|
import { hashSync } from 'hasha'
|
|
6
|
-
import { request
|
|
6
|
+
import { request } from '@nxtedition/nxt-undici'
|
|
7
7
|
|
|
8
8
|
export * from './index-common.js'
|
|
9
9
|
|
|
@@ -13,13 +13,9 @@ const wasmBuffer = readFileSync(wasmPath)
|
|
|
13
13
|
|
|
14
14
|
initSync({ module: wasmBuffer })
|
|
15
15
|
|
|
16
|
-
const defaultFetchClient = new Agent({
|
|
17
|
-
connections: 128,
|
|
18
|
-
})
|
|
19
|
-
|
|
20
16
|
export function makeTemplateCompiler({
|
|
21
17
|
logger = globalThis.__nxt_lib_app?.logger,
|
|
22
|
-
dispatcher
|
|
18
|
+
dispatcher,
|
|
23
19
|
platform,
|
|
24
20
|
...args
|
|
25
21
|
}) {
|
|
@@ -30,8 +26,9 @@ export function makeTemplateCompiler({
|
|
|
30
26
|
platform: {
|
|
31
27
|
hasha: hashSync,
|
|
32
28
|
fetch: (resource, options) =>
|
|
33
|
-
request(resource, options ? { dispatcher, ...options } : defaultOptions),
|
|
29
|
+
request(resource, options && dispatcher ? { dispatcher, ...options } : defaultOptions),
|
|
34
30
|
...platform,
|
|
31
|
+
schedule: (fn) => setImmediate(fn),
|
|
35
32
|
},
|
|
36
33
|
})
|
|
37
34
|
}
|
|
@@ -223,6 +223,8 @@ function makeWrapper(expression) {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
export default function ({ ds, proxify, compiler, logger, platform }) {
|
|
226
|
+
const schedule = platform?.schedule ?? ((fn) => queueMicrotask(fn))
|
|
227
|
+
|
|
226
228
|
class Expression {
|
|
227
229
|
constructor(script, expression, args, observer) {
|
|
228
230
|
this._expression = expression
|
|
@@ -453,7 +455,7 @@ export default function ({ ds, proxify, compiler, logger, platform }) {
|
|
|
453
455
|
}
|
|
454
456
|
|
|
455
457
|
this._refreshing = true
|
|
456
|
-
|
|
458
|
+
schedule(this._refreshImpl)
|
|
457
459
|
}
|
|
458
460
|
|
|
459
461
|
_getEntry(key, Entry, opaque) {
|