Skip to content

Commit

Permalink
refactor(ivy): remove the tsc passthrough option (angular#32219)
Browse files Browse the repository at this point in the history
This option makes ngc behave as tsc, and was originally implemented before
ngtsc existed. It was designed so we could build JIT-only versions of
Angular packages to begin testing Ivy early, and is not used at all in our
current setup.

PR Close angular#32219
  • Loading branch information
alxhub authored and sabeersulaiman committed Sep 6, 2019
1 parent 36d0c37 commit fe25ac1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 125 deletions.
7 changes: 1 addition & 6 deletions packages/bazel/src/ngc-wrapped/index.ts
Expand Up @@ -184,15 +184,10 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
}

// Detect from compilerOpts whether the entrypoint is being invoked in Ivy mode.
const isInIvyMode = compilerOpts.enableIvy === 'ngtsc' || compilerOpts.enableIvy === 'tsc';
const isInIvyMode = compilerOpts.enableIvy === 'ngtsc';

// Disable downleveling and Closure annotation if in Ivy mode.
if (isInIvyMode) {
// In pass-through mode for TypeScript, we want to turn off decorator transpilation entirely.
// This causes ngc to be have exactly like tsc.
if (compilerOpts.enableIvy === 'tsc') {
compilerOpts.annotateForClosureCompiler = false;
}
compilerOpts.annotationsAs = 'decorators';
}

Expand Down
3 changes: 1 addition & 2 deletions packages/compiler-cli/src/transformers/api.ts
Expand Up @@ -196,11 +196,10 @@ export interface CompilerOptions extends ts.CompilerOptions {
* `false` - run ngc normally
* `true` - run the ngtsc compiler instead of the normal ngc compiler
* `ngtsc` - alias for `true`
* `tsc` - behave like plain tsc as much as possible (used for testing JIT code)
*
* @publicApi
*/
enableIvy?: boolean|'ngtsc'|'tsc';
enableIvy?: boolean|'ngtsc';

/** @internal */
collectAllErrors?: boolean;
Expand Down
6 changes: 2 additions & 4 deletions packages/compiler-cli/src/transformers/program.ts
Expand Up @@ -27,7 +27,6 @@ import {getAngularEmitterTransformFactory} from './node_emitter_transform';
import {PartialModuleMetadataTransformer} from './r3_metadata_transform';
import {StripDecoratorsMetadataTransformer, getDecoratorStripTransformerFactory} from './r3_strip_decorators';
import {getAngularClassTransformerFactory} from './r3_transform';
import {TscPassThroughProgram} from './tsc_pass_through';
import {DTS, GENERATED_FILES, StructureIsReused, TS, createMessageDiagnostic, isInRootDir, ngToTsDiagnostic, tsStructureIsReused, userError} from './util';


Expand Down Expand Up @@ -900,10 +899,9 @@ export function createProgram({rootNames, options, host, oldProgram}: {
}): Program {
if (options.enableIvy === true) {
return new NgtscProgram(rootNames, options, host, oldProgram as NgtscProgram);
} else if (options.enableIvy === 'tsc') {
return new TscPassThroughProgram(rootNames, options, host, oldProgram);
} else {
return new AngularCompilerProgram(rootNames, options, host, oldProgram);
}
return new AngularCompilerProgram(rootNames, options, host, oldProgram);
}

// Compute the AotCompiler options
Expand Down
112 changes: 0 additions & 112 deletions packages/compiler-cli/src/transformers/tsc_pass_through.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/compiler/src/aot/compiler_options.ts
Expand Up @@ -19,6 +19,6 @@ export interface AotCompilerOptions {
fullTemplateTypeCheck?: boolean;
allowEmptyCodegenFiles?: boolean;
strictInjectionParameters?: boolean;
enableIvy?: boolean|'ngtsc'|'tsc';
enableIvy?: boolean|'ngtsc';
createExternalSymbolFactoryReexports?: boolean;
}

0 comments on commit fe25ac1

Please sign in to comment.