This course tackles challenges in large-scale enterprise software, emphasizing productivity, cohesion, longevity, and complexity for TypeScript developers.
We'll code together to create a new library from scratch, and incrementally add build tools, linting, testing and even automatic API documentation
We'll look closely at the tsconfig we created for our library, examining a variety of the compiler options we enabled
A discussion of different concerns to optimize for, depending on whether you're building a library or an app
Converting to TypeScript: Integrate TypeScript into your build, rename files to .ts, and incrementally enforce stricter types. Progressively refine type information, enhance function and class types, and reduce usage of any. Aim for methodical, incremental changes, backed by tests.
We'll tackle steps 1, 2 and 3 in the TypeScript conversion process, by integrating TypeScript into our build tools, renaming our files to .ts, and getting rid of any implicit any types. We'll use this as an opportunity to learn how this kind of change can be made in many small PRs over a long period of time, as is common in large projects.
TypeScript's .d.ts declaration files, overlay type info on JS files. DefinitelyTyped, a community-driven repository, hosts over 6,000 type declarations. Challenges arise with versioning, but tools like Yarn's TypeScript Plugin ease the process.
We'll tackle step 4, and begin doing some domain modelling, and defining type information for things that are important to a slack app: user, team, channel and message
We'll take on Step 5 to add safety to nullish value and boolean expression handling
We'll add some type guards to our project, and use them as the all-important "glue" joining compile-time type-checking and runtime behavior
We'll learn about yarn workspaces, and how they provide an opportunity for simple but effective modular architecture in a large TypeScript projects.
We'll look closely at how we can write tests for type information, including negative test cases for things we want to ensure do not compile.