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

Adds the TypeScript transformer #7191

Merged
merged 67 commits into from
Mar 18, 2016
Merged

Conversation

rbuckton
Copy link
Member

The TypeScript transformer is designed to remove or transform most TypeScript-specific syntax.

This transformer elides TypeScript-specific nodes such as:

  • Interfaces
  • Type Aliases
  • Type Annotations
  • Ambient Declarations
  • TypeScript-specific modifiers (e.g. abstract, public, private, etc.)
  • implements heritage clauses on classes
  • Type assertions
  • Type parameter lists
  • Type argument lists

In addition, it transforms TypeScript-specific syntax into compatible down-level syntax, including:

  • Decorators
  • Async Functions
  • Property Declarations
  • Parameter property initializers
  • Enums
  • Namespaces
  • Exported declarations inside of a Namespace.

Some TypeScript-specific syntax will remain, specifically import and export declarations that will be handled directly by a later module transformation.

Related Pull Requests:

Review on Reviewable

@rbuckton rbuckton changed the title Adds a TypeScript to ES7 transformer Adds the TypeScript transformer Feb 23, 2016
@DanielRosenwasser
Copy link
Member

Review status: 0 of 12 files reviewed at latest revision, 9 unresolved discussions, some commit checks failed.


src/compiler/transformers/destructuring.ts, line 23 [r1] (raw file):
"highlight" is vague, I can't tell if this is for a future correspondence between transformations or sourcemaps or something else


src/compiler/transformers/destructuring.ts, line 28 [r1] (raw file):
This gets a little hard to read. Please use complete sentences.


src/compiler/transformers/destructuring.ts, line 40 [r1] (raw file):
I don't see the definition of inlineExpressions.


src/compiler/transformers/destructuring.ts, line 231 [r1] (raw file):
Cache length, use below


src/compiler/transformers/destructuring.ts, line 267 [r1] (raw file):
You already have numElements above


src/compiler/transformers/destructuring.ts, line 279 [r1] (raw file):
numElements


src/compiler/transformers/destructuring.ts, line 300 [r1] (raw file):
These are getting somewhat difficult to reason about. The variable is named object, but that's vague enough that I though this was an object literal or binding pattern for whatever reason.


src/compiler/sourcemap.ts, line 70 [r1] (raw file):
I don't know what this is, leave a hefty comment on what it is and why I need it.


src/compiler/transformer.ts, line 29 [r1] (raw file):
Should we conditionally transform modules? Or is it better to unconditionally transform just in case?


Comments from the review on Reviewable.io

@DanielRosenwasser
Copy link
Member

Review status: 0 of 12 files reviewed at latest revision, 10 unresolved discussions, some commit checks failed.


src/compiler/transformers/ts.ts, line 210 [r4] (raw file):
Just write "they will be emitted as part of transformClassDeclaration"

If these constructs are taken care of by transformClassDeclaration, shouldn't these branches be unreachable?


Comments from the review on Reviewable.io

rbuckton and others added 26 commits March 1, 2016 15:59
rbuckton added a commit that referenced this pull request Mar 18, 2016
@rbuckton rbuckton merged commit ca9148e into transforms-printer Mar 18, 2016
@rbuckton rbuckton deleted the transforms-transformer-ts branch March 18, 2016 23:31
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants