test - #70189
Draft
JeanMeche wants to merge 2 commits into
Draft
Conversation
JeanMeche
force-pushed
the
there-shall-be-hostless
branch
3 times, most recently
from
August 13, 2026 16:49
19ac482 to
f83df70
Compare
Contributor
|
Test comment |
Contributor
Test reply |
Member
Author
JeanMeche
force-pushed
the
there-shall-be-hostless
branch
21 times, most recently
from
August 14, 2026 13:08
1bd0d2a to
f8eab2c
Compare
JeanMeche
force-pushed
the
there-shall-be-hostless
branch
7 times, most recently
from
August 14, 2026 14:48
6a3afe8 to
ed6b2c6
Compare
Adds support for hostless components in Angular via the `hostless: true` option in the `@Component` decorator. Hostless components do not create a host DOM element; instead, their templates render directly at the component invocation site using an anchor `Comment` node.
### Runtime & View Engine Architecture
- Emits `ComponentDef.hostless = true` in Ivy definitions.
- Replaces physical host DOM element creation with a comment node anchor (`傻傻elementStart` / `locateOrCreateCommentNodeImpl`).
- Updates native DOM collection, insertion, and removal utilities (`collectNativeNodes`, `nativeInsertBefore`, `nativeRemoveNode`, `removeNestedView`) to seamlessly manage virtual comment-anchored views and their projected content.
- Returns the anchor node for `ComponentRef.location.nativeElement` and the virtual root element in `TestBed`.
### Compiler & Type-Checking
- Adds `hostless: boolean` to `R3ComponentMetadata`, compiler facades, and partial linkers.
- Emits the `IsHostless` type argument in `傻傻ComponentDeclaration` in `.d.ts` declaration files for downstream type checking.
- Diagnostics in `ComponentDecoratorHandler`:
- Disallows `@HostBinding`, `@HostListener`, and `host: {}` bindings on hostless components (`HOSTLESS_COMPONENT_WITH_HOST_BINDINGS`).
- Disallows `ViewEncapsulation.ShadowDom` (`HOSTLESS_COMPONENT_SHADOW_DOM`).
- Disallows `:host` and `:host-context` selector usage in component styles (`HOSTLESS_COMPONENT_HOST_STYLE`).
- Disallows `@Component({ animations: [...] })` (`HOSTLESS_COMPONENT_ANIMATIONS`).
- Diagnostics in `TemplateSemanticsChecker`:
- Enforces DOM binding restrictions on hostless component invocation elements using `CssSelector.parse`.
- Disallows arbitrary DOM attribute, class, style, and event bindings on hostless elements while permitting matched directive selectors/inputs and `ngSkipHydration`.
### Server-Side Rendering & Hydration
- Adds full SSR hydration support for hostless components by locating and claiming server-rendered comment anchors and child DOM nodes.
- Implements `ngSkipHydration` support on hostless components, clearing server-rendered DOM nodes within the virtual component boundary during hydration.
- Enhances hydration path resolution (`calcPathForNode` and `locateRNodeByPath`) to correctly navigate up to parent element containers when anchoring hostless components.
JeanMeche
force-pushed
the
there-shall-be-hostless
branch
from
August 14, 2026 16:23
75e1816 to
26110e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Wild wild wip