@absolutejs/absolute 0.20.0-beta.6 → 0.20.0-beta.61

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 (179) hide show
  1. package/README.md +205 -0
  2. package/dist/angular/browser.js +392 -405
  3. package/dist/angular/browser.js.map +3 -3
  4. package/dist/angular/components/core/streamingSlotRegistrar.js +7 -7
  5. package/dist/angular/components/core/streamingSlotRegistry.js +4 -4
  6. package/dist/angular/index.js +379 -321
  7. package/dist/angular/index.js.map +8 -7
  8. package/dist/angular/server.js +133 -61
  9. package/dist/angular/server.js.map +8 -7
  10. package/dist/build.js +2336 -1347
  11. package/dist/build.js.map +22 -17
  12. package/dist/cli/config/client.js +12 -12
  13. package/dist/cli/config/server.js +1140 -1091
  14. package/dist/cli/index.js +10107 -2126
  15. package/dist/client/chunks/angularPatch-arh4sr68.js +157 -0
  16. package/dist/client/chunks/angularPatch-arh4sr68.js.map +10 -0
  17. package/dist/client/chunks/index-5py90ctf.js +87 -0
  18. package/dist/client/chunks/index-5py90ctf.js.map +10 -0
  19. package/dist/client/chunks/index-m35nbkdp.js +374 -0
  20. package/dist/client/chunks/index-m35nbkdp.js.map +12 -0
  21. package/dist/client/chunks/index-qxjc7kc5.js +12 -0
  22. package/dist/client/chunks/index-qxjc7kc5.js.map +9 -0
  23. package/dist/client/chunks/islands-xj2n8nwf.js +281 -0
  24. package/dist/client/chunks/islands-xj2n8nwf.js.map +14 -0
  25. package/dist/client/chunks/react-pdg4325x.js +65 -0
  26. package/dist/client/chunks/react-pdg4325x.js.map +10 -0
  27. package/dist/client/chunks/svelte-s0c964kb.js +19 -0
  28. package/dist/client/chunks/svelte-s0c964kb.js.map +10 -0
  29. package/dist/client/chunks/vue-rdskrnyg.js +24 -0
  30. package/dist/client/chunks/vue-rdskrnyg.js.map +10 -0
  31. package/dist/client/index.js +73 -841
  32. package/dist/client/index.js.map +7 -20
  33. package/dist/core/streamingSlotRegistrar.js +15 -13
  34. package/dist/core/streamingSlotRegistrar.js.map +2 -2
  35. package/dist/core/streamingSlotRegistry.js +11 -9
  36. package/dist/core/streamingSlotRegistry.js.map +2 -2
  37. package/dist/dev/client/hmrClient.ts +35 -3
  38. package/dist/dev/client/hmrTiming.ts +6 -0
  39. package/dist/dev/client/syncDevtools.ts +237 -0
  40. package/dist/dev/serverBootstrap.js +28 -0
  41. package/dist/image-client/imageClient.js +7 -7
  42. package/dist/index.js +3756 -2361
  43. package/dist/index.js.map +38 -30
  44. package/dist/islands/browser.js +11 -25
  45. package/dist/islands/browser.js.map +2 -2
  46. package/dist/islands/index.js +55 -52
  47. package/dist/islands/index.js.map +5 -4
  48. package/dist/mobile/browser.js +429 -20
  49. package/dist/mobile/browser.js.map +8 -5
  50. package/dist/mobile/index.js +11287 -3348
  51. package/dist/mobile/index.js.map +47 -18
  52. package/dist/mobile/remoteMacAgentEntry.js +1374 -14
  53. package/dist/mobile/shellAuth.js +36 -0
  54. package/dist/mobile/shellBootstrap.js +1800 -0
  55. package/dist/mobile/shellExpoAuth.js +163 -0
  56. package/dist/mobile/shellExpoDevices.js +77 -0
  57. package/dist/mobile/shellExpoSync.js +104 -0
  58. package/dist/mobile/shellSync.js +184 -0
  59. package/dist/mobile/shellUpdate.js +532 -0
  60. package/dist/mobile/uiPrimitives.js +264 -0
  61. package/dist/react/browser.js +17 -59
  62. package/dist/react/browser.js.map +2 -2
  63. package/dist/react/components/browser/index.js +107 -107
  64. package/dist/react/components/index.js +118 -116
  65. package/dist/react/components/index.js.map +2 -2
  66. package/dist/react/hooks/index.js +11 -25
  67. package/dist/react/hooks/index.js.map +2 -2
  68. package/dist/react/index.js +110 -67
  69. package/dist/react/index.js.map +8 -7
  70. package/dist/react/jsxDevRuntimeCompat.js +11 -9
  71. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  72. package/dist/react/jsxRuntimeCompat.js +11 -9
  73. package/dist/react/jsxRuntimeCompat.js.map +2 -2
  74. package/dist/react/router/browser.js +9 -7
  75. package/dist/react/router/browser.js.map +2 -2
  76. package/dist/react/router/index.js +9 -7
  77. package/dist/react/router/index.js.map +2 -2
  78. package/dist/react/server.js +67 -11
  79. package/dist/react/server.js.map +7 -6
  80. package/dist/src/build/pwa.d.ts +16 -0
  81. package/dist/src/cli/config/server.d.ts +1 -1
  82. package/dist/src/cli/instanceStatus.d.ts +1 -0
  83. package/dist/src/cli/scripts/dev.d.ts +2 -0
  84. package/dist/src/client/browserTranslation.d.ts +19 -0
  85. package/dist/src/client/index.d.ts +1 -0
  86. package/dist/src/core/browserTranslation.d.ts +6 -0
  87. package/dist/src/core/devBuild.d.ts +1 -0
  88. package/dist/src/core/prepare.d.ts +376 -0
  89. package/dist/src/dev/clientManager.d.ts +1 -0
  90. package/dist/src/dev/devCert.d.ts +6 -4
  91. package/dist/src/dev/serverEntryCopies.d.ts +3 -0
  92. package/dist/src/ember/browser.d.ts +0 -16
  93. package/dist/src/mobile/adaptiveShell.d.ts +27 -0
  94. package/dist/src/mobile/androidEmulatorController.d.ts +8 -1
  95. package/dist/src/mobile/androidRelease.d.ts +9 -2
  96. package/dist/src/mobile/androidTestReport.d.ts +14 -0
  97. package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
  98. package/dist/src/mobile/androidWebView.d.ts +1 -0
  99. package/dist/src/mobile/browser.d.ts +2 -0
  100. package/dist/src/mobile/capacitorBundle.d.ts +19 -0
  101. package/dist/src/mobile/ciWorkflow.d.ts +26 -0
  102. package/dist/src/mobile/config.d.ts +10 -1
  103. package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
  104. package/dist/src/mobile/deviceCapabilities.d.ts +49 -0
  105. package/dist/src/mobile/expoBridge.d.ts +91 -0
  106. package/dist/src/mobile/expoDevController.d.ts +56 -0
  107. package/dist/src/mobile/expoProject.d.ts +16 -0
  108. package/dist/src/mobile/index.d.ts +23 -0
  109. package/dist/src/mobile/iosDeviceAcceptance.d.ts +32 -0
  110. package/dist/src/mobile/iosPhysicalDeviceTransport.d.ts +16 -0
  111. package/dist/src/mobile/iosRelease.d.ts +63 -3
  112. package/dist/src/mobile/iosSimulatorController.d.ts +20 -2
  113. package/dist/src/mobile/iosTestReport.d.ts +24 -0
  114. package/dist/src/mobile/mobileBundleInspection.d.ts +63 -0
  115. package/dist/src/mobile/mobileInspect.d.ts +142 -0
  116. package/dist/src/mobile/mobilePreview.d.ts +174 -0
  117. package/dist/src/mobile/mobilePreviewClient.d.ts +1 -0
  118. package/dist/src/mobile/nativeAuth.d.ts +6 -0
  119. package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
  120. package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
  121. package/dist/src/mobile/nativeRoute.d.ts +13 -0
  122. package/dist/src/mobile/nativeTestReport.d.ts +91 -0
  123. package/dist/src/mobile/nativeUpdates.d.ts +4 -0
  124. package/dist/src/mobile/navigationLifecycle.d.ts +36 -0
  125. package/dist/src/mobile/navigationState.d.ts +53 -0
  126. package/dist/src/mobile/pageProtocol.d.ts +2 -0
  127. package/dist/src/mobile/releaseDoctor.d.ts +23 -1
  128. package/dist/src/mobile/remoteMacProtocol.d.ts +134 -1
  129. package/dist/src/mobile/remoteMacWire.d.ts +1 -1
  130. package/dist/src/mobile/shellAuth.d.ts +8 -1
  131. package/dist/src/mobile/shellBootstrap.d.ts +15 -2
  132. package/dist/src/mobile/shellExpoAuth.d.ts +12 -0
  133. package/dist/src/mobile/shellExpoDevices.d.ts +3 -0
  134. package/dist/src/mobile/shellExpoSync.d.ts +18 -0
  135. package/dist/src/mobile/shellHttp.d.ts +2 -0
  136. package/dist/src/mobile/shellPush.d.ts +11 -0
  137. package/dist/src/mobile/shellSync.d.ts +46 -1
  138. package/dist/src/mobile/shellUpdate.d.ts +2 -0
  139. package/dist/src/mobile/syncRemediation.d.ts +10 -0
  140. package/dist/src/mobile/syncSchema.d.ts +9 -0
  141. package/dist/src/mobile/transport.d.ts +15 -0
  142. package/dist/src/mobile/uiPrimitives.d.ts +37 -0
  143. package/dist/src/mobile/updateClient.d.ts +44 -0
  144. package/dist/src/mobile/updateProtocol.d.ts +51 -0
  145. package/dist/src/mobile/updatePublisher.d.ts +66 -0
  146. package/dist/src/mobile/updateRollout.d.ts +16 -0
  147. package/dist/src/mobile/updateRuntime.d.ts +27 -0
  148. package/dist/src/mobile/updateSigning.d.ts +20 -0
  149. package/dist/src/plugins/hmr.d.ts +3 -0
  150. package/dist/src/plugins/imageOptimizer.d.ts +1 -1
  151. package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
  152. package/dist/src/utils/imageProcessing.d.ts +3 -0
  153. package/dist/src/utils/loadConfig.d.ts +1 -0
  154. package/dist/src/utils/logger.d.ts +1 -0
  155. package/dist/src/utils/startupBanner.d.ts +1 -0
  156. package/dist/src/utils/userAgentFunctions.d.ts +1 -1
  157. package/dist/src/vue/browser.d.ts +1 -0
  158. package/dist/src/vue/browserTranslation.d.ts +5 -0
  159. package/dist/src/vue/index.d.ts +1 -0
  160. package/dist/svelte/browser.js +12 -26
  161. package/dist/svelte/browser.js.map +2 -2
  162. package/dist/svelte/index.js +104 -61
  163. package/dist/svelte/index.js.map +8 -7
  164. package/dist/svelte/server.js +84 -28
  165. package/dist/svelte/server.js.map +7 -6
  166. package/dist/types/build.d.ts +64 -3
  167. package/dist/types/cli.d.ts +1 -0
  168. package/dist/types/messages.d.ts +1 -1
  169. package/dist/vue/browser.js +116 -56
  170. package/dist/vue/browser.js.map +5 -3
  171. package/dist/vue/components/Image.js +9 -7
  172. package/dist/vue/components/Image.js.map +2 -2
  173. package/dist/vue/components/index.js +11 -9
  174. package/dist/vue/components/index.js.map +2 -2
  175. package/dist/vue/index.js +211 -94
  176. package/dist/vue/index.js.map +10 -7
  177. package/dist/vue/server.js +69 -13
  178. package/dist/vue/server.js.map +7 -6
  179. package/package.json +40 -14
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
28
30
  if (canCache)
29
31
  cache.set(mod, to);
30
32
  return to;
@@ -865,6 +867,20 @@ var requireCurrentIslandRegistry = () => {
865
867
  globalThis.__absoluteIslandRegistry = registry;
866
868
  };
867
869
 
870
+ // src/core/browserTranslation.ts
871
+ var BASELINE_MARKER = "__ABSOLUTE_SSR_TEXT_BASELINES__", BROWSER_TRANSLATION_BASELINE_SCRIPT, browserTranslationBaselineTag = () => `<script>${BROWSER_TRANSLATION_BASELINE_SCRIPT}</script>`, injectBrowserTranslationBaseline = (html) => {
872
+ if (html.includes(BASELINE_MARKER))
873
+ return html;
874
+ const script = browserTranslationBaselineTag();
875
+ const closingBodyIndex = html.lastIndexOf("</body>");
876
+ if (closingBodyIndex < 0)
877
+ return `${html}${script}`;
878
+ return `${html.slice(0, closingBodyIndex)}${script}${html.slice(closingBodyIndex)}`;
879
+ };
880
+ var init_browserTranslation = __esm(() => {
881
+ BROWSER_TRANSLATION_BASELINE_SCRIPT = "window.__ABSOLUTE_SSR_TEXT_BASELINES__=new WeakMap();" + "{const r=document.body,b=window.__ABSOLUTE_SSR_TEXT_BASELINES__;" + 'if(r)for(const e of [r,...r.querySelectorAll("*")]){' + "const t=new Map();for(const [i,n]of[...e.childNodes].entries())" + 'if(n.nodeType===3)t.set(i,n.nodeValue??"");if(t.size)b.set(e,t);}}';
882
+ });
883
+
868
884
  // src/angular/requestProviders.ts
869
885
  var buildRequestProviders = (deps, request, requestContext, responseInit) => [
870
886
  { provide: deps.REQUEST, useValue: request ?? null },
@@ -902,7 +918,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
902
918
  }
903
919
  return html + snippet;
904
920
  }, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
905
- let result = html;
921
+ let result = injectBeforeClose(html, browserTranslationBaselineTag());
906
922
  const registeredScripts = getAndClearClientScripts(requestId);
907
923
  if (registeredScripts.length > 0) {
908
924
  result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
@@ -938,6 +954,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
938
954
  };
939
955
  var init_ssrRender = __esm(() => {
940
956
  init_registerClientScript();
957
+ init_browserTranslation();
941
958
  routeContextCache = new Map;
942
959
  selectorCache = new Map;
943
960
  });
@@ -945,10 +962,10 @@ var init_ssrRender = __esm(() => {
945
962
  // src/angular/islands.ts
946
963
  var exports_islands = {};
947
964
  __export(exports_islands, {
948
- renderAngularIslandToHtml: () => renderAngularIslandToHtml,
949
- mountAngularIsland: () => mountAngularIsland,
965
+ getAngularIslandSelector: () => getAngularIslandSelector,
950
966
  isAngularComponent: () => isAngularComponent,
951
- getAngularIslandSelector: () => getAngularIslandSelector
967
+ mountAngularIsland: () => mountAngularIsland,
968
+ renderAngularIslandToHtml: () => renderAngularIslandToHtml
952
969
  });
953
970
  var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, isAngularComponent = (value) => typeof value === "function", getSelectorFromRenderedIsland = (rootElement) => {
954
971
  const firstChild = rootElement.firstElementChild;
@@ -1010,8 +1027,10 @@ var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_i
1010
1027
  const propsToken = new InjectionToken2(`${wrapperKey}:props`);
1011
1028
 
1012
1029
  class AngularIslandWrapperComponent {
1013
- component = component;
1014
- props = inject(propsToken);
1030
+ constructor() {
1031
+ this.component = component;
1032
+ this.props = inject(propsToken);
1033
+ }
1015
1034
  }
1016
1035
  return {
1017
1036
  deps,
@@ -1460,13 +1479,13 @@ var init_nativeRewrite = __esm(() => {
1460
1479
  // src/build/rewriteImportsPlugin.ts
1461
1480
  var exports_rewriteImportsPlugin = {};
1462
1481
  __export(exports_rewriteImportsPlugin, {
1463
- rewriteVendorDirectories: () => rewriteVendorDirectories,
1464
- rewriteImportsInContent: () => rewriteImportsInContent,
1465
- rewriteBuildOutputsWith: () => rewriteBuildOutputsWith,
1466
- rewriteBuildOutputs: () => rewriteBuildOutputs,
1467
- jsRewriteImports: () => jsRewriteImports,
1482
+ buildWithImportRewrite: () => buildWithImportRewrite,
1468
1483
  fixMissingReExportNamespacesInContent: () => fixMissingReExportNamespacesInContent,
1469
- buildWithImportRewrite: () => buildWithImportRewrite
1484
+ jsRewriteImports: () => jsRewriteImports,
1485
+ rewriteBuildOutputs: () => rewriteBuildOutputs,
1486
+ rewriteBuildOutputsWith: () => rewriteBuildOutputsWith,
1487
+ rewriteImportsInContent: () => rewriteImportsInContent,
1488
+ rewriteVendorDirectories: () => rewriteVendorDirectories
1470
1489
  });
1471
1490
  import { readdir } from "fs/promises";
1472
1491
  import { join as join2 } from "path";
@@ -1880,22 +1899,22 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
1880
1899
  // src/build/stylePreprocessor.ts
1881
1900
  var exports_stylePreprocessor = {};
1882
1901
  __export(exports_stylePreprocessor, {
1883
- stylePreprocessorPlugin: () => stylePreprocessorPlugin,
1884
- recordStyleOutput: () => recordStyleOutput,
1885
- isStylePath: () => isStylePath,
1886
- isStyleModulePath: () => isStyleModulePath,
1887
- isPreprocessableStylePath: () => isPreprocessableStylePath,
1888
- getStyleBaseName: () => getStyleBaseName,
1889
- getCssOutputExtension: () => getCssOutputExtension,
1890
- forgetStyleEntry: () => forgetStyleEntry,
1891
- findStyleEntriesImporting: () => findStyleEntriesImporting,
1892
- createSvelteStylePreprocessor: () => createSvelteStylePreprocessor,
1893
- createStyleTransformConfig: () => createStyleTransformConfig,
1894
- createStylePreprocessorPlugin: () => createStylePreprocessorPlugin,
1895
- compileStyleSource: () => compileStyleSource,
1896
- compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
1902
+ addStyleImporter: () => addStyleImporter,
1897
1903
  compileStyleFileIfNeeded: () => compileStyleFileIfNeeded,
1898
- addStyleImporter: () => addStyleImporter
1904
+ compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
1905
+ compileStyleSource: () => compileStyleSource,
1906
+ createStylePreprocessorPlugin: () => createStylePreprocessorPlugin,
1907
+ createStyleTransformConfig: () => createStyleTransformConfig,
1908
+ createSvelteStylePreprocessor: () => createSvelteStylePreprocessor,
1909
+ findStyleEntriesImporting: () => findStyleEntriesImporting,
1910
+ forgetStyleEntry: () => forgetStyleEntry,
1911
+ getCssOutputExtension: () => getCssOutputExtension,
1912
+ getStyleBaseName: () => getStyleBaseName,
1913
+ isPreprocessableStylePath: () => isPreprocessableStylePath,
1914
+ isStyleModulePath: () => isStyleModulePath,
1915
+ isStylePath: () => isStylePath,
1916
+ recordStyleOutput: () => recordStyleOutput,
1917
+ stylePreprocessorPlugin: () => stylePreprocessorPlugin
1899
1918
  });
1900
1919
  import { createHash } from "crypto";
1901
1920
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
@@ -2996,10 +3015,10 @@ var init_renderIslandMarkup = __esm(() => {
2996
3015
  // src/core/devRouteRegistrationCallsite.ts
2997
3016
  var exports_devRouteRegistrationCallsite = {};
2998
3017
  __export(exports_devRouteRegistrationCallsite, {
2999
- patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
3000
- isPageHandler: () => isPageHandler,
3018
+ getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite,
3001
3019
  getOriginalPageHandlerSource: () => getOriginalPageHandlerSource,
3002
- getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
3020
+ isPageHandler: () => isPageHandler,
3021
+ patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites
3003
3022
  });
3004
3023
  import { AsyncLocalStorage } from "async_hooks";
3005
3024
  import { Elysia } from "elysia";
@@ -3854,6 +3873,7 @@ var colors, MONTHS, formatTimestamp = () => {
3854
3873
  port,
3855
3874
  host,
3856
3875
  networkUrl,
3876
+ mobilePreviewUrl,
3857
3877
  protocol = "http"
3858
3878
  } = options;
3859
3879
  const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
@@ -3867,6 +3887,9 @@ var colors, MONTHS, formatTimestamp = () => {
3867
3887
  if (networkUrl) {
3868
3888
  console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
3869
3889
  }
3890
+ if (mobilePreviewUrl) {
3891
+ console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
3892
+ }
3870
3893
  console.log("");
3871
3894
  };
3872
3895
  var init_startupBanner = __esm(() => {
@@ -4517,8 +4540,8 @@ var init_lowerDeferSyntax = __esm(() => {
4517
4540
  // src/utils/generatedDir.ts
4518
4541
  var exports_generatedDir = {};
4519
4542
  __export(exports_generatedDir, {
4520
- getGeneratedRoot: () => getGeneratedRoot,
4521
- getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
4543
+ getFrameworkGeneratedDir: () => getFrameworkGeneratedDir,
4544
+ getGeneratedRoot: () => getGeneratedRoot
4522
4545
  });
4523
4546
  import { join as join8 } from "path";
4524
4547
  var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join8(getGeneratedRoot(projectRoot), framework), getGeneratedRoot = (projectRoot = process.cwd()) => join8(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME);
@@ -4527,17 +4550,25 @@ var init_generatedDir = () => {};
4527
4550
  // src/build/compileAngular.ts
4528
4551
  var exports_compileAngular = {};
4529
4552
  __export(exports_compileAngular, {
4530
- invalidateAngularJitCache: () => invalidateAngularJitCache,
4531
- compileAngularFiles: () => compileAngularFiles,
4532
- compileAngularFileJIT: () => compileAngularFileJIT,
4553
+ compileAngular: () => compileAngular,
4533
4554
  compileAngularFile: () => compileAngularFile,
4534
- compileAngular: () => compileAngular
4555
+ compileAngularFileJIT: () => compileAngularFileJIT,
4556
+ compileAngularFiles: () => compileAngularFiles,
4557
+ invalidateAngularJitCache: () => invalidateAngularJitCache
4535
4558
  });
4536
4559
  import { existsSync as existsSync5, readFileSync as readFileSync5, promises as fs } from "fs";
4537
4560
  import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve7, relative as relative5 } from "path";
4538
4561
  var {Glob } = globalThis.Bun;
4539
4562
  import ts from "typescript";
4540
- var traceAngularPhase = async (name, fn, metadata) => {
4563
+ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
4564
+ const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
4565
+ try {
4566
+ await fs.writeFile(temporaryPath, content, "utf-8");
4567
+ await fs.rename(temporaryPath, path);
4568
+ } finally {
4569
+ await fs.rm(temporaryPath, { force: true });
4570
+ }
4571
+ }, traceAngularPhase = async (name, fn, metadata) => {
4541
4572
  const tracePhase = globalThis.__absoluteBuildTracePhase;
4542
4573
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
4543
4574
  }, readTsconfigPathAliases = () => {
@@ -4803,10 +4834,10 @@ var traceAngularPhase = async (name, fn, metadata) => {
4803
4834
  }
4804
4835
  }, writeResourceCacheFile = async (cachePath, source) => {
4805
4836
  await fs.mkdir(dirname5(cachePath), { recursive: true });
4806
- await fs.writeFile(cachePath, JSON.stringify({
4837
+ await writeTextFileAtomically(cachePath, JSON.stringify({
4807
4838
  source,
4808
4839
  version: 1
4809
- }), "utf-8");
4840
+ }));
4810
4841
  }, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
4811
4842
  const resourcePaths = collectAngularResourcePaths(source, dirname5(filePath));
4812
4843
  const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
@@ -4992,7 +5023,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
4992
5023
  });
4993
5024
  await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
4994
5025
  await fs.mkdir(dirname5(target), { recursive: true });
4995
- await fs.writeFile(target, content, "utf-8");
5026
+ await writeTextFileAtomically(target, content);
4996
5027
  })), { outputs: entries.length });
4997
5028
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
4998
5029
  }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
@@ -5457,7 +5488,7 @@ ${fields}
5457
5488
  const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
5458
5489
  const preservedInjection = await readPreservedInjection(targetPath);
5459
5490
  await fs.mkdir(targetDir, { recursive: true });
5460
- await fs.writeFile(targetPath, processedContent + preservedInjection, "utf-8");
5491
+ await writeTextFileAtomically(targetPath, processedContent + preservedInjection);
5461
5492
  jitContentCache.set(cacheKey, contentHash);
5462
5493
  }
5463
5494
  allOutputs.push(targetPath);
@@ -5473,7 +5504,7 @@ ${fields}
5473
5504
  export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
5474
5505
  ` : withoutLegacyFlag;
5475
5506
  if (nextEntryOutput !== entryOutput) {
5476
- await fs.writeFile(entryOutputPath, nextEntryOutput, "utf-8");
5507
+ await writeTextFileAtomically(entryOutputPath, nextEntryOutput);
5477
5508
  }
5478
5509
  }
5479
5510
  return allOutputs;
@@ -5643,7 +5674,7 @@ export const providers = [${fragments.join(", ")}];
5643
5674
  `;
5644
5675
  }
5645
5676
  }
5646
- await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
5677
+ await traceAngularPhase("wrapper/write-server-output", () => writeTextFileAtomically(rawServerFile, rewritten), { entry: resolvedEntry });
5647
5678
  const relativePath = relative5(indexesDir, rawServerFile).replace(/\\/g, "/");
5648
5679
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
5649
5680
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
@@ -5655,6 +5686,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
5655
5686
  import { provideClientHydration } from '@angular/platform-browser';
5656
5687
  import { withHttpTransferCacheOptions } from '@angular/platform-browser';
5657
5688
  import { provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
5689
+ import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
5658
5690
  import * as pageModule from '${normalizedImportPath}';
5659
5691
  var ${componentClassName} = pageModule.default;
5660
5692
  // REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
@@ -5718,8 +5750,10 @@ if (!document.querySelector(_sel)) {
5718
5750
  }
5719
5751
 
5720
5752
  var providers = [provideZonelessChangeDetection()];
5753
+ var restoreTranslation = function() {};
5721
5754
  if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
5722
5755
  providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
5756
+ restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
5723
5757
  }
5724
5758
  delete window.__HMR_SKIP_HYDRATION__;
5725
5759
  providers.push.apply(providers, pageProviders);
@@ -5746,7 +5780,7 @@ if (pageHasRawStreamingSlots) {
5746
5780
  });
5747
5781
  }
5748
5782
  return appRef;
5749
- });
5783
+ }).finally(restoreTranslation);
5750
5784
  }
5751
5785
  window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
5752
5786
  window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
@@ -5762,6 +5796,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
5762
5796
  import { provideClientHydration } from '@angular/platform-browser';
5763
5797
  import { withHttpTransferCacheOptions } from '@angular/platform-browser';
5764
5798
  import { enableProdMode, provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
5799
+ import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
5765
5800
  import * as pageModule from '${normalizedImportPath}';
5766
5801
  var ${componentClassName} = pageModule.default;
5767
5802
  // REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
@@ -5804,8 +5839,10 @@ if (!document.querySelector(_sel)) {
5804
5839
  }
5805
5840
 
5806
5841
  var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
5842
+ var restoreTranslation = function() {};
5807
5843
  if (!isClientRender && !pageHasIslands) {
5808
5844
  providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
5845
+ restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
5809
5846
  }
5810
5847
  window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
5811
5848
  var absolutePageReady = Promise.resolve();
@@ -5829,7 +5866,7 @@ if (pageHasRawStreamingSlots) {
5829
5866
  });
5830
5867
  }
5831
5868
  return appRef;
5832
- });
5869
+ }).finally(restoreTranslation);
5833
5870
  }
5834
5871
  window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
5835
5872
  window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
@@ -5842,7 +5879,7 @@ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
5842
5879
  `.trim();
5843
5880
  const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
5844
5881
  const indexUnchanged = cachedWrapper?.indexHash === indexHash;
5845
- await traceAngularPhase("wrapper/write-client-index", () => fs.writeFile(clientFile, hydration, "utf-8"), { entry: resolvedEntry });
5882
+ await traceAngularPhase("wrapper/write-client-index", () => writeTextFileAtomically(clientFile, hydration), { entry: resolvedEntry });
5846
5883
  wrapperOutputCache.set(resolvedEntry, {
5847
5884
  indexHash,
5848
5885
  serverHash: serverContentHash
@@ -6484,6 +6521,7 @@ var getCurrentAbsoluteMobileProducerContext = () => {
6484
6521
  // src/mobile/pageProtocol.ts
6485
6522
  var ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE = "application/vnd.absolute.page+json";
6486
6523
  var ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION = 1;
6524
+ var ABSOLUTE_NATIVE_ROUTE_DATA_MEDIA_TYPE = "application/vnd.absolute.native-route+json";
6487
6525
  var BAD_REQUEST_STATUS = 400;
6488
6526
  var OK_STATUS = 200;
6489
6527
  var SERVER_ERROR_STATUS = 500;
@@ -6502,6 +6540,11 @@ var acceptsAbsoluteMobilePage = (request) => {
6502
6540
  return false;
6503
6541
  return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE);
6504
6542
  };
6543
+ var acceptsAbsoluteNativeRouteData = (request) => {
6544
+ if (!request)
6545
+ return false;
6546
+ return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_NATIVE_ROUTE_DATA_MEDIA_TYPE);
6547
+ };
6505
6548
  var readRequiredHeader = (request, name) => {
6506
6549
  const value = request.headers.get(name)?.trim();
6507
6550
  return value ? value : undefined;
@@ -6632,6 +6675,32 @@ var finalizeArchivedMobilePage = (context, input) => {
6632
6675
  return createAbsoluteMobilePageErrorResponse(page.pageId);
6633
6676
  }
6634
6677
  };
6678
+ var finalizeAbsoluteNativeRouteDevelopmentPage = (input) => {
6679
+ if (false) {}
6680
+ if (input.request?.method !== "GET") {
6681
+ return createAbsoluteMobileInvalidRequestResponse("Native-route data requests must use GET.");
6682
+ }
6683
+ if (input.request.headers.get(MOBILE_PAGE_REQUEST_HEADERS.protocol) !== String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)) {
6684
+ return createAbsoluteMobileInvalidRequestResponse(`Native-route data requires protocol ${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}.`);
6685
+ }
6686
+ const [representation] = input.compatibility.representations;
6687
+ if (!representation) {
6688
+ return createAbsoluteMobilePageErrorResponse(input.compatibility.pageId);
6689
+ }
6690
+ try {
6691
+ return envelopeResponse({
6692
+ contract: representation.contract,
6693
+ framework: input.compatibility.framework,
6694
+ kind: "page",
6695
+ pageId: input.compatibility.pageId,
6696
+ props: normalizeJsonValue(representation.mapProps(input.props)),
6697
+ status: input.status ?? OK_STATUS
6698
+ }, input.status ?? OK_STATUS);
6699
+ } catch (error) {
6700
+ console.error(`[Mobile] Failed to produce development native route ${input.compatibility.pageId}:`, error);
6701
+ return createAbsoluteMobilePageErrorResponse(input.compatibility.pageId);
6702
+ }
6703
+ };
6635
6704
  var createAbsoluteMobileInvalidRequestResponse = (message) => envelopeResponse({ kind: "invalid-request", message }, BAD_REQUEST_STATUS);
6636
6705
  var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
6637
6706
  code: "representation-failed",
@@ -6641,6 +6710,9 @@ var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
6641
6710
  }, SERVER_ERROR_STATUS);
6642
6711
  var createAbsoluteMobileUpgradeResponse = (result) => envelopeResponse(result, UPGRADE_REQUIRED_STATUS);
6643
6712
  var finalizeAbsoluteMobilePage = (input) => {
6713
+ if (acceptsAbsoluteNativeRouteData(input.request)) {
6714
+ return finalizeAbsoluteNativeRouteDevelopmentPage(input);
6715
+ }
6644
6716
  const parsed = parseAbsoluteMobilePageRequest(input.request);
6645
6717
  if (parsed.kind === "not-mobile")
6646
6718
  return;
@@ -7120,16 +7192,16 @@ var withPendingTask = async (work) => {
7120
7192
  }
7121
7193
  };
7122
7194
  export {
7123
- withPendingTask,
7124
- provideDeterministicEnv,
7125
- handleAngularPageRequest,
7126
- createDeterministicRandom,
7127
- buildAbsoluteHttpTransferCacheOptions,
7128
- DETERMINISTIC_SEED,
7129
- DETERMINISTIC_RANDOM,
7195
+ ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER,
7130
7196
  DETERMINISTIC_NOW,
7131
- ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
7197
+ DETERMINISTIC_RANDOM,
7198
+ DETERMINISTIC_SEED,
7199
+ buildAbsoluteHttpTransferCacheOptions,
7200
+ createDeterministicRandom,
7201
+ handleAngularPageRequest,
7202
+ provideDeterministicEnv,
7203
+ withPendingTask
7132
7204
  };
7133
7205
 
7134
- //# debugId=4F398A37606C42FD64756E2164756E21
7206
+ //# debugId=DDB31A317058248664756E2164756E21
7135
7207
  //# sourceMappingURL=server.js.map