I still don't see a reason why one would use Vue or React. I agree that templating of data is something you should use a library for. But there are great templating libraries. Handlebars for example. Can someone give a short example of code that would be more elegant using Vue then just a simple template engine?
Vue.js 3
141–150 of 308 posts
Re: Vue.js 3
#142I was hoping for better Typescript support for typing properties, since that is where 90% of our type errors occur. But it seems like you still have to specify the types manually. The example from the manual: const Component = defineComponent({ props: { name: String, success: { type: String }, callback: { type: Function as PropType void> }, message: { type: Object as PropType , required: true, validator(message: Comp…
It's not that we can't implement it like that, the real challenge is in minimizing breakage from v2. We decided it's better to not completely alter how props are declared because that would be too much breakage. Instead, there's the compiler-based approach with ` `: https://docs.google.com/presentation/d/1VjBM6ae-fuawK1TltYLX... (runtime props definitions auto-generated from TS interface)
Re: Vue.js 3
#143I still don't see a reason why one would use Vue or React. I agree that templating of data is something you should use a library for. But there are great templating libraries. Handlebars for example. Can someone give a short example of code that would be more elegant using Vue then just a simple template engine?
Re: Vue.js 3
#144Re: Vue.js 3
#145Earlier quoted context omitted.
This is a popular opinion particularly if all someone pays attention to is Twitter and Reddit but I'd argue it is a wrong opinion. Angular is alive and well, and being used/adopted every day for projects no one hears about. It isn't the "sexy" choice, but it is the one a lot of companies make. And if you're gonna point to opinion polls, and all kinds of respect to those who put them out, but they have a hard time cap…
Depends where you live and work I suppose. I used to work in a consultancy firm in Norway that was all in on Angular two-three years ago. Angular has been very popular in enterprise here. But Twitter and Reddit reach enterprise too in the end. The consultancy firm has now switched more or less entirely over to React because Angular is so out of vogue.
Re: Vue.js 3
#146if this means no more Vuex, i'm all for that. that extra abstraction layer never proved useful to me.
Out of curiosity, how do you handle data needed by tons of components at different tree depths (info about the current user for example)? I don’t always reach for Vuex, but when an app reaches a certain size it sure beats passing every bit of common data down through the entire tree, as I find you quickly hit a point where you’re passing data to components solely so it can pass it to it’s children.
Benefits: easy to create, type safety is simple.
Drawbacks: you don't get a serializable state log for free (that can be recorded and replayed when hitting bugs).
Re: Vue.js 3
#147Vue is the only one of the most popular 3 frameworks that can easily be used on a minimal basis to sort of "spruce up" old applications by selectively adding it here and there in the templates. Seems like they should try more marketing and community outreach toward that end. Gradual adoption is a feature / selling point not many web development frameworks can claim.
Why can't React do the same?
This has allowed me to do things like create Vue-based tools in a locked-down corporate environment where I was not able to install Nodejs on my machine.
Re: Vue.js 3
#148Nice, but does it have material?
Re: Vue.js 3
#149Vue is the only one of the most popular 3 frameworks that can easily be used on a minimal basis to sort of "spruce up" old applications by selectively adding it here and there in the templates. Seems like they should try more marketing and community outreach toward that end. Gradual adoption is a feature / selling point not many web development frameworks can claim.
Why can't React do the same?
So if you want to use it on one page, it's a hard sell to set up all that infrastructure (and document it for the team)
On some sites I've used Vue.js by simply adding a tag with vue.min.js.
On sites already using Gulp or similar, it's pretty simple to incorporate the Vue bundle and use it on one or a few pages.
Re: Vue.js 3
#150Earlier quoted context omitted.
Why can't React do the same?
I'm not sure about React's capability with this, but Vue can very easily run with no build stage. You can load Vue from a CDN and use a couple lines of JS to point it at a DOM element in your app. Then you can write a plain JS Vue object (what goes inside the tags in a .vue file), and all this logic will apply inside the element you pointed it at. You can also write components, although that gets a little clunky with…