Skip to content

add Vue support in @xsai-use/vue#7

Merged
exoticknight merged 18 commits intomainfrom
feat/vue
Jun 14, 2025
Merged

add Vue support in @xsai-use/vue#7
exoticknight merged 18 commits intomainfrom
feat/vue

Conversation

@exoticknight
Copy link
Member

#6

@exoticknight exoticknight requested review from Copilot and kwaa June 8, 2025 09:21
@exoticknight exoticknight self-assigned this Jun 8, 2025
@exoticknight exoticknight mentioned this pull request Jun 8, 2025
3 tasks

This comment was marked as outdated.

Copy link
Member

@nekomeowww nekomeowww left a comment

Choose a reason for hiding this comment

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

Mostly styling issues. Generally LGTM.

@exoticknight exoticknight requested a review from Copilot June 11, 2025 10:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds first-class Vue support to @xsai-use/vue, including a dedicated TypeScript configuration, core utilities, a useChat Vue composable, and a complete example app to demonstrate usage.

  • Introduces tsconfig.vue.json tailored for Vue projects.
  • Implements deepToRaw utility and useChat composable in the Vue package.
  • Provides an example Vue application (examples/vue) with Vite setup and UI components.

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.vue.json Vue-specific TypeScript config extending @vue/tsconfig
packages/vue/src/utils/deep-to-raw.ts Add deepToRaw utility to unwrap Vue reactivity
packages/vue/src/use-chat.ts Implement useChat composable for streaming chat in Vue
packages/vue/src/index.ts Export useChat and re-export shared types
packages/vue/package.json Bump Vue peer/dev dependency to ^3.5.13
package.json Add Vue plugin and TS config to root dev dependencies
eslint.config.ts Enable Vue linting
examples/vue/vite.config.ts Vite config with Vue and Tailwind plugins
examples/vue/src/* Complete Vue demo app, components, and styling
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (5)

packages/vue/src/use-chat.ts:38

  • [nitpick] The suffix 'R' in initialUIMessagesR is ambiguous. Consider renaming to initialUIMessagesRef or computedInitialMessages for clarity.
const initialUIMessagesR = computed(() => initialUIMessages)

packages/vue/src/use-chat.ts:13

  • Consider adding a JSDoc comment for useChat, describing its options, returned reactive state and methods to improve developer experience.
export function useChat(options: UseChatOptions) {

packages/vue/src/utils/deep-to-raw.ts:11

  • Add unit tests for deepToRaw covering arrays, nested objects, refs/reactive proxies, and primitive values to ensure correctness across cases.
export function deepToRaw<T>(input: T): T {

packages/vue/src/index.ts:2

  • The syntax 'export type * from ...' is not supported by TypeScript. Use 'export * from "@xsai-use/shared"' to re-export all exports, or explicitly list types with 'export type { X, Y } from ...'.
export type * from '@xsai-use/shared'

packages/vue/src/use-chat.ts:73

  • structuredClone may not be available in all environments. Verify compatibility targets or include a polyfill/deep-clone fallback for broader support.
const clonedMessage = structuredClone(message)

@exoticknight exoticknight requested review from kwaa and nekomeowww June 13, 2025 12:45
Copy link
Member

@nekomeowww nekomeowww left a comment

Choose a reason for hiding this comment

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

Thanks! Wonderful work.

@nekomeowww
Copy link
Member

Rebase is required.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@exoticknight exoticknight merged commit b3d5af7 into main Jun 14, 2025
1 check passed
@exoticknight exoticknight deleted the feat/vue branch June 14, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants