First off, weird that /c/technology is the closest I can find to a programming/coding com.

the class syntax looks neat, but then when you toJSON the equivalent fromJson does not exist and you have to write it yourself and there's tons of things that are very easy to go wrong and then you're double creating objects (RIP GC).

I saw some packages that claimed to address this issue, but IMO it's easier enough to just do the functional programming thing I'm being bullied into, and they didn't look small. One of them would add 9kb (3.3gziped) to my build.

Also I shaved 5kb off my build by removing lodash/find, but I don't recommend removing lodash functions without typescript.

  • mittens [he/him]
    ·
    2 years ago

    use clojurescript and don't serialize your payload, just send it as is to your clojure backend using homoiconic list structures

  • PigPoopBallsDotJPG [none/use name]
    ·
    2 years ago

    Fancy serialisation is kind of a security nightmare. On top of that, javascript's opaque assign-by-reference semantics make the level of meta required for, e.g., objects always being easily serialisable a recipe for migraines.

  • frankfurt_schoolgirl [she/her]
    ·
    2 years ago

    I've found classes are kind of superfluous when you've got typescript. I know there are some libraries to generate serialization and validation code for typescript interfaces at runtime as well.