@angular/core 19.2.0 → 20.0.0-next.0
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 +16 -24
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +15 -4
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +3 -4
- 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/{apply_import_manager-a4e62ded.js → apply_import_manager-0959b78c.js} +3 -3
- package/schematics/bundles/{checker-2eecc677.js → checker-cf6f7980.js} +121 -16
- package/schematics/bundles/cleanup-unused-imports.js +6 -6
- package/schematics/bundles/{compiler_host-f313eac9.js → compiler_host-cc1379e9.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +3 -3
- package/schematics/bundles/imports-31a38653.js +1 -1
- package/schematics/bundles/{index-afc3f749.js → index-42d84d69.js} +4 -4
- package/schematics/bundles/{index-3891dd55.js → index-6675d6bc.js} +4 -4
- package/schematics/bundles/inject-migration.js +3 -3
- package/schematics/bundles/leading_space-6e7a8ec6.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-1abf1f5f.js → migrate_ts_type_references-5089e4ef.js} +9 -5
- package/schematics/bundles/ng_decorators-6878e227.js +1 -1
- package/schematics/bundles/nodes-ffdce442.js +1 -1
- package/schematics/bundles/output-migration.js +6 -6
- package/schematics/bundles/pending-tasks.js +3 -3
- package/schematics/bundles/{program-24da9092.js → program-362689f0.js} +148 -148
- package/schematics/bundles/{project_paths-64bc3947.js → project_paths-7d2daa1e.js} +3 -3
- package/schematics/bundles/project_tsconfig_paths-6c9cde78.js +1 -1
- package/schematics/bundles/property_name-42030525.js +1 -1
- package/schematics/bundles/provide-initializer.js +3 -3
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/self-closing-tags-migration.js +4 -4
- package/schematics/bundles/signal-input-migration.js +7 -7
- package/schematics/bundles/signal-queries-migration.js +7 -7
- package/schematics/bundles/signals.js +7 -7
- package/schematics/bundles/standalone-migration.js +5 -5
- package/testing/index.d.ts +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
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-cf6f7980.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
12
|
var assert = require('assert');
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var project_paths = require('./project_paths-
|
|
13
|
+
var index = require('./index-42d84d69.js');
|
|
14
|
+
var project_paths = require('./project_paths-7d2daa1e.js');
|
|
15
15
|
var leading_space = require('./leading_space-6e7a8ec6.js');
|
|
16
|
-
require('./program-
|
|
16
|
+
require('./program-362689f0.js');
|
|
17
17
|
require('path');
|
|
18
18
|
|
|
19
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -161,6 +161,7 @@ var BinaryOperator;
|
|
|
161
161
|
BinaryOperator[BinaryOperator["Bigger"] = 15] = "Bigger";
|
|
162
162
|
BinaryOperator[BinaryOperator["BiggerEquals"] = 16] = "BiggerEquals";
|
|
163
163
|
BinaryOperator[BinaryOperator["NullishCoalesce"] = 17] = "NullishCoalesce";
|
|
164
|
+
BinaryOperator[BinaryOperator["Exponentiation"] = 18] = "Exponentiation";
|
|
164
165
|
})(BinaryOperator || (BinaryOperator = {}));
|
|
165
166
|
function nullSafeIsEquivalent(base, other) {
|
|
166
167
|
if (base == null || other == null) {
|
|
@@ -232,6 +233,9 @@ class Expression {
|
|
|
232
233
|
modulo(rhs, sourceSpan) {
|
|
233
234
|
return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
|
|
234
235
|
}
|
|
236
|
+
power(rhs, sourceSpan) {
|
|
237
|
+
return new BinaryOperatorExpr(BinaryOperator.Exponentiation, this, rhs, null, sourceSpan);
|
|
238
|
+
}
|
|
235
239
|
and(rhs, sourceSpan) {
|
|
236
240
|
return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
|
|
237
241
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,14 +10,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
13
|
+
var project_paths = require('./project_paths-7d2daa1e.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
var program = require('./program-
|
|
16
|
+
var checker = require('./checker-cf6f7980.js');
|
|
17
|
+
var program = require('./program-362689f0.js');
|
|
18
18
|
require('path');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
-
var index = require('./index-
|
|
19
|
+
var apply_import_manager = require('./apply_import_manager-0959b78c.js');
|
|
20
|
+
var index = require('./index-42d84d69.js');
|
|
21
21
|
require('@angular-devkit/core');
|
|
22
22
|
require('node:path/posix');
|
|
23
23
|
require('fs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
+
var compiler_host = require('./compiler_host-cc1379e9.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
var imports = require('./imports-31a38653.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
|
-
require('./checker-
|
|
18
|
+
require('./checker-cf6f7980.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
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
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-cf6f7980.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var p = require('path');
|
|
12
12
|
require('os');
|
|
@@ -859,143 +859,6 @@ function compileComponentMetadataAsyncResolver(dependencies) {
|
|
|
859
859
|
return checker.arrowFn([], checker.literalArr(dynamicImports));
|
|
860
860
|
}
|
|
861
861
|
|
|
862
|
-
/**
|
|
863
|
-
* Generate an ngDevMode guarded call to setClassDebugInfo with the debug info about the class
|
|
864
|
-
* (e.g., the file name in which the class is defined)
|
|
865
|
-
*/
|
|
866
|
-
function compileClassDebugInfo(debugInfo) {
|
|
867
|
-
const debugInfoObject = {
|
|
868
|
-
className: debugInfo.className,
|
|
869
|
-
};
|
|
870
|
-
// Include file path and line number only if the file relative path is calculated successfully.
|
|
871
|
-
if (debugInfo.filePath) {
|
|
872
|
-
debugInfoObject.filePath = debugInfo.filePath;
|
|
873
|
-
debugInfoObject.lineNumber = debugInfo.lineNumber;
|
|
874
|
-
}
|
|
875
|
-
// Include forbidOrphanRendering only if it's set to true (to reduce generated code)
|
|
876
|
-
if (debugInfo.forbidOrphanRendering) {
|
|
877
|
-
debugInfoObject.forbidOrphanRendering = checker.literal(true);
|
|
878
|
-
}
|
|
879
|
-
const fnCall = checker.importExpr(checker.Identifiers.setClassDebugInfo)
|
|
880
|
-
.callFn([debugInfo.type, checker.mapLiteral(debugInfoObject)]);
|
|
881
|
-
const iife = checker.arrowFn([], [checker.devOnlyGuardedExpression(fnCall).toStmt()]);
|
|
882
|
-
return iife.callFn([]);
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
/*!
|
|
886
|
-
* @license
|
|
887
|
-
* Copyright Google LLC All Rights Reserved.
|
|
888
|
-
*
|
|
889
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
890
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
891
|
-
*/
|
|
892
|
-
/**
|
|
893
|
-
* Compiles the expression that initializes HMR for a class.
|
|
894
|
-
* @param meta HMR metadata extracted from the class.
|
|
895
|
-
*/
|
|
896
|
-
function compileHmrInitializer(meta) {
|
|
897
|
-
const moduleName = 'm';
|
|
898
|
-
const dataName = 'd';
|
|
899
|
-
const timestampName = 't';
|
|
900
|
-
const idName = 'id';
|
|
901
|
-
const importCallbackName = `${meta.className}_HmrLoad`;
|
|
902
|
-
const namespaces = meta.namespaceDependencies.map((dep) => {
|
|
903
|
-
return new checker.ExternalExpr({ moduleName: dep.moduleName, name: null });
|
|
904
|
-
});
|
|
905
|
-
// m.default
|
|
906
|
-
const defaultRead = checker.variable(moduleName).prop('default');
|
|
907
|
-
// ɵɵreplaceMetadata(Comp, m.default, [...namespaces], [...locals], import.meta, id);
|
|
908
|
-
const replaceCall = checker.importExpr(checker.Identifiers.replaceMetadata)
|
|
909
|
-
.callFn([
|
|
910
|
-
meta.type,
|
|
911
|
-
defaultRead,
|
|
912
|
-
checker.literalArr(namespaces),
|
|
913
|
-
checker.literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
|
|
914
|
-
checker.variable('import').prop('meta'),
|
|
915
|
-
checker.variable(idName),
|
|
916
|
-
]);
|
|
917
|
-
// (m) => m.default && ɵɵreplaceMetadata(...)
|
|
918
|
-
const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
919
|
-
// '<url>?c=' + id + '&t=' + encodeURIComponent(t)
|
|
920
|
-
const urlValue = checker.literal(`./@ng/component?c=`)
|
|
921
|
-
.plus(checker.variable(idName))
|
|
922
|
-
.plus(checker.literal('&t='))
|
|
923
|
-
.plus(checker.variable('encodeURIComponent').callFn([checker.variable(timestampName)]));
|
|
924
|
-
// import.meta.url
|
|
925
|
-
const urlBase = checker.variable('import').prop('meta').prop('url');
|
|
926
|
-
// new URL(urlValue, urlBase).href
|
|
927
|
-
const urlHref = new checker.InstantiateExpr(checker.variable('URL'), [urlValue, urlBase]).prop('href');
|
|
928
|
-
// function Cmp_HmrLoad(t) {
|
|
929
|
-
// import(/* @vite-ignore */ urlHref).then((m) => m.default && replaceMetadata(...));
|
|
930
|
-
// }
|
|
931
|
-
const importCallback = new checker.DeclareFunctionStmt(importCallbackName, [new checker.FnParam(timestampName)], [
|
|
932
|
-
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
933
|
-
// warning for each usage within the development code. If Vite provides a method to
|
|
934
|
-
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
935
|
-
new checker.DynamicImportExpr(urlHref, null, '@vite-ignore')
|
|
936
|
-
.prop('then')
|
|
937
|
-
.callFn([replaceCallback])
|
|
938
|
-
.toStmt(),
|
|
939
|
-
], null, checker.StmtModifier.Final);
|
|
940
|
-
// (d) => d.id === id && Cmp_HmrLoad(d.timestamp)
|
|
941
|
-
const updateCallback = checker.arrowFn([new checker.FnParam(dataName)], checker.variable(dataName)
|
|
942
|
-
.prop('id')
|
|
943
|
-
.identical(checker.variable(idName))
|
|
944
|
-
.and(checker.variable(importCallbackName).callFn([checker.variable(dataName).prop('timestamp')])));
|
|
945
|
-
// Cmp_HmrLoad(Date.now());
|
|
946
|
-
// Initial call to kick off the loading in order to avoid edge cases with components
|
|
947
|
-
// coming from lazy chunks that change before the chunk has loaded.
|
|
948
|
-
const initialCall = checker.variable(importCallbackName)
|
|
949
|
-
.callFn([checker.variable('Date').prop('now').callFn([])]);
|
|
950
|
-
// import.meta.hot
|
|
951
|
-
const hotRead = checker.variable('import').prop('meta').prop('hot');
|
|
952
|
-
// import.meta.hot.on('angular:component-update', () => ...);
|
|
953
|
-
const hotListener = hotRead
|
|
954
|
-
.clone()
|
|
955
|
-
.prop('on')
|
|
956
|
-
.callFn([checker.literal('angular:component-update'), updateCallback]);
|
|
957
|
-
return checker.arrowFn([], [
|
|
958
|
-
// const id = <id>;
|
|
959
|
-
new checker.DeclareVarStmt(idName, checker.literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, checker.StmtModifier.Final),
|
|
960
|
-
// function Cmp_HmrLoad() {...}.
|
|
961
|
-
importCallback,
|
|
962
|
-
// ngDevMode && Cmp_HmrLoad(Date.now());
|
|
963
|
-
checker.devOnlyGuardedExpression(initialCall).toStmt(),
|
|
964
|
-
// ngDevMode && import.meta.hot && import.meta.hot.on(...)
|
|
965
|
-
checker.devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt(),
|
|
966
|
-
])
|
|
967
|
-
.callFn([]);
|
|
968
|
-
}
|
|
969
|
-
/**
|
|
970
|
-
* Compiles the HMR update callback for a class.
|
|
971
|
-
* @param definitions Compiled definitions for the class (e.g. `defineComponent` calls).
|
|
972
|
-
* @param constantStatements Supporting constants statements that were generated alongside
|
|
973
|
-
* the definition.
|
|
974
|
-
* @param meta HMR metadata extracted from the class.
|
|
975
|
-
*/
|
|
976
|
-
function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
977
|
-
const namespaces = 'ɵɵnamespaces';
|
|
978
|
-
const params = [meta.className, namespaces].map((name) => new checker.FnParam(name, checker.DYNAMIC_TYPE));
|
|
979
|
-
const body = [];
|
|
980
|
-
for (const local of meta.localDependencies) {
|
|
981
|
-
params.push(new checker.FnParam(local.name));
|
|
982
|
-
}
|
|
983
|
-
// Declare variables that read out the individual namespaces.
|
|
984
|
-
for (let i = 0; i < meta.namespaceDependencies.length; i++) {
|
|
985
|
-
body.push(new checker.DeclareVarStmt(meta.namespaceDependencies[i].assignedName, checker.variable(namespaces).key(checker.literal(i)), checker.DYNAMIC_TYPE, checker.StmtModifier.Final));
|
|
986
|
-
}
|
|
987
|
-
body.push(...constantStatements);
|
|
988
|
-
for (const field of definitions) {
|
|
989
|
-
if (field.initializer !== null) {
|
|
990
|
-
body.push(checker.variable(meta.className).prop(field.name).set(field.initializer).toStmt());
|
|
991
|
-
for (const stmt of field.statements) {
|
|
992
|
-
body.push(stmt);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
return new checker.DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, checker.StmtModifier.Final);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
862
|
/**
|
|
1000
863
|
* Every time we make a breaking change to the declaration interface or partial-linker behavior, we
|
|
1001
864
|
* must update this constant to prevent old partial-linkers from incorrectly processing the
|
|
@@ -1011,7 +874,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
1011
874
|
function compileDeclareClassMetadata(metadata) {
|
|
1012
875
|
const definitionMap = new checker.DefinitionMap();
|
|
1013
876
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
1014
|
-
definitionMap.set('version', checker.literal('
|
|
877
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1015
878
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1016
879
|
definitionMap.set('type', metadata.type);
|
|
1017
880
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -1029,7 +892,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
1029
892
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
1030
893
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
1031
894
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
1032
|
-
definitionMap.set('version', checker.literal('
|
|
895
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1033
896
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1034
897
|
definitionMap.set('type', metadata.type);
|
|
1035
898
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1124,7 +987,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1124
987
|
const definitionMap = new checker.DefinitionMap();
|
|
1125
988
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1126
989
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1127
|
-
definitionMap.set('version', checker.literal('
|
|
990
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1128
991
|
// e.g. `type: MyDirective`
|
|
1129
992
|
definitionMap.set('type', meta.type.value);
|
|
1130
993
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1540,7 +1403,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1540
1403
|
function compileDeclareFactoryFunction(meta) {
|
|
1541
1404
|
const definitionMap = new checker.DefinitionMap();
|
|
1542
1405
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1543
|
-
definitionMap.set('version', checker.literal('
|
|
1406
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1544
1407
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1545
1408
|
definitionMap.set('type', meta.type.value);
|
|
1546
1409
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1575,7 +1438,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1575
1438
|
function createInjectableDefinitionMap(meta) {
|
|
1576
1439
|
const definitionMap = new checker.DefinitionMap();
|
|
1577
1440
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1578
|
-
definitionMap.set('version', checker.literal('
|
|
1441
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1579
1442
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1580
1443
|
definitionMap.set('type', meta.type.value);
|
|
1581
1444
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1626,7 +1489,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1626
1489
|
function createInjectorDefinitionMap(meta) {
|
|
1627
1490
|
const definitionMap = new checker.DefinitionMap();
|
|
1628
1491
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1629
|
-
definitionMap.set('version', checker.literal('
|
|
1492
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1630
1493
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1631
1494
|
definitionMap.set('type', meta.type.value);
|
|
1632
1495
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1659,7 +1522,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1659
1522
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1660
1523
|
}
|
|
1661
1524
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1662
|
-
definitionMap.set('version', checker.literal('
|
|
1525
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1663
1526
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1664
1527
|
definitionMap.set('type', meta.type.value);
|
|
1665
1528
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1710,7 +1573,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1710
1573
|
function createPipeDefinitionMap(meta) {
|
|
1711
1574
|
const definitionMap = new checker.DefinitionMap();
|
|
1712
1575
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1713
|
-
definitionMap.set('version', checker.literal('
|
|
1576
|
+
definitionMap.set('version', checker.literal('20.0.0-next.0'));
|
|
1714
1577
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1715
1578
|
// e.g. `type: MyPipe`
|
|
1716
1579
|
definitionMap.set('type', meta.type.value);
|
|
@@ -1726,6 +1589,143 @@ function createPipeDefinitionMap(meta) {
|
|
|
1726
1589
|
return definitionMap;
|
|
1727
1590
|
}
|
|
1728
1591
|
|
|
1592
|
+
/**
|
|
1593
|
+
* Generate an ngDevMode guarded call to setClassDebugInfo with the debug info about the class
|
|
1594
|
+
* (e.g., the file name in which the class is defined)
|
|
1595
|
+
*/
|
|
1596
|
+
function compileClassDebugInfo(debugInfo) {
|
|
1597
|
+
const debugInfoObject = {
|
|
1598
|
+
className: debugInfo.className,
|
|
1599
|
+
};
|
|
1600
|
+
// Include file path and line number only if the file relative path is calculated successfully.
|
|
1601
|
+
if (debugInfo.filePath) {
|
|
1602
|
+
debugInfoObject.filePath = debugInfo.filePath;
|
|
1603
|
+
debugInfoObject.lineNumber = debugInfo.lineNumber;
|
|
1604
|
+
}
|
|
1605
|
+
// Include forbidOrphanRendering only if it's set to true (to reduce generated code)
|
|
1606
|
+
if (debugInfo.forbidOrphanRendering) {
|
|
1607
|
+
debugInfoObject.forbidOrphanRendering = checker.literal(true);
|
|
1608
|
+
}
|
|
1609
|
+
const fnCall = checker.importExpr(checker.Identifiers.setClassDebugInfo)
|
|
1610
|
+
.callFn([debugInfo.type, checker.mapLiteral(debugInfoObject)]);
|
|
1611
|
+
const iife = checker.arrowFn([], [checker.devOnlyGuardedExpression(fnCall).toStmt()]);
|
|
1612
|
+
return iife.callFn([]);
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
/*!
|
|
1616
|
+
* @license
|
|
1617
|
+
* Copyright Google LLC All Rights Reserved.
|
|
1618
|
+
*
|
|
1619
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
1620
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
1621
|
+
*/
|
|
1622
|
+
/**
|
|
1623
|
+
* Compiles the expression that initializes HMR for a class.
|
|
1624
|
+
* @param meta HMR metadata extracted from the class.
|
|
1625
|
+
*/
|
|
1626
|
+
function compileHmrInitializer(meta) {
|
|
1627
|
+
const moduleName = 'm';
|
|
1628
|
+
const dataName = 'd';
|
|
1629
|
+
const timestampName = 't';
|
|
1630
|
+
const idName = 'id';
|
|
1631
|
+
const importCallbackName = `${meta.className}_HmrLoad`;
|
|
1632
|
+
const namespaces = meta.namespaceDependencies.map((dep) => {
|
|
1633
|
+
return new checker.ExternalExpr({ moduleName: dep.moduleName, name: null });
|
|
1634
|
+
});
|
|
1635
|
+
// m.default
|
|
1636
|
+
const defaultRead = checker.variable(moduleName).prop('default');
|
|
1637
|
+
// ɵɵreplaceMetadata(Comp, m.default, [...namespaces], [...locals], import.meta, id);
|
|
1638
|
+
const replaceCall = checker.importExpr(checker.Identifiers.replaceMetadata)
|
|
1639
|
+
.callFn([
|
|
1640
|
+
meta.type,
|
|
1641
|
+
defaultRead,
|
|
1642
|
+
checker.literalArr(namespaces),
|
|
1643
|
+
checker.literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
|
|
1644
|
+
checker.variable('import').prop('meta'),
|
|
1645
|
+
checker.variable(idName),
|
|
1646
|
+
]);
|
|
1647
|
+
// (m) => m.default && ɵɵreplaceMetadata(...)
|
|
1648
|
+
const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
1649
|
+
// '<url>?c=' + id + '&t=' + encodeURIComponent(t)
|
|
1650
|
+
const urlValue = checker.literal(`./@ng/component?c=`)
|
|
1651
|
+
.plus(checker.variable(idName))
|
|
1652
|
+
.plus(checker.literal('&t='))
|
|
1653
|
+
.plus(checker.variable('encodeURIComponent').callFn([checker.variable(timestampName)]));
|
|
1654
|
+
// import.meta.url
|
|
1655
|
+
const urlBase = checker.variable('import').prop('meta').prop('url');
|
|
1656
|
+
// new URL(urlValue, urlBase).href
|
|
1657
|
+
const urlHref = new checker.InstantiateExpr(checker.variable('URL'), [urlValue, urlBase]).prop('href');
|
|
1658
|
+
// function Cmp_HmrLoad(t) {
|
|
1659
|
+
// import(/* @vite-ignore */ urlHref).then((m) => m.default && replaceMetadata(...));
|
|
1660
|
+
// }
|
|
1661
|
+
const importCallback = new checker.DeclareFunctionStmt(importCallbackName, [new checker.FnParam(timestampName)], [
|
|
1662
|
+
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
1663
|
+
// warning for each usage within the development code. If Vite provides a method to
|
|
1664
|
+
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
1665
|
+
new checker.DynamicImportExpr(urlHref, null, '@vite-ignore')
|
|
1666
|
+
.prop('then')
|
|
1667
|
+
.callFn([replaceCallback])
|
|
1668
|
+
.toStmt(),
|
|
1669
|
+
], null, checker.StmtModifier.Final);
|
|
1670
|
+
// (d) => d.id === id && Cmp_HmrLoad(d.timestamp)
|
|
1671
|
+
const updateCallback = checker.arrowFn([new checker.FnParam(dataName)], checker.variable(dataName)
|
|
1672
|
+
.prop('id')
|
|
1673
|
+
.identical(checker.variable(idName))
|
|
1674
|
+
.and(checker.variable(importCallbackName).callFn([checker.variable(dataName).prop('timestamp')])));
|
|
1675
|
+
// Cmp_HmrLoad(Date.now());
|
|
1676
|
+
// Initial call to kick off the loading in order to avoid edge cases with components
|
|
1677
|
+
// coming from lazy chunks that change before the chunk has loaded.
|
|
1678
|
+
const initialCall = checker.variable(importCallbackName)
|
|
1679
|
+
.callFn([checker.variable('Date').prop('now').callFn([])]);
|
|
1680
|
+
// import.meta.hot
|
|
1681
|
+
const hotRead = checker.variable('import').prop('meta').prop('hot');
|
|
1682
|
+
// import.meta.hot.on('angular:component-update', () => ...);
|
|
1683
|
+
const hotListener = hotRead
|
|
1684
|
+
.clone()
|
|
1685
|
+
.prop('on')
|
|
1686
|
+
.callFn([checker.literal('angular:component-update'), updateCallback]);
|
|
1687
|
+
return checker.arrowFn([], [
|
|
1688
|
+
// const id = <id>;
|
|
1689
|
+
new checker.DeclareVarStmt(idName, checker.literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, checker.StmtModifier.Final),
|
|
1690
|
+
// function Cmp_HmrLoad() {...}.
|
|
1691
|
+
importCallback,
|
|
1692
|
+
// ngDevMode && Cmp_HmrLoad(Date.now());
|
|
1693
|
+
checker.devOnlyGuardedExpression(initialCall).toStmt(),
|
|
1694
|
+
// ngDevMode && import.meta.hot && import.meta.hot.on(...)
|
|
1695
|
+
checker.devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt(),
|
|
1696
|
+
])
|
|
1697
|
+
.callFn([]);
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Compiles the HMR update callback for a class.
|
|
1701
|
+
* @param definitions Compiled definitions for the class (e.g. `defineComponent` calls).
|
|
1702
|
+
* @param constantStatements Supporting constants statements that were generated alongside
|
|
1703
|
+
* the definition.
|
|
1704
|
+
* @param meta HMR metadata extracted from the class.
|
|
1705
|
+
*/
|
|
1706
|
+
function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
1707
|
+
const namespaces = 'ɵɵnamespaces';
|
|
1708
|
+
const params = [meta.className, namespaces].map((name) => new checker.FnParam(name, checker.DYNAMIC_TYPE));
|
|
1709
|
+
const body = [];
|
|
1710
|
+
for (const local of meta.localDependencies) {
|
|
1711
|
+
params.push(new checker.FnParam(local.name));
|
|
1712
|
+
}
|
|
1713
|
+
// Declare variables that read out the individual namespaces.
|
|
1714
|
+
for (let i = 0; i < meta.namespaceDependencies.length; i++) {
|
|
1715
|
+
body.push(new checker.DeclareVarStmt(meta.namespaceDependencies[i].assignedName, checker.variable(namespaces).key(checker.literal(i)), checker.DYNAMIC_TYPE, checker.StmtModifier.Final));
|
|
1716
|
+
}
|
|
1717
|
+
body.push(...constantStatements);
|
|
1718
|
+
for (const field of definitions) {
|
|
1719
|
+
if (field.initializer !== null) {
|
|
1720
|
+
body.push(checker.variable(meta.className).prop(field.name).set(field.initializer).toStmt());
|
|
1721
|
+
for (const stmt of field.statements) {
|
|
1722
|
+
body.push(stmt);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
return new checker.DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, checker.StmtModifier.Final);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
1729
|
/**
|
|
1730
1730
|
* Base URL for the error details page.
|
|
1731
1731
|
*
|
|
@@ -20389,7 +20389,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
20389
20389
|
* @param minVersion Minimum required version for the feature.
|
|
20390
20390
|
*/
|
|
20391
20391
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
20392
|
-
// A version of `
|
|
20392
|
+
// A version of `20.0.0-next.0` usually means that core is at head so it supports
|
|
20393
20393
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
20394
20394
|
// with the current version during build time.
|
|
20395
20395
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,8 +10,8 @@ var core = require('@angular-devkit/core');
|
|
|
10
10
|
var posixPath = require('node:path/posix');
|
|
11
11
|
var os = require('os');
|
|
12
12
|
var ts = require('typescript');
|
|
13
|
-
var checker = require('./checker-
|
|
14
|
-
var program = require('./program-
|
|
13
|
+
var checker = require('./checker-cf6f7980.js');
|
|
14
|
+
var program = require('./program-362689f0.js');
|
|
15
15
|
require('path');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
+
var compiler_host = require('./compiler_host-cc1379e9.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
var imports = require('./imports-31a38653.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
|
-
require('./checker-
|
|
18
|
+
require('./checker-cf6f7980.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('fs');
|
|
21
21
|
require('module');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
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-
|
|
14
|
+
var compiler_host = require('./compiler_host-cc1379e9.js');
|
|
15
15
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
16
16
|
var ts = require('typescript');
|
|
17
|
-
var checker = require('./checker-
|
|
17
|
+
var checker = require('./checker-cf6f7980.js');
|
|
18
18
|
var property_name = require('./property_name-42030525.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('@angular-devkit/core');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,11 +10,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
13
|
+
var project_paths = require('./project_paths-7d2daa1e.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
require('./program-
|
|
16
|
+
var checker = require('./checker-cf6f7980.js');
|
|
17
|
+
require('./program-362689f0.js');
|
|
18
18
|
require('path');
|
|
19
19
|
var ng_decorators = require('./ng_decorators-6878e227.js');
|
|
20
20
|
var property_name = require('./property_name-42030525.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular
|
|
3
|
+
* @license Angular v20.0.0-next.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
12
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-5089e4ef.js');
|
|
13
13
|
var ts = require('typescript');
|
|
14
14
|
require('os');
|
|
15
|
-
var checker = require('./checker-
|
|
16
|
-
var program = require('./program-
|
|
15
|
+
var checker = require('./checker-cf6f7980.js');
|
|
16
|
+
var program = require('./program-362689f0.js');
|
|
17
17
|
require('path');
|
|
18
|
-
var project_paths = require('./project_paths-
|
|
19
|
-
var index = require('./index-
|
|
18
|
+
var project_paths = require('./project_paths-7d2daa1e.js');
|
|
19
|
+
var index = require('./index-42d84d69.js');
|
|
20
20
|
var assert = require('assert');
|
|
21
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
21
|
+
var apply_import_manager = require('./apply_import_manager-0959b78c.js');
|
|
22
22
|
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
23
23
|
require('./leading_space-6e7a8ec6.js');
|
|
24
24
|
require('fs');
|