From 539d1613ed222eddddcc91f05b33e58e2a7c6c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 17 Apr 2026 16:49:51 +0200 Subject: [PATCH 1/2] refactor(@angular/build): use `t.buildUndefinedNode` instead of `Scope#buildUndefinedNode` Babel 8 is _likely_ going to remove the variant on `Scope#`, since this method has not needed scope-specific information in ages. --- .../build/src/tools/babel/plugins/elide-angular-metadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts b/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts index 22d757ed369a..fee4a8d6892d 100644 --- a/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts +++ b/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts @@ -48,7 +48,7 @@ const angularMetadataFunctions: Record boolean> = * * @returns A babel plugin object instance. */ -export default function (): PluginObj { +export default function ({ types: t }): PluginObj { return { visitor: { CallExpression(path) { @@ -79,7 +79,7 @@ export default function (): PluginObj { if (parent && (parent.isFunctionExpression() || parent.isArrowFunctionExpression())) { // Replace the metadata function with `void 0` which is the equivalent return value // of the metadata function. - path.replaceWith(path.scope.buildUndefinedNode()); + path.replaceWith(t.buildUndefinedNode()); } } }, From 33745621b4117b6f3413604dfc9291235358defc Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:49:15 +0000 Subject: [PATCH 2/2] fixup! refactor(@angular/build): use `t.buildUndefinedNode` instead of `Scope#buildUndefinedNode` --- .../build/src/tools/babel/plugins/elide-angular-metadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts b/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts index fee4a8d6892d..b9b56cbb2cbf 100644 --- a/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts +++ b/packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import type { NodePath, PluginObj } from '@babel/core'; +import type { types as BabelTypes, NodePath, PluginObj } from '@babel/core'; /** * The name of the Angular class metadata function created by the Angular compiler. @@ -48,7 +48,7 @@ const angularMetadataFunctions: Record boolean> = * * @returns A babel plugin object instance. */ -export default function ({ types: t }): PluginObj { +export default function ({ types: t }: { types: typeof BabelTypes }): PluginObj { return { visitor: { CallExpression(path) {