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

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 (63) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -2
  3. package/changelog.json +57 -0
  4. package/dist/angular/browser.js +12 -12
  5. package/dist/angular/browser.js.map +6 -7
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +2 -6
  7. package/dist/angular/components/core/streamingSlotRegistry.js +3 -7
  8. package/dist/angular/components/defer-slot.component.js +12 -7
  9. package/dist/angular/components/stream-slot.component.js +3 -1
  10. package/dist/angular/index.js +40 -13
  11. package/dist/angular/index.js.map +7 -7
  12. package/dist/angular/server.js +39 -12
  13. package/dist/angular/server.js.map +6 -6
  14. package/dist/build/buildWorker.js +135 -57
  15. package/dist/build.js +1183 -1011
  16. package/dist/build.js.map +16 -15
  17. package/dist/cli/config/server.js +43 -12
  18. package/dist/cli/{doctor-repprx92.js → doctor-m36tmx4d.js} +70 -15
  19. package/dist/cli/index.js +1 -1
  20. package/dist/core/streamingSlotRegistrar.js +2 -5
  21. package/dist/core/streamingSlotRegistrar.js.map +4 -5
  22. package/dist/core/streamingSlotRegistry.js +2 -5
  23. package/dist/core/streamingSlotRegistry.js.map +4 -5
  24. package/dist/dev/serverBootstrap.js +2 -1
  25. package/dist/index.js +1116 -940
  26. package/dist/index.js.map +18 -17
  27. package/dist/islands/index.js +2 -2
  28. package/dist/islands/index.js.map +3 -3
  29. package/dist/mobile/browser.js +2 -2
  30. package/dist/mobile/browser.js.map +3 -3
  31. package/dist/mobile/index.js +2 -2
  32. package/dist/mobile/index.js.map +3 -3
  33. package/dist/react/components/index.js +2 -5
  34. package/dist/react/components/index.js.map +5 -6
  35. package/dist/react/index.js +45 -16
  36. package/dist/react/index.js.map +8 -8
  37. package/dist/react/router/browser.js.map +2 -2
  38. package/dist/react/router/index.js.map +2 -2
  39. package/dist/react/server.js +45 -16
  40. package/dist/react/server.js.map +8 -8
  41. package/dist/src/angular/components/defer-slot.component.d.ts +1 -0
  42. package/dist/src/build/missingReactRouter.d.ts +8 -0
  43. package/dist/src/build/vueModuleOutputPath.d.ts +10 -6
  44. package/dist/src/cli/scripts/doctor.d.ts +10 -0
  45. package/dist/src/core/streamingSlotWarningScope.d.ts +3 -0
  46. package/dist/src/dev/hot/reload.d.ts +5 -0
  47. package/dist/src/dev/hot/runtime.d.ts +2 -0
  48. package/dist/src/dev/srcPath.d.ts +2 -1
  49. package/dist/src/react/pageHandler.d.ts +5 -0
  50. package/dist/src/react/router/Link.d.ts +6 -1
  51. package/dist/src/react/serverComponents/pageHandler.d.ts +2 -0
  52. package/dist/src/utils/portInUse.d.ts +16 -0
  53. package/dist/svelte/index.js +39 -12
  54. package/dist/svelte/index.js.map +6 -6
  55. package/dist/svelte/server.js +39 -12
  56. package/dist/svelte/server.js.map +6 -6
  57. package/dist/vue/components/index.js +2 -5
  58. package/dist/vue/components/index.js.map +4 -5
  59. package/dist/vue/index.js +39 -12
  60. package/dist/vue/index.js.map +6 -6
  61. package/dist/vue/server.js +39 -12
  62. package/dist/vue/server.js.map +6 -6
  63. package/package.json +1 -1
@@ -101,7 +101,7 @@ var init_cspNonceRef = __esm(() => {
101
101
  });
102
102
 
103
103
  // src/utils/runtimeMode.ts
104
- var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
104
+ var ENV_VAR = "NODE_ENV", readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR], getNodeEnv = () => readEnv(), isDevelopmentRuntime = () => readEnv() === "development", isProductionRuntime = () => readEnv() === "production";
105
105
 
106
106
  // src/utils/inlinePageCss.ts
107
107
  var siblingCssCache, clearSiblingCssCache = () => {
@@ -937,13 +937,25 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
937
937
  return;
938
938
  warnedMissingBootstrap = true;
939
939
  logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
940
- }, manifestBuildDir, WINDOWS_ABSOLUTE_PATH, isServerFilePath = (value) => {
940
+ }, MANIFEST_BUILD_DIR_KEY, getManifestBuildDir = () => {
941
+ const value = Reflect.get(globalThis, MANIFEST_BUILD_DIR_KEY);
942
+ return typeof value === "string" ? value : undefined;
943
+ }, WINDOWS_ABSOLUTE_PATH, withTrailingSlash = (path) => path.endsWith("/") ? path : `${path}/`, currentWorkingRoot = () => {
944
+ try {
945
+ return withTrailingSlash(process.cwd().replaceAll("\\", "/"));
946
+ } catch {
947
+ return;
948
+ }
949
+ }, isServerFilePath = (value) => {
941
950
  if (WINDOWS_ABSOLUTE_PATH.test(value))
942
951
  return true;
943
- if (!manifestBuildDir)
944
- return false;
945
- const root = manifestBuildDir.endsWith("/") ? manifestBuildDir : `${manifestBuildDir}/`;
946
- return value.startsWith(root);
952
+ const buildDir = getManifestBuildDir();
953
+ if (buildDir && value.startsWith(withTrailingSlash(buildDir)))
954
+ return true;
955
+ const root = currentWorkingRoot();
956
+ if (root && root !== "/" && value.startsWith(root))
957
+ return true;
958
+ return false;
947
959
  }, toBrowserManifest = (manifest) => {
948
960
  const browserManifest = {};
949
961
  for (const [key, value] of Object.entries(manifest)) {
@@ -1155,12 +1167,13 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
1155
1167
  return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
1156
1168
  }, setCurrentIslandManifest = (manifest, buildDir) => {
1157
1169
  globalThis.__absoluteManifest = manifest;
1158
- manifestBuildDir = buildDir?.replaceAll("\\", "/");
1170
+ Reflect.set(globalThis, MANIFEST_BUILD_DIR_KEY, buildDir?.replaceAll("\\", "/"));
1159
1171
  };
1160
1172
  var init_islandPageContext = __esm(() => {
1161
1173
  init_escapeScriptContent();
1162
1174
  init_cspNonceRef();
1163
1175
  init_logger();
1176
+ MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
1164
1177
  WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
1165
1178
  });
1166
1179
 
@@ -2702,7 +2715,7 @@ var setStreamingSlotWarningController = (controller) => {
2702
2715
  Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
2703
2716
  };
2704
2717
  var warnMissingStreamingSlotCollector = (primitiveName) => {
2705
- if (isProductionRuntime() || isStreamingSlotCollectionActive()) {
2718
+ if (isStreamingSlotCollectionActive()) {
2706
2719
  return;
2707
2720
  }
2708
2721
  getWarningController()?.maybeWarn(primitiveName);
@@ -2889,7 +2902,11 @@ var extractCallsiteFromStack = (stack) => {
2889
2902
  `).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
2890
2903
  return location ? normalizeCallsitePath2(location) : undefined;
2891
2904
  };
2892
- var buildMissingCollectorWarning = (primitiveName, handlerCallsite) => `${primitiveName} rendered during SSR without streaming slot collection enabled. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
2905
+ var buildMissingCollectorWarning = (primitiveName, { explicitlyDisabled, handlerCallsite }) => {
2906
+ const fix = explicitlyDisabled ? "This page handler sets { collectStreamingSlots: false }, so the slot stays on its fallback and never streams. Remove the option (or set it to true) to stream this route." : "The slot stays on its fallback and never streams. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.";
2907
+ return `${primitiveName} rendered during SSR without streaming slot collection enabled. ${fix}${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
2908
+ };
2909
+ var productionWarnings = new Set;
2893
2910
  setStreamingSlotWarningController({
2894
2911
  maybeWarn: (primitiveName) => {
2895
2912
  const store = getWarningStorage()?.getStore();
@@ -2897,7 +2914,13 @@ setStreamingSlotWarningController({
2897
2914
  return;
2898
2915
  }
2899
2916
  store.hasWarned = true;
2900
- logWarn(buildMissingCollectorWarning(primitiveName, store.handlerCallsite));
2917
+ const message = buildMissingCollectorWarning(primitiveName, store);
2918
+ if (isProductionRuntime()) {
2919
+ if (productionWarnings.has(message))
2920
+ return;
2921
+ productionWarnings.add(message);
2922
+ }
2923
+ logWarn(message);
2901
2924
  }
2902
2925
  });
2903
2926
  var captureStreamingSlotWarningCallsite = () => {
@@ -2910,7 +2933,11 @@ var captureStreamingSlotWarningCallsite = () => {
2910
2933
  }
2911
2934
  return extractCallsiteFromStack(stack);
2912
2935
  };
2913
- var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
2936
+ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({
2937
+ explicitlyDisabled: metadata?.explicitlyDisabled === true,
2938
+ handlerCallsite: metadata?.handlerCallsite,
2939
+ hasWarned: false
2940
+ }, task);
2914
2941
 
2915
2942
  // src/vue/pageHandler.ts
2916
2943
  init_ssrErrorPage();
@@ -3277,5 +3304,5 @@ export {
3277
3304
  handleVuePageRequest
3278
3305
  };
3279
3306
 
3280
- //# debugId=F9CA11A69DA611AC64756E2164756E21
3307
+ //# debugId=1FF8E0EE26DF46A564756E2164756E21
3281
3308
  //# sourceMappingURL=server.js.map