6

Joined a new project. The codebase is… Jesus Christ Vampire Hunter, is there ANY decent project in vue which has an hint of readibility in this damn world?

Every single time anyone talks about vue I roll my eyes “no I swear we managed it well!” 600 lines of code components. Is there even a good way to structure it for big apps?

Comments
  • 1
    It works well for me. I take out any non view/state related logic into separate TypeScript files (functions/classes) and keep the .vue as small as possible. I need, however, to use better naming for *everything*.
  • 1
    @rantsauce Mhh I see what you mean, what perplexes me is the hostility towards linters, the fact you basically have to declare template, script and css all together and the fact you have to first import the components and then declare them as components… it seems so verbose and so far I’ve seen so many “just this time”s due to the fact everything is in the same file
  • 0
    If you're writing a monolith, don't use Vue.

    Like @rantsauce said, break everything up. Build some packages that can be shared across domains, but at the end of the day if your Vue app covers more than one domain you did it wrong.
  • 0
    @piratefox Not just linters. Syntax highlighting, LSP servers, autocompletion, and a whole bunch of tools are having a hard time dealing with .vue files. I know it's possible to separate them but I never do it, don't know why.

    For the verbosity, I disagree. I prefer verbosity over obscurity.

    Quick example:

    import AutocompleteSearch from './AutocompleteSearch.vue';

    components: {

    'autocomplete-search': AutocompleteSearch,

    },

    I know it's going to be <autocomplete-search /> and not <autocompletesearch />
  • 0
    "is there ANY decent project in vue" - you are asking questions like "is there and red colour that's green?"
  • 1
    We have 5 vue projects. 2 of them written by script kiddies that pretend they are developers and 3 of them written by actual frontend developers. Needless to say that 2 projects are complete garbage. There are some components with 1.6k loc. Other 3 projects are like poetry compared to them. My point is; its not the tool, its god damn incopetent developers.
  • 0
    @hack I love you.
  • 0
    @rantsauce I mean, verbosity doesn’t always oppose to obscurity… just try to add an enum in a template!

    Or vuex’s getters: they are verbose AND obscure (as with decorators you have to specify them as strings… what a bad idea)
  • 0
    @hack I beg to differ, it’s 90% the devs and 10% the tool… but yeah my rant revolves mostly around the incompetence of the devs!
Add Comment