Skip to content

TypeScript Roadmap: January - June 2019 #29288

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Roadmap Overview

This roadmap is meant to give our team and users clarity over our priorities over the next 6 months. It's meant more as a set of guidelines than as a strict set of tasks we are bound to finish. We may adjust over this period depending on changing needs and feedback from our users.

At a high-level, we're going to be focusing on the following 5 goals:

  • Types on every desk, in every home, for every JS developer
  • Productivity through strong tooling
  • Approachability and UX
  • Community engagement
  • Infrastructure and engineering systems

How do we plan to tackle this? While much of what we do ties into other domains, the how is broken down into the following sections which this roadmap will dive into:

Language design and innovation

TypeScript and the core type system

  • Enabling popular JS patterns in a type-safe way
  • Increasing expressivity
  • Proving relationships between types
  • Stricter settings
  • Implementing ECMAScript features

This is a continuous and iterative process. The goal of TypeScript's type system is to statically model patterns in JavaScript in a reasonable way while catching bugs and enforcing correctness. As more features are added to ECMAScript, and as we notice emerging patterns in the ecosystem, we have more work to do, and because the JavaScript world moves fast, so must we.

Something that may be surprising is "proving relationships between types". In a sense, this is our team generalizing patterns between type operators and encoding that in our type relationships. It's effectively having the compiler do algebra so that things "just work" when users use our type operators.

Back to top

JavaScript: TypeScript beyond TypeScript

  • Understanding more dynamic patterns
  • Making the JavaScript editing experience better
  • Automating the addition of JSDoc types
  • Smoothing the transition to TypeScript

TypeScript isn't just for TypeScript anymore. Our userbase now includes the JavaScript ecosystem as a whole, whether they are

  • using .js/.jsx files in editors powered by TypeScript,
  • compiling purely with allowJs.
  • type-checking with checkJs (also enabled by the // @ts-check comment), or
  • transitioning to TypeScript

Whoever these users are, we believe TypeScript can serve them in some way.

Back to top

Committee representation

  • Class fields (public and private)
  • Decorators
  • ES/CJS module interop
  • Null propagation/coalescing
  • Pipeline
  • Protocols
  • Class static blocks

We are involved in several different committees, including TC39 and the Node modules group. We try to provide representation as

  • implementers of TypeScript, the type-checker
  • implementers of JavaScript language services & tooling
  • a voice for the users of both of the above

Currently we're prioritizing forward compatibility with proposals/features that we've adopted early on, but we want to be involved in other above features both because we want to ensure that ECMAScript continues to grow in a way that makes developers' lives easier.

We have no plans to implement any proposals unless they hit stage 3 and we have high confidence in them.

Developer productivity tools and integration

Editor productivity

  • "Proactive" quick fixes (i.e. suggestions)
  • Declaration file fixes and refactorings
    • Generate missing .d.ts files
    • Locally fork @types package
  • "Bread and butter" fixes & refactorings
  • Migration tooling
More details here

These "bread and butter" quick fixes and refactorings refer to a class of code modifications and fixes that are applicable to most users, and generally improve everyone's quality of life. This functionality is also useful for teaching users about language features and patterns, and can make working with TypeScript/JavaScript more approachable.

Whereas many of our quick fixes are "reactive" (i.e. they are created and triggered after a user has seen a definite error), "proactive" fixes are a way of taking the experience a step further where TypeScript can analyze code and can surface suggestions and code changes for improvements rather than to fix an error. As an example, as of TypeScript 3.2, we can detect implicit `any` types even outside of `noImplicitAny` and offer up a fix to infer an appropriate type.

Beyond that, we have more targeted workflows in mind. A lot of our recent feedback around TypeScript has been that dealing with declaration files is still the most painful part of the workflow - specifically around adding declarations when they don't exist on DefinitelyTyped, and fixing erroneous declaration files. We want to investigate whether there's a good workflow we can provide here.

Another targeted workflow is migration. We'll be investing in ways to ease migration to TypeScript and typed JavaScript as we believe there is still work to be done here to smooth out the process of adding types.

Back to top

Linting

  • Semantic rules in ESLint
    • Parity with TSLint
    • Speed & scalability
  • Editor integration for ESLint

In a survey we ran in VS Code a few months back, the most frequent theme we heard from users was that the linting experience left much to be desired. Since part of our team is dedicated to editing experiences in JavaScript, our editor team set out to add support for both TSLint and ESLint. However, we noticed that there were a few architectural issues with the way TSLint rules operate that impacted performance. Fixing TSLint to operate more efficiently would require a different API which would break existing rules (unless an interop API was built like what wotan provides).

Meanwhile, ESLint already has the more-performant architecture we're looking for from a linter. Additionally, different communities of users often have lint rules (e.g. rules for React Hooks or Vue) that are built for ESLint, but not TSLint.

Given this, our editor team will be focusing on leveraging ESLint rather than duplicating work. For scenarios that ESLint currently doesn't cover (e.g. semantic linting or program-wide linting), we'll be working on sending contributions to bring ESLint's TypeScript support to parity with TSLint. As an initial testbed of how this works in practice, we'll be switching the TypeScript repository over to using ESLint, and sending any new rules upstream.

Back to top

Speed, scalability, and stability

  • Automatically unloading projects in TSServer
  • Composite project polish & fixes
  • Addressing performance issues
    • ETW support
    • Benchmarking infrastructure
    • Tracking down and fixing regressions
  • Automated testing infrastructure for TSServer
More details here

With composite projects, we introduced a "smarter" way to build co-located TypeScript projects for scenarios such as monorepos, "serverless" apps, etc. Part of the goal of composite projects was faster builds with seamless editor experience. We'll be continuing there, polishing the experience and making improvements like functionality for automatically swapping projects in and out to save memory.

In part because JavaScript users typically lack any sort of project configuration, we have seen some poor performance (especially for users in Visual Studio), and as such we'll be making this a near-term priority.

Over the last few versions of TypeScript, we've also seen some emit-time regressions. We're going to be investigating what happened to cause this, which includes setting up infrastructure to track the regression and hunting down the original problem.

Back to top

Command line experiences

We've consistently been asked for ways to automatically apply the sorts of code transformations that our quick fixes and refactorings use. Similarly, users have asked us for ways to trigger operations like "organize imports" or "format file" so that they can be used in pre-commit hooks. We want to investigate surfacing language service operations on the command line.

In the past, we've deferred to providing our users with APIs that they can consume. This has worked to some extent, encouraging users to create projects like tsfmt. In practice, we haven't seen that much of this.

In the meantime, we've seen projects like Prettier and jscodeshift sprout up, both with TypeScript support. These tools specialize specifically in their respective areas (formatting and code transformation), so we don't necessarily see ourselves as "competing" with these in any way; but if TypeScript drives the fundamental editing experience for TypeScript and JavaScript users, it feels like there's a gap to be filled between what happens in the editor and what happens during commits & CI, so we want to see what we can bring users here.

Education and UX

New handbook

  • Writing tailored intros for developers with different backgrounds
  • Writing new core handbook
  • Reference pages
  • Infrastructure to replace look & feel, and subsume current publishing process
  • Documentation around checkJs
More details here.

We've long had a comprehension and perception problem from our handbook. If you look at our documentation today, union types come way too late in handbook under a section called "advanced types". It also assumes too much about terminology. Additionally, TypeScript is often perceived as a language that pushes JavaScript developers to write object-oriented code, and we suspect this is because our documentation and examples focused on newer ECMAScript features like classes (partially to demonstrate down-leveling features, and partially because we lacked union types early on). We're overdue for some changes.

Over the next few months, we'll be working on a new version of handbook. Writing a general document for all users is difficult because the audience for TypeScript is broad, and one of the strengths (and weaknesses) of the current handbook is that it tries to serve everyone at once. We have several different groups of developers who have different expectations when learning TypeScript, and we need to adjust the level of exposure of different concepts. Given that, our goal is to organize the handbook into three different parts:

  1. Tailored introductions (setup for the core handbook)
  2. The core handbook (everyone reads this)
  3. Reference pages (kind of like deep-dives/appendices)

Our idea here is to segment developers and create a custom introduction to TypeScript for different groups. These buckets would include

  • Complete novices
  • Background mainly in JS (or another dynamically-typed language)
  • Background mainly in statically-typed OO languages
  • Background mainly in statically-typed FP languages
  • Background with many different languages (i.e. the "veteran" developers)

Once developers get past the intros, they are directed to the core handbook. The core handbook makes no assumptions about other languages, just a reasonably comfortable understanding of JavaScript. Users who read through the documentation of the handbook should never feel overwhelmed by details (the tone of the core handbook should be informal), and should be able to dive into most TypeScript codebases and feel comfortable contributing.

Users who are looking for precise behavior and descriptions of TypeScript, on the other hand, will have a new section called "reference pages". These reference pages should have precise language and clear examples without impacting readability.

Back to top

Error and type display UX

  • Interactive diagnostics and quick info
  • "Smarter" diagnostics
  • More related error spans
More details here

Error UX is a subtle but fundamental part of comprehending what the type system is doing. Over the past few years, TypeScript has accumulated what one could call "UX debt". As our type system has become more advanced, our UX hasn't kept up. To catch up, in the last 3 versions of TypeScript (3.0, 3.1, and 3.2) we worked on several different batches of error message improvements.

The community response has been overwhelmingly positive and has validated the original feedback we received from talking directly to users. As we try to serve more inexperienced users, we need to guide them to solutions quickly with precise but approachable error UX. This includes prioritizing misleading error messages that users file, and thinking deeply about what the heck is going wrong on the scarier messages. But it also opens up the opportunity for creative new ideas. For example, can we can have editors surface a more approachable experience, where users only see the full explanation of an error on demand.

Back to top

Playground and website

  • Update examples to less OO-heavy/ESNext style
  • Playground
    • Editable tsconfig.json
    • Serialized playground settings
    • Nightly playground releases via CDNs

In addition to the handbook, we need to make adjustments to the website. Our playground will need an update, and will need an update to the examples.

Community investment

DefinitelyTyped

More details here

DefinitelyTyped is now such a core part of the JavaScript and TypeScript ecosystem. First and foremost, it's what actually lets TypeScript users interoperate smoothly with JavaScript libraries. But beyond that, it now powers the JavaScript editing experience across several different editors.

Today, DefinitelyTyped is the 10th most popular open source project on GitHub. That means there's a lot of traffic. When it comes to our team, we see our primary role not in authoring declaration files, but as building out the tools for others to do so. That includes our weekly PR rotations (where members of our team review external PRs to DefinitelyTyped) and DefinitelyTyped's surrounding infrastructure such as the types publisher, dtslint, and dt-mergebot.

As described in the productivity section of this document, we also have some ideas to make the offhand authoring process easier.

Back to top

External contributors

  • Easier contributions to the docs
  • Open contributions to the playground and website
  • Automated PR process on TypeScript

Back to top

Partner teams

We continue to elicit feedback from various partner teams, including library authors and organizations/individuals using TypeScript in interesting or broadly applicable ways. This gives us insight on various things we could improve. If you or your organization have any interesting feedback, we'd probably love to hear from you!

Back to top

API Consumers

  • Rolling requests for API endpoints
  • Investigate improving rich editing experiences
    • in enhancing plugins like IntelliCode
    • in templates

Back to top

Outreach

  • Public talks
  • Meetup attendance
  • In-depth blog post content
  • Help with TSConf coordination

We want to encourage members of our team to be involved with the community, and write and talk about things that they find interesting. This keeps us close to our users and makes the project itself more approachable.

Internal engineering

Team infrastructure

  • Faster builds
    • Always use the LKG to build the compiler.
  • Better testing across external repositories

Everything that aids us in our day-to-day development and publishing processes around TypeScript is continuously valued. Making builds faster (e.g. converting our builds not to bootstrap themselves outside of CI), adding/migrating our lint rules, and adding new benchmarking infrastructure are things.

The idea here is really anything that improves

  • stability
  • productivity
  • ease of contribution

for development on the TypeScript project and any of our satellite projects.

Back to top

Organizational guidance

  • Internal guidance on TypeScript-first API designs
  • Providing internal partner teams with best practices for projects
  • Addressing major Microsoft-internal build regressions

Because we have the expertise, and because we are involved with the JavaScript community, we're able to provide a level of guidance across Microsoft to give users better experiences all around. Additionally, when we hear about major build regressions on large codebases, our internal teams can provide us with their source code, allowing us to create minimal repros (which is not always the case with external closed-source codebases). This work usually benefits external users in some way, whether it's because a bug fix generalizes, because we've produced better APIs, or because we've been able to extract new guidance.

Back to top

Metadata

Metadata

Assignees

No one assigned

    Labels

    PlanningIteration plans and roadmapping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close