@angular/compiler 20.0.0-rc.1 → 20.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/compiler.mjs +135 -126
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +645 -329
- package/package.json +2 -2
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-rc.
|
|
2
|
+
* @license Angular v20.0.0-rc.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -415,13 +415,13 @@ class SelectorlessMatcher {
|
|
|
415
415
|
// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
|
|
416
416
|
// explicitly set.
|
|
417
417
|
const emitDistinctChangesOnlyDefaultValue = true;
|
|
418
|
-
var ViewEncapsulation;
|
|
418
|
+
var ViewEncapsulation$1;
|
|
419
419
|
(function (ViewEncapsulation) {
|
|
420
420
|
ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
|
|
421
421
|
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
|
|
422
422
|
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
|
|
423
423
|
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
|
|
424
|
-
})(ViewEncapsulation || (ViewEncapsulation = {}));
|
|
424
|
+
})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
|
|
425
425
|
var ChangeDetectionStrategy;
|
|
426
426
|
(function (ChangeDetectionStrategy) {
|
|
427
427
|
ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
|
|
@@ -504,11 +504,33 @@ var core = /*#__PURE__*/Object.freeze({
|
|
|
504
504
|
NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA,
|
|
505
505
|
get SecurityContext () { return SecurityContext; },
|
|
506
506
|
Type: Type$1,
|
|
507
|
-
get ViewEncapsulation () { return ViewEncapsulation; },
|
|
507
|
+
get ViewEncapsulation () { return ViewEncapsulation$1; },
|
|
508
508
|
emitDistinctChangesOnlyDefaultValue: emitDistinctChangesOnlyDefaultValue,
|
|
509
509
|
parseSelectorToR3Selector: parseSelectorToR3Selector
|
|
510
510
|
});
|
|
511
511
|
|
|
512
|
+
var FactoryTarget;
|
|
513
|
+
(function (FactoryTarget) {
|
|
514
|
+
FactoryTarget[FactoryTarget["Directive"] = 0] = "Directive";
|
|
515
|
+
FactoryTarget[FactoryTarget["Component"] = 1] = "Component";
|
|
516
|
+
FactoryTarget[FactoryTarget["Injectable"] = 2] = "Injectable";
|
|
517
|
+
FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe";
|
|
518
|
+
FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule";
|
|
519
|
+
})(FactoryTarget || (FactoryTarget = {}));
|
|
520
|
+
var R3TemplateDependencyKind$1;
|
|
521
|
+
(function (R3TemplateDependencyKind) {
|
|
522
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
|
|
523
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
|
|
524
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
|
|
525
|
+
})(R3TemplateDependencyKind$1 || (R3TemplateDependencyKind$1 = {}));
|
|
526
|
+
var ViewEncapsulation;
|
|
527
|
+
(function (ViewEncapsulation) {
|
|
528
|
+
ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
|
|
529
|
+
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
|
|
530
|
+
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
|
|
531
|
+
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
|
|
532
|
+
})(ViewEncapsulation || (ViewEncapsulation = {}));
|
|
533
|
+
|
|
512
534
|
/**
|
|
513
535
|
* A lazily created TextEncoder instance for converting strings into UTF-8 bytes
|
|
514
536
|
*/
|
|
@@ -2682,42 +2704,6 @@ class Identifiers {
|
|
|
2682
2704
|
moduleName: CORE,
|
|
2683
2705
|
};
|
|
2684
2706
|
static attribute = { name: 'ɵɵattribute', moduleName: CORE };
|
|
2685
|
-
static attributeInterpolate1 = {
|
|
2686
|
-
name: 'ɵɵattributeInterpolate1',
|
|
2687
|
-
moduleName: CORE,
|
|
2688
|
-
};
|
|
2689
|
-
static attributeInterpolate2 = {
|
|
2690
|
-
name: 'ɵɵattributeInterpolate2',
|
|
2691
|
-
moduleName: CORE,
|
|
2692
|
-
};
|
|
2693
|
-
static attributeInterpolate3 = {
|
|
2694
|
-
name: 'ɵɵattributeInterpolate3',
|
|
2695
|
-
moduleName: CORE,
|
|
2696
|
-
};
|
|
2697
|
-
static attributeInterpolate4 = {
|
|
2698
|
-
name: 'ɵɵattributeInterpolate4',
|
|
2699
|
-
moduleName: CORE,
|
|
2700
|
-
};
|
|
2701
|
-
static attributeInterpolate5 = {
|
|
2702
|
-
name: 'ɵɵattributeInterpolate5',
|
|
2703
|
-
moduleName: CORE,
|
|
2704
|
-
};
|
|
2705
|
-
static attributeInterpolate6 = {
|
|
2706
|
-
name: 'ɵɵattributeInterpolate6',
|
|
2707
|
-
moduleName: CORE,
|
|
2708
|
-
};
|
|
2709
|
-
static attributeInterpolate7 = {
|
|
2710
|
-
name: 'ɵɵattributeInterpolate7',
|
|
2711
|
-
moduleName: CORE,
|
|
2712
|
-
};
|
|
2713
|
-
static attributeInterpolate8 = {
|
|
2714
|
-
name: 'ɵɵattributeInterpolate8',
|
|
2715
|
-
moduleName: CORE,
|
|
2716
|
-
};
|
|
2717
|
-
static attributeInterpolateV = {
|
|
2718
|
-
name: 'ɵɵattributeInterpolateV',
|
|
2719
|
-
moduleName: CORE,
|
|
2720
|
-
};
|
|
2721
2707
|
static classProp = { name: 'ɵɵclassProp', moduleName: CORE };
|
|
2722
2708
|
static elementContainerStart = {
|
|
2723
2709
|
name: 'ɵɵelementContainerStart',
|
|
@@ -2839,6 +2825,46 @@ class Identifiers {
|
|
|
2839
2825
|
name: 'ɵɵstylePropInterpolateV',
|
|
2840
2826
|
moduleName: CORE,
|
|
2841
2827
|
};
|
|
2828
|
+
static interpolate = {
|
|
2829
|
+
name: 'ɵɵinterpolate',
|
|
2830
|
+
moduleName: CORE,
|
|
2831
|
+
};
|
|
2832
|
+
static interpolate1 = {
|
|
2833
|
+
name: 'ɵɵinterpolate1',
|
|
2834
|
+
moduleName: CORE,
|
|
2835
|
+
};
|
|
2836
|
+
static interpolate2 = {
|
|
2837
|
+
name: 'ɵɵinterpolate2',
|
|
2838
|
+
moduleName: CORE,
|
|
2839
|
+
};
|
|
2840
|
+
static interpolate3 = {
|
|
2841
|
+
name: 'ɵɵinterpolate3',
|
|
2842
|
+
moduleName: CORE,
|
|
2843
|
+
};
|
|
2844
|
+
static interpolate4 = {
|
|
2845
|
+
name: 'ɵɵinterpolate4',
|
|
2846
|
+
moduleName: CORE,
|
|
2847
|
+
};
|
|
2848
|
+
static interpolate5 = {
|
|
2849
|
+
name: 'ɵɵinterpolate5',
|
|
2850
|
+
moduleName: CORE,
|
|
2851
|
+
};
|
|
2852
|
+
static interpolate6 = {
|
|
2853
|
+
name: 'ɵɵinterpolate6',
|
|
2854
|
+
moduleName: CORE,
|
|
2855
|
+
};
|
|
2856
|
+
static interpolate7 = {
|
|
2857
|
+
name: 'ɵɵinterpolate7',
|
|
2858
|
+
moduleName: CORE,
|
|
2859
|
+
};
|
|
2860
|
+
static interpolate8 = {
|
|
2861
|
+
name: 'ɵɵinterpolate8',
|
|
2862
|
+
moduleName: CORE,
|
|
2863
|
+
};
|
|
2864
|
+
static interpolateV = {
|
|
2865
|
+
name: 'ɵɵinterpolateV',
|
|
2866
|
+
moduleName: CORE,
|
|
2867
|
+
};
|
|
2842
2868
|
static nextContext = { name: 'ɵɵnextContext', moduleName: CORE };
|
|
2843
2869
|
static resetView = { name: 'ɵɵresetView', moduleName: CORE };
|
|
2844
2870
|
static templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
|
|
@@ -3017,6 +3043,10 @@ class Identifiers {
|
|
|
3017
3043
|
static forwardRef = { name: 'forwardRef', moduleName: CORE };
|
|
3018
3044
|
static resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };
|
|
3019
3045
|
static replaceMetadata = { name: 'ɵɵreplaceMetadata', moduleName: CORE };
|
|
3046
|
+
static getReplaceMetadataURL = {
|
|
3047
|
+
name: 'ɵɵgetReplaceMetadataURL',
|
|
3048
|
+
moduleName: CORE,
|
|
3049
|
+
};
|
|
3020
3050
|
static ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };
|
|
3021
3051
|
static declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };
|
|
3022
3052
|
static InjectableDeclaration = {
|
|
@@ -3185,6 +3215,10 @@ function _splitAt(input, character, defaultValues) {
|
|
|
3185
3215
|
function noUndefined(val) {
|
|
3186
3216
|
return val === undefined ? null : val;
|
|
3187
3217
|
}
|
|
3218
|
+
// Escape characters that have a special meaning in Regular Expressions
|
|
3219
|
+
function escapeRegExp(s) {
|
|
3220
|
+
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
|
3221
|
+
}
|
|
3188
3222
|
function utf8Encode(str) {
|
|
3189
3223
|
let encoded = [];
|
|
3190
3224
|
for (let index = 0; index < str.length; index++) {
|
|
@@ -4035,14 +4069,6 @@ var R3FactoryDelegateType;
|
|
|
4035
4069
|
R3FactoryDelegateType[R3FactoryDelegateType["Class"] = 0] = "Class";
|
|
4036
4070
|
R3FactoryDelegateType[R3FactoryDelegateType["Function"] = 1] = "Function";
|
|
4037
4071
|
})(R3FactoryDelegateType || (R3FactoryDelegateType = {}));
|
|
4038
|
-
var FactoryTarget$1;
|
|
4039
|
-
(function (FactoryTarget) {
|
|
4040
|
-
FactoryTarget[FactoryTarget["Directive"] = 0] = "Directive";
|
|
4041
|
-
FactoryTarget[FactoryTarget["Component"] = 1] = "Component";
|
|
4042
|
-
FactoryTarget[FactoryTarget["Injectable"] = 2] = "Injectable";
|
|
4043
|
-
FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe";
|
|
4044
|
-
FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule";
|
|
4045
|
-
})(FactoryTarget$1 || (FactoryTarget$1 = {}));
|
|
4046
4072
|
/**
|
|
4047
4073
|
* Construct a factory function expression for the given `R3FactoryMetadata`.
|
|
4048
4074
|
*/
|
|
@@ -4145,7 +4171,7 @@ function compileInjectDependency(dep, target, index) {
|
|
|
4145
4171
|
(dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) |
|
|
4146
4172
|
(dep.host ? 1 /* InjectFlags.Host */ : 0) |
|
|
4147
4173
|
(dep.optional ? 8 /* InjectFlags.Optional */ : 0) |
|
|
4148
|
-
(target === FactoryTarget
|
|
4174
|
+
(target === FactoryTarget.Pipe ? 16 /* InjectFlags.ForPipe */ : 0);
|
|
4149
4175
|
// If this dependency is optional or otherwise has non-default flags, then additional
|
|
4150
4176
|
// parameters describing how to inject the dependency must be passed to the inject function
|
|
4151
4177
|
// that's being used.
|
|
@@ -4215,12 +4241,12 @@ function isExpressionFactoryMetadata(meta) {
|
|
|
4215
4241
|
}
|
|
4216
4242
|
function getInjectFn(target) {
|
|
4217
4243
|
switch (target) {
|
|
4218
|
-
case FactoryTarget
|
|
4219
|
-
case FactoryTarget
|
|
4220
|
-
case FactoryTarget
|
|
4244
|
+
case FactoryTarget.Component:
|
|
4245
|
+
case FactoryTarget.Directive:
|
|
4246
|
+
case FactoryTarget.Pipe:
|
|
4221
4247
|
return Identifiers.directiveInject;
|
|
4222
|
-
case FactoryTarget
|
|
4223
|
-
case FactoryTarget
|
|
4248
|
+
case FactoryTarget.NgModule:
|
|
4249
|
+
case FactoryTarget.Injectable:
|
|
4224
4250
|
default:
|
|
4225
4251
|
return Identifiers.inject;
|
|
4226
4252
|
}
|
|
@@ -6507,7 +6533,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
6507
6533
|
type: meta.type,
|
|
6508
6534
|
typeArgumentCount: meta.typeArgumentCount,
|
|
6509
6535
|
deps: [],
|
|
6510
|
-
target: FactoryTarget
|
|
6536
|
+
target: FactoryTarget.Injectable,
|
|
6511
6537
|
};
|
|
6512
6538
|
if (meta.useClass !== undefined) {
|
|
6513
6539
|
// meta.useClass has two modes of operation. Either deps are specified, in which case `new` is
|
|
@@ -23612,13 +23638,10 @@ function propertyInterpolate(name, strings, expressions, sanitizer, sourceSpan)
|
|
|
23612
23638
|
}
|
|
23613
23639
|
return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
23614
23640
|
}
|
|
23615
|
-
function attributeInterpolate(name, strings, expressions, sanitizer, sourceSpan) {
|
|
23641
|
+
function attributeInterpolate(name, strings, expressions, sanitizer, namespace, sourceSpan) {
|
|
23616
23642
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23617
|
-
const
|
|
23618
|
-
|
|
23619
|
-
extraArgs.push(sanitizer);
|
|
23620
|
-
}
|
|
23621
|
-
return callVariadicInstruction(ATTRIBUTE_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
23643
|
+
const value = callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
23644
|
+
return attribute(name, value, sanitizer, namespace);
|
|
23622
23645
|
}
|
|
23623
23646
|
function stylePropInterpolate(name, strings, expressions, unit, sourceSpan) {
|
|
23624
23647
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
@@ -23730,6 +23753,26 @@ const PROPERTY_INTERPOLATE_CONFIG = {
|
|
|
23730
23753
|
return (n - 1) / 2;
|
|
23731
23754
|
},
|
|
23732
23755
|
};
|
|
23756
|
+
const VALUE_INTERPOLATE_CONFIG = {
|
|
23757
|
+
constant: [
|
|
23758
|
+
Identifiers.interpolate,
|
|
23759
|
+
Identifiers.interpolate1,
|
|
23760
|
+
Identifiers.interpolate2,
|
|
23761
|
+
Identifiers.interpolate3,
|
|
23762
|
+
Identifiers.interpolate4,
|
|
23763
|
+
Identifiers.interpolate5,
|
|
23764
|
+
Identifiers.interpolate6,
|
|
23765
|
+
Identifiers.interpolate7,
|
|
23766
|
+
Identifiers.interpolate8,
|
|
23767
|
+
],
|
|
23768
|
+
variable: Identifiers.interpolateV,
|
|
23769
|
+
mapping: (n) => {
|
|
23770
|
+
if (n % 2 === 0) {
|
|
23771
|
+
throw new Error(`Expected odd number of arguments`);
|
|
23772
|
+
}
|
|
23773
|
+
return (n - 1) / 2;
|
|
23774
|
+
},
|
|
23775
|
+
};
|
|
23733
23776
|
/**
|
|
23734
23777
|
* `InterpolationConfig` for the `stylePropInterpolate` instruction.
|
|
23735
23778
|
*/
|
|
@@ -23753,29 +23796,6 @@ const STYLE_PROP_INTERPOLATE_CONFIG = {
|
|
|
23753
23796
|
return (n - 1) / 2;
|
|
23754
23797
|
},
|
|
23755
23798
|
};
|
|
23756
|
-
/**
|
|
23757
|
-
* `InterpolationConfig` for the `attributeInterpolate` instruction.
|
|
23758
|
-
*/
|
|
23759
|
-
const ATTRIBUTE_INTERPOLATE_CONFIG = {
|
|
23760
|
-
constant: [
|
|
23761
|
-
Identifiers.attribute,
|
|
23762
|
-
Identifiers.attributeInterpolate1,
|
|
23763
|
-
Identifiers.attributeInterpolate2,
|
|
23764
|
-
Identifiers.attributeInterpolate3,
|
|
23765
|
-
Identifiers.attributeInterpolate4,
|
|
23766
|
-
Identifiers.attributeInterpolate5,
|
|
23767
|
-
Identifiers.attributeInterpolate6,
|
|
23768
|
-
Identifiers.attributeInterpolate7,
|
|
23769
|
-
Identifiers.attributeInterpolate8,
|
|
23770
|
-
],
|
|
23771
|
-
variable: Identifiers.attributeInterpolateV,
|
|
23772
|
-
mapping: (n) => {
|
|
23773
|
-
if (n % 2 === 0) {
|
|
23774
|
-
throw new Error(`Expected odd number of arguments`);
|
|
23775
|
-
}
|
|
23776
|
-
return (n - 1) / 2;
|
|
23777
|
-
},
|
|
23778
|
-
};
|
|
23779
23799
|
/**
|
|
23780
23800
|
* `InterpolationConfig` for the `styleMapInterpolate` instruction.
|
|
23781
23801
|
*/
|
|
@@ -24174,7 +24194,7 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
24174
24194
|
break;
|
|
24175
24195
|
case OpKind.Attribute:
|
|
24176
24196
|
if (op.expression instanceof Interpolation) {
|
|
24177
|
-
OpList.replace(op, attributeInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan));
|
|
24197
|
+
OpList.replace(op, attributeInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.namespace, op.sourceSpan));
|
|
24178
24198
|
}
|
|
24179
24199
|
else {
|
|
24180
24200
|
OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace));
|
|
@@ -30084,12 +30104,12 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
30084
30104
|
definitionMap.set('dependencies', importExpr(Identifiers.getComponentDepsFactory).callFn(args));
|
|
30085
30105
|
}
|
|
30086
30106
|
if (meta.encapsulation === null) {
|
|
30087
|
-
meta.encapsulation = ViewEncapsulation.Emulated;
|
|
30107
|
+
meta.encapsulation = ViewEncapsulation$1.Emulated;
|
|
30088
30108
|
}
|
|
30089
30109
|
let hasStyles = !!meta.externalStyles?.length;
|
|
30090
30110
|
// e.g. `styles: [str1, str2]`
|
|
30091
30111
|
if (meta.styles && meta.styles.length) {
|
|
30092
|
-
const styleValues = meta.encapsulation == ViewEncapsulation.Emulated
|
|
30112
|
+
const styleValues = meta.encapsulation == ViewEncapsulation$1.Emulated
|
|
30093
30113
|
? compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR)
|
|
30094
30114
|
: meta.styles;
|
|
30095
30115
|
const styleNodes = styleValues.reduce((result, style) => {
|
|
@@ -30103,12 +30123,12 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
30103
30123
|
definitionMap.set('styles', literalArr(styleNodes));
|
|
30104
30124
|
}
|
|
30105
30125
|
}
|
|
30106
|
-
if (!hasStyles && meta.encapsulation === ViewEncapsulation.Emulated) {
|
|
30126
|
+
if (!hasStyles && meta.encapsulation === ViewEncapsulation$1.Emulated) {
|
|
30107
30127
|
// If there is no style, don't generate css selectors on elements
|
|
30108
|
-
meta.encapsulation = ViewEncapsulation.None;
|
|
30128
|
+
meta.encapsulation = ViewEncapsulation$1.None;
|
|
30109
30129
|
}
|
|
30110
30130
|
// Only set view encapsulation if it's not the default value
|
|
30111
|
-
if (meta.encapsulation !== ViewEncapsulation.Emulated) {
|
|
30131
|
+
if (meta.encapsulation !== ViewEncapsulation$1.Emulated) {
|
|
30112
30132
|
definitionMap.set('encapsulation', literal(meta.encapsulation));
|
|
30113
30133
|
}
|
|
30114
30134
|
// e.g. `animation: [trigger('123', [])]`
|
|
@@ -31477,7 +31497,7 @@ class ResourceLoader {
|
|
|
31477
31497
|
|
|
31478
31498
|
class CompilerFacadeImpl {
|
|
31479
31499
|
jitEvaluator;
|
|
31480
|
-
FactoryTarget = FactoryTarget
|
|
31500
|
+
FactoryTarget = FactoryTarget;
|
|
31481
31501
|
ResourceLoader = ResourceLoader;
|
|
31482
31502
|
elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
31483
31503
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
@@ -31853,7 +31873,7 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
|
|
|
31853
31873
|
animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null,
|
|
31854
31874
|
defer,
|
|
31855
31875
|
changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
|
|
31856
|
-
encapsulation: decl.encapsulation ?? ViewEncapsulation.Emulated,
|
|
31876
|
+
encapsulation: decl.encapsulation ?? ViewEncapsulation$1.Emulated,
|
|
31857
31877
|
interpolation,
|
|
31858
31878
|
declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
|
|
31859
31879
|
relativeContextFilePath: '',
|
|
@@ -32133,7 +32153,7 @@ class CompilerConfig {
|
|
|
32133
32153
|
defaultEncapsulation;
|
|
32134
32154
|
preserveWhitespaces;
|
|
32135
32155
|
strictInjectionParameters;
|
|
32136
|
-
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
|
|
32156
|
+
constructor({ defaultEncapsulation = ViewEncapsulation$1.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
|
|
32137
32157
|
this.defaultEncapsulation = defaultEncapsulation;
|
|
32138
32158
|
this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
|
|
32139
32159
|
this.strictInjectionParameters = strictInjectionParameters === true;
|
|
@@ -33805,15 +33825,6 @@ class MapPlaceholderNames extends CloneVisitor {
|
|
|
33805
33825
|
}
|
|
33806
33826
|
}
|
|
33807
33827
|
|
|
33808
|
-
var FactoryTarget;
|
|
33809
|
-
(function (FactoryTarget) {
|
|
33810
|
-
FactoryTarget[FactoryTarget["Directive"] = 0] = "Directive";
|
|
33811
|
-
FactoryTarget[FactoryTarget["Component"] = 1] = "Component";
|
|
33812
|
-
FactoryTarget[FactoryTarget["Injectable"] = 2] = "Injectable";
|
|
33813
|
-
FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe";
|
|
33814
|
-
FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule";
|
|
33815
|
-
})(FactoryTarget || (FactoryTarget = {}));
|
|
33816
|
-
|
|
33817
33828
|
function compileClassMetadata(metadata) {
|
|
33818
33829
|
const fnCall = internalCompileClassMetadata(metadata);
|
|
33819
33830
|
return arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]).callFn([]);
|
|
@@ -33909,7 +33920,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
33909
33920
|
function compileDeclareClassMetadata(metadata) {
|
|
33910
33921
|
const definitionMap = new DefinitionMap();
|
|
33911
33922
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
33912
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
33923
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
33913
33924
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33914
33925
|
definitionMap.set('type', metadata.type);
|
|
33915
33926
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -33927,7 +33938,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
33927
33938
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
33928
33939
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
33929
33940
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
33930
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
33941
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
33931
33942
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33932
33943
|
definitionMap.set('type', metadata.type);
|
|
33933
33944
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -34022,7 +34033,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
34022
34033
|
const definitionMap = new DefinitionMap();
|
|
34023
34034
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
34024
34035
|
definitionMap.set('minVersion', literal(minVersion));
|
|
34025
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34036
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34026
34037
|
// e.g. `type: MyDirective`
|
|
34027
34038
|
definitionMap.set('type', meta.type.value);
|
|
34028
34039
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34289,8 +34300,8 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
|
|
|
34289
34300
|
definitionMap.set('changeDetection', importExpr(Identifiers.ChangeDetectionStrategy)
|
|
34290
34301
|
.prop(ChangeDetectionStrategy[meta.changeDetection]));
|
|
34291
34302
|
}
|
|
34292
|
-
if (meta.encapsulation !== ViewEncapsulation.Emulated) {
|
|
34293
|
-
definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation[meta.encapsulation]));
|
|
34303
|
+
if (meta.encapsulation !== ViewEncapsulation$1.Emulated) {
|
|
34304
|
+
definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation$1[meta.encapsulation]));
|
|
34294
34305
|
}
|
|
34295
34306
|
if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {
|
|
34296
34307
|
definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));
|
|
@@ -34438,11 +34449,11 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34438
34449
|
function compileDeclareFactoryFunction(meta) {
|
|
34439
34450
|
const definitionMap = new DefinitionMap();
|
|
34440
34451
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34441
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34452
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34442
34453
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34443
34454
|
definitionMap.set('type', meta.type.value);
|
|
34444
34455
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
34445
|
-
definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget
|
|
34456
|
+
definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget[meta.target]));
|
|
34446
34457
|
return {
|
|
34447
34458
|
expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]),
|
|
34448
34459
|
statements: [],
|
|
@@ -34473,7 +34484,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
34473
34484
|
function createInjectableDefinitionMap(meta) {
|
|
34474
34485
|
const definitionMap = new DefinitionMap();
|
|
34475
34486
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
34476
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34487
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34477
34488
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34478
34489
|
definitionMap.set('type', meta.type.value);
|
|
34479
34490
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -34524,7 +34535,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
34524
34535
|
function createInjectorDefinitionMap(meta) {
|
|
34525
34536
|
const definitionMap = new DefinitionMap();
|
|
34526
34537
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
34527
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34538
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34528
34539
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34529
34540
|
definitionMap.set('type', meta.type.value);
|
|
34530
34541
|
definitionMap.set('providers', meta.providers);
|
|
@@ -34557,7 +34568,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
34557
34568
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
34558
34569
|
}
|
|
34559
34570
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
34560
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34571
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34561
34572
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34562
34573
|
definitionMap.set('type', meta.type.value);
|
|
34563
34574
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -34608,7 +34619,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
34608
34619
|
function createPipeDefinitionMap(meta) {
|
|
34609
34620
|
const definitionMap = new DefinitionMap();
|
|
34610
34621
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
34611
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34622
|
+
definitionMap.set('version', literal('20.0.0-rc.2'));
|
|
34612
34623
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34613
34624
|
// e.g. `type: MyPipe`
|
|
34614
34625
|
definitionMap.set('type', meta.type.value);
|
|
@@ -34681,23 +34692,21 @@ function compileHmrInitializer(meta) {
|
|
|
34681
34692
|
]);
|
|
34682
34693
|
// (m) => m.default && ɵɵreplaceMetadata(...)
|
|
34683
34694
|
const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
34684
|
-
//
|
|
34685
|
-
const
|
|
34686
|
-
.
|
|
34687
|
-
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34691
|
-
// new URL(urlValue, urlBase).href
|
|
34692
|
-
const urlHref = new InstantiateExpr(variable('URL'), [urlValue, urlBase]).prop('href');
|
|
34695
|
+
// getReplaceMetadataURL(id, timestamp, import.meta.url)
|
|
34696
|
+
const url = importExpr(Identifiers.getReplaceMetadataURL)
|
|
34697
|
+
.callFn([
|
|
34698
|
+
variable(idName),
|
|
34699
|
+
variable(timestampName),
|
|
34700
|
+
variable('import').prop('meta').prop('url'),
|
|
34701
|
+
]);
|
|
34693
34702
|
// function Cmp_HmrLoad(t) {
|
|
34694
|
-
// import(/* @vite-ignore */
|
|
34703
|
+
// import(/* @vite-ignore */ url).then((m) => m.default && replaceMetadata(...));
|
|
34695
34704
|
// }
|
|
34696
34705
|
const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [
|
|
34697
34706
|
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
34698
34707
|
// warning for each usage within the development code. If Vite provides a method to
|
|
34699
34708
|
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
34700
|
-
new DynamicImportExpr(
|
|
34709
|
+
new DynamicImportExpr(url, null, '@vite-ignore')
|
|
34701
34710
|
.prop('then')
|
|
34702
34711
|
.callFn([replaceCallback])
|
|
34703
34712
|
.toStmt(),
|
|
@@ -34766,7 +34775,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
34766
34775
|
* @description
|
|
34767
34776
|
* Entry point for all public APIs of the compiler package.
|
|
34768
34777
|
*/
|
|
34769
|
-
const VERSION = new Version('20.0.0-rc.
|
|
34778
|
+
const VERSION = new Version('20.0.0-rc.2');
|
|
34770
34779
|
|
|
34771
34780
|
//////////////////////////////////////
|
|
34772
34781
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -34792,5 +34801,5 @@ const VERSION = new Version('20.0.0-rc.1');
|
|
|
34792
34801
|
// the late binding of the Compiler to the @angular/core for jit compilation.
|
|
34793
34802
|
publishFacade(_global);
|
|
34794
34803
|
|
|
34795
|
-
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget
|
|
34804
|
+
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParenthesizedExpr, ParenthesizedExpression, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, SECURITY_SCHEMA, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, SelectorlessMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, StringToken, StringTokenKind, TagContentType, TaggedTemplateLiteral, TaggedTemplateLiteralExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, TemplateLiteralElementExpr, TemplateLiteralExpr, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Component$1 as TmplAstComponent, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Directive$1 as TmplAstDirective, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HostElement as TmplAstHostElement, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration$1 as TmplAstLetDeclaration, NeverDeferredTrigger as TmplAstNeverDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, TypeofExpression, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation$1 as ViewEncapsulation, VoidExpr, VoidExpression, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileHmrInitializer, compileHmrUpdateCallback, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, escapeRegExp, findMatchingDirectivesAndPipes, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
|
|
34796
34805
|
//# sourceMappingURL=compiler.mjs.map
|