Skip to content

feat(#4033): add Vue wrappers#4047

Open
bdfranck wants to merge 9 commits into
devfrom
benji/vue-wrappers
Open

feat(#4033): add Vue wrappers#4047
bdfranck wants to merge 9 commits into
devfrom
benji/vue-wrappers

Conversation

@bdfranck

@bdfranck bdfranck commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

This PR adds Vue wrappers to our DS components. It also adds a Vue PR preview section with an example page of the wrappers in action.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://GovAlta.github.io/ui-components/pr-preview-vue/pr-4047/

Built to branch gh-pages at 2026-06-17 19:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Preview links

Target URL
Docs https://govalta.github.io/ui-components/pr-preview/pr-4047/
React playground https://govalta.github.io/ui-components/pr-preview-react/pr-4047/
Angular playground https://govalta.github.io/ui-components/pr-preview-angular/pr-4047/
Vue playground https://govalta.github.io/ui-components/pr-preview-vue/pr-4047/

Built from commit afc5fbd. Previews are removed automatically when this PR closes.

@bdfranck bdfranck force-pushed the benji/vue-wrappers branch 5 times, most recently from cdbc5e7 to d77b23d Compare June 16, 2026 21:12
@bdfranck bdfranck marked this pull request as ready for review June 16, 2026 21:13
@bdfranck

Copy link
Copy Markdown
Collaborator Author

@vanessatran-ddi @willcodeforcoffee We don't need to do an in-depth review yet. Just a quick "sanity check" to see if these Vue wrappers are largely in the right direction.

@bdfranck bdfranck linked an issue Jun 16, 2026 that may be closed by this pull request
@willcodeforcoffee

Copy link
Copy Markdown
Collaborator
image

Something is missing... 😉

@bdfranck bdfranck force-pushed the benji/vue-wrappers branch from d77b23d to d832812 Compare June 17, 2026 15:00

@willcodeforcoffee willcodeforcoffee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is some great progress @bdfranck ! I'm really impressed!
Like you said, this is early, but I like what you're doing so far! Looking forward to seeing the rest.

I wonder what @vanessatran-ddi thinks about the barrel files? I thought they added file clutter, but that is IMHO.

@@ -0,0 +1 @@
export { default as GoabAccordion } from "./accordion.vue";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think I like having per-component barrel files like this. I prefer one big file of exports at a higher level like we did with React and Angular.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh yeah! We have single files for both React and Angular. I've changed it here as well.

@@ -0,0 +1,24 @@
<script setup lang="ts">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Weirdly Card isn't working at all. I tried to find a solution quickly but came up dry.

Image

It could be something to do with slot?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right, there are a bunch of "soft deprecated" components that we don't need to create Vue wrappers now. I've removed them because it will simplify testing and discourage future teams from using them.

const customName = options?.renamedProps?.[key];
const attrName = customName ?? transformFn(key);

if (key.startsWith("data-")) {

@vanessatran-ddi vanessatran-ddi Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We do not need this data- logic, I checked on vue framework and they will auto set inheritAttrs true, https://vuejs.org/api/options-misc.html#inheritattrs

}

export function useWcProps(
props: Record<string, unknown>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of flattenning props to string and unknown, we can do like this:

Image

Reason is: if I make a mistake for example on tab.vue like this:

Image

(disabled not disable), at least compiler will fail and tell me something is wrong:

Image

export const kebab: TransformFn = (input) =>
input.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();

export function transformProps<WC = Record<string, unknown>>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove this function as nowhere in vue-components called it

</script>

<template>
<goa-dropdown v-bind="wcProps" :value="valueAttr" @_change="onChange">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

value is binding 2 times, one is wcProps and here.Should we exclude value from useWcProps

Comment thread libs/vue-components/src/lib/dropdown/dropdown.vue

<template>
<goa-popover v-bind="wcProps">
<div v-if="slots.target" slot="target">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in react and angular wrapper target slot is mandatory, vue we do not have a way to require for a slot, but I think we should add a warning message, perhaps add onMounted hook here and add warning if target slot is missing

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.

Vue: Create wrappers

3 participants