refactor(ivy): move the expr/stmt translator to a separate target (#26203)
Template type-checking will make use of expression and statement translation as well as the ImportManager, so this code needs to live in a separate build target which can be depended on by both the main ngtsc transform as well as the template type-checking mechanism. This refactor introduces a separate build target for that code. PR Close #26203
This commit is contained in:
parent
79466baef8
commit
4c615f7de7
|
@ -16,5 +16,6 @@ ts_library(
|
|||
"//packages/compiler-cli/src/ngtsc/host",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/transform",
|
||||
"//packages/compiler-cli/src/ngtsc/translator",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -14,7 +14,7 @@ import {SourceMapConsumer, SourceMapGenerator, RawSourceMap} from 'source-map';
|
|||
import * as ts from 'typescript';
|
||||
|
||||
import {Decorator} from '../../../ngtsc/host';
|
||||
import {ImportManager, translateStatement} from '../../../ngtsc/transform';
|
||||
import {ImportManager, translateStatement} from '../../../ngtsc/translator';
|
||||
import {AnalyzedClass, AnalyzedFile} from '../analyzer';
|
||||
import {IMPORT_PREFIX} from '../constants';
|
||||
import {NgccReflectionHost} from '../host/ngcc_host';
|
||||
|
|
|
@ -14,6 +14,7 @@ ts_library(
|
|||
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
||||
"//packages/compiler-cli/src/ngtsc/host",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/translator",
|
||||
"//packages/compiler-cli/src/ngtsc/util",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -10,4 +10,3 @@ export * from './src/api';
|
|||
export {IvyCompilation} from './src/compilation';
|
||||
export {DtsFileTransformer} from './src/declaration';
|
||||
export {ivyTransformFactory} from './src/transform';
|
||||
export {ImportManager, translateStatement} from './src/translator';
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ImportManager, translateType} from '../../translator';
|
||||
|
||||
import {CompileResult} from './api';
|
||||
import {ImportManager, translateType} from './translator';
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ import {ConstantPool} from '@angular/compiler';
|
|||
import * as ts from 'typescript';
|
||||
|
||||
import {Decorator, ReflectionHost} from '../../host';
|
||||
import {ImportManager, translateExpression, translateStatement} from '../../translator';
|
||||
import {relativePathBetween} from '../../util/src/path';
|
||||
import {VisitListEntryResult, Visitor, visit} from '../../util/src/visitor';
|
||||
|
||||
import {CompileResult} from './api';
|
||||
import {IvyCompilation} from './compilation';
|
||||
import {ImportManager, translateExpression, translateStatement} from './translator';
|
||||
|
||||
const NO_DECORATORS = new Set<ts.Decorator>();
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "translator",
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/compiler-cli/src/ngtsc/translator",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli/src/ngtsc/util",
|
||||
],
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export {ImportManager, translateExpression, translateStatement, translateType} from './src/translator';
|
Loading…
Reference in New Issue