refactor(compiler): Remove the interpolation config (#64071)

After #63474, we don't need that anymore.

PR Close #64071
This commit is contained in:
Matthieu Riegler
2025-09-25 11:21:08 +02:00
committed by kirjs
parent fc643c9044
commit 04462ed67f
34 changed files with 74 additions and 339 deletions
@@ -20,7 +20,6 @@ import {
CssSelector,
DeclarationListEmitMode,
DeclareComponentTemplateInfo,
DEFAULT_INTERPOLATION_CONFIG,
DeferBlockDepsEmitMode,
DomElementSchemaRegistry,
ExternalExpr,
@@ -955,7 +954,6 @@ export class ComponentDecoratorHandler
template,
encapsulation,
changeDetection,
interpolation: template.interpolationConfig ?? DEFAULT_INTERPOLATION_CONFIG,
styles,
externalStyles,
// These will be replaced during the compilation step, after all `NgModule`s have been
@@ -1349,7 +1347,6 @@ export class ComponentDecoratorHandler
ctx.updateFromTemplate(
analysis.template.content,
analysis.template.declaration.resolvedTemplateUrl,
analysis.template.interpolationConfig ?? DEFAULT_INTERPOLATION_CONFIG,
);
}
@@ -2473,7 +2470,7 @@ export class ComponentDecoratorHandler
/** Creates a new binding parser. */
private getNewBindingParser() {
return makeBindingParser(undefined, this.enableSelectorless);
return makeBindingParser(this.enableSelectorless);
}
}
@@ -7,8 +7,6 @@
*/
import {
DEFAULT_INTERPOLATION_CONFIG,
InterpolationConfig,
LexerRange,
ParsedTemplate,
ParseSourceFile,
@@ -91,7 +89,6 @@ export interface ParsedTemplateWithSource extends ParsedComponentTemplate {
*/
interface CommonTemplateDeclaration {
preserveWhitespaces: boolean;
interpolationConfig: InterpolationConfig;
templateUrl: string;
resolvedTemplateUrl: string;
}
@@ -284,7 +281,6 @@ export function createEmptyTemplate(
declaration: templateUrl
? {
isInline: false,
interpolationConfig: InterpolationConfig.fromArray(null),
preserveWhitespaces: false,
templateUrlExpression: templateUrl,
templateUrl: 'missing.ng.html',
@@ -292,7 +288,6 @@ export function createEmptyTemplate(
}
: {
isInline: true,
interpolationConfig: InterpolationConfig.fromArray(null),
preserveWhitespaces: false,
expression: template!,
templateUrl: containingFile,
@@ -312,7 +307,6 @@ function parseExtractedTemplate(
// We always normalize line endings if the template has been escaped (i.e. is inline).
const i18nNormalizeLineEndingsInICUs = escapedString || options.i18nNormalizeLineEndingsInICUs;
const commonParseOptions: ParseTemplateOptions = {
interpolationConfig: template.interpolationConfig,
range: sourceParseRange ?? undefined,
enableI18nLegacyMessageIdFormat: options.enableI18nLegacyMessageIdFormat,
i18nNormalizeLineEndingsInICUs,
@@ -379,7 +373,6 @@ export function parseTemplateDeclaration(
preserveWhitespaces = value;
}
let interpolationConfig = DEFAULT_INTERPOLATION_CONFIG;
if (component.has('interpolation')) {
const expr = component.get('interpolation')!;
const value = evaluator.evaluate(expr);
@@ -394,7 +387,6 @@ export function parseTemplateDeclaration(
'interpolation must be an array with 2 elements of string type',
);
}
interpolationConfig = InterpolationConfig.fromArray(value as [string, string]);
}
if (component.has('templateUrl')) {
@@ -411,7 +403,6 @@ export function parseTemplateDeclaration(
const resourceUrl = resourceLoader.resolve(templateUrl, containingFile);
return {
isInline: false,
interpolationConfig,
preserveWhitespaces,
templateUrl,
templateUrlExpression: templateUrlExpr,
@@ -433,7 +424,6 @@ export function parseTemplateDeclaration(
} else if (component.has('template')) {
return {
isInline: true,
interpolationConfig,
preserveWhitespaces,
expression: component.get('template')!,
templateUrl: containingFile,
@@ -6,8 +6,6 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {InterpolationConfig} from '@angular/compiler';
/**
* Captures template information intended for extraction of i18n messages from a template.
*
@@ -23,5 +21,5 @@ export interface Xi18nContext {
* the return type is declared as `void` for simplicity, since any parse errors would be reported
* as diagnostics anyway.
*/
updateFromTemplate(html: string, url: string, interpolationConfig: InterpolationConfig): void;
updateFromTemplate(html: string, url: string): void;
}