ZestfulNation / vue-hotel-datepicker

A VueJS v2 responsive date range picker. Displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more.
https://zestfulnation.github.io/vue-hotel-datepicker/
MIT License
840 stars 220 forks source link

change index.js (createApp), ondestroy, emits #267

Closed bzd2000 closed 3 years ago

bzd2000 commented 3 years ago

Hi,

Here is a first attempt to migrate to vue 3 (#213)

Basically: Changed index.js to use createApp add emits for emitted events. changed destoryed to unmounted upgraded packages to vue 3

There is an issue with not able to load close.svg when I used it in a fresh vue 3 project. But it is also an issue with the vue2 version. (seems not to be packed, probably the way it has been defined img src="@/assets/images/close.svg" alt="x")

Some tests are failing due to import statements not working. But that is also to the case for the vue2 version.

besides that, it seems to work for a vue3 project without having tested all the options

matiasperrone commented 3 years ago

@bzd2000 This will keep the Vue v2 working?

matiasperrone commented 3 years ago

close svg it was added in the commit 27d5aded5ba7a70759725c00e2e035f718925211 on Feb 10

matiasperrone commented 3 years ago

You should use "pnpm" instead of "npm" (both have the same interface, same options and commands) at least for development purposes

matiasperrone commented 3 years ago

I am going to start a fresh v3 project and then add the components and the assets. I think it is the best way to go.

bzd2000 commented 3 years ago

Combination vue2 and vue3 is not easy ( a lot of projects tried but always created a separate vue3 branch)

bzd2000 commented 3 years ago

Indeed fresh vue3 will be best.

bzd2000 commented 3 years ago

anyway I don't think there is a lot of code change needed

matiasperrone commented 3 years ago

I mean that there is code that maintenance is becoming harder and harder, so I want to clean it up a little.

matiasperrone commented 3 years ago

I have been reading and we may have to create a new version for vue3. So I am going to import the repository in a new one. I let you know once I have spoken with the team.

matiasperrone commented 3 years ago

Do you want to became a part of the team?

matiasperrone commented 3 years ago

We may be can have the two components in the same package, I mean the vue3 version and the vue2... although is not very "performant" right?

bzd2000 commented 3 years ago

@matiasperrone ,

I would do the following:

  1. Get out a vue 3 compatible package a soon as possible. Main reason, because it gives a good impression for your project. Seen your code base, I don't think it will take a lot of effort. You don't seem to use exotic vue features.

    Here you have 2 options: A. separate code base (so you need to update twice for changes) Easy and fast on the short term. B. shared code base for 2 packages I have seen other projects trying this. But at the end they created separate code bases because too much time had to be put on maken both vue2 and vue3 work. Maybe in your case, it could be easier because you don't use vue plugin system (which complicates vue2/vue3 compatibility). But still .... I would not do this.

  2. Start indeed a new repo for a rewrite in vue3 (with composition api) as a v5 project. I would also try to check with your user base how long you need to support vue2 and make some clear decision on when vue2 will be deprecated.

I'm available to help on your project