r/javascript • • Sep 20 '18

The Solo JavaScript Developer Challenging Google and Facebook

https://www.wired.com/story/the-solo-javascript-developer-challenging-google-facebook/
52 Upvotes

38 comments sorted by

View all comments

10

u/spaces_over_tabs Sep 20 '18

I've used Angular and the biggest and best thing about it is Typescript. Don't get me wrong, Angular is fantastic and I love it. I learned TS because of Angular and fell in love with it. Every project I do now, I use TS and not necessarily Angular but I need TS.

7

u/TheScapeQuest Sep 20 '18

TypeScript with React and Redux works beautifully. I was so against it when I started a new project using it, now I couldn't live without it. Just protects me from myself a lot more.

Not to say I don't pull my hair out for a few hours every time I try to upgrade a major package though...

1

u/spaces_over_tabs Sep 20 '18

Really? I've had reservations using Typescript with other frameworks because it seems more like an afterthought and the first party support is usually patchy. I relate with the library struggle though, especially when there's no @types for it

2

u/MrJohz Sep 20 '18

TypeScript works pretty well with React. It's not perfectly documented, but the types are all there. Sometimes it's a bit of effort to work out exactly which type you should be using for something, if there's maybe a couple that fit.

The biggest issue is that React encourages you to depend more on smaller packages for the specific utilities you need (unlike Angular, which tends to go more down the 'here, have everything' route). That inevitably leads to more missing @types issues, which is irritating, but I always figure that if a package doesn't have typedefs written for it, it's probably not going to be well-enough maintained that I should be relying on it.

I've had a couple of issues with ImmutableJS, which is often seen in React-world. Basically, the types don't brilliantly support the idea of ES6 classes extending the ImmutableJS records, which is a shame because it's often a useful pattern for explicitly defining the model of your structure. The latest bleeding-edge RC version does fix almost all of these problems... but then it's bleeding-edge stuff again and last I checked the maintainer seems to have disappeared a bit. That said, there are plenty of other options if you are going to go down the immutable state route, so it's not like there's nothing out there.