@absolutejs/absolute 0.20.0-beta.91 → 0.20.0-beta.93

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/changelog.json +41 -0
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/build/buildWorker.js +10 -1
  6. package/dist/build.js +16 -7
  7. package/dist/build.js.map +9 -8
  8. package/dist/cli/{compile-5hchbcbd.js → compile-wkfd88w7.js} +5 -5
  9. package/dist/cli/{dev-aykeaa7b.js → dev-01zcxngn.js} +83 -11
  10. package/dist/cli/{expoDevController-tr63cg78.js → expoDevController-k15hftqn.js} +25 -1
  11. package/dist/cli/expoNativeWatcher-rmc95bak.js +138 -0
  12. package/dist/cli/{expoProject-dac8fqhq.js → expoProject-mmm3s62b.js} +1 -1
  13. package/dist/cli/{index-fn44wefq.js → index-3sdvzrv2.js} +37 -28
  14. package/dist/cli/index-bw4ktfnz.js +11 -0
  15. package/dist/cli/{index-jqdt7841.js → index-kh44yx23.js} +1 -1
  16. package/dist/cli/{index-39j0dhq7.js → index-v5knwk7v.js} +1 -1
  17. package/dist/cli/{index-tame6e2c.js → index-wqhbxtyp.js} +49 -12
  18. package/dist/cli/index.js +5 -5
  19. package/dist/cli/{mobile-bg1jy34n.js → mobile-pbe1a667.js} +20 -12
  20. package/dist/cli/{remoteMacProtocol-vw931n0a.js → remoteMacProtocol-kqvkp0qd.js} +2 -1
  21. package/dist/cli/{start-7jg0csqy.js → start-dw5crgp7.js} +3 -3
  22. package/dist/dev/client/handlers/svelte.ts +11 -15
  23. package/dist/dev/serverBootstrap.js +10 -1
  24. package/dist/index.js +17 -8
  25. package/dist/index.js.map +11 -10
  26. package/dist/mobile/index.js +371 -162
  27. package/dist/mobile/index.js.map +10 -8
  28. package/dist/mobile/mobilePreviewClient.ts +1 -1
  29. package/dist/mobile/remoteMacAgentEntry.js +105 -68
  30. package/dist/src/dev/clientManager.d.ts +2 -2
  31. package/dist/src/mobile/androidConformance.d.ts +4 -1
  32. package/dist/src/mobile/expoDevController.d.ts +2 -6
  33. package/dist/src/mobile/expoNativeObservability.d.ts +1 -1
  34. package/dist/src/mobile/expoNativeWatcher.d.ts +21 -0
  35. package/dist/src/mobile/index.d.ts +1 -0
  36. package/dist/src/mobile/remoteMacProtocol.d.ts +1 -4
  37. package/dist/src/utils/unrefTimer.d.ts +5 -0
  38. package/package.json +5 -2
@@ -998,6 +998,27 @@ public final class AbsoluteMobileObservabilityModule: Module, MXMetricManagerSub
998
998
  }
999
999
  }
1000
1000
  }
1001
+
1002
+ #if DEBUG
1003
+ AsyncFunction("enqueueForTesting") { (options: [String: String]) -> Bool in
1004
+ guard let testId = options["testId"],
1005
+ testId.range(of: "^[A-Za-z0-9._:-]{1,128}$", options: .regularExpression) != nil else { return false }
1006
+ let key = "absolute-native-observability-test-id"
1007
+ guard UserDefaults.standard.string(forKey: key) != testId else { return false }
1008
+ UserDefaults.standard.set(testId, forKey: key)
1009
+ Self.queue.sync {
1010
+ Self.enqueue(
1011
+ kind: "crash",
1012
+ occurredAt: Date().timeIntervalSince1970 * 1000,
1013
+ details: [
1014
+ "message": "token=mobile-observability-secret",
1015
+ "source": "absolutejs-conformance"
1016
+ ]
1017
+ )
1018
+ }
1019
+ return true
1020
+ }
1021
+ #endif
1001
1022
  }
1002
1023
 
1003
1024
  private static func root() -> URL? {
@@ -1281,6 +1302,7 @@ import { ABSOLUTE_MOBILE_MANIFEST } from './webAssets';
1281
1302
  type NativeObservabilityModule = {
1282
1303
  acknowledge(options: { ids: string[] }): Promise<void>;
1283
1304
  crashForTesting(options: { testId: string }): Promise<boolean>;
1305
+ enqueueForTesting(options: { testId: string }): Promise<boolean>;
1284
1306
  pending(): Promise<{ reports: unknown[] }>;
1285
1307
  };
1286
1308
  type NativeReport = { details: Record<string, unknown>; id: string; kind: string; occurredAt: number; platform: 'android' | 'ios' };
@@ -1342,6 +1364,12 @@ export const startAbsoluteExpoNativeObservability = () => {
1342
1364
  return drain();
1343
1365
  };
1344
1366
  export const crashAbsoluteExpoNativeObservabilityForTesting = (testId: string) => native.crashForTesting({ testId });
1367
+ export const enqueueAbsoluteExpoNativeObservabilityForTesting = async (testId: string) => {
1368
+ await drain();
1369
+ const enqueued = await native.enqueueForTesting({ testId });
1370
+ await drain();
1371
+ return enqueued;
1372
+ };
1345
1373
  `;
1346
1374
  var absoluteExpoNativeObservabilityFiles = (project) => new Map([
1347
1375
  [
@@ -1465,7 +1493,7 @@ var packageDependencies = (plan) => Object.fromEntries(plan.requiredPackages.map
1465
1493
  var expoPackage = (auth, sync, devices, updates) => ({
1466
1494
  dependencies: {
1467
1495
  "@absolutejs/devices": "0.7.0",
1468
- "@absolutejs/devices-expo": "0.0.2",
1496
+ "@absolutejs/devices-expo": "0.0.3",
1469
1497
  ...auth ? {
1470
1498
  "@absolutejs/auth": ABSOLUTE_EXPO_AUTH_CORE_VERSION,
1471
1499
  [ABSOLUTE_EXPO_AUTH_PACKAGE]: ABSOLUTE_EXPO_AUTH_VERSION
@@ -2072,7 +2100,7 @@ var webHostSource = (config, auth, sync) => {
2072
2100
  const nativeRoutePatterns = nativeRoutes.map((route) => route.split("/").filter(Boolean));
2073
2101
  return `${EXPO_GENERATED_HEADER}import * as Linking from 'expo-linking';
2074
2102
  import { router, usePathname } from 'expo-router';
2075
- import { useEffect, useRef, useState } from 'react';
2103
+ import { useEffect, useMemo, useRef, useState } from 'react';
2076
2104
  import { ActivityIndicator, BackHandler, Platform, StyleSheet, View } from 'react-native';
2077
2105
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
2078
2106
  import { WebView, type WebViewMessageEvent } from 'react-native-webview';
@@ -2227,17 +2255,21 @@ const authStatus = async () => {
2227
2255
  return { principal: principal ? { namespace: principal.namespace } : null, user };` : "throw new Error('Expo Auth is not configured.');"}
2228
2256
  };
2229
2257
 
2230
- export function AbsoluteWebHost() {
2231
- const pathname = usePathname() || '/';
2258
+ export type AbsoluteWebHostProps = { path?: string };
2259
+
2260
+ export function AbsoluteWebHost({ path }: AbsoluteWebHostProps = {}) {
2261
+ const routerPathname = usePathname() || '/';
2262
+ const pathname = path?.startsWith('/') && !path.startsWith('//') ? path : routerPathname;
2232
2263
  const safeAreaInsets = useSafeAreaInsets();
2233
2264
  const webView = useRef<WebView>(null);
2234
2265
  const devicesBridge = useRef<{ close(): void | Promise<void>; request(method: string, params: Record<string, unknown>): Promise<unknown> } | undefined>(undefined);
2235
2266
  const syncBridge = useRef<{ close(): void | Promise<void>; request(method: string, params: Record<string, unknown>): Promise<unknown> } | undefined>(undefined);
2236
2267
  const [indexUri, setIndexUri] = useState<string>();
2237
- const [canGoBack, setCanGoBack] = useState(false);
2268
+ const canGoBack = useRef(false);
2238
2269
  const [runtimeReady, setRuntimeReady] = useState(!AUTH_ENABLED && !SYNC_ENABLED);
2239
2270
  const [devicesReady, setDevicesReady] = useState(false);
2240
2271
  const activeWebPath = useRef(pathname);
2272
+ const webSource = useMemo(() => indexUri ? { uri: indexUri } : undefined, [indexUri]);
2241
2273
 
2242
2274
  useEffect(() => {
2243
2275
  if (!AUTH_ENABLED && !SYNC_ENABLED) return;
@@ -2295,7 +2327,7 @@ export function AbsoluteWebHost() {
2295
2327
  if (!active) return;
2296
2328
  respond({ event, format: BRIDGE_FORMAT, kind: 'event', path: activeWebPath.current, payload });
2297
2329
  }).then(host => {
2298
- if (!active) return void host.close();
2330
+ if (!active) return void Promise.resolve(host.close()).catch(() => undefined);
2299
2331
  devicesBridge.current = host;
2300
2332
  setDevicesReady(true);
2301
2333
  });
@@ -2303,7 +2335,7 @@ export function AbsoluteWebHost() {
2303
2335
  active = false;
2304
2336
  const host = devicesBridge.current;
2305
2337
  devicesBridge.current = undefined;
2306
- void host?.close();
2338
+ if (host) void Promise.resolve(host.close()).catch(() => undefined);
2307
2339
  };
2308
2340
  }, []);
2309
2341
  const hasOrigin = (source: string, origin: string) => {
@@ -2323,7 +2355,7 @@ export function AbsoluteWebHost() {
2323
2355
  return;
2324
2356
  }
2325
2357
  if (message.kind === 'event' && message.event === 'back-unhandled') {
2326
- if (canGoBack) webView.current?.goBack();
2358
+ if (canGoBack.current) webView.current?.goBack();
2327
2359
  else BackHandler.exitApp();
2328
2360
  return;
2329
2361
  }
@@ -2357,22 +2389,27 @@ export function AbsoluteWebHost() {
2357
2389
  }
2358
2390
  };
2359
2391
 
2360
- if (!indexUri || !runtimeReady || !devicesReady) return <View style={styles.loading}><ActivityIndicator /></View>;
2392
+ if (!webSource || !runtimeReady || !devicesReady) return <View style={styles.loading}><ActivityIndicator /></View>;
2361
2393
  return <WebView
2362
2394
  allowFileAccess
2363
2395
  allowFileAccessFromFileURLs
2364
2396
  allowUniversalAccessFromFileURLs={false}
2365
- allowingReadAccessToURL={indexUri.slice(0, indexUri.lastIndexOf('/') + 1)}
2397
+ allowingReadAccessToURL={webSource.uri.slice(0, webSource.uri.lastIndexOf('/') + 1)}
2366
2398
  injectedJavaScriptBeforeContentLoaded={bridgeBootstrap(pathname, safeAreaInsets)}
2367
2399
  onMessage={onMessage}
2368
- onNavigationStateChange={state => setCanGoBack(state.canGoBack)}
2400
+ onNavigationStateChange={state => {
2401
+ canGoBack.current = state.canGoBack;
2402
+ if (!DEV_ORIGIN || !hasOrigin(state.url, DEV_ORIGIN)) return;
2403
+ const route = new URL(state.url);
2404
+ activeWebPath.current = route.pathname + route.search + route.hash;
2405
+ }}
2369
2406
  onShouldStartLoadWithRequest={request => {
2370
2407
  if (request.url.startsWith('file:') || hasOrigin(request.url, PRODUCTION_ORIGIN) || DEV_ORIGIN && hasOrigin(request.url, DEV_ORIGIN)) return true;
2371
2408
  void Linking.openURL(request.url);
2372
2409
  return false;
2373
2410
  }}
2374
2411
  ref={webView}
2375
- source={{ uri: indexUri }}
2412
+ source={webSource}
2376
2413
  style={styles.web}
2377
2414
  />;
2378
2415
  }
package/dist/cli/index.js CHANGED
@@ -58,7 +58,7 @@ if (command === "dev") {
58
58
  }
59
59
  const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
60
60
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
61
- const { dev } = await import("./dev-aykeaa7b.js");
61
+ const { dev } = await import("./dev-01zcxngn.js");
62
62
  await dev(serverEntry, configPath, {
63
63
  androidDevice,
64
64
  eager: args.includes("--eager"),
@@ -71,7 +71,7 @@ if (command === "dev") {
71
71
  const configPath = parseNamedArg("--config");
72
72
  const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
73
73
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
74
- const { start } = await import("./start-7jg0csqy.js");
74
+ const { start } = await import("./start-dw5crgp7.js");
75
75
  await start(serverEntry, outdir, configPath, {
76
76
  prebuilt: args.includes("--prebuilt")
77
77
  });
@@ -81,7 +81,7 @@ if (command === "dev") {
81
81
  const configPath = parseNamedArg("--config");
82
82
  const positionalArgs = stripNamedArgs("--outdir", "--config");
83
83
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
84
- const { start } = await import("./start-7jg0csqy.js");
84
+ const { start } = await import("./start-dw5crgp7.js");
85
85
  await start(serverEntry, outdir, configPath, { prepareOnly: true });
86
86
  } else if (command === "build") {
87
87
  sendTelemetryEvent("cli:command", { command });
@@ -197,13 +197,13 @@ if (command === "dev") {
197
197
  const configPath = parseNamedArg("--config");
198
198
  const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
199
199
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
200
- const { compile } = await import("./compile-5hchbcbd.js");
200
+ const { compile } = await import("./compile-wkfd88w7.js");
201
201
  await compile(serverEntry, outdir, outfile, configPath);
202
202
  } else if (command === "mobile") {
203
203
  sendTelemetryEvent("cli:command", {
204
204
  command: `mobile:${workspaceCommand ?? "unknown"}`
205
205
  });
206
- const { runMobile } = await import("./mobile-bg1jy34n.js");
206
+ const { runMobile } = await import("./mobile-pbe1a667.js");
207
207
  try {
208
208
  await runMobile(args);
209
209
  } catch (error) {
@@ -1,18 +1,18 @@
1
1
  // @bun
2
- import {
3
- installPackages
4
- } from "./index-zh6hhrwy.js";
5
2
  import {
6
3
  formatBytes
7
4
  } from "./index-9r7n9dqp.js";
5
+ import {
6
+ installPackages
7
+ } from "./index-zh6hhrwy.js";
8
8
  import {
9
9
  start
10
- } from "./index-39j0dhq7.js";
10
+ } from "./index-v5knwk7v.js";
11
11
  import {
12
12
  ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT,
13
13
  ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
14
14
  resolveAbsoluteMobileRoute
15
- } from "./index-jqdt7841.js";
15
+ } from "./index-kh44yx23.js";
16
16
  import"./index-bzs19w3r.js";
17
17
  import"./index-s2tazax7.js";
18
18
  import {
@@ -30,7 +30,7 @@ import {
30
30
  listAbsoluteRemoteMacProfiles,
31
31
  pairAbsoluteRemoteMac,
32
32
  removeAbsoluteRemoteMacProfile
33
- } from "./index-fn44wefq.js";
33
+ } from "./index-3sdvzrv2.js";
34
34
  import {
35
35
  ABSOLUTE_IOS_SIMULATOR_NAME,
36
36
  parseIosSimulators,
@@ -46,6 +46,7 @@ import {
46
46
  import {
47
47
  loadConfig
48
48
  } from "./index-06cmrcdq.js";
49
+ import"./index-bw4ktfnz.js";
49
50
  import {
50
51
  sendTelemetryEvent
51
52
  } from "./index-9kwmb3c0.js";
@@ -66,7 +67,7 @@ import {
66
67
  syncAbsoluteExpoWebAssets,
67
68
  unsignedAbsoluteMobileUpdate,
68
69
  writeAbsoluteExpoProject
69
- } from "./index-tame6e2c.js";
70
+ } from "./index-wqhbxtyp.js";
70
71
  import {
71
72
  normalizeAbsoluteIosDeviceIdentifier
72
73
  } from "./index-j66p8hn5.js";
@@ -19046,20 +19047,26 @@ var normalizeRoute = (route) => {
19046
19047
  }
19047
19048
  return value;
19048
19049
  };
19049
- var absoluteAndroidDevelopmentUrl = (port, route, https = false) => {
19050
+ var absoluteAndroidDevelopmentUrl = (port, route, https = false, target = "capacitor-android") => {
19050
19051
  if (!Number.isInteger(port) || port < 1 || port > 65535) {
19051
19052
  throw new TypeError("Android conformance requires a valid dev port.");
19052
19053
  }
19053
19054
  const url = new URL(`${https ? "https" : "http"}://localhost:${port}${normalizeRoute(route)}`);
19054
- url.searchParams.set("__absolute_target", "capacitor-android");
19055
+ url.searchParams.set("__absolute_target", target);
19055
19056
  return url.href;
19056
19057
  };
19057
19058
  var inspectAbsoluteAndroidRoute = async (session, options) => {
19058
19059
  const route = normalizeRoute(options.route);
19059
- await session.navigate(absoluteAndroidDevelopmentUrl(options.port, route, options.https));
19060
+ const url = absoluteAndroidDevelopmentUrl(options.port, route, options.https, options.target);
19061
+ if (options.navigation === "in-page")
19062
+ await session.evaluate(`location.assign(${JSON.stringify(url)})`);
19063
+ else if (options.navigation !== "none")
19064
+ await session.navigate(url);
19065
+ const target = options.target ?? "capacitor-android";
19066
+ const { origin } = new URL(url);
19060
19067
  const result = await session.waitFor(`(() => {
19061
19068
  const value = ${routeExpression};
19062
- return value.bodyText.length > 0 && value.hmrConnected && value.nativeTarget === 'capacitor-android' ? value : null;
19069
+ return value.bodyText.length > 0 && value.hmrConnected && value.nativeTarget === ${JSON.stringify(target)} && new URL(value.url).origin === ${JSON.stringify(origin)} && new URL(value.url).pathname === ${JSON.stringify(route)} ? value : null;
19063
19070
  })()`, { timeoutMs: options.timeoutMs ?? DEFAULT_ROUTE_TIMEOUT_MS });
19064
19071
  const check = { ...result, route };
19065
19072
  if (check.overlayVisible) {
@@ -19070,6 +19077,7 @@ var inspectAbsoluteAndroidRoute = async (session, options) => {
19070
19077
  var waitForAbsoluteAndroidHmrApply = async (session, options) => {
19071
19078
  const expectedKind = JSON.stringify(options.kind);
19072
19079
  const afterUpdateId = JSON.stringify(options.afterUpdateId);
19080
+ const target = JSON.stringify(options.target ?? "capacitor-android");
19073
19081
  const apply = await session.waitFor(`(() => {
19074
19082
  const applies = window.__ABS_HMR_APPLIES__ ?? [];
19075
19083
  const values = applies.length > 0
@@ -19077,7 +19085,7 @@ var waitForAbsoluteAndroidHmrApply = async (session, options) => {
19077
19085
  : [window.__ABS_HMR_LAST_APPLY__];
19078
19086
  for (let index = values.length - 1; index >= 0; index -= 1) {
19079
19087
  const value = values[index];
19080
- if (!value || value.target !== 'capacitor-android') continue;
19088
+ if (!value || value.target !== ${target}) continue;
19081
19089
  if (${expectedKind} !== undefined && value.kind !== ${expectedKind}) continue;
19082
19090
  if (${afterUpdateId} !== undefined && !(value.updateId > ${afterUpdateId})) continue;
19083
19091
  return value;
@@ -26,8 +26,9 @@ import {
26
26
  syncAbsoluteRemoteMacReleaseInputs,
27
27
  validateAbsoluteRemoteMacProfileName,
28
28
  validateAbsoluteSshDestination
29
- } from "./index-fn44wefq.js";
29
+ } from "./index-3sdvzrv2.js";
30
30
  import"./index-qxnptvwn.js";
31
+ import"./index-bw4ktfnz.js";
31
32
  import"./index-knt92dm8.js";
32
33
  import"./index-t84wxk1p.js";
33
34
  import"./index-wtfnv3n2.js";
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  start
4
- } from "./index-39j0dhq7.js";
5
- import"./index-jqdt7841.js";
4
+ } from "./index-v5knwk7v.js";
5
+ import"./index-kh44yx23.js";
6
6
  import"./index-bzs19w3r.js";
7
7
  import"./index-s2tazax7.js";
8
8
  import"./index-fc9vxw56.js";
@@ -11,7 +11,7 @@ import"./index-06cmrcdq.js";
11
11
  import"./index-9kwmb3c0.js";
12
12
  import"./index-w5vswatm.js";
13
13
  import"./index-rd2hbttb.js";
14
- import"./index-tame6e2c.js";
14
+ import"./index-wqhbxtyp.js";
15
15
  import"./index-ar4gz15x.js";
16
16
  import"./index-t84wxk1p.js";
17
17
  import"./index-wtfnv3n2.js";
@@ -273,32 +273,28 @@ export const handleSvelteUpdate = (message: {
273
273
  }
274
274
 
275
275
  import(modulePath)
276
- .then((newModule) => {
276
+ .then(async (newModule) => {
277
277
  let applied = false;
278
278
  if (acceptFn) {
279
279
  acceptFn(newModule);
280
280
  applied = true;
281
281
  }
282
282
 
283
- /* $.hmr_accept swaps component code in place but re-runs
284
- * the <script> body with the original mount props, so any
285
- * state seeded from a prop (e.g. a composable doing
286
- * $state(initialCount)) resets. Remount with the preserved
287
- * state merged into props — mirroring the bundled-fallback
288
- * bootstrap — so that state carries across (issue #41). */
283
+ /* Let the compiler-owned $.hmr wrapper finish its queued state
284
+ * restoration before applying the prop-backed remount fallback. An
285
+ * immediate remount can race that restoration and reset rune state. */
289
286
  const preserved = window.__HMR_PRESERVED_STATE__;
290
287
  const remount = window.__SVELTE_REMOUNT__;
291
288
  const hasPreserved =
292
289
  preserved && Object.keys(preserved).length > 0;
293
290
 
294
- if (applied) {
295
- if (typeof remount === 'function' && hasPreserved) {
296
- remount({
297
- ...(window.__INITIAL_PROPS__ ?? {}),
298
- ...preserved
299
- });
300
- }
301
- } else if (typeof remount === 'function') {
291
+ if (applied) await Promise.resolve();
292
+ if (applied && typeof remount === 'function' && hasPreserved) {
293
+ remount({
294
+ ...(window.__INITIAL_PROPS__ ?? {}),
295
+ ...preserved
296
+ });
297
+ } else if (!applied && typeof remount === 'function') {
302
298
  /* Resilience fallback: no accept callback was found, so
303
299
  * `$.hmr` never wired the freshly imported module in. The
304
300
  * import warmed the module cache; remount the page with
@@ -23,6 +23,15 @@ var init_constants = __esm(() => {
23
23
  TWO_THIRDS = 2 / 3;
24
24
  });
25
25
 
26
+ // src/utils/unrefTimer.ts
27
+ var unrefTimer = (timer) => {
28
+ if (timer === null || typeof timer !== "object" && typeof timer !== "function")
29
+ return;
30
+ const unref = Reflect.get(timer, "unref");
31
+ if (typeof unref === "function")
32
+ Reflect.apply(unref, timer, []);
33
+ };
34
+
26
35
  // src/dev/bootLifecycle.ts
27
36
  var getBootPhase = () => globalThis.__absoluteBootPhase;
28
37
  var init_bootLifecycle = __esm(() => {
@@ -190,7 +199,7 @@ setTimeout(poll,${POLL_INTERVAL_MS});
190
199
  if (attempts >= BIND_RETRY_LIMIT)
191
200
  return;
192
201
  retryTimer = setTimeout(tryBind, BIND_RETRY_INTERVAL_MS);
193
- retryTimer.unref();
202
+ unrefTimer(retryTimer);
194
203
  } finally {
195
204
  bindingPlaceholder = false;
196
205
  }
package/dist/index.js CHANGED
@@ -10477,6 +10477,15 @@ var init_logger = __esm(() => {
10477
10477
  };
10478
10478
  });
10479
10479
 
10480
+ // src/utils/unrefTimer.ts
10481
+ var unrefTimer = (timer) => {
10482
+ if (timer === null || typeof timer !== "object" && typeof timer !== "function")
10483
+ return;
10484
+ const unref = Reflect.get(timer, "unref");
10485
+ if (typeof unref === "function")
10486
+ Reflect.apply(unref, timer, []);
10487
+ };
10488
+
10480
10489
  // src/dev/bootLifecycle.ts
10481
10490
  var DEFERRED_TASK_FALLBACK_SECONDS = 15, setBootPhase = (phase) => {
10482
10491
  globalThis.__absoluteBootPhase = phase;
@@ -10495,8 +10504,7 @@ var DEFERRED_TASK_FALLBACK_SECONDS = 15, setBootPhase = (phase) => {
10495
10504
  globalThis.__absoluteDeferredBootTasks = queue;
10496
10505
  queue.push(task);
10497
10506
  const timer = setTimeout(runDeferredBootTasks, DEFERRED_TASK_FALLBACK_SECONDS * MILLISECONDS_IN_A_SECOND);
10498
- if (typeof timer === "object" && "unref" in timer)
10499
- timer.unref();
10507
+ unrefTimer(timer);
10500
10508
  }, runDeferredBootTasks = () => {
10501
10509
  const tasks = globalThis.__absoluteDeferredBootTasks ?? [];
10502
10510
  globalThis.__absoluteDeferredBootTasks = [];
@@ -10545,8 +10553,7 @@ var DEFAULT_BATCH_SIZE = 12, DEFAULT_POLL_MS = 25, DEFAULT_MAX_PAUSE_MS = 2000,
10545
10553
  return batch;
10546
10554
  }, defaultSleep = (delayMs) => new Promise((resolve12) => {
10547
10555
  const timer = setTimeout(resolve12, delayMs);
10548
- if (typeof timer === "object" && "unref" in timer)
10549
- timer.unref();
10556
+ unrefTimer(timer);
10550
10557
  }), dependencyOrderedSequence = function* (files, getEntrySources, getDependencies) {
10551
10558
  const remaining = new Set(files);
10552
10559
  let lastEntryCount = NO_ENTRIES_YET;
@@ -10627,6 +10634,7 @@ var DEFAULT_BATCH_SIZE = 12, DEFAULT_POLL_MS = 25, DEFAULT_MAX_PAUSE_MS = 2000,
10627
10634
  }
10628
10635
  };
10629
10636
  };
10637
+ var init_idleScheduler = () => {};
10630
10638
 
10631
10639
  // src/mobile/config.ts
10632
10640
  var exports_config = {};
@@ -23043,7 +23051,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
23043
23051
  if (slots.length === 0)
23044
23052
  return;
23045
23053
  idleTimer = setTimeout(terminateWorkers, idleTimeoutMs);
23046
- idleTimer.unref();
23054
+ unrefTimer(idleTimer);
23047
23055
  };
23048
23056
  const takeJobFor = (slot) => {
23049
23057
  const affine = queue.findIndex((job2) => job2.affinityIndex === slot.index);
@@ -29770,7 +29778,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
29770
29778
  atomicRecoveryScan(eventDir);
29771
29779
  for (const delay of [25, 100]) {
29772
29780
  const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
29773
- timer.unref();
29781
+ unrefTimer(timer);
29774
29782
  }
29775
29783
  }
29776
29784
  return;
@@ -37934,6 +37942,7 @@ var init_prepare = __esm(() => {
37934
37942
  init_bootTimeline();
37935
37943
  init_logger();
37936
37944
  init_bootLifecycle();
37945
+ init_idleScheduler();
37937
37946
  MAX_STATIC_ROUTE_COUNT = Number.MAX_SAFE_INTEGER;
37938
37947
  MOBILE_DEV_MODULE_HEADERS = {
37939
37948
  "Cache-Control": "no-store",
@@ -37973,7 +37982,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
37973
37982
  previousHash = nextHash;
37974
37983
  onChange();
37975
37984
  }, interval);
37976
- timer.unref();
37985
+ unrefTimer(timer);
37977
37986
  return {
37978
37987
  close: () => clearInterval(timer)
37979
37988
  };
@@ -45567,5 +45576,5 @@ export {
45567
45576
  wrapPageHandlerWithStreamingSlots
45568
45577
  };
45569
45578
 
45570
- //# debugId=C72C9985AAD6064264756E2164756E21
45579
+ //# debugId=C8B68CBBBBB0579564756E2164756E21
45571
45580
  //# sourceMappingURL=index.js.map