feat(angular): support universal web components in v0.9 renderer - #2273
feat(angular): support universal web components in v0.9 renderer#2273josemontespg wants to merge 1 commit into
Conversation
3bf9f98 to
4fb7d3f
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces support for universal Web Components in the Angular v0.9 renderer, migrating default Basic Catalog implementations to universal Web Components, adding a toWebComponent adapter, and updating SurfaceComponent and AngularCatalog to dynamically render custom element tags. The review feedback highlights critical improvements, including moving side effects out of a computed signal in SurfaceComponent into an effect block, fixing a reconnection bug in toWebComponent where the component model update subscription is lost, and passing the Angular Injector to bridged Web Components to ensure robust dependency resolution.
4fb7d3f to
744a652
Compare
744a652 to
7db9b6c
Compare
850c3f0 to
bab2ced
Compare
bab2ced to
b33e52c
Compare
| - Add `UniversalBasicCatalog`, `NativeBasicCatalog`, and `BasicCatalogBase` supporting both universal Web Components from `@a2ui/web_core` and native Angular `@Component` implementations. | ||
| - Add `toWebComponent` adapter to convert custom Angular `@Component` implementations into W3C Custom Elements with dynamic DI injector forwarding and reconnection handling. | ||
| - Update `ComponentHostComponent` to dynamically mount either universal Web Components or native Angular components based on catalog definitions. | ||
| - Update `SurfaceComponent` with pure computed surface ID derivation and reactive surface registration via constructor `effect()`. |
There was a problem hiding this comment.
This is an internal implementation detail this line can be removed because it's not part of the public API change
| - Add `toWebComponent` adapter to convert custom Angular `@Component` implementations into W3C Custom Elements with dynamic DI injector forwarding and reconnection handling. | ||
| - Update `ComponentHostComponent` to dynamically mount either universal Web Components or native Angular components based on catalog definitions. | ||
| - Update `SurfaceComponent` with pure computed surface ID derivation and reactive surface registration via constructor `effect()`. | ||
| - Add standalone helper `provideA2Ui` configuration function and `A2UI_USE_UNIVERSAL_COMPONENTS` injection token for Angular applications. [#2273](https://github.com/a2ui-project/a2ui/pull/2273) |
There was a problem hiding this comment.
the provideA2UI function already existed in this PR we're just moving it from one file to another so this is actually not an API change. the important part to mention here is that we are exposing a new configuration option to let app hosts choose if they want to enable the useUniversalComponents option
b33e52c to
280d7a2
Compare
280d7a2 to
e581bb5
Compare
e581bb5 to
0dfcb2d
Compare
15e49be to
b922d66
Compare
b922d66 to
0622541
Compare
0622541 to
6c95cc4
Compare
6c95cc4 to
4590094
Compare
107a6ce to
6ed751e
Compare
6ed751e to
f86ad09
Compare
Summary
This PR introduces full support for universal W3C Web Components in the Angular v0.9 renderer alongside native Angular component support:
ComponentHostComponentto dynamically resolve and render both universal W3C Web Components (from@a2ui/web_core) and native Angular@Componentclasses. Passes the activeInjectorand setsComponentContextreactively.toWebComponent): ImplementedtoWebComponentto wrap Angular components as Custom Elements with full lifecycle management (createComponent,attachView,detachView), dynamic injector lookup, and safe reconnection subscription handling.provideA2Ui): AddedUniversalBasicCatalog,NativeBasicCatalog, andBasicCatalogBasesupporting theA2UI_USE_UNIVERSAL_COMPONENTSinjection token, configured conveniently viaprovideA2Ui(...).SurfaceComponentto accept bothsurfaceIdand directsurfacemodels, managing surface group registration cleanly inside a constructoreffect()and keepingeffectiveSurfaceIdas a purecomputedsignal.Verification
yarn --cwd renderers/angular test:unitpassed (33 unit tests & 267 explorer specs passing)../scripts/fix_format.shandyarn --cwd renderers/angular lintpassed cleanly.Resolves #1270