Skip to content

Angular v0.9 Renderer#878

Open
gspencergoog wants to merge 7 commits intogoogle:mainfrom
gspencergoog:angular_v0_9
Open

Angular v0.9 Renderer#878
gspencergoog wants to merge 7 commits intogoogle:mainfrom
gspencergoog:angular_v0_9

Conversation

@gspencergoog
Copy link
Collaborator

Description

This PR adds the v0.9 Angular renderer and packages it into secondary entry points with appropriate package.json configurations. Additionally, it integrates the a2ui_explorer sample app into the samples/ 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 standard exports lookup.
  • samples/client/angular/projects/a2ui_explorer/: Imported and decoupled demo-app from Lit, updating for A2uiRendererService bindings and dynamic rendering setup.
  • Config Adjustments: Disabling preserveSymlinks and configuring moduleResolution: "bundler" inside samples workspace configurations to fix subpath resolution for linked packages.

Impact & Risks

  • No Impact to v0.8 Core: v0.9 is completely isolated behind standalone @a2ui/angular/v0_9 node subpaths.
  • Fixed Resolves: Rephrased standard builder linking so application static analysis does not fail.

Testing

  1. Run npx ng build a2ui_explorer successfully in samples/client/angular/ workspace.

Includes:
- v0.9 renderer components in v0_9 folder
- a2ui_explorer app moved to samples/
- Fixed tsconfig (moduleResolution: bundler, module: esnext) and angular.json (preserveSymlinks: false) resolving for linked secondary entries
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and well-executed architectural change by adding a new v0.9 Angular renderer and refactoring the existing one into a v0.8 structure. The new v0.9 renderer's signal-based architecture with a ComponentHost is a great improvement. The inclusion of a comprehensive sample application is also very helpful for demonstrating the new capabilities. Most of the changes improve performance and type safety. I've identified one critical bug in the v0.8 catalog bindings, a high-severity issue in another binding, and a minor code quality issue in a test file that should be addressed.

inputBinding('text', () => properties.text ?? null),
inputBinding('label', () => properties.label),
inputBinding('textFieldType', () => properties.textFieldType),
inputBinding('inputType', () => properties.textFieldType),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There's a mismatch between the input binding name in the catalog and the actual input property name in the TextField component. The catalog is attempting to bind to an input named inputType, but the component's input is named textFieldType. This will cause a runtime error as the inputType input does not exist on the component.

Suggested change
inputBinding('inputType', () => properties.textFieldType),
inputBinding('textFieldType', () => properties.textFieldType),

return [
inputBinding('text', () => properties.text),
inputBinding('usageHint', () => properties.usageHint || null),
inputBinding('usageHint', () => properties.usageHint),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The binding for usageHint has been changed from () => properties.usageHint || null to () => properties.usageHint. The Text component's usageHint input is required and does not accept undefined. If properties.usageHint is not present on the node, this binding will pass undefined, leading to a runtime error. The previous implementation was safer by coercing undefined to null.

Suggested change
inputBinding('usageHint', () => properties.usageHint),
inputBinding('usageHint', () => properties.usageHint ?? null),

additionalStyles: {},
},
},
{ provide: MessageProcessor, useValue: mockMessageProcessor },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The MessageProcessor is provided twice in this test configuration (here and on line 141). This is redundant and should be removed to keep the test setup clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant