Skip to content

feat: migrate to Vue 3 and Vue Test Utils v2#1875

Open
GerardoIbarra wants to merge 2 commits into
sagalbot:masterfrom
GerardoIbarra:master
Open

feat: migrate to Vue 3 and Vue Test Utils v2#1875
GerardoIbarra wants to merge 2 commits into
sagalbot:masterfrom
GerardoIbarra:master

Conversation

@GerardoIbarra

Copy link
Copy Markdown

This PR migrates the Vue-select library from Vue 2 to Vue 3, including updates to the core component, build configuration, and the entire test suite. The component is now fully compatible with the Vue 3 reactivity system and modern tooling.

Key Changes

Core Component ( Select.vue )

🟢 Renamed value prop to modelValue for Vue 3 v-model compatibility.
🟢 Updated event emissions:
- input→ update:modelValue.
🟢 Replaced $scopedSlots with $slots (unified slots API).
🟢 Added explicit emits declaration for all internal events.
🟢 Updated dynamic ref handling for v-for loops (deselect buttons).

Test Infrastructure

🟢 Migrated from vue-jest to @vue/vue3-jest and updated babel-jest.
🟢 Updated
tests/helpers.js
to use createApp and h instead of the global Vue instance.
🟢 Refactored all 22 test suites (174 tests) to use Vue 3 compatible syntax and selectors.
🟢 Migrated slot tests to the new function-based render API.

Build & Tooling

🟢 Replaced .babelrc with babel.config.js for better Jest compatibility.
🟢 Updated Webpack aliases to use the Vue 3 ESM bundler.
🟢 Updated package.json dependencies:
- vue(^3.5),
- @vue/test-utils (^2.4),
- and added @vue/compiler-sfc.

Verification Results

✅ Unit Tests: 100% test suites passing (172 passed, 2 skipped due to JSDOM environment limitations).
✅ Dev Server: Verified working via npm run serve.
✅ Build: Production build completes successfully.

Breaking Changes

  • This release is not backwards compatible with Vue 2.
  • Users must update their v-model usage from value to modelValue (or just use standard v-model).
image image

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.

1 participant