Skip to content

feat: vue3 renderer and some vue3 samples#591

Closed
shawnwang15 wants to merge 2 commits intogoogle:mainfrom
shawnwang15:feature/vue3
Closed

feat: vue3 renderer and some vue3 samples#591
shawnwang15 wants to merge 2 commits intogoogle:mainfrom
shawnwang15:feature/vue3

Conversation

@shawnwang15
Copy link

Description

This PR adds complete Vue 3 support to A2UI by implementing a new Vue 3 renderer and sample applications with vue3 composition api, and aligning with the existing Angular and Lit implementations. Remaining Angular samples will be added in subsequent updates.

What's Changed

  • Vue 3 Renderer
  • Sample Applications: Restaurant Finder、Gallery

I am deeply interested in the intersection of AI and front-end engineering, and I look forward to contributing to the long-term maintenance of this project

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 comprehensive Vue 3 renderer for A2UI, complete with core components, a message processor, and sample applications. The implementation is well-structured, leveraging modern Vue 3 features like the Composition API and <script setup>. The separation between rendering logic, data handling, and component definitions is clean. My review focuses on improving robustness, ensuring consistency with the specifications, and enhancing maintainability. I've identified a few areas for improvement, including incomplete feature implementation in an input component and opportunities to make the code more resilient and consistent. Overall, this is a very strong contribution that significantly expands the project's capabilities.

:id="inputId"
:value="inputValue"
placeholder="Please enter a value"
:type="inputType === 'number' ? 'number' : 'text'"
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 type attribute for the <input> element is not fully implemented according to the ResolvedTextField type definition. The current implementation only distinguishes between number and text, while the type also supports email, password, tel, and url. This limits the functionality of the TextField component.

        :type="inputType || 'text'"

Copy link
Author

Choose a reason for hiding this comment

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

This implementation aligns with the Angular counterpart.

userAction: {
name: action.name,
sourceComponentId: component.id,
surfaceId: surfaceId!,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using a non-null assertion (!) on surfaceId can introduce a risk of runtime errors if this composable is ever used in a context where surfaceId could be null. To make the function more robust, it would be safer to add a guard clause that checks for the existence of surfaceId before proceeding to dispatch the action.

Suggested change
surfaceId: surfaceId!,
surfaceId: surfaceId,

Copy link
Author

Choose a reason for hiding this comment

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

This follows the same implementation logic as in Angular.

Comment on lines +26 to +34
interface HintedStyles {
h1: Record<string, string>;
h2: Record<string, string>;
h3: Record<string, string>;
h4: Record<string, string>;
h5: Record<string, string>;
body: Record<string, string>;
caption: Record<string, string>;
}
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 HintedStyles interface is missing the h6 property, but the areHintedStyles type guard on line 118 checks for it. This discrepancy can lead to incorrect type assertions. To ensure type safety and consistency, the h6 property should be added to the interface.

interface HintedStyles {
  h1: Record<string, string>;
  h2: Record<string, string>;
  h3: Record<string, string>;
  h4: Record<string, string>;
  h5: Record<string, string>;
  h6: Record<string, string>;
  body: Record<string, string>;
  caption: Record<string, string>;
}

Copy link
Author

Choose a reason for hiding this comment

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

This follows the same implementation logic as in Angular.

tag: 'Layout',
surface: createSingleComponentSurface('Column', {
children: [
createComponent('Heading', { text: { literalString: 'Heading Text' } }),
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 component type Heading is not defined in the DEFAULT_CATALOG, which will cause a console warning and prevent the component from rendering. To display a heading, you should use the Text component with the appropriate usageHint, such as 'h1'.

        createComponent('Text', { text: { literalString: 'Heading Text' }, usageHint: 'h1' }),

Copy link
Author

Choose a reason for hiding this comment

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

This follows the same implementation logic as in Angular.

thanks

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@AndrewXiGua
Copy link

Description

This PR adds complete Vue 3 support to A2UI by implementing a new Vue 3 renderer and sample applications with vue3 composition api, and aligning with the existing Angular and Lit implementations. Remaining Angular samples will be added in subsequent updates.

What's Changed

  • Vue 3 Renderer
  • Sample Applications: Restaurant Finder、Gallery

I am deeply interested in the intersection of AI and front-end engineering, and I look forward to contributing to the long-term maintenance of this project

When will the Vue 3 renderer support v0.9?

@zeroasterisk
Copy link
Collaborator

Hi @shawnwang15, thanks for putting together a Vue 3 renderer — that's significant work! 🙏

We've been rethinking our approach to community renderers. Maintaining renderers for every framework inside this monorepo isn't scalable, so we're moving toward an ecosystem model where community renderers live in their own repos and we link to them from our docs.

Here's what we'd suggest:

  1. Publish your Vue renderer as its own repo (e.g. shawnwang15/a2ui-vue)
  2. Open a PR to add it to our Ecosystem Renderers page — that's where users discover community renderers
  3. We're also working on conformance tests (tracked in Program to accept and bless community-maintained renderers #681) that will help renderer authors verify spec compatibility across frameworks

This way you have full ownership and release velocity, and we make sure users can find your work. The ecosystem page already lists several community renderers (a2ui.org/ecosystem/renderers).

We'd love to see a Vue renderer in the ecosystem — please do publish it and we'll link to it!

@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants