There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?

27

Closed

Make the TypeScript Compiler extensible

description

It would be interesting to extend TypeScript in a more reliable fashion by allowing the compiler to be extensible. As a result, 3rd parties could leverage the published TypeScript version and, through the use of a composition or plugin model, extend TypeScript
along a well-defined API surface.

Ideally it would be a great benefit to have a mechanism where a plugin or extension author could subclass the Compiler, Scanner, Parser, Pull-Type Checker, Emitter, and other interesting internals, to add additional capabilities.

As a result, plugin authors could use the well-defined surface to add additional behavior to TypeScript, such as minification at compile time, extensions to the language, embed other languages, localize at compile time, emit debug or coverage metadata, refactoring,
etc., without needing to fork the entire codebase and find a means to keep the fork and the extensions in sync.

Please consider providing a published extensibility API for the TypeScript compiler, and a means to provide plugins either via command-line switches and/or by providing a global "plugins" folder in the TypeScript installation path.

There of course are open questions and likely concerns around forcing TypeScript into a well-defined API surface, which could make it more difficult to change the API to add future capabilities, as well as how plugins could effectively interface with tooling
such as the Visual Studio language extensions.

file attachments

As part of our move to GitHub, we're closing our CodePlex suggestions and asking that people move them to the GitHub issue tracker for further discussion. Some feature requests may already be active on GitHub, so please make sure to look for an existing
issue before filing a new one.

Another use case for this could be an attribute that makes all of a class' properties into knockout observables, or a way to control which method is used to implement inheritance (so I can use a JS framework's object.extend method instead of typescripts, for
specific classes instead of the current global hack)