Fire-Side Chat with Kent C. Dodds

Rate this content
Bookmark

FAQ

The pandemic didn't really impact my career much because I was already doing a lot of remote work, like workshops. However, it did shake things up with my kids starting school at home.

The time required depends on the size of the project and the team's experience. Migrations are tough, so it's essential to do it iteratively rather than all at once. Starting with a loose TypeScript setup and gradually tightening it as you get more comfortable is advisable.

Yes, Next.js is a solid framework and widely used. However, I'm personally excited about Remix, which offers unique features not found elsewhere. Remix is still in developer preview, but it's worth keeping an eye on.

For component libraries, focus more on integration tests rather than unit tests. Render the component and interact with it to ensure it works as expected. Avoid unnecessary unit tests for simple components like buttons.

100% code coverage is often not practical for applications. Instead, focus on use case coverage to ensure you're testing real-world scenarios effectively. Code coverage reports can remind you of untested paths, but don't aim for 100% just to satisfy a metric.

Be nice and improve your communication skills. Being nice makes people want to work with you, and good communication helps you articulate your accomplishments and career goals effectively.

React Testing Library is tested using similar principles as any other code. We write tests that resemble the way the software is used, including calling functions like render and getByText to ensure they work correctly.

Yes, I recommend linting and typing your tests. There are linter plugins for testing libraries that help you write better tests, and writing tests in TypeScript can provide additional benefits despite occasional annoyances.

Practice and actively share your work. While I don't have specific resources, the Soft Skills Engineering podcast offers excellent advice on improving communication and other soft skills in tech.

For critical RTL features, visual regression testing tools like Applitools or Percy.io are recommended. These tools use advanced AI to reduce flakiness and ensure your interface works correctly in different locales.

Kent C. Dodds
Kent C. Dodds
31 min
14 May, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Kent C. Dodds discusses various topics including migrating projects to TypeScript, Next.js and Remix, testing libraries, RTL testing with React Testing Library, integration testing for component libraries, testing design systems, writing tests, communication resources, and the popularity of Hooks in React development.

1. Introduction and Personal Background

Short description:

Hello! Hey Kent, how are you doing? I'm doing great! It's a beautiful morning here in Utah, kind of rainy, but my wife likes the rain, so I'm happy. Happy wife, happy life! And of course happy kids with managing four kids. Yeah, like I said, crazy managing that with your career.

Hello! Hey Kent, how are you doing? I'm doing great! It's a beautiful morning here in Utah, kind of rainy, but my wife likes the rain, so I'm happy. Happy wife, happy life! And of course happy kids with managing four kids.

Yeah, like I said, crazy managing that with your career. Yeah, they're great! I know that you are really happy with your kids, and I'm also happy with my kids of course, but how are you managing now with the pandemic? They're probably more at home and managing your career is that difficult or is it okay now? You know, I was already doing a lot of remote stuff before the pandemic hit, lots of remote workshops and things, and so the pandemic didn't really impact my career a whole lot in that regard. I mean everybody was impacted and my kids started doing school at home and everything, so it shook everything up, but yeah, I wasn't impacted as much as everybody else. Good to hear that. So, as much as I would love to talk about your kids, I also have a son, and yeah, like to talk about it, I think our audience is not here for talking about your kids. They want to talk about testing, and so a few weeks ago we've sent out a tweet that people can ask some questions that they want us to discuss, and the first one is from Peter Hozak.

2. Migrating Projects to TypeScript

Short description:

You are migrating some of your projects to TypeScript. Migrations are always tough, so it's important to consider the size of your project and the experience of your team. I recommend starting with loose TypeScript and gradually adding stricter rules over time. Avoid the Big Bang strategy to maintain good relationships with your colleagues.

You are migrating some of your projects to TypeScript. What are the biggest pain points for you so far, and what can you recommend to the people or teams who are not yet decided whether to start the migration in their projects? How time-consuming would you say it will be?

Ooh, so it will be relative to the size of your project and the experience of your team, so I can't really tell you exactly how time-consuming it would be. Migrations are always really tough. You have to take that with a grain of salt. I actually have a blog post about engineering and business alignment and how important it is that you do what's best for the business, not just what you want to do. It's actually a pretty good blog post. You can go take a look at it at kentcdots.com slash blog.

As far as recommendability, I definitely recommend it. I think it's a great idea. There are some strategies that you can use. To be clear, I haven't ever... I'm trying to remember. I think we actually did migrate one of our projects at PayPal to Flow. That was in process as I was leaving. But here are a couple of tips. First off, it doesn't have to be perfect, especially if you're just learning TypeScript. So I would not turn on strict mode. It's actually similar to adding ESLint to a project that's never had linting. I wouldn't recommend it enabling all of the rules and fixing it all in one giant PR, but rather disable most of the rules, and then over time, you add them as warnings, and then you fix things here and there, and then you turn them on as errors or whatever. So in the same way, just make your TypeScript really loose at the very beginning, especially if you don't know TypeScript very well. You don't want to just spend a ton of time writing your types, and they end up misleading you, and you write it poorly because you're new at TypeScript. So throw an unknown there, throw in any here, whatever you need to do to get it going, and then come back later when you know TypeScript better. So yeah, I would recommend it. I would recommend it iteratively over time rather than just one giant PR, but yeah, I think it's a good idea.

Yeah, that's also my experience. Going with a Big Bang, I mean, besides that it just takes a lot of work from you, you're going to send that PR to someone and he's going to be your arch enemy after that, right? If you want to keep friends with your colleagues, then don't do the Big Bang, even if it's a small project, like Migrant TypeScript, even though it's really valuable, it is a lot of work and yeah, don't go with the Big Bang strategy.

Next question. What a different story. You're getting Big Bang prettier all day. Next question is from Behzad.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

React 19 Panel Discussion
React Summit 2024React Summit 2024
27 min
React 19 Panel Discussion
Ryan Carniato
Evan Bacon
Sathya Gunasekaran
Tim Neutkens
Brooks Lybrand
5 authors
The Talk revolves around React 19 and the React compiler, highlighting its new APIs, optimizations, and impact on frameworks like Next.js. The React compiler has undergone multiple iterations, resulting in improved performance and alignment with developers' expectations. The integration of React with Next.js simplifies rendering and offers free optimizations. There is excitement about the opt-in approach of React Server Components and the potential of underrated features like suspense and transitions. Overall, React's influence on the JavaScript ecosystem and UI libraries is acknowledged and appreciated.