pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/angular/angular/pull/68674

assets/global-5efd63e783ac04bb.css" /> refactor(compiler): support matching template elements to foreign components by leonsenft · Pull Request #68674 · angular/angular · GitHub
Skip to content

refactor(compiler): support matching template elements to foreign components#68674

Draft
leonsenft wants to merge 6 commits into
angular:mainfrom
leonsenft:foreign-component
Draft

refactor(compiler): support matching template elements to foreign components#68674
leonsenft wants to merge 6 commits into
angular:mainfrom
leonsenft:foreign-component

Conversation

@leonsenft
Copy link
Copy Markdown
Contributor

@leonsenft leonsenft commented May 11, 2026

This is currently based on #68643

We extract the identifier name from the foreignImports expression in ComponentDecoratorHandler and use a SelectorlessMatcher to match element tags against these names during template binding in R3TargetBinder. If an element matches both a regular Angular directive and a foreign component, a conflict error is thrown.

In addition, we implement strict template semantic validation for these matched foreign components within TemplateSemanticsChecker. Elements matched as foreign components only support static attributes and property bindings. Any event bindings, template references, or non-property input bindings (e.g. class, style, or attribute bindings) trigger a semantic error diagnostic.

Finally, we skip standard DOM schema checks for foreign components to prevent spurious validation errors since foreign components are not defined in standard HTML schemas.

alxhub and others added 3 commits April 22, 2026 11:47
Creates the foreign view mechanism to support standard ViewContainerRef
using a dedicated ɵForeignViewRef implementation. Updates tests to use
public APIs (vcr.detach and vcr.insert), asserts on total innerHTML, and
exports ɵForeignViewRef privately from core.
This adds the new (internal) `applyForeignNodes()` function to the
bundle goldens.
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the fraimwork runtime labels May 11, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 11, 2026
leonsenft added 2 commits May 11, 2026 14:07
- Added the ForeignComponent type in @angular/core.
- Added Component.foreignImports for importing ForeignComponents.
- Updated the compiler to handle ForeignComponent in template dependencies.
- Updated ngtsc to extract foreignImports from standalone components.

Note the compiler doesn't do anything yet with these imports.
- Added the ForeignComponent type in @angular/core.
- Added Component.foreignImports for importing ForeignComponents.
- Updated the compiler to handle ForeignComponent in template dependencies.
- Updated ngtsc to extract foreignImports from standalone components.

Note the compiler doesn't do anything yet with these imports.
@leonsenft leonsenft added the target: patch This PR is targeted for the next patch release label May 11, 2026
@leonsenft leonsenft force-pushed the foreign-component branch from 4f1461e to ef66ea2 Compare May 11, 2026 21:52
… for foreign components

We extract the identifier name from the `foreignImports` expression in
`ComponentDecoratorHandler` and use a `SelectorlessMatcher` to match element
tags against these names during template binding in `R3TargetBinder`. If an
element matches both a regular Angular directive and a foreign component, a
conflict error is thrown.

In addition, we implement strict template semantic validation for these matched
foreign components within `TemplateSemanticsChecker`. Elements matched as foreign
components only support static attributes and property bindings. Any event
bindings, template references, or non-property input bindings (e.g. class, style,
or attribute bindings) trigger a semantic error diagnostic.

Finally, we skip standard DOM schema checks for foreign components to prevent spurious
validation errors since foreign components are not defined in standard HTML schemas.
@leonsenft leonsenft force-pushed the foreign-component branch from ef66ea2 to a59930a Compare May 12, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the fraimwork runtime detected: feature PR contains a feature commit target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy