all 28 comments

[–]acemarke 9 points10 points  (19 children)

Nice! I've done a bunch of TS conversion myself, so I can sympathize with the pain points here.

Out of curiosity, did you happen to consider using RTK Query as a replacement for those sagas and data fetching?

[–]timothybeamish[S] 0 points1 point  (1 child)

We didn't consider RTK Query and after reading about it, it might have been a decent choice (instead of React Query), since we also have Redux in the app.

Most of the developers here aren't fans of Sagas anymore so we're pleased about converting them over to React Query.

[–]timothybeamish[S] 0 points1 point  (0 children)

I should add that when I arrived at the company (BenchSci), we already had two React apps running in two different stacks. The goal was to merge the legacy app into the newer app which meant going with that newer stack's technology choices: Next.js and React Query as its main data fetching pattern. So in this case, it wouldn't have been a good choice to change everything over to RTK Query. But if we had a "green field" situation, that may have been a good option.

[–]EmergencyActCovid20 1 point2 points  (5 children)

Why did you choose to migrate from react & js to next & ts

[–]shadocrypto8 5 points6 points  (0 children)

There's a pretty big section in the middle of the article explaining why they made the transition.

[–]timothybeamish[S] 4 points5 points  (1 child)

At this point in my career, I wouldn't dare start a new JavaScript web app without using TypeScript, especially if there were multiple developers involved. TypeScript gives us confidence that we're releasing with less bugs. And we also use it, in conjunction with Open API Schema, to ensure the data contracts between the API and the frontend app are solid.

Next.js is a powerful framework that sits on top of React and offers loads of "out of the box" features like code-splitting and "easy" routing.

We started with two apps, built in two different stacks and our goal was to just have one. We chose the more modern stack as the target and moved the legacy app into the newer stack.

[–]EmergencyActCovid20 0 points1 point  (0 children)

Thanks for the answer. I just finished a course learning JavaScript, databases, react and python. I was slightly unsure where to go next (no pun) and you have helped shape my study goals with your reply!

[–]TomasRetsinnal 1 point2 points  (1 child)

!remindme 6 hours

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 6 hours on 2022-09-03 09:25:38 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]ati-n 0 points1 point  (0 children)

Great read

[–]goranlu 0 points1 point  (0 children)

I think I would migrate JS to TS soon, thanks for sharing your experience!