Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Vue 3 #44

Merged
merged 4 commits into from
Aug 12, 2021
Merged

Upgrade to Vue 3 #44

merged 4 commits into from
Aug 12, 2021

Conversation

eliottvincent
Copy link
Contributor

Hey! I upgraded your library to Vue 3.

We use it at Crisp for two of our apps that we are upgrading to Vue 3 (app.crisp.chat and marketplace.crisp.chat). The behavior is similar to the previous version.

The tests don't run anymore, I need to have a look at them.

@@ -27,6 +27,7 @@
"author": "egoist<0x142857@gmail.com>",
"license": "MIT",
"devDependencies": {
"@vue/compiler-sfc": "^3.1.5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vue/compiler-sfc replaces vue-template-compiler

@@ -53,12 +53,15 @@ function installRouterPrefetch(
default: 2000
}
},
setup(props, context) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RouterLink exposes a setup() method, so we need to call it in order to have full inheritance.
Otherwise our custom RouterLink component won't render anything.

mounted() {
if (this.prefetch && observer && canPrefetch) {
requestIdleCallback(this.observe, { timeout: this.timeout })
}
},
beforeDestroy() {
beforeUnmount() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some directives have been renamed in Vue 3.

return this.$router.getMatchedComponents(this.to).filter(Component => {
return Component.cid === undefined && typeof Component === 'function'
})
getRouteComponents(route) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vue-router doesn't expose a getMatchedComponents() method anymore, so we need to define it by ourselves.

@eliottvincent
Copy link
Contributor Author

(fixes #33)

@egoist
Copy link
Owner

egoist commented Aug 12, 2021

can you grant me the push permission to the fork? I made some changes to the tests

@eliottvincent
Copy link
Contributor Author

I just added you as a collaborator with write permissions on the repository.

@egoist egoist merged commit a9c916b into egoist:master Aug 12, 2021
@egoist
Copy link
Owner

egoist commented Aug 12, 2021

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants