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

[5.x ONLY]feat(compiler-cli): make ngc use the new transformer pipeline #18494

Merged
merged 1 commit into from Aug 11, 2017

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Aug 2, 2017

closes #18388

The source map does not currently work with the transformer pipeline.
It will be re-enabled after TypeScript 2.4 is made the min version.

To revert to the former compiler, use the disableTransformerPipeline in tsconfig.json:

{
  "angularCompilerOptions": {
    "disableTransformerPipeline": true
  }
}

TODO:

  • figure out why the CI fails

@vicb vicb added area: core Issues related to the framework runtime action: review The PR is still awaiting reviews from at least one requested reviewer feature Issue that requests a new feature labels Aug 2, 2017
@tbosch
Copy link
Contributor

tbosch commented Aug 2, 2017

Type in commit message: "... is made is min version."

Copy link
Contributor

@tbosch tbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good when CI is green.

@mary-poppins
Copy link

You can preview 361b5f5 at https://pr18494-361b5f5.ngbuilds.io/.

@@ -115,9 +116,26 @@ class AngularCompilerProgram implements Program {
getLazyRoutes(cancellationToken?: ts.CancellationToken): {[route: string]: string} { return {}; }

emit({emitFlags = EmitFlags.Default, cancellationToken}:
{emitFlags?: EmitFlags, cancellationToken?: ts.CancellationToken}): ts.EmitResult {
{emitFlags?: EmitFlags, cancellationToken?: ts.CancellationToken}): tsickle.EmitResult {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid borrowing tsickle version of EmitResult. Consider introducing an ng.EmitResult

export function performCompilation(
basePath: string, files: string[], options: ts.CompilerOptions, ngOptions: any,
consoleError: (s: string) => void = console.error,
checkFunc: (cwd: string, ...args: any[]) => void = check, tsCompilerHost?: ts.CompilerHost) {
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should not use exceptions to report errors. Currently it reports errors through a callback using the try catch to translate the errors it receives from the compiler to calls to the callback (returning the exit code to use). The try catch should stay. Consider returning the additional information from tsickle and the exit code.

@@ -5,13 +5,14 @@
"main": "index.js",
"typings": "index.d.ts",
"bin": {
"ngc": "./src/main.js",
"ngc": "./src/main2.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making using the transform based compiler a flag that can be turned off if necessary but defaults to true.

@@ -0,0 +1,15 @@
#!/usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the old main and have the old main read the flag to decide which to use based on the flag.

@vicb vicb force-pushed the 0802-ngc branch 2 times, most recently from 657407a to 78746ee Compare August 2, 2017 22:18
@mary-poppins
Copy link

You can preview 657407a at https://pr18494-657407a.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 78746ee at https://pr18494-78746ee.ngbuilds.io/.

@vicb vicb force-pushed the 0802-ngc branch 2 times, most recently from 2f102a4 to 8446780 Compare August 3, 2017 00:07
@mary-poppins
Copy link

You can preview 8446780 at https://pr18494-8446780.ngbuilds.io/.

@mary-poppins
Copy link

You can preview d98dec6 at https://pr18494-d98dec6.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 4519541 at https://pr18494-4519541.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 139d1cd at https://pr18494-139d1cd.ngbuilds.io/.

@vicb vicb force-pushed the 0802-ngc branch 2 times, most recently from 1fd12cf to fe1619d Compare August 4, 2017 02:26
@mary-poppins
Copy link

You can preview fe1619d at https://pr18494-fe1619d.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 3a30501 at https://pr18494-3a30501.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 660c1a5 at https://pr18494-660c1a5.ngbuilds.io/.

@vicb vicb force-pushed the 0802-ngc branch 2 times, most recently from 8d3b6d7 to 58a56ac Compare August 8, 2017 02:53
@mary-poppins
Copy link

You can preview 7d36393 at https://pr18494-7d36393.ngbuilds.io/.

@mary-poppins
Copy link

You can preview e030c78 at https://pr18494-e030c78.ngbuilds.io/.

@vicb vicb added target: major This PR is targeted for the next major release and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Aug 10, 2017
@mary-poppins
Copy link

You can preview 834c1ee at https://pr18494-834c1ee.ngbuilds.io/.

@mary-poppins
Copy link

You can preview a5fb931 at https://pr18494-a5fb931.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 21eeffc at https://pr18494-21eeffc.ngbuilds.io/.

@vikerman
Copy link
Contributor

Approving for platform-server changes

@vicb vicb added the action: merge The PR is ready for merge by the caretaker label Aug 10, 2017
@vicb
Copy link
Contributor Author

vicb commented Aug 10, 2017

Travis is red because of aio. There is a pending PR that should fix this but it's not related to the changes from this PR.

@tbosch
Copy link
Contributor

tbosch commented Aug 11, 2017

@vicb please rebase, should get green now...

The source map does not currently work with the transformer pipeline.
It will be re-enabled after TypeScript 2.4 is made the min version.

To revert to the former compiler, use the `disableTransformerPipeline` in
tsconfig.json:

```
{
  "angularCompilerOptions": {
    "disableTransformerPipeline": true
  }
}
```
@mary-poppins
Copy link

You can preview e772479 at https://pr18494-e772479.ngbuilds.io/.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes feature Issue that requests a new feature target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants