Skip to content

Removal of type-checking support #194

@frankwallis

Description

@frankwallis

From version 7.0.0 onwards, plugin-typescript no longer supports type-checking, files are now only transpiled and the plugin will report on syntax errors but will not report any type-checking errors. Here I want to record the reasoning behind this and open it up for discussion.

typings - it was not possible to match the typescript compiler's file resolution algorithm in the browser as it can involve searching the file-system for external typings files included in packages.
@types - again typescript searches the file system to find declaration files in @types packages, this is not possible when compiling in the browser.
wildcards - tsconfig now supports specifying wildcards for files to be included in the build.
fetch - in order to type-check a file the plugin needs to fetch declaration files and elided typescript files outside of the runtime javascript dependency tree. SystemJS no longer supports fetching files and other ways of injecting these files can affect the order that files are actually executed at runtime.
complexity - the added complexity needed to support type-checking was having a negative impact on transpiler support, for example it was hard to introduce package-level typescriptOptions which is now available in 7.0.0.

Ultimately it was impossible for plugin-typescript’s type-checking to maintain parity with other typescript tooling and tsc itself. Because of the incompatibility with other tools, type-checking with plugin-typescript was no longer a setup I felt comfortable supporting and recommending to others. My advice is to use npm @types and perform type-checking in the IDE and using tsc itself, and use plugin-typescript to get a fast turnaround when developing in the browser.

I hope that 7.0.0 will be a strong and stable release and I welcome any feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions