@absolutejs/absolute 0.20.0-beta.57 → 0.20.0-beta.59

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/dist/cli/index.js CHANGED
@@ -2192,6 +2192,11 @@ const bridgeBootstrap = (path: string, safeAreaInsets: { bottom: number; left: n
2192
2192
  send({ format: 3, kind: 'event', event: 'navigation', path });
2193
2193
  }
2194
2194
  };
2195
+ globalThis.__absoluteRequestBack = () => {
2196
+ const event = new CustomEvent('absolute:back-request', { cancelable: true });
2197
+ if (!dispatchEvent(event)) return;
2198
+ send({ format: 3, kind: 'event', event: 'back-unhandled', path: currentPath });
2199
+ };
2195
2200
  if (\${DEV_ORIGIN ? 'true' : 'false'}) {
2196
2201
  const publishPath = () => {
2197
2202
  const path = location.pathname + location.search + location.hash;
@@ -2300,12 +2305,12 @@ export function AbsoluteWebHost() {
2300
2305
  }, [safeAreaInsets.bottom, safeAreaInsets.left, safeAreaInsets.right, safeAreaInsets.top]);
2301
2306
  useEffect(() => {
2302
2307
  const subscription = BackHandler.addEventListener('hardwareBackPress', () => {
2303
- if (!canGoBack) return false;
2304
- webView.current?.goBack();
2308
+ if (!indexUri) return false;
2309
+ webView.current?.injectJavaScript('globalThis.__absoluteRequestBack?.(); true;');
2305
2310
  return true;
2306
2311
  });
2307
2312
  return () => subscription.remove();
2308
- }, [canGoBack]);
2313
+ }, [indexUri]);
2309
2314
 
2310
2315
  const respond = (message: Record<string, unknown>) => {
2311
2316
  const source = JSON.stringify(message).replaceAll('\\u2028', '\\\\u2028').replaceAll('\\u2029', '\\\\u2029');
@@ -2345,6 +2350,11 @@ export function AbsoluteWebHost() {
2345
2350
  else activeWebPath.current = message.path;
2346
2351
  return;
2347
2352
  }
2353
+ if (message.kind === 'event' && message.event === 'back-unhandled') {
2354
+ if (canGoBack) webView.current?.goBack();
2355
+ else BackHandler.exitApp();
2356
+ return;
2357
+ }
2348
2358
  if (message.kind !== 'request' || typeof message.id !== 'string' || message.path !== activeWebPath.current) return;
2349
2359
  try {
2350
2360
  if (typeof message.params !== 'object' || message.params === null || Array.isArray(message.params)) throw new Error('Expo bridge method params are invalid.');
@@ -3413,7 +3423,7 @@ import {
3413
3423
  sep as sep2,
3414
3424
  win32
3415
3425
  } from "path";
3416
- var ANDROID_BOOT_TIMEOUT_MS = 180000, ANDROID_BOOT_POLL_MS = 1000, DEV_JOURNAL_FORMAT = 1, NATIVE_CACHE_FORMAT = 1, HASH_RADIX = 16, EXECUTABLE_MODE_MASK = 73, NATIVE_PUBLIC_PATH_SEGMENTS = 5, CAPACITOR_PROJECT_DIRECTORY_PATTERN, ANDROID_TIMING_PHASES, androidTimingSummary = (timings, physicalDevice = false) => ANDROID_TIMING_PHASES.map(([phase, label]) => {
3426
+ var ANDROID_BOOT_TIMEOUT_MS = 180000, ANDROID_BOOT_POLL_MS = 1000, ANDROID_CAPTURE_TIMEOUT_MS = 1e4, DEV_JOURNAL_FORMAT = 1, NATIVE_CACHE_FORMAT = 1, HASH_RADIX = 16, EXECUTABLE_MODE_MASK = 73, NATIVE_PUBLIC_PATH_SEGMENTS = 5, CAPACITOR_PROJECT_DIRECTORY_PATTERN, ANDROID_TIMING_PHASES, androidTimingSummary = (timings, physicalDevice = false) => ANDROID_TIMING_PHASES.map(([phase, label]) => {
3417
3427
  const duration = timings[phase];
3418
3428
  if (duration === undefined || label === undefined)
3419
3429
  return null;
@@ -3455,7 +3465,8 @@ var ANDROID_BOOT_TIMEOUT_MS = 180000, ANDROID_BOOT_POLL_MS = 1000, DEV_JOURNAL_F
3455
3465
  cwd: options.cwd,
3456
3466
  env: options.env,
3457
3467
  stderr: "pipe",
3458
- stdout: "pipe"
3468
+ stdout: "pipe",
3469
+ timeout: ANDROID_CAPTURE_TIMEOUT_MS
3459
3470
  });
3460
3471
  return {
3461
3472
  exitCode: result.exitCode,
@@ -4015,7 +4026,7 @@ var ANDROID_BOOT_TIMEOUT_MS = 180000, ANDROID_BOOT_POLL_MS = 1000, DEV_JOURNAL_F
4015
4026
  const installPath = await buildAndroidDebugApp(options.project, options.capture, options.run, options.env, options.signal);
4016
4027
  throwIfAborted(options.signal);
4017
4028
  options.transition("installing");
4018
- await requireSuccess([
4029
+ const installCommand = [
4019
4030
  options.project.adb,
4020
4031
  "-s",
4021
4032
  options.serial,
@@ -4023,7 +4034,23 @@ var ANDROID_BOOT_TIMEOUT_MS = 180000, ANDROID_BOOT_POLL_MS = 1000, DEV_JOURNAL_F
4023
4034
  "-r",
4024
4035
  "-d",
4025
4036
  installPath
4026
- ], "Android app installation", options.run, { env: options.env, signal: options.signal });
4037
+ ];
4038
+ let installExitCode = await options.run(installCommand, {
4039
+ env: options.env,
4040
+ signal: options.signal
4041
+ });
4042
+ throwIfAborted(options.signal);
4043
+ if (installExitCode !== 0) {
4044
+ options.log("Android app installation lost its ADB transport; reconnecting and retrying once.");
4045
+ await requireSuccess([options.project.adb, "-s", options.serial, "wait-for-device"], "Android device reconnection", options.run, { env: options.env, signal: options.signal });
4046
+ installExitCode = await options.run(installCommand, {
4047
+ env: options.env,
4048
+ signal: options.signal
4049
+ });
4050
+ throwIfAborted(options.signal);
4051
+ }
4052
+ if (installExitCode !== 0)
4053
+ throw new Error(`Android app installation failed (exit ${installExitCode}).`);
4027
4054
  const updated = androidInstalledPackageIdentity(options.project, options.serial, options.capture, options.env);
4028
4055
  await persistInstalledAndroidNativeCache(options, updated);
4029
4056
  return { nativeCacheHit: false, uid: updated?.uid };
@@ -21384,6 +21411,14 @@ var init_iosTestReport = __esm(() => {
21384
21411
  "ADAPT-04",
21385
21412
  "Confirm automatic system-bar appearance and unchanged author layout."
21386
21413
  ],
21414
+ ...Array.from({ length: 5 }, (_, index) => [
21415
+ `MOBILE-UI-${String(index + 1).padStart(2, "0")}`,
21416
+ `Complete framework-neutral mobile UI runbook check MOBILE-UI-${String(index + 1).padStart(2, "0")}.`
21417
+ ]),
21418
+ ...Array.from({ length: 6 }, (_, index) => [
21419
+ `NAV-LIFE-${String(index + 1).padStart(2, "0")}`,
21420
+ `Complete transactional navigation runbook check NAV-LIFE-${String(index + 1).padStart(2, "0")}.`
21421
+ ]),
21387
21422
  ...Array.from({ length: 10 }, (_, index) => [
21388
21423
  `DEVICEDEV-${String(index + 1).padStart(2, "0")}`,
21389
21424
  `Complete physical-device development runbook check DEVICEDEV-${String(index + 1).padStart(2, "0")}.`
@@ -21485,6 +21520,14 @@ var init_androidTestReport = __esm(() => {
21485
21520
  "ADAPT-04",
21486
21521
  "Confirm automatic system-bar appearance and unchanged author layout."
21487
21522
  ],
21523
+ ...Array.from({ length: 5 }, (_, index) => [
21524
+ `MOBILE-UI-${String(index + 1).padStart(2, "0")}`,
21525
+ `Complete framework-neutral mobile UI runbook check MOBILE-UI-${String(index + 1).padStart(2, "0")}.`
21526
+ ]),
21527
+ ...Array.from({ length: 6 }, (_, index) => [
21528
+ `NAV-LIFE-${String(index + 1).padStart(2, "0")}`,
21529
+ `Complete transactional navigation runbook check NAV-LIFE-${String(index + 1).padStart(2, "0")}.`
21530
+ ]),
21488
21531
  ["CAP-01", "Complete automatic device-capability provisioning checks."],
21489
21532
  [
21490
21533
  "SYSUI-01",
package/dist/index.js CHANGED
@@ -10492,9 +10492,10 @@ var indexContentCache, resolveDevClientDir = () => {
10492
10492
  `,
10493
10493
  `// Attempt hydration with error handling`,
10494
10494
  `const shouldClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';`,
10495
- `// Use document (not document.body) when the page renders <html><head><body>`,
10496
- `// to avoid "In HTML, <html> cannot be a child of <body>" hydration error`,
10497
- `const container = typeof document !== 'undefined' ? (shouldClientRender ? document.getElementById('root') : document) : null;`,
10495
+ `// AbsoluteJS routes are document components. Mobile data-envelope renders`,
10496
+ `// must therefore use document too: mounting <html><head><body> inside #root`,
10497
+ `// makes React's document singletons corrupt the persistent native shell.`,
10498
+ `const container = typeof document !== 'undefined' ? document : null;`,
10498
10499
  `if (!container) {`,
10499
10500
  ` throw new Error('React root container not found: document is null');`,
10500
10501
  `}
@@ -41176,5 +41177,5 @@ export {
41176
41177
  wrapPageHandlerWithStreamingSlots
41177
41178
  };
41178
41179
 
41179
- //# debugId=B96B244F3880BE5264756E2164756E21
41180
+ //# debugId=93E5701100F7F0FD64756E2164756E21
41180
41181
  //# sourceMappingURL=index.js.map