Giter Site home page Giter Site logo

Comments (6)

AustinGil avatar AustinGil commented on July 27, 2024 1

Unfortunately, the solution above does not work. Back to the drawing board. I'd like to avoid something withing the component, but may end up with your solution.

from vuetensils.

AustinGil avatar AustinGil commented on July 27, 2024

Hey @stuartjnelson, thanks for reporting this. It's actually a known issue. Im working on supporting both Vue 2 and Vue 3. There are only some minor changes, but in order to address them, I need to detect which version of Vue is running. The good news is that this won't negatively affect anything. The bad news is I dont know of a better way to detect what version is running.

from vuetensils.

stuartjnelson avatar stuartjnelson commented on July 27, 2024

Hey @AustinGil,

Thanks for quick reply and sorry if this was already reported. Do I had a play around (by this I mean hacking Vuetensils from inside my node_modules directory). I was able to check if it was Vue 2 by doing the following;

const isVue3 = this.render  === 'function' || false

This only worked if it was done inside the exported object not where you have it nicely at the top. I wonder if this would cause issues if you use Composition API plugin with Vue 2...

from vuetensils.

AustinGil avatar AustinGil commented on July 27, 2024

Oh that's a pretty clever approach. I was also considering modifying the code so its more like

import * as namedExports from 'vue'

const isVue3 = namedExports && namedExports.version && namedExports.version.startsWith('3')

It's a bit more verbose, but I think that should work. I just wonder if it would impact the bundle size differently.

from vuetensils.

stuartjnelson avatar stuartjnelson commented on July 27, 2024

I feel it not a bad verbose though but like you said for this check you wouldn't want to affect bundle size. Let me know if I can help with this

from vuetensils.

AustinGil avatar AustinGil commented on July 27, 2024

Ended up just adopting vue-demi as it's the recommended solution from the core team. I didnt want to add an external dependency, but fixing this issue was required for Vite support

from vuetensils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.