@angular/core 12.1.2 → 12.1.3
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/bundles/core-testing.umd.js +1 -1
- package/bundles/core.umd.js +83 -29
- package/bundles/core.umd.js.map +1 -1
- package/core.d.ts +1 -1
- package/core.metadata.json +1 -1
- package/esm2015/src/application_ref.js +6 -2
- package/esm2015/src/compiler/compiler_facade.js +31 -8
- package/esm2015/src/di/jit/injectable.js +4 -3
- package/esm2015/src/di/r3_injector.js +5 -2
- package/esm2015/src/render3/jit/directive.js +6 -5
- package/esm2015/src/render3/jit/module.js +7 -4
- package/esm2015/src/render3/jit/partial.js +27 -9
- package/esm2015/src/render3/jit/pipe.js +5 -3
- package/esm2015/src/version.js +1 -1
- package/fesm2015/core.js +83 -29
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/package.json +1 -1
- package/src/r3_symbols.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
package/bundles/core.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.1.
|
|
2
|
+
* @license Angular v12.1.3
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4340,15 +4340,38 @@
|
|
|
4340
4340
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4341
4341
|
* found in the LICENSE file at https://angular.io/license
|
|
4342
4342
|
*/
|
|
4343
|
-
function getCompilerFacade() {
|
|
4343
|
+
function getCompilerFacade(request) {
|
|
4344
4344
|
var globalNg = _global['ng'];
|
|
4345
|
-
if (
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4345
|
+
if (globalNg && globalNg.ɵcompilerFacade) {
|
|
4346
|
+
return globalNg.ɵcompilerFacade;
|
|
4347
|
+
}
|
|
4348
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
4349
|
+
// Log the type as an error so that a developer can easily navigate to the type from the
|
|
4350
|
+
// console.
|
|
4351
|
+
console.error("JIT compilation failed for " + request.kind, request.type);
|
|
4352
|
+
var message = "The " + request.kind + " '" + request
|
|
4353
|
+
.type.name + "' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n";
|
|
4354
|
+
if (request.usage === 1 /* PartialDeclaration */) {
|
|
4355
|
+
message += "The " + request.kind + " is part of a library that has been partially compiled.\n";
|
|
4356
|
+
message +=
|
|
4357
|
+
"However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n";
|
|
4358
|
+
message += '\n';
|
|
4359
|
+
message +=
|
|
4360
|
+
"Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n";
|
|
4361
|
+
}
|
|
4362
|
+
else {
|
|
4363
|
+
message +=
|
|
4364
|
+
"JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n";
|
|
4365
|
+
}
|
|
4366
|
+
message +=
|
|
4367
|
+
"Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n";
|
|
4368
|
+
message +=
|
|
4369
|
+
"or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.";
|
|
4370
|
+
throw new Error(message);
|
|
4371
|
+
}
|
|
4372
|
+
else {
|
|
4373
|
+
throw new Error('JIT compiler unavailable');
|
|
4350
4374
|
}
|
|
4351
|
-
return globalNg.ɵcompilerFacade;
|
|
4352
4375
|
}
|
|
4353
4376
|
|
|
4354
4377
|
/**
|
|
@@ -11725,6 +11748,7 @@
|
|
|
11725
11748
|
this.assertNotDestroyed();
|
|
11726
11749
|
// Set the injection context.
|
|
11727
11750
|
var previousInjector = setCurrentInjector(this);
|
|
11751
|
+
var previousInjectImplementation = setInjectImplementation(undefined);
|
|
11728
11752
|
try {
|
|
11729
11753
|
// Check for the SkipSelf flag.
|
|
11730
11754
|
if (!(flags & exports.InjectFlags.SkipSelf)) {
|
|
@@ -11777,7 +11801,8 @@
|
|
|
11777
11801
|
}
|
|
11778
11802
|
}
|
|
11779
11803
|
finally {
|
|
11780
|
-
// Lastly,
|
|
11804
|
+
// Lastly, restore the previous injection context.
|
|
11805
|
+
setInjectImplementation(previousInjectImplementation);
|
|
11781
11806
|
setCurrentInjector(previousInjector);
|
|
11782
11807
|
}
|
|
11783
11808
|
};
|
|
@@ -14202,7 +14227,8 @@
|
|
|
14202
14227
|
Object.defineProperty(type, NG_PROV_DEF, {
|
|
14203
14228
|
get: function () {
|
|
14204
14229
|
if (ngInjectableDef === null) {
|
|
14205
|
-
|
|
14230
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });
|
|
14231
|
+
ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, "ng:///" + type.name + "/\u0275prov.js", getInjectableMetadata(type, meta));
|
|
14206
14232
|
}
|
|
14207
14233
|
return ngInjectableDef;
|
|
14208
14234
|
},
|
|
@@ -14213,7 +14239,7 @@
|
|
|
14213
14239
|
Object.defineProperty(type, NG_FACTORY_DEF, {
|
|
14214
14240
|
get: function () {
|
|
14215
14241
|
if (ngFactoryDef === null) {
|
|
14216
|
-
var compiler = getCompilerFacade();
|
|
14242
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type: type });
|
|
14217
14243
|
ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, "ng:///" + type.name + "/\u0275fac.js", {
|
|
14218
14244
|
name: type.name,
|
|
14219
14245
|
type: type,
|
|
@@ -22040,7 +22066,7 @@
|
|
|
22040
22066
|
/**
|
|
22041
22067
|
* @publicApi
|
|
22042
22068
|
*/
|
|
22043
|
-
var VERSION = new Version('12.1.
|
|
22069
|
+
var VERSION = new Version('12.1.3');
|
|
22044
22070
|
|
|
22045
22071
|
/**
|
|
22046
22072
|
* @license
|
|
@@ -27639,7 +27665,8 @@
|
|
|
27639
27665
|
// go into an infinite loop before we've reached the point where we throw all the errors.
|
|
27640
27666
|
throw new Error("'" + stringifyForError(moduleType) + "' module can't import itself");
|
|
27641
27667
|
}
|
|
27642
|
-
|
|
27668
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27669
|
+
ngModuleDef = compiler.compileNgModule(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275mod.js", {
|
|
27643
27670
|
type: moduleType,
|
|
27644
27671
|
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
|
|
27645
27672
|
declarations: declarations.map(resolveForwardRef),
|
|
@@ -27667,7 +27694,7 @@
|
|
|
27667
27694
|
Object.defineProperty(moduleType, NG_FACTORY_DEF, {
|
|
27668
27695
|
get: function () {
|
|
27669
27696
|
if (ngFactoryDef === null) {
|
|
27670
|
-
var compiler = getCompilerFacade();
|
|
27697
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27671
27698
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275fac.js", {
|
|
27672
27699
|
name: moduleType.name,
|
|
27673
27700
|
type: moduleType,
|
|
@@ -27696,7 +27723,9 @@
|
|
|
27696
27723
|
(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),
|
|
27697
27724
|
],
|
|
27698
27725
|
};
|
|
27699
|
-
|
|
27726
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
27727
|
+
ngInjectorDef =
|
|
27728
|
+
compiler.compileInjector(angularCoreEnv, "ng:///" + moduleType.name + "/\u0275inj.js", meta);
|
|
27700
27729
|
}
|
|
27701
27730
|
return ngInjectorDef;
|
|
27702
27731
|
},
|
|
@@ -28059,7 +28088,7 @@
|
|
|
28059
28088
|
Object.defineProperty(type, NG_COMP_DEF, {
|
|
28060
28089
|
get: function () {
|
|
28061
28090
|
if (ngComponentDef === null) {
|
|
28062
|
-
var compiler = getCompilerFacade();
|
|
28091
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });
|
|
28063
28092
|
if (componentNeedsResolution(metadata)) {
|
|
28064
28093
|
var error = ["Component '" + type.name + "' is not resolved:"];
|
|
28065
28094
|
if (metadata.templateUrl) {
|
|
@@ -28150,8 +28179,9 @@
|
|
|
28150
28179
|
// that use `@Directive()` with no selector. In that case, pass empty object to the
|
|
28151
28180
|
// `directiveMetadata` function instead of null.
|
|
28152
28181
|
var meta = getDirectiveMetadata$1(type, directive || {});
|
|
28182
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28153
28183
|
ngDirectiveDef =
|
|
28154
|
-
|
|
28184
|
+
compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
|
|
28155
28185
|
}
|
|
28156
28186
|
return ngDirectiveDef;
|
|
28157
28187
|
},
|
|
@@ -28162,7 +28192,7 @@
|
|
|
28162
28192
|
function getDirectiveMetadata$1(type, metadata) {
|
|
28163
28193
|
var name = type && type.name;
|
|
28164
28194
|
var sourceMapUrl = "ng:///" + name + "/\u0275dir.js";
|
|
28165
|
-
var compiler = getCompilerFacade();
|
|
28195
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28166
28196
|
var facade = directiveMetadata(type, metadata);
|
|
28167
28197
|
facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
|
|
28168
28198
|
if (facade.usesInheritance) {
|
|
@@ -28176,7 +28206,7 @@
|
|
|
28176
28206
|
get: function () {
|
|
28177
28207
|
if (ngFactoryDef === null) {
|
|
28178
28208
|
var meta = getDirectiveMetadata$1(type, metadata);
|
|
28179
|
-
var compiler = getCompilerFacade();
|
|
28209
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type: type });
|
|
28180
28210
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + type.name + "/\u0275fac.js", {
|
|
28181
28211
|
name: meta.metadata.name,
|
|
28182
28212
|
type: meta.metadata.type,
|
|
@@ -28330,7 +28360,7 @@
|
|
|
28330
28360
|
get: function () {
|
|
28331
28361
|
if (ngFactoryDef === null) {
|
|
28332
28362
|
var metadata = getPipeMetadata(type, meta);
|
|
28333
|
-
var compiler = getCompilerFacade();
|
|
28363
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
28334
28364
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, "ng:///" + metadata.name + "/\u0275fac.js", {
|
|
28335
28365
|
name: metadata.name,
|
|
28336
28366
|
type: metadata.type,
|
|
@@ -28348,7 +28378,9 @@
|
|
|
28348
28378
|
get: function () {
|
|
28349
28379
|
if (ngPipeDef === null) {
|
|
28350
28380
|
var metadata = getPipeMetadata(type, meta);
|
|
28351
|
-
|
|
28381
|
+
var compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
28382
|
+
ngPipeDef =
|
|
28383
|
+
compiler.compilePipe(angularCoreEnv, "ng:///" + metadata.name + "/\u0275pipe.js", metadata);
|
|
28352
28384
|
}
|
|
28353
28385
|
return ngPipeDef;
|
|
28354
28386
|
},
|
|
@@ -29784,7 +29816,11 @@
|
|
|
29784
29816
|
if (compilerProviders.length === 0) {
|
|
29785
29817
|
return Promise.resolve(moduleFactory);
|
|
29786
29818
|
}
|
|
29787
|
-
var compiler = getCompilerFacade(
|
|
29819
|
+
var compiler = getCompilerFacade({
|
|
29820
|
+
usage: 0 /* Decorator */,
|
|
29821
|
+
kind: 'NgModule',
|
|
29822
|
+
type: moduleType,
|
|
29823
|
+
});
|
|
29788
29824
|
var compilerInjector = Injector.create({ providers: compilerProviders });
|
|
29789
29825
|
var resourceLoader = compilerInjector.get(compiler.ResourceLoader);
|
|
29790
29826
|
// The resource loader can also return a string while the "resolveComponentResources"
|
|
@@ -33903,7 +33939,7 @@
|
|
|
33903
33939
|
* @codeGenApi
|
|
33904
33940
|
*/
|
|
33905
33941
|
function ɵɵngDeclareDirective(decl) {
|
|
33906
|
-
var compiler = getCompilerFacade();
|
|
33942
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });
|
|
33907
33943
|
return compiler.compileDirectiveDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275fac.js", decl);
|
|
33908
33944
|
}
|
|
33909
33945
|
/**
|
|
@@ -33921,7 +33957,7 @@
|
|
|
33921
33957
|
* @codeGenApi
|
|
33922
33958
|
*/
|
|
33923
33959
|
function ɵɵngDeclareComponent(decl) {
|
|
33924
|
-
var compiler = getCompilerFacade();
|
|
33960
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });
|
|
33925
33961
|
return compiler.compileComponentDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275cmp.js", decl);
|
|
33926
33962
|
}
|
|
33927
33963
|
/**
|
|
@@ -33930,16 +33966,34 @@
|
|
|
33930
33966
|
* @codeGenApi
|
|
33931
33967
|
*/
|
|
33932
33968
|
function ɵɵngDeclareFactory(decl) {
|
|
33933
|
-
var compiler = getCompilerFacade(
|
|
33969
|
+
var compiler = getCompilerFacade({
|
|
33970
|
+
usage: 1 /* PartialDeclaration */,
|
|
33971
|
+
kind: getFactoryKind(decl.target),
|
|
33972
|
+
type: decl.type
|
|
33973
|
+
});
|
|
33934
33974
|
return compiler.compileFactoryDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275fac.js", decl);
|
|
33935
33975
|
}
|
|
33976
|
+
function getFactoryKind(target) {
|
|
33977
|
+
switch (target) {
|
|
33978
|
+
case exports.ɵɵFactoryTarget.Directive:
|
|
33979
|
+
return 'directive';
|
|
33980
|
+
case exports.ɵɵFactoryTarget.Component:
|
|
33981
|
+
return 'component';
|
|
33982
|
+
case exports.ɵɵFactoryTarget.Injectable:
|
|
33983
|
+
return 'injectable';
|
|
33984
|
+
case exports.ɵɵFactoryTarget.Pipe:
|
|
33985
|
+
return 'pipe';
|
|
33986
|
+
case exports.ɵɵFactoryTarget.NgModule:
|
|
33987
|
+
return 'NgModule';
|
|
33988
|
+
}
|
|
33989
|
+
}
|
|
33936
33990
|
/**
|
|
33937
33991
|
* Compiles a partial injectable declaration object into a full injectable definition object.
|
|
33938
33992
|
*
|
|
33939
33993
|
* @codeGenApi
|
|
33940
33994
|
*/
|
|
33941
33995
|
function ɵɵngDeclareInjectable(decl) {
|
|
33942
|
-
var compiler = getCompilerFacade();
|
|
33996
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });
|
|
33943
33997
|
return compiler.compileInjectableDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275prov.js", decl);
|
|
33944
33998
|
}
|
|
33945
33999
|
/**
|
|
@@ -33948,7 +34002,7 @@
|
|
|
33948
34002
|
* @codeGenApi
|
|
33949
34003
|
*/
|
|
33950
34004
|
function ɵɵngDeclareInjector(decl) {
|
|
33951
|
-
var compiler = getCompilerFacade();
|
|
34005
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33952
34006
|
return compiler.compileInjectorDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275inj.js", decl);
|
|
33953
34007
|
}
|
|
33954
34008
|
/**
|
|
@@ -33957,7 +34011,7 @@
|
|
|
33957
34011
|
* @codeGenApi
|
|
33958
34012
|
*/
|
|
33959
34013
|
function ɵɵngDeclareNgModule(decl) {
|
|
33960
|
-
var compiler = getCompilerFacade();
|
|
34014
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
33961
34015
|
return compiler.compileNgModuleDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275mod.js", decl);
|
|
33962
34016
|
}
|
|
33963
34017
|
/**
|
|
@@ -33966,7 +34020,7 @@
|
|
|
33966
34020
|
* @codeGenApi
|
|
33967
34021
|
*/
|
|
33968
34022
|
function ɵɵngDeclarePipe(decl) {
|
|
33969
|
-
var compiler = getCompilerFacade();
|
|
34023
|
+
var compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });
|
|
33970
34024
|
return compiler.compilePipeDeclaration(angularCoreEnv, "ng:///" + decl.type.name + "/\u0275pipe.js", decl);
|
|
33971
34025
|
}
|
|
33972
34026
|
|