Skip to content

[Master feature] TypeScript in AMP #13791

Closed
@dreamofabear

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

  1. 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.
  2. 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.
  3. Convert: If gathered data is supportive, add support for incremental transpilation for remaining source and convert existing JS to TS file-by-file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions