Skip to content

Commit ccdf235

Browse files
committed
fixup! refactor(compiler): emit instructions for foreign components
1 parent d941c13 commit ccdf235

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

  • packages
    • compiler-cli/src/ngtsc/annotations/component/src
    • compiler/src/template/pipeline/src

packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,15 +2346,15 @@ export class ComponentDecoratorHandler implements DecoratorHandler<
23462346
const context = getSourceFile(node);
23472347

23482348
return analysis.foreignImports.map((foreignMeta) => {
2349-
const {ref, rawExpression} = foreignMeta;
2349+
const {name, ref, rawExpression} = foreignMeta;
23502350

23512351
const emittedRef = this.refEmitter.emit(ref, context);
23522352
assertSuccessfulReferenceEmit(emittedRef, node.name, 'foreign component');
23532353

23542354
ts.setEmitFlags(rawExpression, ts.EmitFlags.NoComments | ts.EmitFlags.NoNestedComments);
23552355

23562356
return {
2357-
name: foreignMeta.name,
2357+
name,
23582358
component: new o.WrappedNodeExpr(rawExpression),
23592359
} satisfies R3ForeignComponentMetadata;
23602360
});

packages/compiler/src/template/pipeline/src/ingest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ function ingestElement(unit: ViewCompilationUnit, element: t.Element): void {
309309
}
310310
const props = propEntries.length > 0 ? o.literalMap(propEntries) : null;
311311

312+
// Foreign components are created in the creation block. Updates are triggered reactively
313+
// through directly passed signal properties, alleviating the need for any explicit update
314+
// operations.
312315
unit.create.push(
313316
ir.createForeignComponentOp(id, foreignComp.component, props, element.startSourceSpan),
314317
);

0 commit comments

Comments
 (0)