Conversation
ef5ea2a to
dc38d42
Compare
jacobsimionato
left a comment
There was a problem hiding this comment.
Hey this is great! I think it'd be beneficial to merge this ASAP and happy to defer addressing everything here until after merge if you want.
| -c "Google LLC" \ | ||
| . | ||
| .; then | ||
| echo "License check failed. To fix this, install addlicense and run it:" |
There was a problem hiding this comment.
Thanks! This is great.
| const bindingsObject: Record<string, any> = {}; | ||
| if (componentBindings) { | ||
| for (const binding of componentBindings) { | ||
| // binding is from inputBinding, which typically is { provide: ..., useFactory: ... } or similar in older angular |
There was a problem hiding this comment.
Lol! Thanks for removing. I assume this was never implemented here, and the bindings are handled some other way?
| @@ -14,11 +14,10 @@ | |||
| * limitations under the License. | |||
There was a problem hiding this comment.
Ha totally unused variable! I'd have a slight preference to exclude all v0.8 changes from this PR, but I can't see how deleting this could break anyone seeing as it's private.
There was a problem hiding this comment.
That was my thought process as well. Just worried I'd forget to do it, and it's just cruft.
| private context?: ComponentContext; | ||
|
|
||
| ngOnInit(): void { | ||
| const surface = this.rendererService.surfaceGroup?.getSurface(this.surfaceId()); |
There was a problem hiding this comment.
Is it still possible to explicitly pass in the rendererService when you create this, e.g. so there can be multiple rendererServices in the same application, potentially in different features, with different catalogs?
There was a problem hiding this comment.
Yes, it is still possible to have multiple A2uiRendererService instances in the same application, but the "v0.9 way" to do this is via Angular's Dependency Injection rather than explicitly passing it as a property. We could add an input for it later if that seems more ergonomic, I think.
Gemini example:
How it works with multiple features
If you have different features that need different catalogs or configurations, you can provide a unique A2uiRendererService at the "feature-root" component level.
@Component({
selector: 'feature-a',
providers: [
A2uiRendererService,
{
provide: A2UI_RENDERER_CONFIG,
useValue: { catalogs: [CatalogA], ... }
}
],
template: `
<a2ui-v09-component-host surfaceId="surface-a" componentId="root" />
`
})
export class FeatureAComponent {}| /** | ||
| * Extends the generic ComponentApi to include Angular-specific component types. | ||
| */ | ||
| export interface AngularComponentApi extends ComponentApi { |
There was a problem hiding this comment.
Can we call this AngularComponentImplementation instead? I know that the implementation isn't inline directly here, and it's a reference to a class, but conceptually, this does represent the implementation of a component. If I have an instance of this class for e.g. ButtonAngularComponentImplementation, this defines a specific implementation of Button which will always look a certain way.
| /** | ||
| * Base class for Angular-specific component catalogs. | ||
| */ | ||
| export class AngularCatalog extends Catalog<AngularComponentApi> {} |
There was a problem hiding this comment.
Can we just do this:
export type AngularCatalog = Catalog<AngularComponentApi>;
There was a problem hiding this comment.
If we change it to a type, then it will be erased when it's compiled, and then we can't use it as a token in a provider, and we'd have to have a separate injection token. The class makes it both stick around (so we can use it directly in a provider), and gives us a single point where would add helper methods that are available to all catalogs.
Description
This PR adds the v0.9 Angular renderer and packages it into secondary entry points with appropriate
package.jsonconfigurations. Additionally, it integrates thea2ui_explorersample app into thesamples/workspace and verifies application bundle generation fully compiles.Changes
renderers/angular/v0_9/: Added the complete v0.9 Angular code (components and core).renderers/angular/ng-package.json&package.json: Created subpath mappings (@a2ui/angular/v0_9) for standardexportslookup.samples/client/angular/projects/a2ui_explorer/: Imported and decoupleddemo-appfrom Lit, updating forA2uiRendererServicebindings and dynamic rendering setup.preserveSymlinksand configuringmoduleResolution: "bundler"insidesamplesworkspace configurations to fix subpath resolution for linked packages.Impact & Risks
@a2ui/angular/v0_9node subpaths.Testing
npx ng build a2ui_explorersuccessfully insamples/client/angular/workspace.