@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
@@ -136,7 +136,7 @@ var init_cspNonceRef = __esm(() => {
136
136
  });
137
137
 
138
138
  // src/utils/runtimeMode.ts
139
- var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
139
+ var ENV_VAR = "NODE_ENV", readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR], getNodeEnv = () => readEnv(), isDevelopmentRuntime = () => readEnv() === "development", isProductionRuntime = () => readEnv() === "production";
140
140
 
141
141
  // src/utils/getDurationString.ts
142
142
  var getDurationString = (duration) => {
@@ -338,13 +338,25 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
338
338
  return;
339
339
  warnedMissingBootstrap = true;
340
340
  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().");
341
- }, manifestBuildDir, WINDOWS_ABSOLUTE_PATH, isServerFilePath = (value) => {
341
+ }, MANIFEST_BUILD_DIR_KEY, getManifestBuildDir = () => {
342
+ const value = Reflect.get(globalThis, MANIFEST_BUILD_DIR_KEY);
343
+ return typeof value === "string" ? value : undefined;
344
+ }, WINDOWS_ABSOLUTE_PATH, withTrailingSlash = (path) => path.endsWith("/") ? path : `${path}/`, currentWorkingRoot = () => {
345
+ try {
346
+ return withTrailingSlash(process.cwd().replaceAll("\\", "/"));
347
+ } catch {
348
+ return;
349
+ }
350
+ }, isServerFilePath = (value) => {
342
351
  if (WINDOWS_ABSOLUTE_PATH.test(value))
343
352
  return true;
344
- if (!manifestBuildDir)
345
- return false;
346
- const root = manifestBuildDir.endsWith("/") ? manifestBuildDir : `${manifestBuildDir}/`;
347
- return value.startsWith(root);
353
+ const buildDir = getManifestBuildDir();
354
+ if (buildDir && value.startsWith(withTrailingSlash(buildDir)))
355
+ return true;
356
+ const root = currentWorkingRoot();
357
+ if (root && root !== "/" && value.startsWith(root))
358
+ return true;
359
+ return false;
348
360
  }, toBrowserManifest = (manifest) => {
349
361
  const browserManifest = {};
350
362
  for (const [key, value] of Object.entries(manifest)) {
@@ -556,12 +568,13 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
556
568
  return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
557
569
  }, setCurrentIslandManifest = (manifest, buildDir) => {
558
570
  globalThis.__absoluteManifest = manifest;
559
- manifestBuildDir = buildDir?.replaceAll("\\", "/");
571
+ Reflect.set(globalThis, MANIFEST_BUILD_DIR_KEY, buildDir?.replaceAll("\\", "/"));
560
572
  };
561
573
  var init_islandPageContext = __esm(() => {
562
574
  init_escapeScriptContent();
563
575
  init_cspNonceRef();
564
576
  init_logger();
577
+ MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
565
578
  WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
566
579
  });
567
580
 
@@ -7297,7 +7310,7 @@ var setStreamingSlotWarningController = (controller) => {
7297
7310
  Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
7298
7311
  };
7299
7312
  var warnMissingStreamingSlotCollector = (primitiveName) => {
7300
- if (isProductionRuntime() || isStreamingSlotCollectionActive()) {
7313
+ if (isStreamingSlotCollectionActive()) {
7301
7314
  return;
7302
7315
  }
7303
7316
  getWarningController()?.maybeWarn(primitiveName);
@@ -7484,7 +7497,11 @@ var extractCallsiteFromStack = (stack) => {
7484
7497
  `).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
7485
7498
  return location ? normalizeCallsitePath2(location) : undefined;
7486
7499
  };
7487
- 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)}.` : ""}`;
7500
+ var buildMissingCollectorWarning = (primitiveName, { explicitlyDisabled, handlerCallsite }) => {
7501
+ 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.";
7502
+ return `${primitiveName} rendered during SSR without streaming slot collection enabled. ${fix}${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
7503
+ };
7504
+ var productionWarnings = new Set;
7488
7505
  setStreamingSlotWarningController({
7489
7506
  maybeWarn: (primitiveName) => {
7490
7507
  const store = getWarningStorage()?.getStore();
@@ -7492,7 +7509,13 @@ setStreamingSlotWarningController({
7492
7509
  return;
7493
7510
  }
7494
7511
  store.hasWarned = true;
7495
- logWarn(buildMissingCollectorWarning(primitiveName, store.handlerCallsite));
7512
+ const message = buildMissingCollectorWarning(primitiveName, store);
7513
+ if (isProductionRuntime()) {
7514
+ if (productionWarnings.has(message))
7515
+ return;
7516
+ productionWarnings.add(message);
7517
+ }
7518
+ logWarn(message);
7496
7519
  }
7497
7520
  });
7498
7521
  var captureStreamingSlotWarningCallsite = () => {
@@ -7505,7 +7528,11 @@ var captureStreamingSlotWarningCallsite = () => {
7505
7528
  }
7506
7529
  return extractCallsiteFromStack(stack);
7507
7530
  };
7508
- var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
7531
+ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({
7532
+ explicitlyDisabled: metadata?.explicitlyDisabled === true,
7533
+ handlerCallsite: metadata?.handlerCallsite,
7534
+ hasWarned: false
7535
+ }, task);
7509
7536
 
7510
7537
  // src/angular/pageHandler.ts
7511
7538
  init_ssrRender();
@@ -7796,5 +7823,5 @@ export {
7796
7823
  withPendingTask
7797
7824
  };
7798
7825
 
7799
- //# debugId=7C84EAD3FF54B97D64756E2164756E21
7826
+ //# debugId=3613818A3D22FF3664756E2164756E21
7800
7827
  //# sourceMappingURL=server.js.map