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

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 (47) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/changelog.json +11 -0
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +47 -27
  6. package/dist/angular/index.js.map +6 -5
  7. package/dist/angular/server.js +47 -27
  8. package/dist/angular/server.js.map +6 -5
  9. package/dist/build.js +635 -613
  10. package/dist/build.js.map +25 -24
  11. package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
  12. package/dist/cli/{compile-ndc36zna.js → compile-n6fs2vmx.js} +16 -14
  13. package/dist/cli/config/server.js +85 -65
  14. package/dist/cli/{dev-x49583aj.js → dev-6h1f0mzq.js} +1 -1
  15. package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
  16. package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
  17. package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
  18. package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
  19. package/dist/cli/index-4j1twret.js +22 -0
  20. package/dist/cli/{index-25e7k849.js → index-bhyd3ejc.js} +4 -4
  21. package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
  22. package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
  23. package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
  24. package/dist/cli/{index-z794p5qg.js → index-mqevg32w.js} +22 -19
  25. package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
  26. package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
  27. package/dist/cli/index.js +11 -11
  28. package/dist/cli/{islands-p4vgx7a2.js → islands-vk05sj6v.js} +5 -4
  29. package/dist/cli/{mobile-nqdkk3gd.js → mobile-62b6j3j7.js} +5 -4
  30. package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
  31. package/dist/cli/{start-t3cq57wn.js → start-jh6kyp92.js} +5 -4
  32. package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
  33. package/dist/dev/importCostReport.js +45 -26
  34. package/dist/index.js +633 -611
  35. package/dist/index.js.map +25 -24
  36. package/dist/mobile/index.js +115 -95
  37. package/dist/mobile/index.js.map +6 -5
  38. package/dist/mobile/remoteMacAgentEntry.js +205 -651
  39. package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
  40. package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
  41. package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
  42. package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
  43. package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
  44. package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
  45. package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
  46. package/dist/src/utils/lazyTypescript.d.ts +3 -0
  47. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.20.0-beta.174 — 2026-11-14
10
+
11
+ ### Changed
12
+
13
+ - **Servers start faster: the framework no longer loads TypeScript at import**
14
+ Importing `@absolutejs/absolute` (and its `build`, `angular`, `angular/server` and `mobile` entry points) loaded the `typescript` package straight away, which takes a few hundred milliseconds of CPU, even though a running server never needs it. TypeScript now loads the first time the framework actually uses it (route scanning, island registries, Angular compilation, config editing), so servers start faster. Nothing you call changed, and those functions stay synchronous.
15
+
9
16
  ## 0.20.0-beta.173 — 2026-11-14
10
17
 
11
18
  ### Security
package/changelog.json CHANGED
@@ -2,6 +2,17 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/absolute",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "detail": "Importing `@absolutejs/absolute` (and its `build`, `angular`, `angular/server` and `mobile` entry points) loaded the `typescript` package straight away, which takes a few hundred milliseconds of CPU, even though a running server never needs it. TypeScript now loads the first time the framework actually uses it (route scanning, island registries, Angular compilation, config editing), so servers start faster. Nothing you call changed, and those functions stay synchronous.",
9
+ "kind": "changed",
10
+ "summary": "Servers start faster: the framework no longer loads TypeScript at import"
11
+ }
12
+ ],
13
+ "date": "2026-11-14",
14
+ "version": "0.20.0-beta.174"
15
+ },
5
16
  {
6
17
  "changes": [
7
18
  {
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- // .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistrar.ts
2
+ // .angular-partial-tmp-dYHPyC/src/core/streamingSlotRegistrar.ts
3
3
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
4
4
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
5
5
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- // .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistrar.ts
2
+ // .angular-partial-tmp-dYHPyC/src/core/streamingSlotRegistrar.ts
3
3
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
4
4
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
5
5
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -46,7 +46,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
46
46
  getWarningController()?.maybeWarn(primitiveName);
47
47
  };
48
48
 
49
- // .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistry.ts
49
+ // .angular-partial-tmp-dYHPyC/src/core/streamingSlotRegistry.ts
50
50
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
51
51
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
52
52
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -4956,6 +4956,26 @@ var init_partialPrerender = __esm(() => {
4956
4956
  SINK_STORAGE_KEY = Symbol.for("absolutejs.partialPrerenderHolesSink");
4957
4957
  });
4958
4958
 
4959
+ // src/utils/lazyTypescript.ts
4960
+ import { createRequire as createRequire2 } from "module";
4961
+ var loaded, loadTypescript = () => {
4962
+ if (loaded)
4963
+ return loaded;
4964
+ const requireFromHere = createRequire2(import.meta.url);
4965
+ const typescript = requireFromHere("typescript");
4966
+ loaded = typescript;
4967
+ return typescript;
4968
+ }, createLazyTypescript = () => {
4969
+ const target = Object.create(null);
4970
+ return new Proxy(target, {
4971
+ get: (_target, key) => Reflect.get(loadTypescript(), key),
4972
+ has: (_target, key) => Reflect.has(loadTypescript(), key)
4973
+ });
4974
+ }, lazyTypescript;
4975
+ var init_lazyTypescript = __esm(() => {
4976
+ lazyTypescript = createLazyTypescript();
4977
+ });
4978
+
4959
4979
  // src/islands/sourceMetadata.ts
4960
4980
  var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate2 = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
4961
4981
  const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
@@ -5505,22 +5525,22 @@ var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", g
5505
5525
  var init_generatedDir = () => {};
5506
5526
 
5507
5527
  // src/build/downlevelAsyncForZone.ts
5508
- import ts from "typescript";
5509
5528
  var ASYNC_KEYWORD, downlevelAsyncForZone = (code, fileName) => {
5510
5529
  if (!isAngularZoneMode() || !ASYNC_KEYWORD.test(code))
5511
5530
  return code;
5512
- return ts.transpileModule(code, {
5531
+ return lazyTypescript.transpileModule(code, {
5513
5532
  compilerOptions: {
5514
5533
  importHelpers: false,
5515
- module: ts.ModuleKind.ESNext,
5534
+ module: lazyTypescript.ModuleKind.ESNext,
5516
5535
  sourceMap: false,
5517
- target: ts.ScriptTarget.ES2016,
5536
+ target: lazyTypescript.ScriptTarget.ES2016,
5518
5537
  useDefineForClassFields: false
5519
5538
  },
5520
5539
  fileName: fileName.replace(/\.[cm]?[tj]sx?$/, ".js")
5521
5540
  }).outputText;
5522
5541
  };
5523
5542
  var init_downlevelAsyncForZone = __esm(() => {
5543
+ init_lazyTypescript();
5524
5544
  ASYNC_KEYWORD = /\basync\b/;
5525
5545
  });
5526
5546
 
@@ -5534,7 +5554,6 @@ __export(exports_compileAngular, {
5534
5554
  import { existsSync as existsSync5, readFileSync as readFileSync6, promises as fs } from "fs";
5535
5555
  import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve6, relative as relative5 } from "path";
5536
5556
  var {Glob } = globalThis.Bun;
5537
- import ts2 from "typescript";
5538
5557
  var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
5539
5558
  const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
5540
5559
  try {
@@ -5549,7 +5568,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5549
5568
  }, readTsconfigPathAliases = () => {
5550
5569
  try {
5551
5570
  const configPath = resolve6(process.cwd(), "tsconfig.json");
5552
- const config = ts2.readConfigFile(configPath, ts2.sys.readFile).config;
5571
+ const config = lazyTypescript.readConfigFile(configPath, lazyTypescript.sys.readFile).config;
5553
5572
  const compilerOptions = config?.compilerOptions ?? {};
5554
5573
  const baseUrl = resolve6(process.cwd(), compilerOptions.baseUrl ?? ".");
5555
5574
  const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
@@ -5678,7 +5697,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5678
5697
  return resolve6(import.meta.dir, "./dev/client");
5679
5698
  }, devClientDir, hmrClientPath, formatDiagnosticMessage = (diagnostic) => {
5680
5699
  try {
5681
- return ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
5700
+ return lazyTypescript.flattenDiagnosticMessageText(diagnostic.messageText, `
5682
5701
  `);
5683
5702
  } catch {
5684
5703
  return String(diagnostic.messageText || "Unknown error");
@@ -5686,7 +5705,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5686
5705
  }, throwOnCompilationErrors = (diagnostics) => {
5687
5706
  if (!diagnostics?.length)
5688
5707
  return;
5689
- const errors = diagnostics.filter((diag) => diag.category === ts2.DiagnosticCategory.Error);
5708
+ const errors = diagnostics.filter((diag) => diag.category === lazyTypescript.DiagnosticCategory.Error);
5690
5709
  if (!errors.length)
5691
5710
  return;
5692
5711
  const fullMessage = errors.map(formatDiagnosticMessage).join(`
@@ -5728,22 +5747,22 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5728
5747
  }
5729
5748
  return `${path}.js${query}`;
5730
5749
  }, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
5731
- const sourceFile = ts2.createSourceFile(fileName, source, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TS);
5750
+ const sourceFile = lazyTypescript.createSourceFile(fileName, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
5732
5751
  const specifiers = [];
5733
5752
  const addSpecifier = (node) => {
5734
- if (!node || !ts2.isStringLiteralLike(node))
5753
+ if (!node || !lazyTypescript.isStringLiteralLike(node))
5735
5754
  return;
5736
5755
  const specifier = node.text;
5737
5756
  if (isRelativeModuleSpecifier(specifier))
5738
5757
  specifiers.push(specifier);
5739
5758
  };
5740
5759
  const visit = (node) => {
5741
- if (ts2.isImportDeclaration(node) || ts2.isExportDeclaration(node)) {
5760
+ if (lazyTypescript.isImportDeclaration(node) || lazyTypescript.isExportDeclaration(node)) {
5742
5761
  addSpecifier(node.moduleSpecifier);
5743
- } else if (ts2.isCallExpression(node) && node.expression.kind === ts2.SyntaxKind.ImportKeyword) {
5762
+ } else if (lazyTypescript.isCallExpression(node) && node.expression.kind === lazyTypescript.SyntaxKind.ImportKeyword) {
5744
5763
  addSpecifier(node.arguments[0]);
5745
5764
  }
5746
- ts2.forEachChild(node, visit);
5765
+ lazyTypescript.forEachChild(node, visit);
5747
5766
  };
5748
5767
  visit(sourceFile);
5749
5768
  return specifiers;
@@ -5891,25 +5910,25 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5891
5910
  emitDecoratorMetadata: true,
5892
5911
  esModuleInterop: true,
5893
5912
  experimentalDecorators: true,
5894
- module: ts2.ModuleKind.ESNext,
5895
- moduleResolution: ts2.ModuleResolutionKind.Bundler,
5896
- newLine: ts2.NewLineKind.LineFeed,
5913
+ module: lazyTypescript.ModuleKind.ESNext,
5914
+ moduleResolution: lazyTypescript.ModuleResolutionKind.Bundler,
5915
+ newLine: lazyTypescript.NewLineKind.LineFeed,
5897
5916
  noLib: false,
5898
5917
  outDir,
5899
5918
  skipLibCheck: true,
5900
- target: ts2.ScriptTarget.ES2022,
5919
+ target: lazyTypescript.ScriptTarget.ES2022,
5901
5920
  ...config.options
5902
5921
  };
5903
- options.target = ts2.ScriptTarget.ES2022;
5922
+ options.target = lazyTypescript.ScriptTarget.ES2022;
5904
5923
  options.experimentalDecorators = true;
5905
5924
  options.emitDecoratorMetadata = true;
5906
- options.newLine = ts2.NewLineKind.LineFeed;
5925
+ options.newLine = lazyTypescript.NewLineKind.LineFeed;
5907
5926
  options.outDir = outDir;
5908
5927
  options.noEmit = false;
5909
5928
  options.incremental = false;
5910
5929
  options.tsBuildInfoFile = undefined;
5911
5930
  options.rootDir = process.cwd();
5912
- const host = await traceAngularPhase("aot/create-compiler-host", () => ts2.createCompilerHost(options));
5931
+ const host = await traceAngularPhase("aot/create-compiler-host", () => lazyTypescript.createCompilerHost(options));
5913
5932
  const originalGetDefaultLibLocation = host.getDefaultLibLocation;
5914
5933
  host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
5915
5934
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
@@ -5955,7 +5974,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
5955
5974
  host.getSourceFile = (fileName, languageVersion, onError) => {
5956
5975
  const source = transformedSources.get(resolve6(fileName));
5957
5976
  if (source) {
5958
- return ts2.createSourceFile(fileName, source, languageVersion, true);
5977
+ return lazyTypescript.createSourceFile(fileName, source, languageVersion, true);
5959
5978
  }
5960
5979
  return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
5961
5980
  };
@@ -6484,8 +6503,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
6484
6503
  }
6485
6504
  }
6486
6505
  return allOutputs;
6487
- }, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) => ts2.isClassDeclaration(statement) && statement.name !== undefined && (ts2.getModifiers(statement) ?? []).some((modifier) => modifier.kind === ts2.SyntaxKind.ExportKeyword), statementReferencesClass = (statement, className, sourceFile) => {
6488
- if (!ts2.isExpressionStatement(statement))
6506
+ }, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) => lazyTypescript.isClassDeclaration(statement) && statement.name !== undefined && (lazyTypescript.getModifiers(statement) ?? []).some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword), statementReferencesClass = (statement, className, sourceFile) => {
6507
+ if (!lazyTypescript.isExpressionStatement(statement))
6489
6508
  return false;
6490
6509
  const text = statement.getText(sourceFile);
6491
6510
  return new RegExp(`^\\s*${className}\\s*=`).test(text) || new RegExp(`\u0275setClassMetadata\\(\\s*${className}\\b`).test(text);
@@ -6493,16 +6512,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
6493
6512
  const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
6494
6513
  if (defaultMatch)
6495
6514
  return defaultMatch[1] ?? null;
6496
- const sourceFile = ts2.createSourceFile("page.js", source, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.JS);
6515
+ const sourceFile = lazyTypescript.createSourceFile("page.js", source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.JS);
6497
6516
  const exportedNames = new Set;
6498
6517
  for (const statement of sourceFile.statements) {
6499
- if (!ts2.isExportDeclaration(statement) || statement.moduleSpecifier || !statement.exportClause || !ts2.isNamedExports(statement.exportClause))
6518
+ if (!lazyTypescript.isExportDeclaration(statement) || statement.moduleSpecifier || !statement.exportClause || !lazyTypescript.isNamedExports(statement.exportClause))
6500
6519
  continue;
6501
6520
  for (const element of statement.exportClause.elements) {
6502
6521
  exportedNames.add((element.propertyName ?? element.name).text);
6503
6522
  }
6504
6523
  }
6505
- const candidates = sourceFile.statements.filter(ts2.isClassDeclaration).filter((statement) => isExportedClass(statement) || exportedNames.has(statement.name?.text ?? "")).map((statement) => {
6524
+ const candidates = sourceFile.statements.filter(lazyTypescript.isClassDeclaration).filter((statement) => isExportedClass(statement) || exportedNames.has(statement.name?.text ?? "")).map((statement) => {
6506
6525
  const className = statement.name?.text ?? "";
6507
6526
  const related = sourceFile.statements.filter((other) => statementReferencesClass(other, className, sourceFile)).map((other) => other.getText(sourceFile));
6508
6527
  const text = [statement.getText(sourceFile), ...related].join(`
@@ -6929,6 +6948,7 @@ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
6929
6948
  };
6930
6949
  };
6931
6950
  var init_compileAngular = __esm(() => {
6951
+ init_lazyTypescript();
6932
6952
  init_constants();
6933
6953
  init_sourceMetadata();
6934
6954
  init_lowerDeferSyntax();
@@ -17268,5 +17288,5 @@ export {
17268
17288
  withPendingTask
17269
17289
  };
17270
17290
 
17271
- //# debugId=1A554578F02D3D8164756E2164756E21
17291
+ //# debugId=0E4E0A705DAAEB6064756E2164756E21
17272
17292
  //# sourceMappingURL=index.js.map