27
Root
5y

Stupid javascript.
Stupid hoisting-oblivious "frontend devs."
Stupid browser-specific javascript behavior.
Stupid thrown-together javascript minifier that literally only strips out whitespace and comments.
Stupid poorly-written javascript spamming my api.

Time to rewrite it. Grumble grumble. Soo not how I wanted to spend my morning-turn-afternoon.

Leading to the last but not least:
Stupid me forgetting javascript's quirks.

Comments
  • 0
    Mind sharing what Minifier you're using?
  • 7
    Let's compare undeclared variables!
    Then set them for the next check!
    Within the wrong scope so hoisting doesn't work and they disappear immediately!
    And perform an api call when they differ!
    And then repeat it every 250ms!

    Fucking inept idiots.
  • 2
    @Root oof, so somebody didn't put time into testing? Unpleasant, indeed.
    Hoisting and object referencing are really fu(n/c)ky things, I'd say they're enemies in any supporting language if used exceedingly.
  • 4
    @olback Some homemade regex monstrosity that "works well enough" and so hasn't been touched in years. The devs here just work their way around its quirks. It looks for a specific comment, and when present, squishes all the JS in that file. so if the "minifier" breaks things too much, you can just turn it off.

    Why isn't there a real minifier with context-aware rewriting? Easy: laziness. 😓
  • 0
  • 1
    Why such excuses of minifiers ever exist... for you... just to suffer 🤔
  • 2
    @vintprox They tested it and made sure it worked; they just never looked at the network tab or server log.

    As soon as I added code to modify the form pre- and post- api response, I noticed something /fu(n|c)ky/.

    And I agree. I don't like languages doing things I don't explicitly tell them to. I don't care if it saves keystrokes; it costs headaches. Especially when someone else just "makes it work," gets credit for their haste, and I'm left to clean up their mess.

    It's the Peter principle in action!
  • 2
    eval('var a = 1') no more hoisting
  • 2
    I'm not a java script dev in any way shape or form. Now for some reason I am in charge of figuring out why the performance in this app is so bad.
  • 0
    @projektaquarius if its anything like the be apps I work its function calls that stack a hand full of promise functions wrapped in new promises
  • 0
    @vorticalbox according to Google dev tools, it's a lot of queryselectorall calls in our plugin registration code.
  • 0
    Have never ran into those problems using typescript so far.
    Just sayin.
Add Comment