@absolutejs/absolute 0.19.0-beta.947 → 0.19.0-beta.949

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 (39) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +38 -21
  4. package/dist/angular/index.js.map +5 -6
  5. package/dist/angular/server.js +38 -21
  6. package/dist/angular/server.js.map +5 -6
  7. package/dist/build.js +843 -369
  8. package/dist/build.js.map +17 -17
  9. package/dist/cli/index.js +206 -50
  10. package/dist/client/index.js +2 -2
  11. package/dist/client/index.js.map +2 -2
  12. package/dist/index.js +1139 -460
  13. package/dist/index.js.map +19 -19
  14. package/dist/islands/index.js +2 -2
  15. package/dist/islands/index.js.map +2 -2
  16. package/dist/react/index.js +2 -27
  17. package/dist/react/index.js.map +4 -5
  18. package/dist/react/server.js +1 -26
  19. package/dist/react/server.js.map +4 -5
  20. package/dist/src/angular/pageHandler.d.ts +0 -1
  21. package/dist/src/build/compileAngular.d.ts +1 -0
  22. package/dist/src/build/compileTailwind.d.ts +4 -3
  23. package/dist/src/build/tailwindCompiler.d.ts +2 -2
  24. package/dist/src/core/devBuild.d.ts +17 -0
  25. package/dist/src/dev/serverEntryWatcher.d.ts +4 -0
  26. package/dist/src/react/pageHandler.d.ts +0 -1
  27. package/dist/src/svelte/pageHandler.d.ts +0 -1
  28. package/dist/src/vue/pageHandler.d.ts +0 -1
  29. package/dist/svelte/index.js +2 -25
  30. package/dist/svelte/index.js.map +4 -5
  31. package/dist/svelte/server.js +1 -24
  32. package/dist/svelte/server.js.map +4 -5
  33. package/dist/types/globals.d.ts +19 -0
  34. package/dist/vue/index.js +2 -25
  35. package/dist/vue/index.js.map +4 -5
  36. package/dist/vue/server.js +1 -24
  37. package/dist/vue/server.js.map +4 -5
  38. package/package.json +1 -1
  39. package/dist/src/core/ssrCache.d.ts +0 -3
@@ -533,7 +533,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
533
533
  value: propValue
534
534
  })).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
535
535
  return [...providers, ...propProviders];
536
- }, clearSelectorCache = () => selectorCache.clear(), isInjectionToken = (value) => {
536
+ }, isInjectionToken = (value) => {
537
537
  if (!value || typeof value !== "object") {
538
538
  return false;
539
539
  }
@@ -2945,14 +2945,6 @@ var init_logger = __esm(() => {
2945
2945
  };
2946
2946
  });
2947
2947
 
2948
- // src/core/ssrCache.ts
2949
- var dirtyFrameworks, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework), markSsrCacheDirty = (framework) => {
2950
- dirtyFrameworks.add(framework);
2951
- };
2952
- var init_ssrCache = __esm(() => {
2953
- dirtyFrameworks = new Set;
2954
- });
2955
-
2956
2948
  // src/islands/sourceMetadata.ts
2957
2949
  var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate2 = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
2958
2950
  const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
@@ -3504,6 +3496,7 @@ var init_generatedDir = () => {};
3504
3496
  // src/build/compileAngular.ts
3505
3497
  var exports_compileAngular = {};
3506
3498
  __export(exports_compileAngular, {
3499
+ invalidateAngularJitCache: () => invalidateAngularJitCache,
3507
3500
  compileAngularFiles: () => compileAngularFiles,
3508
3501
  compileAngularFileJIT: () => compileAngularFileJIT,
3509
3502
  compileAngularFile: () => compileAngularFile,
@@ -3511,6 +3504,7 @@ __export(exports_compileAngular, {
3511
3504
  });
3512
3505
  import { existsSync as existsSync4, readFileSync as readFileSync4, promises as fs } from "fs";
3513
3506
  import { join as join7, basename as basename3, sep, dirname as dirname4, resolve as resolve6, relative as relative4 } from "path";
3507
+ var {Glob } = globalThis.Bun;
3514
3508
  import ts from "typescript";
3515
3509
  var traceAngularPhase = async (name, fn, metadata) => {
3516
3510
  const tracePhase = globalThis.__absoluteBuildTracePhase;
@@ -3970,7 +3964,9 @@ var traceAngularPhase = async (name, fn, metadata) => {
3970
3964
  await fs.writeFile(target, content, "utf-8");
3971
3965
  })), { outputs: entries.length });
3972
3966
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
3973
- }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
3967
+ }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
3968
+ jitContentCache.delete(resolve6(filePath));
3969
+ }, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
3974
3970
  const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
3975
3971
  let match;
3976
3972
  while ((match = re.exec(source)) !== null) {
@@ -4396,6 +4392,25 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4396
4392
  const indexesDir = join7(compiledParent, "indexes");
4397
4393
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
4398
4394
  const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve6(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
4395
+ if (!hmr) {
4396
+ await traceAngularPhase("aot/copy-json-resources", async () => {
4397
+ const cwd = process.cwd();
4398
+ const angularSrcDir = resolve6(outRoot);
4399
+ if (!existsSync4(angularSrcDir))
4400
+ return;
4401
+ const jsonGlob = new Glob("**/*.json");
4402
+ for (const rel of jsonGlob.scanSync({
4403
+ absolute: false,
4404
+ cwd: angularSrcDir
4405
+ })) {
4406
+ const sourcePath = join7(angularSrcDir, rel);
4407
+ const cwdRel = relative4(cwd, sourcePath);
4408
+ const targetPath = join7(compiledRoot, cwdRel);
4409
+ await fs.mkdir(dirname4(targetPath), { recursive: true });
4410
+ await fs.copyFile(sourcePath, targetPath);
4411
+ }
4412
+ });
4413
+ }
4399
4414
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
4400
4415
  const compileTasks = entryPoints.map(async (entry) => {
4401
4416
  const resolvedEntry = resolve6(entry);
@@ -4469,7 +4484,6 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4469
4484
  rewritten = `import '@angular/compiler';
4470
4485
  ${rewritten}`;
4471
4486
  }
4472
- rewritten = rewritten.replace(new RegExp(`templateUrl:\\s*['"]\\.\\/${fileBase}\\.html['"]`), `templateUrl: '../../pages/${fileBase}.html'`);
4473
4487
  if (detectedClassName && !rewritten.includes("export default")) {
4474
4488
  rewritten += `
4475
4489
  export default ${componentClassName};
@@ -5691,7 +5705,6 @@ var captureStreamingSlotWarningCallsite = () => {
5691
5705
  var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
5692
5706
 
5693
5707
  // src/angular/pageHandler.ts
5694
- init_ssrCache();
5695
5708
  init_ssrRender();
5696
5709
  var lastSelector = "angular-page";
5697
5710
  var isRecord5 = (value) => typeof value === "object" && value !== null;
@@ -5746,6 +5759,18 @@ var ensureAngularSsrNodeModules = async (outDir) => {
5746
5759
  };
5747
5760
  var resolveRuntimeAngularModulePath = async (pagePath) => {
5748
5761
  if (!pagePath.endsWith(".ts")) {
5762
+ if (true) {
5763
+ try {
5764
+ const { stat } = await import("fs/promises");
5765
+ const stats = await stat(pagePath);
5766
+ return {
5767
+ path: pagePath,
5768
+ cacheBuster: stats.mtimeMs.toString(BASE_36_RADIX)
5769
+ };
5770
+ } catch {
5771
+ return { path: pagePath, cacheBuster: undefined };
5772
+ }
5773
+ }
5749
5774
  return {
5750
5775
  path: pagePath,
5751
5776
  cacheBuster: undefined
@@ -5810,14 +5835,6 @@ var handleAngularPageRequest = async (input) => {
5810
5835
  headTag: resolvedHeadTag,
5811
5836
  props: maybeProps
5812
5837
  });
5813
- if (isSsrCacheDirty("angular")) {
5814
- clearSelectorCache();
5815
- const script = resolvedIndexPath ? `<script>import(${JSON.stringify(resolvedIndexPath)});</script>` : "";
5816
- const html = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${lastSelector}></${lastSelector}>${script}</body></html>`;
5817
- return new Response(html, {
5818
- headers: { "Content-Type": "text/html" }
5819
- });
5820
- }
5821
5838
  try {
5822
5839
  assertNoHandlerProviders(input);
5823
5840
  const handlerCallsite = options?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
@@ -5895,5 +5912,5 @@ export {
5895
5912
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
5896
5913
  };
5897
5914
 
5898
- //# debugId=2EBCE21622B1047764756E2164756E21
5915
+ //# debugId=DB1C8E0B7290B03364756E2164756E21
5899
5916
  //# sourceMappingURL=server.js.map