#typescript libraries

TypeScript libraries are collections of pre-written code that developers can use to solve common programming problems. The code is written in TypeScript, which is a superset of JavaScript, so it can be used in any JavaScript project. TypeScript libraries provide a way for developers to quickly and easily access useful code snippets without having to write them from scratch. This makes development faster and more efficient, while also ensuring that the code is reliable and well tested.
Vue.js London 2023Vue.js London 2023
30 min
Stop Writing Your Routes
The more you keep working on an application, the more complicated its routing becomes, and the easier it is to make a mistake. ""Was the route named users or was it user?"", ""Did it have an id param or was it userId?"". If only TypeScript could tell you what are the possible names and params. If only you didn't have to write a single route anymore and let a plugin do it for you. In this talk we will go through what it took to bring automatically typed routes for Vue Router.
TypeScript Congress 2023TypeScript Congress 2023
16 min
Unleashing Object Proxies: Building Type-Safe Wrappers for Anything
You must or must not have heard of object proxies before, but have you ever understood how to use them? What the actual usecase of an object proxy is? In this talk, we will do a deep dive into object proxies, understanding how they work, and the kinds of things you can build using them. We will build higher-order wrappers for existing libraries, and learn how to wrap over them in a type-safe manner.
TypeScript Congress 2023TypeScript Congress 2023
7 min
TypeScript Survival Guide: Life-Saving Tips and Techniques
Let's go through your survival kit for the TS jungle! In this talk, you'll get the complete TS guide from simple tips to complex techniques that will help you take the most of TypeScript not only in those large production projects, but also in your small hobby idea. We'll explore validations, configuration, typings and much more.
TypeScript Congress 2023TypeScript Congress 2023
23 min
Are the (module) types wrong?
Have you ever installed a dependency, imported it just like the README instructs, and immediately been met with strange TypeScript errors about default imports, the output module format, or ESM/CommonJS interoperability? When everything works at runtime but TypeScript complains, you might wonder, is this a TypeScript bug? Or… are the types wrong?
The JavaScript module and package publishing landscape is complicated. Nearly one third of the most popular types-included npm packages have some sort of module-related typings issue that can cause confusion for users. But things are starting to improve. In this talk, we’ll:
- explore how we got here—why are things complicated?
- develop a simple and accurate mental model for how TypeScript sees packages
- see how the `arethetypeswrong` tool can help catch issues before publishing
- look at trends in the `arethetypeswrong` data for popular packages over time
- discuss next steps for making the typed package ecosystem better
TypeScript Congress 2023TypeScript Congress 2023
8 min
The Potential of Higher-Kinded Types for Library Semantics
There is a wall that we all hit when developing more sophisticated types: how can I 'abstract out' certain commonalities in my type-level logic? How can I make my types more reusable and composable? How can I make my types more expressive?
This talk will introduce the fundamentals of Higher-Kinded Types, a compelling concept hitherto underutilized, and explore how they can significantly enhance the expressiveness of library semantics, leading to a more intuitive developer experience (DX). We'll demonstrate how HKTs can provide an elevated abstraction level, allowing you to model complex domain problems more naturally and in a type-safe manner.
Join us to understand how leveraging HKTs can elevate your TypeScript coding practice, optimizing the semantics and delivering a more potent and featureful library interface.
TypeScript Congress 2023TypeScript Congress 2023
20 min
Publishing TS Libraries for Fun and Profit
Publishing libraries to NPM is easy - just `tsc
npm publish` and you're done, right?
Whoops, you forgot proper ESM compat. And a user is asking for a UMD build. And it doesn't work in Webpack 4. And `moduleResolution: "node16"` can't find the types.
Publishing libraries today is _complicated_. We'll take a look at the many problems and questions you should consider when publishing a package, and some hard-earned possible answers to those questions.type
TypeScript Congress 2023TypeScript Congress 2023
8 min
Replacing Shell Scripts with Cross-Platform TypeScript
Shell scripts serve a useful purpose, but they have some downsides. What if we could overcome these issues and make our scripts more powerful by utilizing familiar cross-platform TypeScript? In this talk, we'll discuss why you should switch your shell scripts to TypeScript and demonstrate a possible approach.
TypeScript Congress 2023TypeScript Congress 2023
12 min
Unlocking TypeScript's Potential: Exploring the Power of Ecosystem Tooling
Dive into the world of TypeScript ecosystem tooling and uncover the transformative capabilities that can supercharge your development workflow. In this talk, you can discover essential tools for project setup, code analysis, testing, and deployment. Also, learn how intelligent code editors, formatters, and linters improve code quality.
Finally, let's explore type checkers, static analyzers, and refactoring tools that enhance codebase maintainability, TypeScript libraries and frameworks, and witness their seamless integration with bundlers, task runners, testing frameworks, and CI pipelines. Don't miss this talk to unleash the full potential of TypeScript and maximize your productivity with the extensive ecosystem of tools at your disposal and that you probably didn't know!
TypeScript Congress 2023TypeScript Congress 2023
19 min
Migrating TypeScript to Modules: The Fine Details
In TypeScript 5.0, the TypeScript toolchain migrated to modules. In this talk, we'll get deep in the weeds, discussing what "modules" even are (and how we somehow weren't using them), the specifics of the migration itself, how we managed to make the switch "mid-flight" on an actively-developed project, how the migration went, and what's next.
TypeScript Congress 2023TypeScript Congress 2023
12 min
Enhanced AST Static Analysis with Typescript Language Server
Most of the ecosystem tools, like bundlers or transpilers, are based on AST. And Typescript provides one of the best Developer Experiences to work with the code base.
This talk is about the experience of how beneficial it can be to use Type Hints and Typescript Language Server during the AST and static code analysis, based on the example of building a compile-time css-in-js library.
TypeScript Congress 2023TypeScript Congress 2023
10 min
Running TypeScript in WebAssembly on the Cloud
Build serverless functions in TypeScript, and then compile them to WebAssembly (Wasm) to be run in the cloud. This is a different model than the original Wasm design suggested, but it is proving to be a powerful concept. In this talk, we dive into the background of Wasm, then look at its broader applications before examining a novel way of building TypeScript code into a Wasm binary for execution in the cloud.
TypeScript Congress 2023TypeScript Congress 2023
34 min
TypeScript Performance: Going Beyond the Surface
Do you ever find yourself pondering how to identify and address performance issues in TypeScript to maximize the effectiveness of your code? If so, join us for a talk on the performance of TypeScript and the techniques you can use to get the most out of your code. We'll delve into various ways to debug performance, explore how to leverage the power of the TypeScript compiler to detect potential performance issues and use the profiling tools available to track down the underlying bottlenecks.
TypeScript Congress 2023TypeScript Congress 2023
24 min
Generating types without climbing a tree
How do you generate types dynamically? How do you write a script that creates some typescript code? The approach most people would recommend is to use Abstract Syntax Tree manipulations. I was working on a deadline to implement types for our OpenAPI client, and I would have missed our release window. I needed something different and easier to build. Luckily, a friend recommended me a library I didn't know: code-block-writer. I fall in love with it at first sight.
TypeScript Congress 2023TypeScript Congress 2023
25 min
Let's Make a Generic Inference Algorithm
How does generic inference in TypeScript work? For most people, this can seem like a black box. TypeScript's developer lead, Ryan Cavanaugh, walks us from a simple single-step generic inference algorithm up to a simplified model of how generic inference in TypeScript actually works, with a focus on motivating examples.
TypeScript Congress 2023TypeScript Congress 2023
28 min
The Lies We Tell Ourselves Using TypeScript
How safe is TypeScript's type safety? How much can you trust your statically typed code? Can you even consider TypeScript's type system "strong"? In this talk, we look at situations where TypeScript fails badly and learn why things have to be that way. We talk about trade-offs, workarounds, and ultimately solutions for all the damn, terrible lies we tell ourselves when using TypeScript.
TypeScript Congress 2023TypeScript Congress 2023
22 min
From Theory to Practice: harnessing Typescript for successful Atomic Design implementation
Everyone mentions the importance of code "scalability" and "maintainability" and how Typescript helps with it. But when I got started in tech, I remember struggling to find a practical "real-world" example with best practices.
My talk aims to provide such a practical, step-by-step example, sharing some of my learnings and shortcomings: crucially, how we leveraged typescript and atomic design - without over-engineering too early.ty
TypeScript Congress 2023TypeScript Congress 2023
18 min
How TypeScript is integrated in your editor
How can an editor ""automagically"" show type errors when you create a single TypeScript file without running ""npm install typescript"" or having a tsconfig.json file? Is a completion list build by your coding editor, TypeScript itself, or some other mysterious being? What is TSServer?
In this talk I will give you an overview of how the TypeScript server communicates with IDEs and other editors, delivering rich language features without ever running tsc.
TypeScript Congress 2023TypeScript Congress 2023
29 min
How to make our CLIs safer with types?
In this talk, we will explore the various issues encountered when building JavaScript CLIs, and demonstrate how TypeScript can address them and help us make our applications safer.
By the end of this talk, you'll understand how to abstract runtime validations type behind easy-to-use interfaces, and have all the tools you need to bring those benefits into your own CLIs at little cost - whether they are open-source projects, or internal tools.
TypeScript Congress 2023TypeScript Congress 2023
24 min
Faster TypeScript builds with --isolatedDeclarations
Type-checking a TypeScript codebase can be slow, especially for monorepos containing lots of projects that each need to use the type checker to generate type declaration files. In this talk, we introduce — for the very first time — a new TypeScript feature we are working on called “Isolated Declarations” that allows DTS files to be generated without using the type checker at all! This opens the door to faster declaration generation in TypeScript itself, as well as in external tools written in other languages such as ESBuild and swc. You'll see how to use this new option, and maybe (just maybe) you’ll be convinced about the benefits of explicit return types! Most importantly, we will show how Isolated Declarations enables parallel builds to spread work across your CPU cores to significantly improve the build speed of your TypeScript projects.
TypeScript Congress 2023TypeScript Congress 2023
31 min
Using TypeScript with Key/Value Databases
Key/value (KV) databases are becoming ever more popular in web applications. Their super-fast response times and ability to support eventual consistency reads make them especially well suited for apps running on globally distributed edge servers. But with how fast this tech is moving, you might not be fully up to speed on how to use this type of database with TypeScript. In this session, we'll explore good use cases for KV databases, examine several production deployment options, and demonstrate how to effectively hydrate TypeScript objects from values in a KV database.
TypeScript Congress 2023TypeScript Congress 2023
21 min
ArkType: Bringing TypeScript to Runtime
ArkType is a new runtime validator for TypeScript and the first library with the goal of making type syntax available 1:1 in JS with no compilation step.
It uses a carefully optimized static parser so that with each character you type, you'll see a list of completions, a clear ParseError, or your inferred type. At runtime, a simple definition like "string|number[]" will be transformed into a TypeNode that can be used to validate or transform inputs, compared to other TypeNodes, or combined with other definitions to form new TypeNodes.
This talk will cover the process of building ArkType, with a focus on the type-level parser and runtime type system, and demo some of the most exciting features like scopes, index signatures and generics.
TypeScript Congress 2023TypeScript Congress 2023
26 min
Infer multiple things at once with reverse mapped types
Learn about inferring with reverse mapped types to create great inferences for arguments that aggregate different items of the same shape. The technique can help you to introduce type-level relationships within objects and tuples. The talk will start with the introduction to the technique and will go through a couple of real-world-like examples of how this can be used to improve library types.
TypeScript Congress 2023TypeScript Congress 2023
26 min
Taming Language Models through TypeScript
You've probably played with bots like ChatGPT and used them to brainstorm. Maybe you've noticed that getting responses in the right structure or format has been a challenge. As people, we're okay with that - but programs are much more finicky. We've been experimenting with using TypeScript itself as a way of guiding and validating responses from language models.
TypeScript Congress 2022TypeScript Congress 2022
8 min
Type Safety at Runtime in Typescript
We all know, that TypeScript helps us in many ways. The compiler guides us during our work, ensuring, that every piece of data falls into a given place.
But there are some limitations. TypeScript was meant to help us during development time. After the compilation step, we still cannot be 100% sure what can happen during runtime...
Unless we do something about that and defend ourselves against unwanted runtime errors! This talk serves as an introduction to the problem and explains how we can face it to make our applications more error-proof.
TypeScript Congress 2022TypeScript Congress 2022
27 min
TypeScript and the Database: Who Owns the Types?
We all love writing types in TypeScript, but we often find ourselves having to write types in another language as well: SQL. This talk will present the choose-your-own-adventure story that you face when combining TypeScript and SQL and will walk you through the tradeoffs between the various options. Combined poorly, TypeScript and SQL can be duplicative and a source of headaches, but done well they can complement one another by addressing each other's weaknesses.
TypeScript Congress 2022TypeScript Congress 2022
25 min
TypeScript for Library Authors: Harnessing the Power of TypeScript for DX
Using real-life open-source examples, we'll explore the power of TypeScript to improve your users' experience. We'll cover best practices for library authors, as well as tips and tricks for how to take a library to the next level. This talk will cover: 
- how to leverage the type inference to provide help to your users; 
- using types to reduce the need and complexity of your documentation - for example, using function overloads, string literal types, and helper (no-op) functions; 
- setting up testing to ensure your library works (and your types do too!) with tools like tsd and expect-type; 
- treating types as an API and reducing breaking changes whilst shipping enhancements; 
- I'd draw on my experience with libraries like nuxt3, sanity-typed-queries and typed-vuex and show what we managed to do and what I'd do differently in future. 
TypeScript Congress 2022TypeScript Congress 2022
30 min
Lessons from Maintaining TypeScript Libraries
Maintaining widely-used JS libraries is already complicated, and TypeScript adds an additional set of challenges.
Join Redux maintainer Mark Erikson for a look at some of the unique problems TS library maintainers face, and how the Redux team has handled those problems. We'll cover:
- Tradeoffs of different ways to define TS types for a library
- How to target different versions of TS, and considerations for determining the supported version range
- Migrating existing JS libraries to TS
- Differences between writing "app" types and "library" types
- Managing and versioning public types APIs
- Tips and tricks used by types from the Redux libraries
- TS limitations and possible language-level improvements