@nxtedition/lib 23.14.1 → 23.15.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.14.1",
3
+ "version": "23.15.0",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -13,24 +13,23 @@ const wasmBuffer = readFileSync(wasmPath)
13
13
 
14
14
  initSync({ module: wasmBuffer })
15
15
 
16
- export function makeTemplateCompiler({ logger = globalThis.__nxt_lib_app?.logger, ...args }) {
16
+ const defaultFetchClient = new Agent({
17
+ connections: 128,
18
+ })
19
+
20
+ export function makeTemplateCompiler({
21
+ logger = globalThis.__nxt_lib_app?.logger,
22
+ dispatcher = defaultFetchClient,
23
+ ...args
24
+ }) {
25
+ const defaultOptions = { dispatcher }
17
26
  return commonMakeTemplateCompiler({
18
27
  ...args,
19
28
  logger,
20
29
  platform: {
21
30
  hasha: hashSync,
22
- fetch,
31
+ fetch: (resource, options) =>
32
+ request(resource, options ? { dispatcher, ...options } : defaultOptions),
23
33
  },
24
34
  })
25
35
  }
26
-
27
- const fetchClient = new Agent({
28
- connections: 128,
29
- })
30
-
31
- function fetch(resource, options) {
32
- return request(resource, {
33
- ...options,
34
- dispatcher: fetchClient,
35
- })
36
- }
@@ -453,7 +453,7 @@ export default function ({ ds, proxify, compiler, logger, platform }) {
453
453
  }
454
454
 
455
455
  this._refreshing = true
456
- queueMicrotask(this._refreshImpl)
456
+ setImmediate(this._refreshImpl)
457
457
  }
458
458
 
459
459
  _getEntry(key, Entry, opaque) {