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

Vue 3 upgrade #90

Open
zafaralam opened this issue Aug 29, 2020 · 12 comments
Open

Vue 3 upgrade #90

zafaralam opened this issue Aug 29, 2020 · 12 comments

Comments

@zafaralam
Copy link

Are there any plans to release an update for the upcoming Vue 3?

Thanks for the great component 😄

@koca koca added the enhancement New feature or request label Aug 30, 2020
@koca koca removed the enhancement New feature or request label Oct 16, 2020
@koca
Copy link
Owner

koca commented Oct 16, 2020

Hey guys just released v2.0.0-alpha.1 which supports vue 3.

example vue 3 csb: https://codesandbox.io/s/vue-3-support-for-vue-prism-editor-fm7v5

install:

npm install vue-prism-editor@alpha

or

yarn add vue-prism-editor@alpha

cheers 🎉

@koca koca pinned this issue Oct 16, 2020
@syuilo
Copy link

syuilo commented Oct 17, 2020

Great work! Thanks 🎉🎉🎉

@atinux
Copy link

atinux commented Oct 21, 2020

Nice work @koca

When using with vite, I got this error:

Screenshot 2020-10-21 at 18 36 46

By changing these two lines to

const isWindows = /Win/i.test(navigator.platform);
const isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);

It works, but of course will fail if running on SSR, do you have any idea how to fix it since global is not defined with vite and defining it breaks the HMR.

@koca
Copy link
Owner

koca commented Oct 21, 2020

thanks @atinux. Released a new version v2.0.0-alpha.2 for vite support.

I made an example for vite + prismjs + vue-prism-editor usage:
vite csb: https://codesandbox.io/s/vite-vue-prism-editor-q9j8p?file=/src/components/CodeEditor.vue

install:

npm install vue-prism-editor@alpha

or

yarn add vue-prism-editor@alpha

If you have any questions let me know :)

@atinux
Copy link

atinux commented Oct 22, 2020

Awesome, that was fast!

@wagslane
Copy link
Contributor

@koca do you plan to add support to vite in the Vue 2 version? I'm stuck on Vue 2 but also really want to use vite haha

@koca
Copy link
Owner

koca commented Apr 22, 2021

@koca do you plan to add support to vite in the Vue 2 version? I'm stuck on Vue 2 but also really want to use vite haha

Sure, you get the global issue? Or different error?

@wagslane
Copy link
Contributor

Yeah, I worked around it by adding

<script>
    const global = globalThis;
  </script>

To my index.html, but it would be nice if a front-end lib didn't depend on Node.js stuff

@koca
Copy link
Owner

koca commented Apr 22, 2021

Yeah, I worked around it by adding

<script>
    const global = globalThis;
  </script>

To my index.html, but it would be nice if a front-end lib didn't depend on Node.js stuff

Yes I'll change

@koca koca closed this as completed Apr 22, 2021
@koca koca reopened this Apr 22, 2021
@mesqueeb
Copy link

mesqueeb commented Nov 3, 2022

@koca will it be officially released soon? great job btw!

@Flamenco
Copy link

Flamenco commented May 2, 2024

Because this is still alpha, yarn shows v2 as the most current version. It is time to drop the -alpha version.

Screenshot 2024-05-02 at 7 58 57 AM

@coreyogburn
Copy link

coreyogburn commented Aug 21, 2024

I'm having a hard time building the alpha for my Vue 3 web app. Between workspaces, lerna/yarn using a mutex flag, and autoprefixer being referenced but unspecified in the dependencies I'm running circles trying to get a UMD prod min version of this script. Has this project been abandoned? Can you put out a pre-built release of the alpha?

EDIT: nevermind needing to build, found one on jsdelivr

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

8 participants