Skip to content

docs(vue): use TypeScript and destructured typed props in Vue examples - #693

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
ubugeeei:docs/vue-examples-ts-props-destructure
Nov 3, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
ubugeeei:docs/vue-examples-ts-props-destructure

Conversation

@ubugeeei

@ubugeeei ubugeeei commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Vue examples in the docs were inconsistent with the React (TSX) examples next to them, and several relied on implicit props.

  • Add lang="ts" to every Vue example that has a script block (islands.md ×2, markdown.md, layouts.md).
  • Replace implicit defineProps<Props>() and the runtime defineProps({ posts: Array }) with reactive props destructure plus a type declaration:
    • loaders.md: const { users } = defineProps<Props>(), const { projects, usage } = defineProps<Props>()
    • type-safety.md: const { users } = defineProps<Props>()
    • islands.md: const { posts } = defineProps<{ posts: { slug: string; title: string }[] }>()

@void/vue already requires vue@^3.5, where reactive props destructure is stable.

Verification

  • Compiled the stripped form const { … } = defineProps() with vue/compiler-sfc. Non-island pages have their defineProps type argument removed by void-vue:pages-transform. Template references compile to _ctx.*, and script references compile to __props.*.
  • Temporarily switched playground/vue-pages pages (users/index.vue, deferred.vue, blog/index.island.vue) to the same destructured form, then ran packages/vue/test/integration/vue-pages-client.test.ts. 38/38 passed in dev and preview, including SSR, hydration without Vue warnings, deferred props, HMR, and islands. The playground changes were reverted; this PR only touches docs.
  • vp fmt --check passes on the changed files.

🤖 Generated with Claude Code

React examples use TSX, but several Vue examples omitted `lang="ts"`.
Add it to every Vue example with a script block.

Replace implicit `defineProps<Props>()` calls and the runtime
`defineProps({ posts: Array })` declaration with reactive props
destructure and a type declaration, so each example shows where its
template bindings come from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T19:26:59.675693Z d9eaffd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@cpojer
cpojer merged commit fc62be7 into voidzero-dev:main Nov 3, 2026
2 checks passed
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.

2 participants