Live data from Hacker News

How we do Vue at GitLab: one year later

about.gitlab.com

201–208 of 208 posts

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

#201
post #170

I wanted to build something in Vue a few months ago. I really like the single-file-component thing. I also like the code to update automatically and my browser to refresh. I decided on Webpack. First time using it and no idea where to get started. I ended up downloading some boilerplate webpack / vue / vueX that now does everything for me, but I have no idea what webpack is actually doing or how it is doing that. I'm…

I'm in a similar boat right now, I started exploring Vue with the vue-cli default template and VS Code. Webpack and the associated npm ecosystem scares me to no end. When it works, it works wonderfully but it is so incredibly fragile and built upon assumptions that might change if you do not use the exact flavor of tools and utilities the creator of the template does.

For a long time, the way webpack worked in the Vue template was at least 70% black magic to me. I had some issues with it, sometimes I solved those issues after google-ing a lot and landing on completely unrelated projects Github issues for a fix. I never quite felt that I had mastered that whole ecosystem like I felt I had mastered my regular programmin languages and tools.

My day job is C# and my day IDE is VS2017. I've been given permission to explore doing a new application in .NET Core with Vue. So, I've started to translate the default template from vue-cli to Visual Studio and I have learned a LOT by trying to glue these pieces together that no one else seems to have glued together for me. Luckily, MS has done a lot of work to make React play nice with VS2017 and that seems to benefit Vue as well.

I'm not quite there yet, a few last issues remain. Most of them have to do with Intellisense's understanding of Typescript vs. Webpack's understandinf og Typescript. Some remain unsolvable for now (Single File Components using Typescript and SCSS).

Still, the point I'm trying to make is that being forced to read through the entire thing has increased my understanding of the Webpack process immensely. I feel like I'm at 80% mastery now.

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

#202

Earlier quoted context omitted.

> Simplicity makes picking up the unfamiliar easier. The talk I referenced talks about how the opposite is often true. Tools that result in objectively simpler systems can come with a initially steeper learning curve. > You can't accurately deduce from time alone that the time to pick up Vue was based on familiarity with similar libraries. True, I was really just suggesting questioning instincts when evaluating tools…

> "The talk I referenced talks about how the opposite is often true. Tools that result in objectively simpler systems can come with a initially steeper learning curve." I'm aware of Rich Hickey and Clojure. In my experience with Lisps, although they are superficially simple, they make you do more abstraction work than is necessary in more commonly used high-level imperative languages. Lisp seems to strongly encourage…

Totally agree actually, I love all Rich's talks and agree with almost every word of Simple Made Easy but I don't necessarily agree with the conclusion he takes it to (Clojure).

I've heard it suggested somewhere that possibly the leap is in believing that 'a simple thing + a simple thing = a simple thing'.

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

#203
post #25

Earlier quoted context omitted.

I don't know GitLab's exact motivations although I noticed the same thing. I suspect it might be because they're using Vue components on already existing Server Rendered pages as opposed to a full SPA, so by passing the endpoint in the template they can allow the actual URL for that page to be set in the controller, maintaining cohesiveness. E.g. on the server-side .html.erb they'd have something like ` ... `

Just feels like you're halfway following good JS practices. Ex: using Vue is great, but still rendering templates the "old way" instead of server rendering correctly for the whole app and having components remount. Totally get your point :)

I don't disagree but the real power of Vue is that you can immediately start using it in your existing application without having to jump to a full SPA. Vue works just as well when added to a single page or feature in an existing application as it does in a full SPA

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

#204
post #177

I'm very happy the React and Vue projects are headed by people like Evan You and Dan Abramov, not HN commenters. The hostility in these threads is upsetting. There is no best approach and both React and Vue have their worth, if you like them or not. Every time I see a topic about Vue or React (or practically anything JS related) I see the polar opposite of the disarming friendliness coming from the community leaders…

It’s true, that H.N. Commenters guy is a real piece of work.

... But in all seriousness, there is a diversity of viewpoints here. It’s a conversation and people vote up things they find thought provoking. Would you prefer only people who think React and Vue are great post here?

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

#205

Earlier quoted context omitted.

This might be a dumb question, but what’s the best way to actually use this to make a real application? I’m talking speak to a database and hook up a backend. I’ve enjoyed using vue from a “this is a neat way to make components” but I’ve never successfully been able to do anything with it. I understand it’s just the “view” and not a full MVC like rails but I want that to exist. I want it super opinionated and favor c…

Yes you need a lot more tools. A backend framework with a REST API plugged to a data base is common way of doing it. Personally I use Django + Django Rest Framework a lot on the server and axios to query it on the client. But you mileage may vary.

I would love to see a start to finish crud example of the "least" amount of magic and copy paste code for a guide on setting this up. I've messed around with Django and it seemed harder to grasp than rails due to using regex out of the gate to apply a simple route as opposed to get/do or resources.

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

#206

Earlier quoted context omitted.

Nope. Nope. Nope. Trainer here. I train in React and in Vue. My students do 3 times the work with raw vue than in raw react. Every one of them. All the time. It's not even on the same map.

This might be a dumb question, but what’s the best way to actually use this to make a real application? I’m talking speak to a database and hook up a backend. I’ve enjoyed using vue from a “this is a neat way to make components” but I’ve never successfully been able to do anything with it. I understand it’s just the “view” and not a full MVC like rails but I want that to exist. I want it super opinionated and favor c…

Academind has a great video series on creating a Vue app that uses Firebase as the backend, and anyone can follow along and reproduce the results. He also uses Vuetify for the sake of having some prebuilt UI components. https://www.youtube.com/watch?v=dIkPb8krORU

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

#207
post #115

Earlier quoted context omitted.

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 ) }

Code like parent comment is why I use Intercooler.js [1]. [1] http://intercoolerjs.org

Cute ideas in there. Much appreciated

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

#208
post #177

I'm very happy the React and Vue projects are headed by people like Evan You and Dan Abramov, not HN commenters. The hostility in these threads is upsetting. There is no best approach and both React and Vue have their worth, if you like them or not. Every time I see a topic about Vue or React (or practically anything JS related) I see the polar opposite of the disarming friendliness coming from the community leaders…

It’s true, that H.N. Commenters guy is a real piece of work. ... But in all seriousness, there is a diversity of viewpoints here. It’s a conversation and people vote up things they find thought provoking. Would you prefer only people who think React and Vue are great post here?

I don't mind people having opinions. I mind people denouncing everything that competes with their personal preference. Note how I said "hostility".

I'm talking about comments like

"God this is horrible. It's ugly. Hard to read."

"ugly piece of code"

"React failed miserably"

"The JS ecosystem is like the baskin robbins of st"

and so on.

Post reply on HN