BrianRosamilia / vue-crono

Simple timers/jobs for Vue components ⏰
25 stars 6 forks source link

[vue3] `beforeDestroy` has been renamed to `beforeUnmount` #15

Open stritti opened 3 years ago

stritti commented 3 years ago

Using vue-crono together with vue3 there is a warning:

[Vue warn]: 'beforeDestroy' has been renamed to 'beforeUnmount'

BrianRosamilia commented 3 years ago

So do I just need to update this? Seems really strange that they would make a change breaking to vue2 when vue3 hooks make this irrelevant dont they? @stritti

stritti commented 3 years ago

Yes but at least the naming is more clear now. The hook is not irrelevant. It is renamed: https://v3.vuejs.org/guide/migration/introduction.html#other-minor-changes

BrianRosamilia commented 3 years ago

Yeah I'm gonna need advice on how to fix this (or a PR) because with my build pipeline I cant even build against vue 3 since the vue-template-compiler stopped being supported after vue 2.

Vue packages version mismatch:

- vue@3.0.7 (/Users/brianrosamilia/vue-crono/node_modules/vue/index.js)
- vue-template-compiler@2.6.12 (/Users/brianrosamilia/vue-crono/node_modules/vue-template-compiler/package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

And it doesnt work if I install "@vue/compiler-sfc": "^3.0.7", because parcel has no idea what this is, so it tries installing the vue-template-compiler which has a max version of 2.6

Can I fix this issue just by having 2 methods on the mixin called beforeUnmount and beforeDestroy that do the exact same thing? Or does the current backwards compat try to call both of them? @stritti I would be willing to do that if so, but if not, the build pipeline is going to have to be redone, perhaps with parcel 2 beta

polinwei commented 2 years ago

The plugin is really useful. Do you have a plan to migrate to Vue3?

BrianRosamilia commented 2 years ago

@polinwei hey, thanks for the comment! Vue 3 requires you to rework how you think about libraries like mine.

Good news though--there is what appears to be a great continuation to my library in vue 3! https://github.com/riderx/vue-timer-hook

shoutouts to @riderx for doing what appears to be a great job on it

riderx commented 2 years ago

Thank's @BrianRosamilia for the mention !

Your module was a inspiration to build something in vue 3