Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Master feature] TypeScript in AMP #13791

Open
choumx opened this Issue Mar 3, 2018 · 5 comments

Comments

@choumx
Copy link
Collaborator

choumx commented Mar 3, 2018

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.
@choumx

This comment has been minimized.

Copy link
Collaborator Author

choumx commented Mar 3, 2018

@cramforce

This comment has been minimized.

Copy link
Member

cramforce commented Mar 6, 2018

I wish I had done this July 22nd 2015 :)

@choumx

This comment has been minimized.

Copy link
Collaborator Author

choumx commented Apr 3, 2018

Everyone, please fill out the public preliminary interest survey! 🙏

@choumx choumx added this to Feature Backlog in AMP HTML Project Roadmap via automation Apr 5, 2018

@choumx choumx changed the title TypeScript in AMP [Master feature] TypeScript in AMP Apr 5, 2018

@choumx

This comment has been minimized.

Copy link
Collaborator Author

choumx commented Apr 6, 2018

screen shot 2018-04-06 at 5 50 16 pm

Overall:
~15% disapprove, ~20% undecided and over 60% approve.

Positive sentiment:
Static typing should yield better productivity and less buggy code.

Negative sentiment:
Concerns about TS's longevity, learning curve, and opportunity cost of code migration.

See full survey results.

@ampprojectbot

This comment has been minimized.

Copy link
Collaborator

ampprojectbot commented Oct 16, 2018

This issue seems to be in Pending Triage for awhile. @danielrozenberg Please triage this to an appropriate milestone.

@choumx choumx modified the milestones: Pending Triage, New FRs Oct 16, 2018

@danielrozenberg danielrozenberg removed their assignment Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.