A Vue application I'm tasked with fixing consists of one single huge component, wouldn't survive even the most liberal use of linting, and has a reloadPage() function.

How fucked am I?

  • 1
    @buried that depends on what's broken. are you allowed to refactor?
  • 4
    @CoffeeNcode Yeah, luckily our deadline was moved back one week. I'm already rewriting the entire API layer for this component. I'm thinking of pretty much only keeping the styling. I only skimmed the code, but wouldn't be surprised to find DOM selectors in there as well...
  • 4
    methods: {

    reload() {

    this.$nexttick(() => {





    Life hack: how to vue while avoiding its features (Evan You hates this secret trick)
  • 1
    @ltlian Simple trick:
    import React from 'react';
    import ReactDOM from 'react-dom';
    import $ from 'jquery';

    ReactDOM.render(<span>we're all fucked</span>, $('#app-root')); // it will fail
    Dan Abramov hates this trick!
  • 3
    How not to vue 101
  • 2
    Status update:
    I had to scrap the whole thing. I would complain about juniors, but I know I wrote way better code when I was one. Completely unmaintainable, and they spent several WEEKS on it. I'm not sure how many man-hours went into it and I don't think I wanna' know to be honest.
  • 1
    @buried that's probably for the best, starting from scratch. At some point, stuff becomes unfixable
Add Comment