Repository navigation
fix(web_core,angular): guard partial test mocks and 3-arg ComponentModel catalog fallback - #3829
Open
gspencergoog wants to merge 4 commits into
Open
gspencergoog wants to merge 4 commits into
gspencergoog wants to merge 4 commits into
Conversation
…del catalog fallback PR a2ui-project#3658 restored the 3-argument `new ComponentModel(id, type, properties)` constructor where `model.catalog` is `undefined`. PR a2ui-project#3706 and PR a2ui-project#3757 moved `ComponentHostComponent` onto `NodeResolver` and reactive `metadataSignal` and `onMetadataChanged` bindings. Callers using the 3-argument constructor or partial `SurfaceModel` and `ComponentModel` stand-ins hit `TypeError` dereferences on missing catalog, metadata, or emitter properties. Fall back to `surface.defaultCatalog ?? surface.catalog` only when `model.catalog` is `undefined` to preserve v1.0 per-component catalog isolation. Guard optional subscriptions and metadata signals across `NodeResolver`, `DataContext`, `GenericBinder`, and `ComponentHostComponent`.
gspencergoog
force-pushed
the
fix/angular-component-host-optional-guards
branch
from
November 2, 2026 16:52
8d1afdb to
dba1e93
Compare
…nt-host-optional-guards # Conflicts: # typescript/core/web_core/CHANGELOG.md # typescript/core/web_core/src/resolution/data-context.ts # typescript/core/web_core/src/resolution/generic-binder.ts # typescript/core/web_core/src/resolution/ref-fields.ts # typescript/renderers/angular/CHANGELOG.md # typescript/renderers/angular/src/core/component-host.component.ts
`SurfaceModel` already types its `catalog` getter, and `Catalog` already types `id`. Read `surface.catalog` directly in `NodeResolver` and drop the `as AngularCatalog | undefined` cast in `ComponentHostComponent.reportUnresolved`.
…nt-host-optional-guards
This branch has not been deployed
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.
Summary
Restore catalog fallback in
NodeResolver,DataContext,GenericBinder, andComponentHostComponentfor the 3-argumentComponentModelconstructor. Guard optional properties on partial unit test stand-ins.Reviewer Focus
NodeResolver.catalogForintypescript/core/web_core/src/resolution/node-resolver.tssomodel.catalogstill takes precedence when bound and falls back tosurface.defaultCatalog ?? surface.catalogonly whenmodel.catalogisundefined.ComponentHostComponentintypescript/renderers/angular/src/core/component-host.component.tssoonUpdatedandonMetadataChangedsubscriptions behave the same on fullComponentModelinstances while tolerating partial unit test stand-ins.Changes
surface.defaultCatalog ?? surface.cataloginresolveSurfaceCatalog,DataContext, andNodeResolver.catalogForwhenmodel.catalogorsurface.defaultCatalogis omitted.extractRefFields(undefined)inref-fields.tsandgetFieldBehavior(undefined)pluscomponentModel.onUpdated?.subscribe(...)ingeneric-binder.ts.surface.componentsModel?.get(...),surface.dispatchError?.(...),compCatalog?.components?.get(...), andmodel.metadataSignalinNodeResolver.onUpdated?.subscribe(...)andonMetadataChanged?.subscribe(...), and includesurface.cataloginreportUnresolvedinComponentHostComponent.node-resolver.test.tsandcomponent-host.component.spec.tscovering the 3-argumentComponentModelconstructor (#3658) and partial stand-ins.Impact & Risks
No breaking changes or wire-protocol changes. Multi-catalog v1.0 surfaces still resolve each
ComponentModelstrictly against its boundmodel.catalogwithout falling back across catalogs.Testing
@a2ui/web_core.@a2ui/angular.