@angular/core 19.0.0-rc.0 → 19.0.0-rc.2
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.
- package/fesm2022/core.mjs +13699 -13802
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -2
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +6 -6
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +28 -62
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{checker-2451e7c5.js → checker-cd95ebda.js} +191 -169
- package/schematics/bundles/combine_units-528c4a5d.js +1703 -0
- package/schematics/bundles/{compiler_host-f54f8309.js → compiler_host-40e8d55f.js} +8 -5
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +5 -5
- package/schematics/bundles/{imports-44987700.js → imports-4ac08251.js} +1 -1
- package/schematics/bundles/inject-migration.js +131 -37
- package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-ab18a7c3.js → migrate_ts_type_references-0bcee7cb.js} +528 -32
- package/schematics/bundles/{ng_decorators-3ad437d2.js → nodes-0e7d45ca.js} +15 -2
- package/schematics/bundles/output-migration.js +30 -6906
- package/schematics/bundles/pending-tasks.js +5 -5
- package/schematics/bundles/{program-58424797.js → program-8f30df93.js} +119 -59
- package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
- package/schematics/bundles/provide-initializer.js +17 -28
- package/schematics/bundles/route-lazy-loading.js +10 -5
- package/schematics/bundles/signal-input-migration.js +50 -37
- package/schematics/bundles/signal-queries-migration.js +26 -19
- package/schematics/bundles/signals.js +7 -7
- package/schematics/bundles/standalone-migration.js +167 -84
- package/schematics/migrations.json +1 -1
- package/schematics/ng-generate/signals/schema.json +1 -0
- package/testing/index.d.ts +1 -1
- package/schematics/bundles/combine_units-c52492ab.js +0 -31202
- package/schematics/bundles/nodes-ffdce442.js +0 -27
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.0.0-rc.
|
|
3
|
+
* @license Angular v19.0.0-rc.2
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,12 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
14
|
+
var compiler_host = require('./compiler_host-40e8d55f.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var imports = require('./imports-
|
|
16
|
+
var imports = require('./imports-4ac08251.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
|
-
require('./checker-
|
|
18
|
+
require('./checker-cd95ebda.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('fs');
|
|
21
21
|
require('module');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.0.0-rc.
|
|
3
|
+
* @license Angular v19.0.0-rc.2
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-cd95ebda.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var p = require('path');
|
|
12
12
|
require('os');
|
|
@@ -898,33 +898,57 @@ function compileHmrInitializer(meta) {
|
|
|
898
898
|
const urlPartial = `/@ng/component?c=${id}&t=`;
|
|
899
899
|
const moduleName = 'm';
|
|
900
900
|
const dataName = 'd';
|
|
901
|
+
const timestampName = 't';
|
|
902
|
+
const importCallbackName = `${meta.className}_HmrLoad`;
|
|
901
903
|
const locals = meta.locals.map((localName) => checker.variable(localName));
|
|
904
|
+
// m.default
|
|
905
|
+
const defaultRead = checker.variable(moduleName).prop('default');
|
|
902
906
|
// ɵɵreplaceMetadata(Comp, m.default, [...]);
|
|
903
|
-
const
|
|
904
|
-
.callFn([meta.type, checker.
|
|
905
|
-
// (m) => ɵɵreplaceMetadata(...)
|
|
906
|
-
const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)],
|
|
907
|
-
// '<urlPartial>' + encodeURIComponent(
|
|
907
|
+
const replaceCall = checker.importExpr(checker.Identifiers.replaceMetadata)
|
|
908
|
+
.callFn([meta.type, defaultRead, new checker.ExternalExpr(checker.Identifiers.core), checker.literalArr(locals)]);
|
|
909
|
+
// (m) => m.default && ɵɵreplaceMetadata(...)
|
|
910
|
+
const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
911
|
+
// '<urlPartial>' + encodeURIComponent(t)
|
|
908
912
|
const urlValue = checker.literal(urlPartial)
|
|
909
|
-
.plus(checker.variable('encodeURIComponent').callFn([checker.variable(
|
|
910
|
-
//
|
|
911
|
-
//
|
|
912
|
-
//
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
.
|
|
916
|
-
.
|
|
917
|
-
|
|
918
|
-
|
|
913
|
+
.plus(checker.variable('encodeURIComponent').callFn([checker.variable(timestampName)]));
|
|
914
|
+
// function Cmp_HmrLoad(t) {
|
|
915
|
+
// import(/* @vite-ignore */ url).then((m) => m.default && replaceMetadata(...));
|
|
916
|
+
// }
|
|
917
|
+
const importCallback = new checker.DeclareFunctionStmt(importCallbackName, [new checker.FnParam(timestampName)], [
|
|
918
|
+
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
919
|
+
// warning for each usage within the development code. If Vite provides a method to
|
|
920
|
+
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
921
|
+
new checker.DynamicImportExpr(urlValue, null, '@vite-ignore')
|
|
922
|
+
.prop('then')
|
|
923
|
+
.callFn([replaceCallback])
|
|
924
|
+
.toStmt(),
|
|
925
|
+
], null, checker.StmtModifier.Final);
|
|
926
|
+
// (d) => d.id === <id> && Cmp_HmrLoad(d.timestamp)
|
|
927
|
+
const updateCallback = checker.arrowFn([new checker.FnParam(dataName)], checker.variable(dataName)
|
|
928
|
+
.prop('id')
|
|
929
|
+
.identical(checker.literal(id))
|
|
930
|
+
.and(checker.variable(importCallbackName).callFn([checker.variable(dataName).prop('timestamp')])));
|
|
931
|
+
// Cmp_HmrLoad(Date.now());
|
|
932
|
+
// Initial call to kick off the loading in order to avoid edge cases with components
|
|
933
|
+
// coming from lazy chunks that change before the chunk has loaded.
|
|
934
|
+
const initialCall = checker.variable(importCallbackName)
|
|
935
|
+
.callFn([checker.variable('Date').prop('now').callFn([])]);
|
|
919
936
|
// import.meta.hot
|
|
920
937
|
const hotRead = checker.variable('import').prop('meta').prop('hot');
|
|
921
938
|
// import.meta.hot.on('angular:component-update', () => ...);
|
|
922
939
|
const hotListener = hotRead
|
|
923
940
|
.clone()
|
|
924
941
|
.prop('on')
|
|
925
|
-
.callFn([checker.literal('angular:component-update'),
|
|
926
|
-
|
|
927
|
-
|
|
942
|
+
.callFn([checker.literal('angular:component-update'), updateCallback]);
|
|
943
|
+
return checker.arrowFn([], [
|
|
944
|
+
// function Cmp_HmrLoad() {...}.
|
|
945
|
+
importCallback,
|
|
946
|
+
// ngDevMode && Cmp_HmrLoad(Date.now());
|
|
947
|
+
checker.devOnlyGuardedExpression(initialCall).toStmt(),
|
|
948
|
+
// ngDevMode && import.meta.hot && import.meta.hot.on(...)
|
|
949
|
+
checker.devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt(),
|
|
950
|
+
])
|
|
951
|
+
.callFn([]);
|
|
928
952
|
}
|
|
929
953
|
/**
|
|
930
954
|
* Compiles the HMR update callback for a class.
|
|
@@ -963,7 +987,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
963
987
|
function compileDeclareClassMetadata(metadata) {
|
|
964
988
|
const definitionMap = new checker.DefinitionMap();
|
|
965
989
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
966
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
990
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
967
991
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
968
992
|
definitionMap.set('type', metadata.type);
|
|
969
993
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -981,7 +1005,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
981
1005
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
982
1006
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
983
1007
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
984
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1008
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
985
1009
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
986
1010
|
definitionMap.set('type', metadata.type);
|
|
987
1011
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1076,7 +1100,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1076
1100
|
const definitionMap = new checker.DefinitionMap();
|
|
1077
1101
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1078
1102
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1079
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1103
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1080
1104
|
// e.g. `type: MyDirective`
|
|
1081
1105
|
definitionMap.set('type', meta.type.value);
|
|
1082
1106
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1492,7 +1516,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1492
1516
|
function compileDeclareFactoryFunction(meta) {
|
|
1493
1517
|
const definitionMap = new checker.DefinitionMap();
|
|
1494
1518
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1495
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1519
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1496
1520
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1497
1521
|
definitionMap.set('type', meta.type.value);
|
|
1498
1522
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1527,7 +1551,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1527
1551
|
function createInjectableDefinitionMap(meta) {
|
|
1528
1552
|
const definitionMap = new checker.DefinitionMap();
|
|
1529
1553
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1530
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1554
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1531
1555
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1532
1556
|
definitionMap.set('type', meta.type.value);
|
|
1533
1557
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1578,7 +1602,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1578
1602
|
function createInjectorDefinitionMap(meta) {
|
|
1579
1603
|
const definitionMap = new checker.DefinitionMap();
|
|
1580
1604
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1581
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1605
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1582
1606
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1583
1607
|
definitionMap.set('type', meta.type.value);
|
|
1584
1608
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1611,7 +1635,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1611
1635
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1612
1636
|
}
|
|
1613
1637
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1614
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1638
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1615
1639
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1616
1640
|
definitionMap.set('type', meta.type.value);
|
|
1617
1641
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1662,7 +1686,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1662
1686
|
function createPipeDefinitionMap(meta) {
|
|
1663
1687
|
const definitionMap = new checker.DefinitionMap();
|
|
1664
1688
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1665
|
-
definitionMap.set('version', checker.literal('19.0.0-rc.
|
|
1689
|
+
definitionMap.set('version', checker.literal('19.0.0-rc.2'));
|
|
1666
1690
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1667
1691
|
// e.g. `type: MyPipe`
|
|
1668
1692
|
definitionMap.set('type', meta.type.value);
|
|
@@ -1814,7 +1838,7 @@ class AliasStrategy {
|
|
|
1814
1838
|
return null;
|
|
1815
1839
|
}
|
|
1816
1840
|
return {
|
|
1817
|
-
kind:
|
|
1841
|
+
kind: checker.ReferenceEmitKind.Success,
|
|
1818
1842
|
expression: ref.alias,
|
|
1819
1843
|
importedFile: 'unknown',
|
|
1820
1844
|
};
|
|
@@ -2701,12 +2725,21 @@ class DtsMetadataReader {
|
|
|
2701
2725
|
}
|
|
2702
2726
|
// Read the ModuleData out of the type arguments.
|
|
2703
2727
|
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
2728
|
+
const declarations = checker.extractReferencesFromType(this.checker, declarationMetadata, ref.bestGuessOwningModule);
|
|
2729
|
+
const exports = checker.extractReferencesFromType(this.checker, exportMetadata, ref.bestGuessOwningModule);
|
|
2730
|
+
const imports = checker.extractReferencesFromType(this.checker, importMetadata, ref.bestGuessOwningModule);
|
|
2731
|
+
// The module is considered poisoned if it's exports couldn't be
|
|
2732
|
+
// resolved completely. This would make the module not necessarily
|
|
2733
|
+
// usable for scope computation relying on this module; so we propagate
|
|
2734
|
+
// this "incompleteness" information to the caller.
|
|
2735
|
+
const isPoisoned = exports.isIncomplete;
|
|
2704
2736
|
return {
|
|
2705
2737
|
kind: checker.MetaKind.NgModule,
|
|
2706
2738
|
ref,
|
|
2707
|
-
declarations:
|
|
2708
|
-
|
|
2709
|
-
|
|
2739
|
+
declarations: declarations.result,
|
|
2740
|
+
isPoisoned,
|
|
2741
|
+
exports: exports.result,
|
|
2742
|
+
imports: imports.result,
|
|
2710
2743
|
schemas: [],
|
|
2711
2744
|
rawDeclarations: null,
|
|
2712
2745
|
rawImports: null,
|
|
@@ -2758,6 +2791,10 @@ class DtsMetadataReader {
|
|
|
2758
2791
|
? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule)
|
|
2759
2792
|
: null;
|
|
2760
2793
|
const isSignal = def.type.typeArguments.length > 9 && (checker.readBooleanType(def.type.typeArguments[9]) ?? false);
|
|
2794
|
+
// At this point in time, the `.d.ts` may not be fully extractable when
|
|
2795
|
+
// trying to resolve host directive types to their declarations.
|
|
2796
|
+
// If this cannot be done completely, the metadata is incomplete and "poisoned".
|
|
2797
|
+
const isPoisoned = hostDirectives !== null && hostDirectives?.isIncomplete;
|
|
2761
2798
|
return {
|
|
2762
2799
|
kind: checker.MetaKind.Directive,
|
|
2763
2800
|
matchSource: checker.MatchSource.Selector,
|
|
@@ -2768,11 +2805,11 @@ class DtsMetadataReader {
|
|
|
2768
2805
|
exportAs: checker.readStringArrayType(def.type.typeArguments[2]),
|
|
2769
2806
|
inputs,
|
|
2770
2807
|
outputs,
|
|
2771
|
-
hostDirectives,
|
|
2808
|
+
hostDirectives: hostDirectives?.result ?? null,
|
|
2772
2809
|
queries: checker.readStringArrayType(def.type.typeArguments[5]),
|
|
2773
2810
|
...checker.extractDirectiveTypeCheckMeta(clazz, inputs, this.reflector),
|
|
2774
2811
|
baseClass: readBaseClass(clazz, this.checker, this.reflector),
|
|
2775
|
-
isPoisoned
|
|
2812
|
+
isPoisoned,
|
|
2776
2813
|
isStructural,
|
|
2777
2814
|
animationTriggerNames: null,
|
|
2778
2815
|
ngContentSelectors,
|
|
@@ -2914,21 +2951,27 @@ function readHostDirectivesType(checker$1, type, bestGuessOwningModule) {
|
|
|
2914
2951
|
return null;
|
|
2915
2952
|
}
|
|
2916
2953
|
const result = [];
|
|
2954
|
+
let isIncomplete = false;
|
|
2917
2955
|
for (const hostDirectiveType of type.elements) {
|
|
2918
2956
|
const { directive, inputs, outputs } = checker.readMapType(hostDirectiveType, (type) => type);
|
|
2919
2957
|
if (directive) {
|
|
2920
2958
|
if (!ts__default["default"].isTypeQueryNode(directive)) {
|
|
2921
2959
|
throw new Error(`Expected TypeQueryNode: ${checker.nodeDebugInfo(directive)}`);
|
|
2922
2960
|
}
|
|
2961
|
+
const ref = checker.extraReferenceFromTypeQuery(checker$1, directive, type, bestGuessOwningModule);
|
|
2962
|
+
if (ref === null) {
|
|
2963
|
+
isIncomplete = true;
|
|
2964
|
+
continue;
|
|
2965
|
+
}
|
|
2923
2966
|
result.push({
|
|
2924
|
-
directive:
|
|
2967
|
+
directive: ref,
|
|
2925
2968
|
isForwardReference: false,
|
|
2926
2969
|
inputs: checker.readMapType(inputs, checker.readStringType),
|
|
2927
2970
|
outputs: checker.readMapType(outputs, checker.readStringType),
|
|
2928
2971
|
});
|
|
2929
2972
|
}
|
|
2930
2973
|
}
|
|
2931
|
-
return result.length > 0 ? result : null;
|
|
2974
|
+
return result.length > 0 ? { result, isIncomplete } : null;
|
|
2932
2975
|
}
|
|
2933
2976
|
|
|
2934
2977
|
/**
|
|
@@ -5985,7 +6028,7 @@ class MetadataDtsModuleScopeResolver {
|
|
|
5985
6028
|
const exportScope = {
|
|
5986
6029
|
exported: {
|
|
5987
6030
|
dependencies,
|
|
5988
|
-
isPoisoned:
|
|
6031
|
+
isPoisoned: meta.isPoisoned,
|
|
5989
6032
|
},
|
|
5990
6033
|
};
|
|
5991
6034
|
this.cache.set(clazz, exportScope);
|
|
@@ -8656,6 +8699,7 @@ class NgModuleDecoratorHandler {
|
|
|
8656
8699
|
rawExports: analysis.rawExports,
|
|
8657
8700
|
decorator: analysis.decorator,
|
|
8658
8701
|
mayDeclareProviders: analysis.providers !== null,
|
|
8702
|
+
isPoisoned: false,
|
|
8659
8703
|
});
|
|
8660
8704
|
this.injectableRegistry.registerInjectable(node, {
|
|
8661
8705
|
ctorDeps: analysis.fac.deps,
|
|
@@ -13888,22 +13932,18 @@ class ClassExtractor {
|
|
|
13888
13932
|
/** The result only contains properties, method implementations and abstracts */
|
|
13889
13933
|
filterMethodOverloads(declarations) {
|
|
13890
13934
|
return declarations.filter((declaration, index) => {
|
|
13935
|
+
// Check if the declaration is a function or method
|
|
13891
13936
|
if (ts__default["default"].isFunctionDeclaration(declaration) || ts__default["default"].isMethodDeclaration(declaration)) {
|
|
13892
|
-
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
// Later on, the function extractor will handle overloads and implementation detection
|
|
13903
|
-
return !samePreviousAbstractMethod;
|
|
13904
|
-
}
|
|
13905
|
-
return !!declaration.body;
|
|
13906
|
-
}
|
|
13937
|
+
// TypeScript ensures that all declarations for a given abstract method appear consecutively.
|
|
13938
|
+
const nextDeclaration = declarations[index + 1];
|
|
13939
|
+
const isNextAbstractMethodWithSameName = nextDeclaration &&
|
|
13940
|
+
ts__default["default"].isMethodDeclaration(nextDeclaration) &&
|
|
13941
|
+
nextDeclaration.name.getText() === declaration.name?.getText();
|
|
13942
|
+
// Return only the last occurrence of an abstract method to avoid overload duplication.
|
|
13943
|
+
// Subsequent overloads or implementations are handled separately by the function extractor.
|
|
13944
|
+
return !isNextAbstractMethodWithSameName;
|
|
13945
|
+
}
|
|
13946
|
+
// Include non-method declarations, such as properties, without filtering.
|
|
13907
13947
|
return true;
|
|
13908
13948
|
});
|
|
13909
13949
|
}
|
|
@@ -14474,6 +14514,7 @@ function extractTypeAlias(declaration) {
|
|
|
14474
14514
|
name: declaration.name.getText(),
|
|
14475
14515
|
type: declaration.type.getText(),
|
|
14476
14516
|
entryType: EntryType.TypeAlias,
|
|
14517
|
+
generics: extractGenerics(declaration),
|
|
14477
14518
|
rawComment: extractRawJsDoc(declaration),
|
|
14478
14519
|
description: extractJsDocDescription(declaration),
|
|
14479
14520
|
jsdocTags: extractJsDocTags(declaration),
|
|
@@ -17251,13 +17292,19 @@ class UnusedStandaloneImportsRule {
|
|
|
17251
17292
|
if (unused === null) {
|
|
17252
17293
|
return null;
|
|
17253
17294
|
}
|
|
17295
|
+
const propertyAssignment = closestNode(metadata.rawImports, ts__default["default"].isPropertyAssignment);
|
|
17254
17296
|
const category = this.typeCheckingConfig.unusedStandaloneImports === 'error'
|
|
17255
17297
|
? ts__default["default"].DiagnosticCategory.Error
|
|
17256
17298
|
: ts__default["default"].DiagnosticCategory.Warning;
|
|
17257
|
-
if (unused.length === metadata.imports.length) {
|
|
17258
|
-
return checker.makeDiagnostic(checker.ErrorCode.UNUSED_STANDALONE_IMPORTS,
|
|
17259
|
-
}
|
|
17260
|
-
return
|
|
17299
|
+
if (unused.length === metadata.imports.length && propertyAssignment !== null) {
|
|
17300
|
+
return checker.makeDiagnostic(checker.ErrorCode.UNUSED_STANDALONE_IMPORTS, propertyAssignment.name, 'All imports are unused', undefined, category);
|
|
17301
|
+
}
|
|
17302
|
+
return unused.map((ref) => {
|
|
17303
|
+
const diagnosticNode = ref.getIdentityInExpression(metadata.rawImports) ||
|
|
17304
|
+
ref.getIdentityIn(node.getSourceFile()) ||
|
|
17305
|
+
metadata.rawImports;
|
|
17306
|
+
return checker.makeDiagnostic(checker.ErrorCode.UNUSED_STANDALONE_IMPORTS, diagnosticNode, `${ref.node.name.text} is not used within the template of ${metadata.name}`, undefined, category);
|
|
17307
|
+
});
|
|
17261
17308
|
}
|
|
17262
17309
|
getUnusedSymbols(metadata, usedDirectives, usedPipes) {
|
|
17263
17310
|
const { imports, rawImports } = metadata;
|
|
@@ -17273,7 +17320,7 @@ class UnusedStandaloneImportsRule {
|
|
|
17273
17320
|
!usedDirectives.has(currentNode) &&
|
|
17274
17321
|
!this.isPotentialSharedReference(current, rawImports)) {
|
|
17275
17322
|
unused ??= [];
|
|
17276
|
-
unused.push(
|
|
17323
|
+
unused.push(current);
|
|
17277
17324
|
}
|
|
17278
17325
|
continue;
|
|
17279
17326
|
}
|
|
@@ -17283,7 +17330,7 @@ class UnusedStandaloneImportsRule {
|
|
|
17283
17330
|
!usedPipes.has(pipeMeta.name) &&
|
|
17284
17331
|
!this.isPotentialSharedReference(current, rawImports)) {
|
|
17285
17332
|
unused ??= [];
|
|
17286
|
-
unused.push(
|
|
17333
|
+
unused.push(current);
|
|
17287
17334
|
}
|
|
17288
17335
|
}
|
|
17289
17336
|
return unused;
|
|
@@ -17316,6 +17363,19 @@ class UnusedStandaloneImportsRule {
|
|
|
17316
17363
|
return true;
|
|
17317
17364
|
}
|
|
17318
17365
|
}
|
|
17366
|
+
/** Gets the closest parent node of a certain type. */
|
|
17367
|
+
function closestNode(start, predicate) {
|
|
17368
|
+
let current = start.parent;
|
|
17369
|
+
while (current) {
|
|
17370
|
+
if (predicate(current)) {
|
|
17371
|
+
return current;
|
|
17372
|
+
}
|
|
17373
|
+
else {
|
|
17374
|
+
current = current.parent;
|
|
17375
|
+
}
|
|
17376
|
+
}
|
|
17377
|
+
return null;
|
|
17378
|
+
}
|
|
17319
17379
|
|
|
17320
17380
|
/*!
|
|
17321
17381
|
* @license
|
|
@@ -20060,7 +20120,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
20060
20120
|
* @param minVersion Minimum required version for the feature.
|
|
20061
20121
|
*/
|
|
20062
20122
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
20063
|
-
// A version of `19.0.0-rc.
|
|
20123
|
+
// A version of `19.0.0-rc.2` usually means that core is at head so it supports
|
|
20064
20124
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
20065
20125
|
// with the current version during build time.
|
|
20066
20126
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.0.0-rc.
|
|
3
|
+
* @license Angular v19.0.0-rc.2
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,13 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
14
|
+
var compiler_host = require('./compiler_host-40e8d55f.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var imports = require('./imports-
|
|
17
|
-
var nodes = require('./nodes-ffdce442.js');
|
|
16
|
+
var imports = require('./imports-4ac08251.js');
|
|
18
17
|
require('@angular-devkit/core');
|
|
19
|
-
require('./checker-
|
|
18
|
+
require('./checker-cd95ebda.js');
|
|
20
19
|
require('os');
|
|
21
20
|
require('fs');
|
|
22
21
|
require('module');
|
|
@@ -32,9 +31,9 @@ function migrateFile(sourceFile, rewriteFn) {
|
|
|
32
31
|
const provider = tryParseProviderExpression(node);
|
|
33
32
|
if (provider) {
|
|
34
33
|
replaceProviderWithNewApi({
|
|
35
|
-
sourceFile
|
|
36
|
-
node
|
|
37
|
-
provider
|
|
34
|
+
sourceFile,
|
|
35
|
+
node,
|
|
36
|
+
provider,
|
|
38
37
|
changeTracker,
|
|
39
38
|
});
|
|
40
39
|
return;
|
|
@@ -55,24 +54,14 @@ function replaceProviderWithNewApi({ sourceFile, node, provider, changeTracker,
|
|
|
55
54
|
}
|
|
56
55
|
// Replace the provider with the new provide function.
|
|
57
56
|
changeTracker.replaceText(sourceFile, node.getStart(), node.getWidth(), `${provideInitializerFunctionName}(${initializerCode})`);
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
// `
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
...(importInject ? [createImportSpecifier('inject')] : []),
|
|
67
|
-
// Add the `provide*Initializer` function to imports.
|
|
68
|
-
...(!hasProvideInitializeFunction
|
|
69
|
-
? [createImportSpecifier(provideInitializerFunctionName)]
|
|
70
|
-
: []),
|
|
71
|
-
]);
|
|
72
|
-
changeTracker.replaceNode(namedImports, newNamedImports);
|
|
73
|
-
}
|
|
74
|
-
function createImportSpecifier(name) {
|
|
75
|
-
return ts__default["default"].factory.createImportSpecifier(false, undefined, ts__default["default"].factory.createIdentifier(name));
|
|
57
|
+
// Remove the `*_INITIALIZER` token from imports.
|
|
58
|
+
changeTracker.removeImport(sourceFile, initializerToken, angularCoreModule);
|
|
59
|
+
// Add the `inject` function to imports if needed.
|
|
60
|
+
if (importInject) {
|
|
61
|
+
changeTracker.addImport(sourceFile, 'inject', angularCoreModule);
|
|
62
|
+
}
|
|
63
|
+
// Add the `provide*Initializer` function to imports.
|
|
64
|
+
changeTracker.addImport(sourceFile, provideInitializerFunctionName, angularCoreModule);
|
|
76
65
|
}
|
|
77
66
|
function tryParseProviderExpression(node) {
|
|
78
67
|
if (!ts__default["default"].isObjectLiteralExpression(node)) {
|
|
@@ -135,7 +124,7 @@ function tryParseProviderExpression(node) {
|
|
|
135
124
|
return {
|
|
136
125
|
...info,
|
|
137
126
|
importInject: deps.length > 0,
|
|
138
|
-
initializerCode: `(
|
|
127
|
+
initializerCode: `(${useFactory.getText()})(${args.join(', ')})`,
|
|
139
128
|
};
|
|
140
129
|
}
|
|
141
130
|
if (useValue) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.0.0-rc.
|
|
3
|
+
* @license Angular v19.0.0-rc.2
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,10 +11,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var p = require('path');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
15
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
+
var compiler_host = require('./compiler_host-40e8d55f.js');
|
|
15
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
16
16
|
var ts = require('typescript');
|
|
17
|
-
require('./checker-
|
|
17
|
+
require('./checker-cd95ebda.js');
|
|
18
18
|
require('os');
|
|
19
19
|
require('module');
|
|
20
20
|
require('url');
|
|
@@ -61,7 +61,12 @@ function isStandaloneComponent(node) {
|
|
|
61
61
|
const arg = decorator.expression.arguments[0];
|
|
62
62
|
if (ts__default["default"].isObjectLiteralExpression(arg)) {
|
|
63
63
|
const property = findLiteralProperty(arg, 'standalone');
|
|
64
|
-
|
|
64
|
+
if (property) {
|
|
65
|
+
return property.initializer.getText() === 'true';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return true; // standalone is true by default in v19
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
return false;
|