@absolutejs/absolute 0.20.0-beta.174 → 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 (84) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/changelog.json +60 -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 +67 -8
  8. package/dist/angular/index.js.map +10 -8
  9. package/dist/angular/server.js +67 -8
  10. package/dist/angular/server.js.map +10 -8
  11. package/dist/build.js +312 -119
  12. package/dist/build.js.map +20 -18
  13. package/dist/cli/{compile-n6fs2vmx.js → compile-w2z6c9vt.js} +1 -1
  14. package/dist/cli/{dev-6h1f0mzq.js → dev-8br5mr7t.js} +16 -2
  15. package/dist/cli/{index-mqevg32w.js → index-6522t968.js} +21 -2
  16. package/dist/cli/{index-bhyd3ejc.js → index-7z1hh3fg.js} +1 -1
  17. package/dist/cli/index.js +6 -6
  18. package/dist/cli/{islands-vk05sj6v.js → islands-bx67g15t.js} +4 -4
  19. package/dist/cli/{mobile-62b6j3j7.js → mobile-we5q51ey.js} +2 -2
  20. package/dist/cli/{start-jh6kyp92.js → start-srs11bm8.js} +2 -2
  21. package/dist/client/chunks/index-4j1snyh2.js +18 -0
  22. package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
  23. package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
  24. package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
  25. package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
  26. package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
  27. package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
  28. package/dist/client/chunks/react-sprprqzs.js.map +10 -0
  29. package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
  30. package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
  31. package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
  32. package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
  33. package/dist/client/index.js +65 -8
  34. package/dist/client/index.js.map +4 -4
  35. package/dist/client/navigation.js +5 -3
  36. package/dist/client/navigation.js.map +2 -2
  37. package/dist/client/prefetch.js +1 -1
  38. package/dist/dev/client/handlers/islands.ts +85 -0
  39. package/dist/dev/client/hmrClient.ts +6 -0
  40. package/dist/index.js +448 -242
  41. package/dist/index.js.map +21 -19
  42. package/dist/islands/index.js +57 -10
  43. package/dist/islands/index.js.map +9 -7
  44. package/dist/react/browser.js +15 -4
  45. package/dist/react/browser.js.map +5 -5
  46. package/dist/react/components/client.js +506 -0
  47. package/dist/react/components/index.js +14 -15
  48. package/dist/react/components/index.js.map +4 -4
  49. package/dist/react/components/server/index.js +728 -0
  50. package/dist/react/hooks/index.js +14 -15
  51. package/dist/react/hooks/index.js.map +4 -4
  52. package/dist/react/index.js +66 -6
  53. package/dist/react/index.js.map +11 -9
  54. package/dist/react/router/browser.js +7 -8
  55. package/dist/react/router/browser.js.map +4 -4
  56. package/dist/react/router/index.js +7 -8
  57. package/dist/react/router/index.js.map +4 -4
  58. package/dist/react/server.js +14 -1
  59. package/dist/react/server.js.map +4 -4
  60. package/dist/src/build/buildReactServerComponents.d.ts +4 -0
  61. package/dist/src/build/islandEntries.d.ts +5 -0
  62. package/dist/src/client/hydrators/react.d.ts +7 -0
  63. package/dist/src/client/hydrators/svelte.d.ts +3 -0
  64. package/dist/src/client/hydrators/vue.d.ts +3 -0
  65. package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
  66. package/dist/src/core/islandServerGeneration.d.ts +3 -0
  67. package/dist/src/react/components/client.d.ts +4 -0
  68. package/dist/src/react/components/server/index.d.ts +8 -0
  69. package/dist/src/react/serverComponents/constants.d.ts +2 -1
  70. package/dist/svelte/index.js +66 -6
  71. package/dist/svelte/index.js.map +10 -8
  72. package/dist/svelte/server.js +38 -3
  73. package/dist/svelte/server.js.map +6 -5
  74. package/dist/types/build.d.ts +3 -2
  75. package/dist/types/globals.d.ts +15 -0
  76. package/dist/vue/browser.js +26 -16
  77. package/dist/vue/browser.js.map +5 -5
  78. package/dist/vue/index.js +65 -21
  79. package/dist/vue/index.js.map +10 -9
  80. package/package.json +1 -1
  81. package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
  82. package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
  83. package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
  84. package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
@@ -986,10 +986,25 @@ var init_lazyModule = __esm(() => {
986
986
  LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
987
987
  });
988
988
 
989
+ // src/core/islandServerGeneration.ts
990
+ var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
991
+ globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
992
+ }, createIslandGenerationGuard = (reset) => {
993
+ let seen = readGeneration();
994
+ return () => {
995
+ const current = readGeneration();
996
+ if (current === seen)
997
+ return current;
998
+ seen = current;
999
+ reset();
1000
+ return current;
1001
+ };
1002
+ };
1003
+
989
1004
  // src/core/svelteServerModule.ts
990
1005
  import { mkdir, readdir } from "fs/promises";
991
1006
  import { basename, dirname as dirname2, extname as extname2, join as join3, relative as relative2, resolve as resolve3 } from "path";
992
- var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
1007
+ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
993
1008
  const importPath = relative2(dirname2(from), target).replace(/\\/g, "/");
994
1009
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
995
1010
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
@@ -1056,7 +1071,9 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
1056
1071
  }, getCachedModulePath = (sourcePath) => {
1057
1072
  const relativeSourcePath = relative2(process.cwd(), sourcePath).replace(/\\/g, "/");
1058
1073
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
1059
- return join3(serverCacheRoot, `${normalizedSourcePath}.server.js`);
1074
+ const generation = syncIslandGeneration();
1075
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
1076
+ return join3(serverCacheRoot, `${normalizedSourcePath}${generationSuffix}.server.js`);
1060
1077
  }, resolveSvelteImport = async (spec, from) => {
1061
1078
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
1062
1079
  const resolved = resolvePackageImport(spec);
@@ -1088,6 +1105,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
1088
1105
  }
1089
1106
  await Bun.write(path, content);
1090
1107
  }, compileSvelteServerModule = async (sourcePath) => {
1108
+ syncIslandGeneration();
1091
1109
  const cachedModulePath = compiledModuleCache.get(sourcePath);
1092
1110
  if (cachedModulePath) {
1093
1111
  return cachedModulePath;
@@ -1170,6 +1188,10 @@ var init_svelteServerModule = __esm(() => {
1170
1188
  serverCacheRoot = join3(process.cwd(), ".absolutejs", "islands", "svelte");
1171
1189
  compiledModuleCache = new Map;
1172
1190
  originalSourcePathCache = new Map;
1191
+ syncIslandGeneration = createIslandGenerationGuard(() => {
1192
+ compiledModuleCache.clear();
1193
+ originalSourcePathCache.clear();
1194
+ });
1173
1195
  transpiler = new Bun.Transpiler({
1174
1196
  loader: "ts",
1175
1197
  target: "browser"
@@ -4106,6 +4128,19 @@ var init_ssrRender = __esm(() => {
4106
4128
  selectorCache = new Map;
4107
4129
  });
4108
4130
 
4131
+ // src/dev/client/cspNonce.ts
4132
+ var applyPageNonce = (element) => {
4133
+ const nonce = readPageNonce();
4134
+ if (nonce)
4135
+ element.nonce = nonce;
4136
+ return element;
4137
+ }, readPageNonce = () => {
4138
+ if (typeof document === "undefined")
4139
+ return;
4140
+ const carrier = document.querySelector("script[nonce], style[nonce]");
4141
+ return carrier?.nonce || undefined;
4142
+ };
4143
+
4109
4144
  // src/angular/islands.ts
4110
4145
  var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
4111
4146
  const requestId = getSsrContextId();
@@ -4749,13 +4784,15 @@ import { readFileSync as readFileSync5, realpathSync } from "fs";
4749
4784
  import { mkdir as mkdir3 } from "fs/promises";
4750
4785
  import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
4751
4786
  var {Transpiler } = globalThis.Bun;
4752
- var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
4787
+ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
4753
4788
  const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
4754
4789
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
4755
4790
  }, getCachedModulePath3 = (sourcePath) => {
4756
4791
  const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
4757
4792
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
4758
- return join7(serverCacheRoot3, `${normalizedSourcePath}.server.js`);
4793
+ const generation = syncIslandGeneration2();
4794
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
4795
+ return join7(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
4759
4796
  }, writeIfChanged2 = async (path, content) => {
4760
4797
  const targetFile = Bun.file(path);
4761
4798
  if (await targetFile.exists()) {
@@ -4782,6 +4819,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
4782
4819
  `) : nonVueLines.join(`
4783
4820
  `);
4784
4821
  }, 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) => {
4822
+ syncIslandGeneration2();
4785
4823
  const cachedModulePath = compiledModuleCache3.get(sourcePath);
4786
4824
  if (cachedModulePath)
4787
4825
  return cachedModulePath;
@@ -4842,6 +4880,9 @@ var init_vueServerModule = __esm(() => {
4842
4880
  init_isFile();
4843
4881
  serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
4844
4882
  compiledModuleCache3 = new Map;
4883
+ syncIslandGeneration2 = createIslandGenerationGuard(() => {
4884
+ compiledModuleCache3.clear();
4885
+ });
4845
4886
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
4846
4887
  });
4847
4888
 
@@ -4884,7 +4925,7 @@ var init_islandMarkupAttributes = __esm(() => {
4884
4925
  });
4885
4926
 
4886
4927
  // src/core/renderIslandMarkup.ts
4887
- var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
4928
+ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
4888
4929
  islandSequence += 1;
4889
4930
  return `island-${islandSequence}`;
4890
4931
  }, isRecord9 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord9(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
@@ -4898,6 +4939,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
4898
4939
  const loadedModule = await import(compiledModulePath);
4899
4940
  return "default" in loadedModule ? loadedModule.default : loadedModule;
4900
4941
  }, loadServerBuildComponent = async (buildReferencePath) => {
4942
+ syncIslandGeneration3();
4901
4943
  const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
4902
4944
  if (cachedBuildComponent) {
4903
4945
  return cachedBuildComponent;
@@ -4936,6 +4978,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
4936
4978
  }
4937
4979
  return loadServerImportComponent(resolvedComponent);
4938
4980
  }, resolveServerIslandComponent = async (component) => {
4981
+ syncIslandGeneration3();
4939
4982
  const cachedResolvedComponent = resolvedServerComponentCache.get(component);
4940
4983
  if (cachedResolvedComponent) {
4941
4984
  return cachedResolvedComponent;
@@ -5034,6 +5077,10 @@ var init_renderIslandMarkup = __esm(() => {
5034
5077
  init_islands2();
5035
5078
  resolvedServerComponentCache = new Map;
5036
5079
  resolvedServerBuildComponentCache = new Map;
5080
+ syncIslandGeneration3 = createIslandGenerationGuard(() => {
5081
+ resolvedServerComponentCache.clear();
5082
+ resolvedServerBuildComponentCache.clear();
5083
+ });
5037
5084
  });
5038
5085
 
5039
5086
  // src/core/currentIslandRegistry.ts
@@ -5625,6 +5672,17 @@ var defineFileRouteWith = (framework, route, render) => {
5625
5672
 
5626
5673
  // src/core/lookup.ts
5627
5674
  init_requestContext();
5675
+ var DOUBLED_RSC_SUFFIX = "RSCRSC";
5676
+ var warnedDoubledRscKeys = new Set;
5677
+ var warnDoubledRscKey = (source, name, assetPath) => {
5678
+ if (!name.endsWith(DOUBLED_RSC_SUFFIX))
5679
+ return;
5680
+ const current = name.slice(0, -"RSC".length);
5681
+ if (source[current] !== assetPath || warnedDoubledRscKeys.has(name))
5682
+ return;
5683
+ warnedDoubledRscKeys.add(name);
5684
+ console.warn(`[asset] key "${name}" is deprecated: React Server Components pages whose file name ends in RSC no longer get the suffix twice. Use asset(manifest, '${current}').`);
5685
+ };
5628
5686
  var asset = (source, name) => {
5629
5687
  const assetPath = source[name];
5630
5688
  if (assetPath === undefined) {
@@ -5638,6 +5696,8 @@ var asset = (source, name) => {
5638
5696
  console.warn(`[asset] key "${name}" not found in manifest (dev mode \u2014 skipping)`);
5639
5697
  return "";
5640
5698
  }
5699
+ if (!isProductionRuntime())
5700
+ warnDoubledRscKey(source, name, assetPath);
5641
5701
  return assetPath;
5642
5702
  };
5643
5703
 
@@ -6101,5 +6161,5 @@ export {
6101
6161
  useIslandStore
6102
6162
  };
6103
6163
 
6104
- //# debugId=B0580FC0A61D8A6F64756E2164756E21
6164
+ //# debugId=3C69D998E176291964756E2164756E21
6105
6165
  //# sourceMappingURL=index.js.map