@absolutejs/absolute 0.20.0-beta.173 → 0.20.0-beta.175

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 (110) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/changelog.json +71 -0
  3. package/dist/angular/browser.js +13 -2
  4. package/dist/angular/browser.js.map +3 -3
  5. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  6. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  7. package/dist/angular/index.js +113 -34
  8. package/dist/angular/index.js.map +12 -9
  9. package/dist/angular/server.js +113 -34
  10. package/dist/angular/server.js.map +12 -9
  11. package/dist/build.js +946 -731
  12. package/dist/build.js.map +40 -37
  13. package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
  14. package/dist/cli/{compile-ndc36zna.js → compile-w2z6c9vt.js} +16 -14
  15. package/dist/cli/config/server.js +85 -65
  16. package/dist/cli/{dev-x49583aj.js → dev-8br5mr7t.js} +17 -3
  17. package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
  18. package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
  19. package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
  20. package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
  21. package/dist/cli/index-4j1twret.js +22 -0
  22. package/dist/cli/{index-z794p5qg.js → index-6522t968.js} +43 -21
  23. package/dist/cli/{index-25e7k849.js → index-7z1hh3fg.js} +4 -4
  24. package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
  25. package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
  26. package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
  27. package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
  28. package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
  29. package/dist/cli/index.js +11 -11
  30. package/dist/cli/{islands-p4vgx7a2.js → islands-bx67g15t.js} +8 -7
  31. package/dist/cli/{mobile-nqdkk3gd.js → mobile-we5q51ey.js} +5 -4
  32. package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
  33. package/dist/cli/{start-t3cq57wn.js → start-srs11bm8.js} +5 -4
  34. package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
  35. package/dist/client/chunks/index-4j1snyh2.js +18 -0
  36. package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
  37. package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
  38. package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
  39. package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
  40. package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
  41. package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
  42. package/dist/client/chunks/react-sprprqzs.js.map +10 -0
  43. package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
  44. package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
  45. package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
  46. package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
  47. package/dist/client/index.js +65 -8
  48. package/dist/client/index.js.map +4 -4
  49. package/dist/client/navigation.js +5 -3
  50. package/dist/client/navigation.js.map +2 -2
  51. package/dist/client/prefetch.js +1 -1
  52. package/dist/dev/client/handlers/islands.ts +85 -0
  53. package/dist/dev/client/hmrClient.ts +6 -0
  54. package/dist/dev/importCostReport.js +45 -26
  55. package/dist/index.js +1080 -852
  56. package/dist/index.js.map +41 -38
  57. package/dist/islands/index.js +57 -10
  58. package/dist/islands/index.js.map +9 -7
  59. package/dist/mobile/index.js +115 -95
  60. package/dist/mobile/index.js.map +6 -5
  61. package/dist/mobile/remoteMacAgentEntry.js +205 -651
  62. package/dist/react/browser.js +15 -4
  63. package/dist/react/browser.js.map +5 -5
  64. package/dist/react/components/client.js +506 -0
  65. package/dist/react/components/index.js +14 -15
  66. package/dist/react/components/index.js.map +4 -4
  67. package/dist/react/components/server/index.js +728 -0
  68. package/dist/react/hooks/index.js +14 -15
  69. package/dist/react/hooks/index.js.map +4 -4
  70. package/dist/react/index.js +66 -6
  71. package/dist/react/index.js.map +11 -9
  72. package/dist/react/router/browser.js +7 -8
  73. package/dist/react/router/browser.js.map +4 -4
  74. package/dist/react/router/index.js +7 -8
  75. package/dist/react/router/index.js.map +4 -4
  76. package/dist/react/server.js +14 -1
  77. package/dist/react/server.js.map +4 -4
  78. package/dist/src/build/buildReactServerComponents.d.ts +4 -0
  79. package/dist/src/build/islandEntries.d.ts +5 -0
  80. package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
  81. package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
  82. package/dist/src/client/hydrators/react.d.ts +7 -0
  83. package/dist/src/client/hydrators/svelte.d.ts +3 -0
  84. package/dist/src/client/hydrators/vue.d.ts +3 -0
  85. package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
  86. package/dist/src/core/islandServerGeneration.d.ts +3 -0
  87. package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
  88. package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
  89. package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
  90. package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
  91. package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
  92. package/dist/src/react/components/client.d.ts +4 -0
  93. package/dist/src/react/components/server/index.d.ts +8 -0
  94. package/dist/src/react/serverComponents/constants.d.ts +2 -1
  95. package/dist/src/utils/lazyTypescript.d.ts +3 -0
  96. package/dist/svelte/index.js +66 -6
  97. package/dist/svelte/index.js.map +10 -8
  98. package/dist/svelte/server.js +38 -3
  99. package/dist/svelte/server.js.map +6 -5
  100. package/dist/types/build.d.ts +3 -2
  101. package/dist/types/globals.d.ts +15 -0
  102. package/dist/vue/browser.js +26 -16
  103. package/dist/vue/browser.js.map +5 -5
  104. package/dist/vue/index.js +65 -21
  105. package/dist/vue/index.js.map +10 -9
  106. package/package.json +1 -1
  107. package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
  108. package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
  109. package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
  110. package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
@@ -647,12 +647,12 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
647
647
  result = injectBeforeClose(result, `<script${nonceAttr()}>import(${escapeScriptContent(escapedIndexPath)});</script>`);
648
648
  }
649
649
  return result;
650
- }, renderAngularApp = async (deps, PageComponent, providers, document, url = "/") => {
650
+ }, renderAngularApp = async (deps, PageComponent, providers, document2, url = "/") => {
651
651
  const nonce = readCspNonce();
652
652
  const cspProviders = nonce ? [{ provide: deps.CSP_NONCE, useValue: nonce }] : [];
653
653
  const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers: [...providers, ...cspProviders] }, context);
654
654
  return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
655
- document,
655
+ document: document2,
656
656
  platformProviders: [],
657
657
  url
658
658
  }));
@@ -679,6 +679,19 @@ var init_ssrRender = __esm(() => {
679
679
  selectorCache = new Map;
680
680
  });
681
681
 
682
+ // src/dev/client/cspNonce.ts
683
+ var applyPageNonce = (element) => {
684
+ const nonce = readPageNonce();
685
+ if (nonce)
686
+ element.nonce = nonce;
687
+ return element;
688
+ }, readPageNonce = () => {
689
+ if (typeof document === "undefined")
690
+ return;
691
+ const carrier = document.querySelector("script[nonce], style[nonce]");
692
+ return carrier?.nonce || undefined;
693
+ };
694
+
682
695
  // src/angular/islands.ts
683
696
  var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
684
697
  const requestId = getSsrContextId();
@@ -756,9 +769,9 @@ var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_i
756
769
  { provide: deps.APP_BASE_HREF, useValue: "/" },
757
770
  { provide: propsToken, useValue: props }
758
771
  ];
759
- const document = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;
772
+ const document2 = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;
760
773
  const html = await withSuppressedAngularDevLogs(() => deps.renderApplication((context) => deps.bootstrapApplication(WrapperComponent, { providers }, context), {
761
- document,
774
+ document: document2,
762
775
  platformProviders: [],
763
776
  url: "/"
764
777
  }));
@@ -2192,10 +2205,25 @@ var init_lazyModule = __esm(() => {
2192
2205
  LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
2193
2206
  });
2194
2207
 
2208
+ // src/core/islandServerGeneration.ts
2209
+ var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
2210
+ globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
2211
+ }, createIslandGenerationGuard = (reset) => {
2212
+ let seen = readGeneration();
2213
+ return () => {
2214
+ const current = readGeneration();
2215
+ if (current === seen)
2216
+ return current;
2217
+ seen = current;
2218
+ reset();
2219
+ return current;
2220
+ };
2221
+ };
2222
+
2195
2223
  // src/core/svelteServerModule.ts
2196
2224
  import { mkdir as mkdir2, readdir as readdir2 } from "fs/promises";
2197
2225
  import { basename, dirname as dirname3, extname as extname2, join as join6, relative as relative3, resolve as resolve4 } from "path";
2198
- var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
2226
+ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
2199
2227
  const importPath = relative3(dirname3(from), target).replace(/\\/g, "/");
2200
2228
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
2201
2229
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
@@ -2262,7 +2290,9 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
2262
2290
  }, getCachedModulePath2 = (sourcePath) => {
2263
2291
  const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
2264
2292
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
2265
- return join6(serverCacheRoot2, `${normalizedSourcePath}.server.js`);
2293
+ const generation = syncIslandGeneration();
2294
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
2295
+ return join6(serverCacheRoot2, `${normalizedSourcePath}${generationSuffix}.server.js`);
2266
2296
  }, resolveSvelteImport = async (spec, from) => {
2267
2297
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
2268
2298
  const resolved = resolvePackageImport(spec);
@@ -2294,6 +2324,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
2294
2324
  }
2295
2325
  await Bun.write(path, content);
2296
2326
  }, compileSvelteServerModule = async (sourcePath) => {
2327
+ syncIslandGeneration();
2297
2328
  const cachedModulePath = compiledModuleCache2.get(sourcePath);
2298
2329
  if (cachedModulePath) {
2299
2330
  return cachedModulePath;
@@ -2376,6 +2407,10 @@ var init_svelteServerModule = __esm(() => {
2376
2407
  serverCacheRoot2 = join6(process.cwd(), ".absolutejs", "islands", "svelte");
2377
2408
  compiledModuleCache2 = new Map;
2378
2409
  originalSourcePathCache = new Map;
2410
+ syncIslandGeneration = createIslandGenerationGuard(() => {
2411
+ compiledModuleCache2.clear();
2412
+ originalSourcePathCache.clear();
2413
+ });
2379
2414
  transpiler = new Bun.Transpiler({
2380
2415
  loader: "ts",
2381
2416
  target: "browser"
@@ -2409,13 +2444,15 @@ import { readFileSync as readFileSync4, realpathSync } from "fs";
2409
2444
  import { mkdir as mkdir3 } from "fs/promises";
2410
2445
  import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
2411
2446
  var {Transpiler } = globalThis.Bun;
2412
- var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
2447
+ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
2413
2448
  const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
2414
2449
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
2415
2450
  }, getCachedModulePath3 = (sourcePath) => {
2416
2451
  const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
2417
2452
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
2418
- return join7(serverCacheRoot3, `${normalizedSourcePath}.server.js`);
2453
+ const generation = syncIslandGeneration2();
2454
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
2455
+ return join7(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
2419
2456
  }, writeIfChanged2 = async (path, content) => {
2420
2457
  const targetFile = Bun.file(path);
2421
2458
  if (await targetFile.exists()) {
@@ -2442,6 +2479,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
2442
2479
  `) : nonVueLines.join(`
2443
2480
  `);
2444
2481
  }, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
2482
+ syncIslandGeneration2();
2445
2483
  const cachedModulePath = compiledModuleCache3.get(sourcePath);
2446
2484
  if (cachedModulePath)
2447
2485
  return cachedModulePath;
@@ -2502,6 +2540,9 @@ var init_vueServerModule = __esm(() => {
2502
2540
  init_isFile();
2503
2541
  serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
2504
2542
  compiledModuleCache3 = new Map;
2543
+ syncIslandGeneration2 = createIslandGenerationGuard(() => {
2544
+ compiledModuleCache3.clear();
2545
+ });
2505
2546
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
2506
2547
  });
2507
2548
 
@@ -2519,7 +2560,7 @@ var init_islandMarkupAttributes = __esm(() => {
2519
2560
  });
2520
2561
 
2521
2562
  // src/core/renderIslandMarkup.ts
2522
- var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
2563
+ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
2523
2564
  islandSequence += 1;
2524
2565
  return `island-${islandSequence}`;
2525
2566
  }, isRecord4 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord4(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
@@ -2533,6 +2574,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
2533
2574
  const loadedModule = await import(compiledModulePath);
2534
2575
  return "default" in loadedModule ? loadedModule.default : loadedModule;
2535
2576
  }, loadServerBuildComponent = async (buildReferencePath) => {
2577
+ syncIslandGeneration3();
2536
2578
  const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
2537
2579
  if (cachedBuildComponent) {
2538
2580
  return cachedBuildComponent;
@@ -2571,6 +2613,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
2571
2613
  }
2572
2614
  return loadServerImportComponent(resolvedComponent);
2573
2615
  }, resolveServerIslandComponent = async (component) => {
2616
+ syncIslandGeneration3();
2574
2617
  const cachedResolvedComponent = resolvedServerComponentCache.get(component);
2575
2618
  if (cachedResolvedComponent) {
2576
2619
  return cachedResolvedComponent;
@@ -2669,6 +2712,10 @@ var init_renderIslandMarkup = __esm(() => {
2669
2712
  init_islands();
2670
2713
  resolvedServerComponentCache = new Map;
2671
2714
  resolvedServerBuildComponentCache = new Map;
2715
+ syncIslandGeneration3 = createIslandGenerationGuard(() => {
2716
+ resolvedServerComponentCache.clear();
2717
+ resolvedServerBuildComponentCache.clear();
2718
+ });
2672
2719
  });
2673
2720
 
2674
2721
  // src/islands/index.ts
@@ -2777,5 +2824,5 @@ export {
2777
2824
  renderIslandMarkup
2778
2825
  };
2779
2826
 
2780
- //# debugId=92C095658D3C10BD64756E2164756E21
2827
+ //# debugId=2FF60ED2FCC99C4E64756E2164756E21
2781
2828
  //# sourceMappingURL=index.js.map