uppy/packages/@uppy
Merlijn Vos fa23832f6a
@uppy/vue: support kebab-case props in generated components (#6125)
## Summary

- Fix Vue components to work with kebab-case props (`:edit-file` instead
of `:editFile`)
- Update `migrate.mjs` to parse prop names from TypeScript source files
and generate explicit `props` arrays

## Problem

The generated Vue components didn't work correctly with Vue's standard
kebab-case prop convention:

```vue
<!-- This didn't work -->
<FilesList :edit-file="handleEdit" />

<!-- Only this worked (non-standard) -->
<FilesList :editFile="handleEdit" />
```

## Root Cause

The original Vue template used `attrs` to pass props to Preact:

```ts
setup(props, { attrs }) {
  preactRender(preactH(PreactComponent, {
    ...(attrs as Props),  // attrs preserves kebab-case!
    ctx,
  }), container)
}
```

When using `:edit-file` in a Vue template, Vue passes
`attrs['edit-file']` (kebab-case preserved), but Preact expects
`editFile` (camelCase).

## Solution

Generate Vue components with explicit `props` declarations:

```ts
defineComponent({
  props: ['editFile', 'columns', 'imageThumbnail'],
  setup(props) {
    preactRender(preactH(PreactComponent, {
      ...props,  // Vue already converted kebab → camelCase
      ctx,
    }), container)
  }
})
```

When Vue components declare their props, Vue automatically converts
kebab-case template usage to camelCase in the `props` object. This is
standard Vue behavior.

## Why Simpler Alternatives Don't Work

### "Just use `props` instead of `attrs`"

Without a `props` declaration, Vue doesn't know which attributes are
props. The `props` object will be empty and everything goes to `attrs`:

```ts
// Without props declaration
defineComponent({
  setup(props, { attrs }) {
    // props = {}  (empty!)
    // attrs = { 'edit-file': fn }  (kebab-case preserved)
  }
})
```

### "Accept all props dynamically"

Vue doesn't have a "accept all props and convert casing" option. You
must explicitly declare which props you expect for Vue to handle the
conversion.

### "Just document to use camelCase"

This works but violates Vue conventions. Every Vue developer expects
`:edit-file` to work.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Prakash <qxprakash@gmail.com>
2026-01-19 09:59:42 +01:00
..
angular build(deps): bump @angular/compiler from 19.2.17 to 19.2.18 (#6128) 2026-01-12 11:13:45 +01:00
audio build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
aws-s3 Dedupe dependencies (#6085) 2025-12-05 10:22:11 +01:00
box build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
companion build(deps): bump validator from 13.15.20 to 13.15.22 (#6082) 2025-12-03 10:50:49 +01:00
companion-client [ci] release (#6011) 2025-10-17 20:24:52 +02:00
components @uppy/vue: support kebab-case props in generated components (#6125) 2026-01-19 09:59:42 +01:00
compressor build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
core build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
dashboard [ci] release (#6120) 2026-01-12 21:44:39 +01:00
drag-drop build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
drop-target [ci] release (#6060) 2025-12-02 10:09:28 +01:00
dropbox build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
facebook build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
form [ci] release (#6060) 2025-12-02 10:09:28 +01:00
golden-retriever [ci] release (#6096) 2025-12-09 10:01:30 +01:00
google-drive build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
google-drive-picker build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
google-photos-picker build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
image-editor build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
image-generator build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
instagram build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
locales Update the cs dropPaste translation keys to match en locale (#6135) 2026-01-16 10:53:26 +01:00
onedrive build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
provider-views build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
react build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
remote-sources [ci] release (#6060) 2025-12-02 10:09:28 +01:00
screen-capture build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
status-bar build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
store-default [ci] release (#5918) 2025-08-22 09:02:12 +02:00
svelte build(deps-dev): bump @sveltejs/kit from 2.20.7 to 2.49.5 (#6143) 2026-01-16 10:46:30 +01:00
thumbnail-generator [ci] release (#6060) 2025-12-02 10:09:28 +01:00
transloadit [ci] release (#6087) 2025-12-04 12:19:08 +01:00
tus Dedupe dependencies (#6085) 2025-12-05 10:22:11 +01:00
unsplash build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
url build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
utils build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
vue @uppy/vue: support kebab-case props in generated components (#6125) 2026-01-19 09:59:42 +01:00
webcam build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
webdav build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00
xhr-upload [ci] release (#6096) 2025-12-09 10:01:30 +01:00
zoom build(deps): bump preact from 10.26.9 to 10.26.10 (#6123) 2026-01-08 12:00:59 +01:00