vue-crono icon indicating copy to clipboard operation
vue-crono copied to clipboard

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

Open stritti opened this issue 4 years ago • 6 comments

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

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

stritti avatar Jan 27 '21 16:01 stritti

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

BrianRosamilia avatar Feb 15 '21 19:02 BrianRosamilia

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

stritti avatar Feb 16 '21 14:02 stritti

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:

- [email protected] (/Users/brianrosamilia/vue-crono/node_modules/vue/index.js)
- [email protected] (/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

BrianRosamilia avatar Mar 06 '21 17:03 BrianRosamilia

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

polinwei avatar Nov 23 '21 01:11 polinwei

@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

BrianRosamilia avatar Nov 25 '21 15:11 BrianRosamilia

Thank's @BrianRosamilia for the mention !

Your module was a inspiration to build something in vue 3

riderx avatar Nov 25 '21 18:11 riderx