@absolutejs/absolute 0.20.0-beta.92 → 0.20.0-beta.94

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 (39) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/changelog.json +48 -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-vf61bv90.js → compile-qg75ewma.js} +5 -5
  9. package/dist/cli/{dev-perzmh2w.js → dev-sm9px53g.js} +83 -11
  10. package/dist/cli/{expoDevController-tr63cg78.js → expoDevController-a0jk8d43.js} +31 -2
  11. package/dist/cli/expoNativeWatcher-rmc95bak.js +138 -0
  12. package/dist/cli/{expoProject-djc0vk7g.js → expoProject-h38entbj.js} +1 -1
  13. package/dist/cli/{index-8zrnvazp.js → index-0t1cxstr.js} +261 -48
  14. package/dist/cli/{index-fn44wefq.js → index-3sdvzrv2.js} +37 -28
  15. package/dist/cli/{index-gxkmg2ss.js → index-51yyq29s.js} +1 -1
  16. package/dist/cli/index-bw4ktfnz.js +11 -0
  17. package/dist/cli/{index-751czk1b.js → index-d8va9b7v.js} +1 -1
  18. package/dist/cli/index.js +5 -5
  19. package/dist/cli/{mobile-yk7qr9qg.js → mobile-dev4mjsa.js} +20 -12
  20. package/dist/cli/{remoteMacProtocol-vw931n0a.js → remoteMacProtocol-kqvkp0qd.js} +2 -1
  21. package/dist/cli/{start-ef7tgbmf.js → start-0ddnh0y4.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 +599 -208
  27. package/dist/mobile/index.js.map +11 -8
  28. package/dist/mobile/mobilePreviewClient.ts +1 -1
  29. package/dist/mobile/remoteMacAgentEntry.js +354 -188
  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/expoActivityResultRecovery.d.ts +1 -0
  33. package/dist/src/mobile/expoBridge.d.ts +2 -2
  34. package/dist/src/mobile/expoDevController.d.ts +2 -6
  35. package/dist/src/mobile/expoNativeWatcher.d.ts +21 -0
  36. package/dist/src/mobile/index.d.ts +1 -0
  37. package/dist/src/mobile/remoteMacProtocol.d.ts +1 -4
  38. package/dist/src/utils/unrefTimer.d.ts +5 -0
  39. package/package.json +5 -2
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ // src/utils/unrefTimer.ts
3
+ var unrefTimer = (timer) => {
4
+ if (timer === null || typeof timer !== "object" && typeof timer !== "function")
5
+ return;
6
+ const unref = Reflect.get(timer, "unref");
7
+ if (typeof unref === "function")
8
+ Reflect.apply(unref, timer, []);
9
+ };
10
+
11
+ export { unrefTimer };
@@ -10,7 +10,7 @@ import {
10
10
  resolveAbsoluteMobileUpdateRuntime,
11
11
  syncAbsoluteExpoWebAssets,
12
12
  writeAbsoluteExpoProject
13
- } from "./index-8zrnvazp.js";
13
+ } from "./index-0t1cxstr.js";
14
14
 
15
15
  // src/build/islandRegistryTransform.ts
16
16
  import { basename } from "path";
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-perzmh2w.js");
61
+ const { dev } = await import("./dev-sm9px53g.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-ef7tgbmf.js");
74
+ const { start } = await import("./start-0ddnh0y4.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-ef7tgbmf.js");
84
+ const { start } = await import("./start-0ddnh0y4.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-vf61bv90.js");
200
+ const { compile } = await import("./compile-qg75ewma.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-yk7qr9qg.js");
206
+ const { runMobile } = await import("./mobile-dev4mjsa.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-gxkmg2ss.js";
10
+ } from "./index-51yyq29s.js";
11
11
  import {
12
12
  ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT,
13
13
  ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
14
14
  resolveAbsoluteMobileRoute
15
- } from "./index-751czk1b.js";
15
+ } from "./index-d8va9b7v.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-8zrnvazp.js";
70
+ } from "./index-0t1cxstr.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-gxkmg2ss.js";
5
- import"./index-751czk1b.js";
4
+ } from "./index-51yyq29s.js";
5
+ import"./index-d8va9b7v.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-8zrnvazp.js";
14
+ import"./index-0t1cxstr.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