diff --git a/package.json b/package.json index 01c7a59d6..59941331c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "18.2.12", + "@angular/compiler": "19.0.0", "@babel/code-frame": "7.26.2", "@babel/parser": "7.26.2", "@babel/types": "7.26.0", diff --git a/scripts/build/config.js b/scripts/build/config.js index f362d46a2..5bbf4199d 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -368,25 +368,125 @@ const pluginFiles = [ { input: "src/plugins/angular.js", replaceModule: [ - // We only use a small set of `@angular/compiler` from `esm2022/src/expression_parser/` - // Those files can't be imported, they also not directly runnable, because `.mjs` extension is missing { - module: getPackageFile("@angular/compiler/fesm2022/compiler.mjs"), - text: /* indent */ ` - export * from '../esm2022/src/expression_parser/ast.mjs'; - export {Lexer} from '../esm2022/src/expression_parser/lexer.mjs'; - export {Parser} from '../esm2022/src/expression_parser/parser.mjs'; - `, + module: resolveEsmModulePath("@angular/compiler"), + process(text) { + text = text.replace( + "const phases = [", + "const phases = undefined && [", + ); + text = text.replace("publishFacade(_global)", ""); + text = text.replace( + "const serializerVisitor = new GetMsgSerializerVisitor()", + "", + ); + text = text.replace( + "const compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder", + "", + ); + text = text.replace( + "const domSchema = new DomElementSchemaRegistry()", + "", + ); + text = text.replace( + "const elementRegistry = new DomElementSchemaRegistry()", + "", + ); + text = text.replace( + "const serializerVisitor$1 = new _SerializerVisitor()", + "", + ); + text = text.replace( + "const NON_BINDABLE_VISITOR = new NonBindableVisitor()", + "", + ); + text = text.replace( + "const NULL_EXPR = new LiteralExpr(null, null, null)", + "", + ); + text = text.replace( + "const TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null)", + "", + ); + text = text.replace("const _visitor = new _Visitor$2()", ""); + text = text.replaceAll( + /const (.*?) = new BuiltinType\(BuiltinTypeName\..*?\);/gu, + "const $1 = undefined;", + ); + text = text.replaceAll(/var output_ast =.*?;\n/gsu, "var output_ast"); + + text = text.replace( + "const serializer = new IcuSerializerVisitor();", + "", + ); + text = text.replace( + "const _TAG_DEFINITION = new XmlTagDefinition();", + "", + ); + + text = text.replaceAll( + /function transformExpressionsInExpression\(.*?\n.*?\n\}\n/gsu, + "function transformExpressionsInExpression(){}", + ); + + text = text.replaceAll( + /const deferTriggerToR3TriggerInstructionsMap = new Map\(\[\n.*?\n\]\);\n/gsu, + "const deferTriggerToR3TriggerInstructionsMap = undefined;", + ); + + text = text.replaceAll( + /const BINARY_OPERATORS = new Map\(\[\n.*?\n\]\);\n/gsu, + "const BINARY_OPERATORS = undefined;", + ); + + text = text.replaceAll( + /const PIPE_BINDINGS = \[\n.*?\n\];\n/gsu, + "const PIPE_BINDINGS = undefined;", + ); + + text = text.replaceAll( + /const TEXT_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const TEXT_INTERPOLATE_CONFIG = undefined;", + ); + + text = text.replaceAll( + /const CHAINABLE = new Set\(\[\n.*?\n\]\);\n/gsu, + "const CHAINABLE = undefined;", + ); + + text = text.replaceAll( + /const PROPERTY_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const PROPERTY_INTERPOLATE_CONFIG = undefined;", + ); + text = text.replaceAll( + /const STYLE_PROP_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const STYLE_PROP_INTERPOLATE_CONFIG = undefined;", + ); + + text = text.replaceAll( + /const ATTRIBUTE_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const ATTRIBUTE_INTERPOLATE_CONFIG = undefined;", + ); + text = text.replaceAll( + /const STYLE_MAP_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const STYLE_MAP_INTERPOLATE_CONFIG = undefined;", + ); + text = text.replaceAll( + /const CLASS_MAP_INTERPOLATE_CONFIG = \{\n.*?\n\};\n/gsu, + "const CLASS_MAP_INTERPOLATE_CONFIG = undefined;", + ); + text = text.replaceAll( + /const PURE_FUNCTION_CONFIG = \{\n.*?\n\};\n/gsu, + "const PURE_FUNCTION_CONFIG = undefined;", + ); + text = text.replaceAll( + /const NAMED_ENTITIES = \{\n.*?\n\};\n/gsu, + "const NAMED_ENTITIES = {};", + ); + + return text; + }, }, - ...[ - "expression_parser/lexer.mjs", - "expression_parser/parser.mjs", - "ml_parser/defaults.mjs", - ].map((file) => ({ - module: getPackageFile(`@angular/compiler/esm2022/src/${file}`), - process: (text) => - text.replaceAll(/(?<=import .*? from )'(.{1,2}\/.*)'/gu, "'$1.mjs'"), - })), ], }, { diff --git a/yarn.lock b/yarn.lock index 0d386516f..2ce40ca8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,17 +15,17 @@ __metadata: languageName: node linkType: hard -"@angular/compiler@npm:18.2.12": - version: 18.2.12 - resolution: "@angular/compiler@npm:18.2.12" +"@angular/compiler@npm:19.0.0": + version: 19.0.0 + resolution: "@angular/compiler@npm:19.0.0" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/core": 18.2.12 + "@angular/core": 19.0.0 peerDependenciesMeta: "@angular/core": optional: true - checksum: 10/a08fa0fc46c003d83af6e088450f35026281dde7bd65c6775242b52c2695c3deaec2c6bd675933261151932c27072de9b51edcbdde18dca02ed3313bc4873004 + checksum: 10/23752e35ac04c34c0d3e35ab8e2a915e0e7d553968a43efbdb3811a960337d38d89db9ff71d0df7f192a110203f8e89d4e8f30da9b68250a11bce8eea5cc9d19 languageName: node linkType: hard @@ -7246,7 +7246,7 @@ __metadata: version: 0.0.0-use.local resolution: "prettier@workspace:." dependencies: - "@angular/compiler": "npm:18.2.12" + "@angular/compiler": "npm:19.0.0" "@babel/code-frame": "npm:7.26.2" "@babel/generator": "npm:7.26.2" "@babel/parser": "npm:7.26.2"