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

[Feature Request] Upgrade to Vue3 #31

Open
vycoder opened this issue Feb 9, 2021 · 13 comments
Open

[Feature Request] Upgrade to Vue3 #31

vycoder opened this issue Feb 9, 2021 · 13 comments

Comments

@vycoder
Copy link

vycoder commented Feb 9, 2021

Would you consider upgrading to Vue3?

@Kinrany
Copy link
Owner

Kinrany commented Feb 9, 2021

Totally, although I don't currently use it. Are there any relevant breaking changes?

@vycoder
Copy link
Author

vycoder commented Feb 9, 2021

There's not much really. Only the onMounted hook I guess. I've went along and did a quick implementation, maybe you can use this as reference #32 .

I haven't tested this. But I did the same thing on one my projects, I'm referencing the VueP5 directly but for this one, I don't think we'll able to globally register the component. We'll most certainly have to use VueP5 as a plugin going forward.

import VueP5 from 'vue-p5'
import { createApp } from 'vue';

import App from './App.vue';

const app = createApp(App);
app.install(VueP5);

Hope this helps.

@Kinrany
Copy link
Owner

Kinrany commented Feb 9, 2021

mounted -> onMounted

Do you know if there's an API that exists both in Vue 2 and Vue 3? I'd like to avoid maintaining two separate branches.

I'll probably get rid of .vue source and use plain .js to simplify bundling, if that helps.

I haven't tested this. But I did the same thing on one my projects, I'm referencing the VueP5 directly but for this one, I don't think we'll able to globally register the component. We'll most certainly have to use VueP5 as a plugin going forward.

Hmm, so Vue 3 no longer has the ability to register a component globally, and the user must register every component they use with the app instance? Is that right?

I guess I can use and recommend the new way of doing it, if only for making code future-proof!

@vycoder
Copy link
Author

vycoder commented Feb 10, 2021

Do you know if there's an API that exists both in Vue 2 and Vue 3? I'd like to avoid maintaining two separate branches.

I was actually trying to figure that one out, like if there's a way where a lib uses Vue2 internally but ejected of some sort to be used in Vue3. Unfornately, I came up with nothing. lol

I'll probably get rid of .vue source and use plain .js to simplify bundling, if that helps.

Yeah cool, something like a render component would probably be better.

Hmm, so Vue 3 no longer has the ability to register a component globally, and the user must register every component they use with the app instance? Is that right?

Afaik, that's just how it is. In Vue3, we can only register a component on an existing app instance, but I'm not really sure I haven't read anything that says otherwise though.

@lucasfelber
Copy link

Are you still working on this?

@Kinrany
Copy link
Owner

Kinrany commented Oct 15, 2023

No, not really.

The task is simpler now though. Now that Vue 3 is no longer experimental, it's reasonable to just upgrade, without keeping compatibility with Vue 2. I'd accept a PR.

@shkipan
Copy link

shkipan commented Nov 3, 2023

Hello, could you tell, how things are going with this issue? I wanted to try this library but it does not work with vue 3 😢

@Kinrany
Copy link
Owner

Kinrany commented Nov 3, 2023

No changes, someone needs to step up and write a PR 🙂

@shkipan
Copy link

shkipan commented Nov 6, 2023

@Kinrany , what about this PR? It seems, like it solves vue3 issue
#32

@Kinrany
Copy link
Owner

Kinrany commented Nov 6, 2023

@shkipan it was written more than two years ago, when Vue 3 was still experimental. I give it at least 60% chance that there'll be issues, so I'd rather have someone championing the update.

A major concern with every update is maintaining support for two forms of import: as a Node package and as an HTML script tag with no build step.

@shkipan
Copy link

shkipan commented Nov 6, 2023

I see, thank you for the answer

@elasticdotventures
Copy link

elasticdotventures commented Dec 12, 2023

FYI - Vue2 is End of Life as of Dec 31st, 2023
https://v2.vuejs.org/lts/

Also for those looking - consider:
https://github.com/Nico-Mayer/p5vue

@Kinrany
Copy link
Owner

Kinrany commented Dec 12, 2023

Oh well, thanks for the info. Perhaps I'll find time after the new year.

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

No branches or pull requests

5 participants