This is awesome. If you were to do it again, would you use typescript again? Curious about the pros/cons.
This is awesome. If you were to do it again, would you use typescript again? Curious about the pros/cons.
You mean something other than javascript? or another language that ends up javascript ?
Was just curious what your thoughts/pain-points were having finished the project. I'm not super familiar with typescript but your code seems pretty clean and straightforward, especially compared to some other JS frameworks.
Well you can use typescript in other JS frameworks like react and Vue too but it's not their preference. I did a complete project with typescript and Vue 3 tho (there was not much doc for the Typescript version at the time ) and it was a bit better than JS version because I was used to ts by then. In general I like the structure of angular and how the framework handles the problems in more complicated projects
Nice! Thanks for the insight. I followed you on github, excited to see your next projects!
If you haven't tried it yet, Golang is worth playing with. We use it quite a bit at riot (on the backend) and it makes things like concurrency really easy. It's also fast as hell, statically typed like typescript and the ecosystem is pretty lightweight.
I know you're not asking me but my experience with Angular/Typescript has been pretty awful and this seems like a good opportunity to vent. All IMHO:
The amount of boilerplate that's needed, constantly, is insane. In Java I have tight IDE integration to create new classes, getters, setters. In Angular, you want to create a new component? That's 5 minutes of copy pasting, importing in 3 locations, creating 3 (yes, THREE different damn files). Have fun. You could use ng commands, but that's not actually a fix. e.g. you still need to import the new file everywhere you want to use it, and import everything you want to use in it
I don't like TS. "var foo: type" just feels broken. Classes, interfaces, and enums are so poorly implemented that you can't help feel it's all a result of the baggage of transpiling to JS. Lots of weird angular quirks too, like, want to use an enum in a template file? You can't without first creating an instance of that enum in the template's respective component...
The benefits that static typing should provide just don't exist. There's so many 'anys' floating around (from e.g. other JS libraries) that you're never actually sure at compile time whether things will break. And, IDE's don't seem to be as good in auto complete and error detection vs. e.g. IntelliJ / Eclipse for Java.
The entire ecosystem insane. You're using npm, webpack, some dev server, some linter, some IDE, some minifier, the TS transpiler, the Sass transpiler, the ng command line, a UI library (that you better hope was built to interface nicely with Angular), a bunch of 'old-school' JS libraries (that damn sure weren't built for Angular). And somehow all this is meant to work together. It doesn't. Each of these components have their own damn config, and sometimes the config can be config'd in 3 different ways, and naturally the method of config you're using is different to the first answer on SO for whatever change you want to make. Random senseless things just seemed to break, and whenever that happens, the rabbit hole that you have to dive into to try to fix it is insane. I don't think it's a reflection of my skill as a dev to admit that I've felt utterly lost even after hours of googling and research trying to fix some damn silly senseless issue when something dumb in that entire pipeline went wrong in a big Angular project.
This is my experience from a year ago, so maybe things have changed, and I'm happy to be proven wrong on all of these points. But for what it's worth I would never (voluntarily) go back to Angular.
I felt the same way about the npm ecosystem. From a security perspective all those dependencies are a nightmare. I did however love the original version of angular, it worked really nicely with lodash and didn't force the whole ecosystem on you. I moved from web dev to backend a few years ago and was surprised at how much simpler things were. I was intrigued by typescript because OP's code was more readable than most JS I've encountered and didnt seem to rely on a bunch of black-box libraries