gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

lang="html" is useless, and can even cause bugs #344

Closed drafolin closed 1 year ago

gruhn commented 1 year ago

Can you argue why or link to some source?

drafolin commented 1 year ago

Well, for the useless part, any template block is automatically considered as html following the vuejs guidelines

For the bug part, i think it is specific to vite, but it is used a lot, so you should consider it.

When i use your module as-is, i get an error

8:29:45 PM [vite] Internal server error: Component /Users/drafolin/source/<project>/front/node_modules/vue-qrcode-reader/src/components/QrcodeDropZone.vue uses lang html for template, however it is not installed.
  Plugin: vite:vue
  File: /Users/drafolin/source/<project>/front/node_modules/vue-qrcode-reader/src/components/QrcodeDropZone.vue

However, as soon as i hard edit your library and remove lang="html", as i did here, the error goes away and everything loads as expected.

i'm using vue 3.2.47, and vite 4.1.4. I'm working in a team with @chl0e-rnd and @Tobias-Glauser. First one is who found the bug, and the second one helped to find a fix to it. Hope this helps, and don't hesitate to ask if you need more informations.

gruhn commented 1 year ago

Note that the component is not fully Vue 3 compatible yet. Of course it makes sense that templates are considered HTML by default, but the scaffolding tools generated component files with this lang field included – at least under Vue 2. But I guess it won’t hurt to remove it. Would you mind squashing your commits into one and giving it the commit message:

fix: remove lang attributes

Or something like that? The reason is: The version number of releases is automatically determined form commit messages. This only works if we follow Angular Commit Message Conventions.

drafolin commented 1 year ago

Sure thing! Also, I didn't have any other problems with vue3 while using your components so I guess it should work

Btw, basing the version number on commit count is very nice! I love that :fire:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.1.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: