Skip to content

v5.0.0 - Vue 3 support!

Choose a tag to compare

@matiasperrone matiasperrone released this 11 Jul 06:09
· 18 commits to main since this release
981fc01

v5.0.0 - Vue 3 migration

Summary

Vue 2 → Vue 3 migration, plus a full build/test/lint tooling swap (Vue CLI → Vite + Vitest).

Breaking changes

  • v-model prop/event renamed (Vue 3 convention) in HotelDatePicker.vue:
    • prop valuemodelValue
    • emitted event inputupdate:modelValue
    • If you use v-model="show" in your template, no change needed. If you bind the prop/listener manually (:value / @input), update to :model-value / @update:model-value.
  • Vue peer dependency bumped: vue: ^2.6.14vue: ^3.4.0. Consumers on Vue 2 cannot upgrade to this version.
  • Package is now ESM ("type": "module" added) with a new exports map: main points to dist/vueHotelDatepicker.cjs, module to dist/vueHotelDatepicker.es.js, and exports.require / exports.import mirror those two paths.
    • Bug found: vite.config.js still emits the CJS build as dist/vueHotelDatepicker.common.js, not dist/vueHotelDatepicker.cjs. As it stands, require('vue-hotel-datepicker') and exports.require will 404 — this needs a fix before publishing (rename the build output, or point package.json back at .common.js).
  • Named css export removed from src/index.js (previously export { css } alongside the default export). README usage already documents importing CSS via import 'vue-hotel-datepicker/dist/vueHotelDatepicker.css', so this only affects anyone who was using the named export directly.
  • Plugin install changed: HotelDatePicker.install() now calls app.component(HotelDatePicker.name ?? 'HotelDatePicker', HotelDatePicker), so app.use(HotelDatePicker) (Vue 3 plugin pattern) works as expected.

What's Changed

Prop changes

  • Day.vuepriceSymbol is no longer required; defaults to ''.
  • Price.vuesymbol type tightened from [String, null, undefined] to String (still defaults to '').

Tooling / DX changes (internal, not library API)

  • Build: Vue CLI (vue-cli-service build --target lib) → Vite (vite build, lib mode → cjs/es/umd)
  • Dev server: vue-cli-service servevite (new index.html entry point)
  • Tests: Jest + @vue/test-utils v1 (propsData, attachToDocument) → Vitest + @vue/test-utils v2 (props, attachTo)
  • Lint: ESLint + Airbnb config + Babel parser → eslint-plugin-vue (vue3-essential) + eslint-plugin-prettier recommended, no Babel
  • Sass: sass + sass-loader, legacy JS API (deprecation warning) → sass only, Vite css.preprocessorOptions.scss.api: 'modern' (deprecation warning gone)
  • main.js: new Vue({ render: h => h(App) }).$mount('#app')createApp(App).mount('#app')
  • Repo config: babel.config.js, vue.config.js removed (no longer needed)
  • Community files added: .github/ISSUE_TEMPLATE/*, .github/stale.yml
  • Added CLAUDE.md (architecture notes for AI-assisted development)

Other

New Contributors

Full Changelog: v4.6.0...v5.0.0