Earlier quoted context omitted.
I regret every line of Redux boilerplate I ever wrote before discovering MobX. MobX is now even more fantastic with the new proxy based implementation. Reading up on VueX.. Not really looking forward to having to use it over MobX.
> MobX is now even more fantastic with the new proxy based implementation. What does this mean? I've used MobX in the past but curious what has changed with this.
How we do Vue: one year later (2017)
151–159 of 159 posts
Re: How we do Vue: one year later (2017)
#152Earlier quoted context omitted.
> rather than JSX's more sensible curly brackets I'm still waiting for the 2019 equivalent of http://haml.info/
How about Hiccup? Some examples here: https://reagent-project.github.io/ It's not haml, but I'd argue it's awesome.
Re: How we do Vue: one year later (2017)
#153> Just use VueX That's the problem with large-scale Vue apps. Vue is awesome until you need to use VueX, after which it just becomes an inferior version of React + Redux.
Inferior? How exactly? I found Redux to be highly over-engineered in contrast to Vuex which is a lot like MobX - easy to use, yet powerful.
Re: How we do Vue: one year later (2017)
#154Re: How we do Vue: one year later (2017)
#155Earlier quoted context omitted.
I have the opposite feeling to you. The template feels like HTML to me and the syntax is clear and concise. React for me gets confusing with it all muddled together. But each to their own.
Compared to React (and React’s JSX) Vue’s syntax is orders of magnitude more complex and is very inconsistent: https://news.ycombinator.com/item?id=19199423
I feel like these kind of arguments are usually made by people who don't have any extensive experience using Vue, because in practice, it's not really a problem. Sure, you may not like it and prefer JSX (I understand all the pros and cons, all very valid), but that's a whole different statement than saying "Vue's syntax is orders of magnitude more complex and very inconsistent". That's just plain wrong.
Re: How we do Vue: one year later (2017)
#156Earlier quoted context omitted.
If you mix server-side rendered apps with Vue, this is the most common way. Second method is to push the data to a window.__data.staffMemberOptions = "{{ foo }}" and use it in Vue.
Thanks, good to hear. Elsewhere I've added something similar, and populate the data this way: var vue = new Vue({ el: '#app', created: function () { for (var key in __app.dataForVue) { this[key] = __app.dataForVue[key]; } }, // ... };
// main.js
new Vue({
template: '',
components: {App},
data() {
return {
inventory: null
}
},
beforeMount: function () {
this.inventory = JSON.parse(this.$el.attributes['data-inventory'].value);
}
}).$mount('#app');Re: How we do Vue: one year later (2017)
#157Earlier quoted context omitted.
Compared to React (and React’s JSX) Vue’s syntax is orders of magnitude more complex and is very inconsistent: https://news.ycombinator.com/item?id=19199423
That's a very strong statement. To me the templating part of Vue is the least of my problems. While in theory you could make it sound complex by listing an exhaustive list of custom attributes, in reality this is almost never a problem. I have 2+ years experience in Vue, and I've never had any issues with the templating. Problems that are orders of magnitude more complex than templating are problems related to compon…
There is an easy test to see if my statement was true or false:
where "attr" is a Vue attribute. What is x and what can x be? An expression? A string? A function reference? An object? How will it be processed and presented in the end? As a string? As a function call?At any given point in time the value in an attribute is entirely dependent on context (which particular Vue attribute it's in) and on a very arbitrarily defined rules for those attributes. For example, v-on accepts three absolutely different and incompatible things:
v-on:click="x + 1"
A Javascript expression
v-on:click="function_ref"
A function reference bound to JS-code
v-on:click="function_call(param1, param2)"
Looks like a function call but isn't. It's a way to
declare a function ref that will be called with bound params
And that's just one of the tags! I'm not even touching on the JS side of things where magic is abound (see comments at the end here: https://news.ycombinator.com/item?id=17471199)Compare to React's JSX:
// x is a string
// x is a valid Javascript expression
These are the same and they are consistent for every single attribute. The only limitations come from the meaning and the usage of the attributes themselves.
regular_JS_arrow_function() }}>
onClick expects a function reference because that's
what it will eventually call
And the rest around JSX? Plain old Javascript. Where this: {
data: function () {
return {
open: false
}
}
}
doesn't magically turn into this in a completely different part of the object: {
methods: {
toggle: function () {
this.open = !this.open
}
}Re: How we do Vue: one year later (2017)
#158Earlier quoted context omitted.
I'm too inexperienced to have a definitive opinion, but I'm not nearly so positive and wanted to toss out a contrasting opinion to the current comments. After a few years of using React and some past experience with various other templating/view systems (webdev of one sort or another since '99) I started picking up a little Vue. So far it's been easy enough, but it is highly confusing compared to most other systems I…
I have the opposite feeling to you. The template feels like HTML to me and the syntax is clear and concise. React for me gets confusing with it all muddled together. But each to their own.
Different strokes for different folks, but I was quite surprised at my experience. Everyone keeps using the word "intuitive", and anything that I have to learn all these rules and special cases for is the opposite.
Re: How we do Vue: one year later (2017)
#159I've been working with Vue for a few months now, after several years with React, angular, JSP, rails and django (and of course jquery). I know a lot of people, especially in HN, are impressed by it but I found it very lacking. It makes things easy to write at first and with very little learning curve but trades that ease of use for stability, simplicity and maintainability. The main problems, to me, are: * too much g…
I've also been using Vue for a couple of months now. Initial experience is fairly positive, but there are absolutely things I miss. I don't miss JSX that much, but I really miss the way Angular let me inject services wherever I need, and views get updated automatically. If I try anything like that in Vue, it doesn't work, I need to put everything in the Vuex store, which makes the store a single global variable that…