Conversation
c6f49ae to
09d769b
Compare
There was a problem hiding this comment.
Is it customary to put these apps within the SDK folder for web? I noticed they definitely don't tend to be included in NPMs, but it does seem nice to bundle things together in the source at least. I guess that adds some complexity to package.json etc?
There was a problem hiding this comment.
Maybe? I don't really know. I put it here because it made it easier to run (didn't have to change directories), but I could just as easily move it somewhere else. I wasn't thinking about the publishing implications, so maybe it would be better to move it. It's not really a "client" or a "server", though (it runs standalone with no server).
There was a problem hiding this comment.
If we segregate the codebases, can we avoid all these small changes to v0.8 stuff?
There was a problem hiding this comment.
I could move these to another PR, but they are generally actual fixes for the 0.8 renderer that I encountered while implementing 0.9, or just restructuring the code layout so it is similar to 0.9 layout.
There was a problem hiding this comment.
Part of the issue is that this PR is where we're adding a new version, so some of the v0.8 changes are necessary just to accommodate the move.
- Major Architecture Upgrade: Transitioned from static components per element (v0.8) to a fully dynamic component hosting paradigm (v0.9) with dynamic allocation and decoupled bindings (`ComponentHostComponent`). - V0.8 Isolation: Extracted and locked existing legacy configurations into `/src/lib/v0_8/` workspaces backing backwards compatibility layout managers securely. - Unified Inspector Client Dashboard: Set up a custom workspace host system dashboard (`/demo-app`) serving standalone layout widgets pipelines containing hot-reactive aggregates views. - schemas and execution aligning updates: Fixed `BASIC_FUNCTIONS` aligning schemas and validation designs layout. - License compliance instructions: Fixed `.github/workflows/check_license.yml` to help describe local license remediation diagnostics correctly rather than just failing triggers.
87460e3 to
c870088
Compare
Expanded the try-catch block in `resolveSignal`'s effect to cover argument resolution and ensure errors are dispatched to the surface. Reset signal value to undefined instead of throwing to prevent crashing the effect. Added a regression test to verify this behavior.
…ds\n\n- Tightened the `surfaceId` input type in `DynamicComponent` to be strictly\n non-nullable, reflecting its practical usage via the `Renderer`.\n- Removed redundant `if (surfaceId)` guards in form components:\n `CheckBox`, `DateTimeInput`, `MultipleChoice`, `Slider`, and `TextField`.\n- Removed unnecessary `as any` casts in `Image` and `Text` styling logic,\n as modern TypeScript correctly handles narrowed literal indexing.
…safety\n\n- Removed `as any` cast in `Button.handleClick` as `Action` types are compatible.\n- Improved indexing safety in `Image` and `Text` components by using the `in` operator\n as a type guard combined with a `keyof` assertion. This resolves\n 'implicitly has an any type' errors in strict compiler environments like\n the Angular sample app.
…oved path normalization logic for repeating children from `RowComponent` and\n `ColumnComponent` into a shared `getNormalizedPath` utility in `core/utils.ts`.\n- Added unit tests for `getNormalizedPath` in `core/utils.spec.ts`.\n- Updated `RowComponent` and `ColumnComponent` to use the shared utility.
…mplified `surfaceId()` access in `Checkbox`, `MultipleChoice`, and `Slider`.\n- Standardized quotes in `markdown.ts`.
…dererService\n\n- Access `model` directly from `_messageProcessor` instead of keeping a separate\n private reference.
…tion handling in A2uiRendererService Updated A2uiRendererService to support multiple catalogs and independent renderer contexts by introducing a configuration-based initialization. Refined action handling to use SurfaceGroupAction for explicit surface identification and simplified internal logic. Updated ComponentHostComponent to resolve component types from the surface-level catalog, ensuring correct multi-catalog operation. Fixed build errors in the demo app's AgentStubService by adopting the new initialization signature and providing necessary catalog dependencies. Applied project-standard formatting across affected files.
…rerService The method was inappropriate in a multi-catalog context and not used by the framework components. Callers should instead rely on the invoker provided by the catalog on the specific SurfaceModel. Updated unit tests for A2uiRendererService and ComponentHostComponent to reflect this change.
Updated getting started guide to reflect the multi-catalog initialization pattern using `RendererConfiguration`. Corrected the catalog definition example to use the proper base constructor and removed outdated provider instructions.
…r renderer - Implemented comprehensive unit tests for all v0_8 components including Audio, Video, Icon, Divider, MultipleChoice, Tabs, Surface, DateTimeInput, and Modal. - Improved coverage for DynamicComponent, MessageProcessor, MarkdownRenderer, and Text components. - Added c8 for reliable coverage reporting in web_core. - Created architectural overview documentation for web_core and polished angular README. - Audited and removed redundant `as any` type casts to improve type safety. - Verified all 145 tests pass and overall statement coverage is >96%.
- Replace 'any' with specific interfaces ('Example', 'Action', 'A2uiMessage') in demo app and agent stub.
- Update library unit tests to use Angular signals for 'BoundProperty' mocks.
- Ensure 'BoundProperty' mocks include 'value', 'raw', and 'onUpdate' to satisfy type definitions.
- Fix various mock mismatches in spec files discovered during testing.
- Format code with Prettier.
…ject Ensures consistency with dataModelSub by storing the subscription object itself and calling .unsubscribe() directly in selectExample and ngOnDestroy.
…type safety - Merged capitalization and format string binding specs into 'function_binding.spec.ts'. - Introduced 'BaseMinimalCatalog' to improve catalog extensibility and simplified 'DemoCatalog'. - Added 'UpdatePropertyContext' and 'SubmitFormContext' interfaces for stronger typing in 'AgentStubService'. - Implemented 'FormatStringImplementation' in 'web_core' to fix signal interpolation in template strings. - Added 'Custom Price Slider' example to showcase reactive price formatting. - Updated '@a2ui/web_core' dependencies across renderers. Ref: Conversation 6a10b4d3, 4c97e1bd
…ol components Moved versioned endpoints v0_8/ and v0_9/ alongside the primary src/ folder and populated secondary ng-package.json descriptors for discrete package exports @a2ui/angular/v0_x. Emptied the root src/public-api.ts to enforce version choice. Updated all sample app client files inside samples/client/angular/projects/ to import from @a2ui/angular/v0_8 and synchronized paths inside tsconfig.json mappings to support discrete angular compiler workspaces resolving on direct sources directly. BREAKING-CHANGE: Imports from root package @a2ui/angular are no longer supported. Use @a2ui/angular/v0_8 or @a2ui/angular/v0_9 instead.
…ion and implicit any
Proposal: Improving Angular Component APIs via web_core IntegrationBased on an analysis of the current Angular codebase and the React renderer prototype, I propose the following architectural improvements to streamline component development and share more logic across platforms. 1. Adopt
|
By this, I assume you mean the code in this PR? |
| * Bound properties. | ||
| */ | ||
| @Input() props: Record<string, BoundProperty> = {}; | ||
| @Input() surfaceId!: string; |
There was a problem hiding this comment.
Can this just accept a ComponentContext instead? That is intended to include all the information that is used below.
|
|
||
| /** | ||
| * Service responsible for managing A2UI v0.9 rendering sessions. | ||
| * Bridges the A2UI MessageProcessor to Angular-friendly models. |
There was a problem hiding this comment.
Shall we put a note here explaining that this is minimal wrapper around MessageProcessor to handle DI and async initialization? Especially for maintainers, so they understand not to really put logic here, and to just expose everything that MessageProcessor has?
| * Processes a list of messages. | ||
| */ | ||
| processMessages(messages: A2uiMessage[]): void { | ||
| this._messageProcessor?.processMessages(messages); |
There was a problem hiding this comment.
If message processor is null, should this report an error? Or even queue the messages or something?
There was a problem hiding this comment.
Hmm. Yeah, probably.
There was a problem hiding this comment.
This layout with catalogs/minimal and catalogs/basic etc is awesome
There was a problem hiding this comment.
Yeah, when I implement the basic catalog, I was going to just remove the minimal one.
Did you want me to implement this in this PR, or could it be a follow-on? |
There was a problem hiding this comment.
Should this still be in src/ ?
Should the v0.8 and v0.9 folders also be in src?
I'm happy to submit this and iterate later, though I think it'd be good to iterate before implementing the basic catalog perhaps. My biggest concern about submitting this PR is the impact on existing customers, e.g. because
I'm in favour of getting all this submitted, but I'm a bit worried about submitting it all together and then not being able to roll back different parts of it easily if problems occur. Could you potentially split it or wind back some changes? E.g. what if we keep v0.8 sources in their existing location and then just add the new sources at src/v0_9/* ? That way, we can do a 1 step migration in samples and google3 to have people point at v0.9, rather than experience all the pain twice. Or else at least break up the changes into some steps? Sorry to add roadblocks here! If you feel that this is too much messing around and would much prefer to just submit and then deal with the consequences, I'm open to that given this is an early stage project! Either way, I think getting @sugoi-yuzuru or someone who understands the situation with Angular in google3 to take a look at the v0.8 changes could help reduce the risk. |
Description
This adds the v0.9 angular renderer and a small demo of the renderer.
Summary of Changes
This pull request implements the v0.9 Angular renderer for A2UI, featuring a dynamic component hosting mechanism and a more flexible catalog system. It includes a new demo application, migrates the v0.8 renderer, and updates the
web_corelibrary to support the new version's requirements. The changes enhance the A2UI Angular renderer by introducing version 0.9, which features a dynamic component hosting mechanism and a more flexible catalog system.Highlights
web_corelibrary for v0.9, including changes to logical functions, date formatting, and expression schemas.@preact/signals-corefor reactive programming anddate-fnsfor enhanced date formatting.web_core'sDataContextto gracefully manage exceptions during reactive function evaluations.Changelog
and,or) to require avaluesarray argument, removing deprecated individual arguments.formatDateto requireformatparameter to align with new configuration, utilizingdate-fns.date-fnsdependency for expression string formatting workflows.nullparameters intoundefinedfor tighter validation constraints.