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
Conversation
Type in commit message: "... is made is min version." |
There was a problem hiding this 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.
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 { |
There was a problem hiding this comment.
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
packages/compiler-cli/src/ngc.ts
Outdated
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 { |
There was a problem hiding this comment.
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.
packages/compiler-cli/package.json
Outdated
@@ -5,13 +5,14 @@ | |||
"main": "index.js", | |||
"typings": "index.d.ts", | |||
"bin": { | |||
"ngc": "./src/main.js", | |||
"ngc": "./src/main2.js", |
There was a problem hiding this comment.
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.
packages/compiler-cli/src/main2.ts
Outdated
@@ -0,0 +1,15 @@ | |||
#!/usr/bin/env node |
There was a problem hiding this comment.
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.
657407a
to
78746ee
Compare
You can preview 657407a at https://pr18494-657407a.ngbuilds.io/. |
You can preview 78746ee at https://pr18494-78746ee.ngbuilds.io/. |
2f102a4
to
8446780
Compare
You can preview 8446780 at https://pr18494-8446780.ngbuilds.io/. |
You can preview d98dec6 at https://pr18494-d98dec6.ngbuilds.io/. |
You can preview 4519541 at https://pr18494-4519541.ngbuilds.io/. |
You can preview 139d1cd at https://pr18494-139d1cd.ngbuilds.io/. |
1fd12cf
to
fe1619d
Compare
You can preview fe1619d at https://pr18494-fe1619d.ngbuilds.io/. |
You can preview 3a30501 at https://pr18494-3a30501.ngbuilds.io/. |
You can preview 660c1a5 at https://pr18494-660c1a5.ngbuilds.io/. |
8d3b6d7
to
58a56ac
Compare
You can preview 7d36393 at https://pr18494-7d36393.ngbuilds.io/. |
You can preview e030c78 at https://pr18494-e030c78.ngbuilds.io/. |
You can preview 834c1ee at https://pr18494-834c1ee.ngbuilds.io/. |
You can preview a5fb931 at https://pr18494-a5fb931.ngbuilds.io/. |
You can preview 21eeffc at https://pr18494-21eeffc.ngbuilds.io/. |
Approving for platform-server changes |
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. |
@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 } } ```
You can preview e772479 at https://pr18494-e772479.ngbuilds.io/. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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:TODO: