-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Vue.js 3 #2751
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
Comments
Hi @tchukuchuk, just a couple of days ago, I added Vue 3 to a Rails app. I want to create a PR to install vue3 with webpacker and write an article/tutorial about it. Please give me 2-3 days to get that done. Best |
How did you add it without webpacker? That would work for me for the time being! |
https://dev.to/vannsl/vue3-on-rails-l9d I just published this, I haven't checked for typos yet ;) |
Great work!
… On 11 Oct 2020, at 19:17, Vanessa Böhner ***@***.***> wrote:
https://dev.to/vannsl/vue3-on-rails-l9d
I just published this, I haven't checked for typos yet ;)
Typescript follows!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
v3 installation shouldn't be different from v2 We could close this issue I think 👍 |
@guillaumebriday I would suggest to leave it open. I wanted to create a PR to add the installer on webpacker. The installation is different from vue2. The packages are different and the command to create an app. |
(If you just want to close the issues for some reason, it's fine for me. I would still create the PR) |
I mean the configuration related to webpacker is the same. Only the install has changed. Since the whole Vue ecosysteme is not ready for 3 yet, I suggest to add a |
Hi @guillaumebriday, thanks for the quick reply. I actually propose the same. The vue3 ecosystem is not ready yet, therefore vue3 is behind vue@next - so a vue3-install-option is the way to go |
So cool! Thanks 👍 |
Hi @Vannsl , Thanks a lot for your article ! Do you know when you'll publish the next one about Typescript support ? |
Hi @tchukuchuk, I plan it to do upcoming weekend. But as far as I understood it:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent
export default component
}
Since Vue 3 is written in Typescript, there is no need to import other special packages, like the As IDE you might need to use VS Code to install the extension "Vetur". It comes with Typescript support for Vue 3. The rest then should be Vue-TS-syntax realted and is documented on the offical Vue 3 TS Documentation. |
Thanks ! No need to add and configure ts loader for webpack ? |
That's a good question with Vue 3 already written in TS, I'm not sure. If it's not working without, the ts-loader config for vue2 was.
|
Hi @Vannsl, and thanks for your great contribution! While following your instructions (I actually cloned your example repository), I ran rapidly into a major problem. I can't even use a simple <template>
<p>
{{ message }}
</p>
<button @click="doStuff">Click me</button>
</template>
<script>
import { ref } from 'vue'
export default {
// ...
methods: {
doStuff(event) {
alert('Hello!')
}
}
}
</script> All compiles successfully, but then, when clicking the button I get the follow JS error:
Do you think it's related to your setup? Has anyone encountered the same issue? |
Hi @pguegan, the block If you want to refactor the code using the <template>
<p>
{{ message }}
</p>
<button @click="doStuff">Click me</button>
</template>
<script>
import { ref } from 'vue'
export default {
name: 'HelloWorld',
setup() {
const message = ref('Hello World')
function doStuff(event) {
alert('Hello!')
}
return {
message,
doStuff
}
},
}
</script> |
Hello @Vannsl , Have you tried to switch to Typescript ? |
Hi @tchukuchuk, unfortunately something else came up and I have to work on that first. Did you have the chance to try the setup? |
Hi @Vannsl, Thanks for the tutorial. |
Hi @yanovitchsky thanks for the reminder, I actually will have time again to look into that. Give me a couple of days and I hope I'll return with a result (also at @tchukuchuk ) |
I created a pull request (#2792) to use the Vue3 installer like
or
|
As far as I understand from this comment : #2757 (comment) Installers will be removed, which I think it's a good things because they often do too much or not like in the install guide of every techno we want to install. And it's less thing to maintain for Webpacker contributors |
Thanks, guillaumebriday. I understand the comment and agree with the way not to use installer but install guide with all installer steps(I guess it could be something like Vannsl wrote). |
Hi everybody (@yanovitchsky, @tchukuchuk), it took a while, but here's how to add TypeScript: |
There is also vite-rails now, which uses vite instead of webpack. It seemed to work very well on the side project I tested it with, and it's wayyyy faster than webpack. |
Hi,
Do you know where I can find a working example with vuejs 3 and typescript ?
The text was updated successfully, but these errors were encountered: