Closed
Description
Add TypeScript support to AMP and allow new extensions to be written in TypeScript.
Motivation
Given the increasing maturity and popularity of TypeScript and potential developer productivity benefits, we'd like to experiment with TypeScript support in AMP.
Requirements
- Supports existing toolchain, particularly Closure Compiler usage
- Supports piecemeal adoption (with a rollback plan in case this I2I is rejected)
Proposal
- Experiment: Allow new extensions to be written in TypeScript, which will be transpiled to Closure-annotated JS via tsickle as a preprocess to our normal compilation pipeline.
- Gather data: Ship at least one new AMP extension written in TypeScript and collate pros/cons of development experience. Survey AMP community on TypeScript vs. JavaScript preferences.
- Convert: If gathered data is supportive, add support for incremental transpilation for remaining source and convert existing JS to TS file-by-file.
Activity