Live data from Hacker News

How we do Vue at GitLab: one year later

about.gitlab.com

131–140 of 208 posts

Re: How we do Vue at GitLab: one year later

#131

React made me feel stupid, Vue made me feel smart. So I use Vue. I came at it as a long-time jQuery dev with Angular 1 experience.

In general it's best to push your comfort boundaries. It's called learning. I'm not saying React is better than Vue (I honestly think they are very similar). Just that picking a technology based on whether it challenges you or not is probably not the best strategy.

Learning is good. Being productive is better. That's why I prefer Vue over React.

Re: How we do Vue at GitLab: one year later

#132

Earlier quoted context omitted.

Vue and jquery works ok together. First, you can gradualy migrate from jquery dom to vue. As both are very light, having both is not bloated. Plus, you need something to do ajax anyway, and if your site uses it, why add axios as well? Actually I'd say that vue is probably the best tech if you want to progressively improve a legacy jquery heavy website instead of doing a complete rewrite.

Isn't fetch widespread enough to use these days?

Only if you want to ignore 12% market share or use a polyfill:

https://caniuse.com/#search=fetch https://www.netmarketshare.com/browser-market-share.aspx?qpr...

Plus, although fetch is tremendously better than XMLHttpRequest, it still has quirks. It doesn't send cookies by default. The promise resolve on success on code 400 and 500. Headers are verbose. You have to encode and decode json manually. You have to force CORS for it to work.

The end of this article show you the problem:

https://medium.com/@shahata/why-i-wont-be-using-fetch-api-in...

Eventually you end up writting code to wrap fetch. So why not just use jquery or axios ? It's already documented and tested.

Re: How we do Vue at GitLab: one year later

#133
post #30

At my last job we did a comparison between Vue and React before rewriting a major frontend application. We did a POC in both React/Vue and ended up using Vue mainly due to the following reasons: Single File Components Single file components (.vue files) is the best thing about Vue. I understand this might be a personal preference, but we wanted to avoid CSS-IN-JS. Our designer could churn out neat html/css, but was a…

I agree that single file components are awesome. I wish you had been introduced to styled components in react: import styled from 'styled-components' const Container = styled.div` padding: 10px; background: ${ ({ isHovered }) => isHovered ? 'green' : 'red' }; ` const H1 = styled.h1` font-size: 15px; ` const P = styled.p` font-size: 10px; ` const MyComponent = ({ isHovered }) => { return ( Hello This is a thing ) }

There is the Vue equivalent though: https://github.com/styled-components/vue-styled-components

Re: How we do Vue at GitLab: one year later

#134
post #110
post #106

Earlier quoted context omitted.

> I mean, same way with Vue really. If the editor didn't know wtf a Vue file is, you'd lose all the integration too. In a way, that's fair. In another way, the example single component Vue file I linked to is an HTML file. It has a tag and a tag. Just associate .vue with HTML and you're done. That gets to my broader point as well - styled-components reinvents the way you declare styles and the way you apply styles, a…

If you remove styled-component specific tooling from the equation to simplify the argument and just use Glamorous instead of styled-components (which are very close to the same thing except the later is just JS), then it's exactly because of tooling. The reality is that tooling for templates (even Angular or Mustache style) is pretty terrible. Tooling for CSS is just as terrible. Static analysis or doing simple thing…

Is it bad to write without all these JS tools? We just use Visual Studio and include the standalone Vue.js file. We write plain css (no sass etc) and js with some occasional JQuery. We don't use Nodejs and its build tools (Kinda don't like the complexity all those tools bring. You are more worried about the tooling than the actual problem at hand). We use Ajaxmin and Httpcombiner. That's it for Frontend.

Vuejs is great. Found it to be easy and simple to understand. Big thumbs up for Evan You.

Re: How we do Vue at GitLab: one year later

#135
post #30

At my last job we did a comparison between Vue and React before rewriting a major frontend application. We did a POC in both React/Vue and ended up using Vue mainly due to the following reasons: Single File Components Single file components (.vue files) is the best thing about Vue. I understand this might be a personal preference, but we wanted to avoid CSS-IN-JS. Our designer could churn out neat html/css, but was a…

Same. That and the fact it took me an afternoon to get an hello world with react and understand it. And 20 minutes with Vue.

Which order did you attempt to learn them in? Is it possible taking the time to attempt to learn react affected how easy it was to pick up Vue? I know we love to hate on React here but they are very similar. Can you identify what in particular is so confusing with regards to react vs. vue? They have a very similar API.

Re: How we do Vue at GitLab: one year later

#136
post #91
post #81

Earlier quoted context omitted.

React is the new JQuery, I really don't see Vue and Angular being in the same world as React.

As far as the actual libraries themselves go, if any of Vue/Angular/React are the new jQuery, it's Vue. It's the smallest of the three, but more importantly it's the easiest of the three to drop into a page without any tooling.

I have a hard time understanding why this "drop in" experience is so important. Are you all writing simple contact us forms or something incredibly simple?

Any application that I've built which actually required a technology like Vue or React was a significant undertaking and a few hours getting up and going (not that either of them require anywhere close to that) is nothing.

Re: How we do Vue at GitLab: one year later

#137
post #73

Earlier quoted context omitted.

Even if you ignore 2-way-binding?

The whole component russian dolls with data/callback passing is something most beginers have a very hard time to grasp. Add webpack to the mix, make them fight with JSX that doesn't want to do what they need and voila, you get a sad student. Starting with vue is just: add a script tag, put your template here, now your data here. Done. The start up experience is nothing alike.

Uh, you pass data & callbacks through props in vue also, unless you use a single component. Why not just compare it to using a single component in react then also and be honest?

Re: How we do Vue at GitLab: one year later

#138

Earlier quoted context omitted.

Same. That and the fact it took me an afternoon to get an hello world with react and understand it. And 20 minutes with Vue.

Which order did you attempt to learn them in? Is it possible taking the time to attempt to learn react affected how easy it was to pick up Vue? I know we love to hate on React here but they are very similar. Can you identify what in particular is so confusing with regards to react vs. vue? They have a very similar API.

Vue dlc is better. Vue doesn't require webpack. All vue tutorials agree on how to so things and they work the first time you try them. You son't have to learn a new way to do templates or pass data. You can start withou components. You can even start without npm.

In summary, vue offers a simpler hands on experience while allowing smooth learning curve to more complicated setup matching react's.

React just throws you in unkown waters and say 'now swim'. And on the side of the river, 3 persons are screaming to you contradictory advices.

Re: How we do Vue at GitLab: one year later

#139
post #91

Earlier quoted context omitted.

As far as the actual libraries themselves go, if any of Vue/Angular/React are the new jQuery, it's Vue. It's the smallest of the three, but more importantly it's the easiest of the three to drop into a page without any tooling.

I have a hard time understanding why this "drop in" experience is so important. Are you all writing simple contact us forms or something incredibly simple? Any application that I've built which actually required a technology like Vue or React was a significant undertaking and a few hours getting up and going (not that either of them require anywhere close to that) is nothing.

First, as a learning experience it's easier. In the HN bubble it's easy to forget most web project out there don't even have npm installed. I regularly train dev that just learn what ajax means.

Secondly, a lot of my projects just don't need anything else. If i have a 2 weeks contract with a client, i'm not going to setup webpack, a ci server and docker.

Having the choice to scale up or down is an amazing feature.

Re: How we do Vue at GitLab: one year later

#140

Earlier quoted context omitted.

The whole component russian dolls with data/callback passing is something most beginers have a very hard time to grasp. Add webpack to the mix, make them fight with JSX that doesn't want to do what they need and voila, you get a sad student. Starting with vue is just: add a script tag, put your template here, now your data here. Done. The start up experience is nothing alike.

Uh, you pass data & callbacks through props in vue also, unless you use a single component. Why not just compare it to using a single component in react then also and be honest?

Actually beginers in view won't use a component at all. They will use it angulajs 1 style
Post reply on HN