LeSuisse/vue-dompurify-html

Is it possible to keep vue2 support in vue-dompurify-html v3?

maninak opened this issue · 3 comments

Hey,

I just saw that the upcoming v3 of this plugin brings vue3 support (yay!) but drops vue2 support (:cry:).

Would it be possible to keep support for vue2 if vue-demi was used?

More info about it here: https://antfu.me/posts/make-libraries-working-with-vue-2-and-3

Hi,

Please note that the support of vue-legacy branch is not dropped as mentioned in the release notes of the 3.0.0 version.

When I started to work on the support of Vue 3, vue-demi did not exist but it is not the only reason I preferred to maintain 2 distinct branch. They are some subtleties with the rendering between Vue 2 and Vue 3 see for example #1791 which does not affect Vue 3.

I might take another look at this but for now I do not think it is really much of an issue for users of this library. Besides compatibility the other change that might break your app if the fact that the DOMPurify instance is now isolated in each directive and I would argue (ab)using that it was not the case in the v2 is already not a good idea.

When upgrading from Vue 2 to Vue 3 you will also need to upgrade this library but it should be painless. Since this is not something uncommon in the Vue ecosystem I'm not feeling too bad about that.

Understood. I actually had missed the part that support for vue-legacy isn't getting dropped, thanks for that info.

Helping with a painless upgrade is still a best-prectice, IMO (that's why vue-demi was created by a vue core member).

Having said the above, my answer/suggestion is resolved, so feel free to close the issue as necessary.

Thank you for your time!

Done in v3.1.0