The linker is implemented using a Babel transform such that Babel needs to parse and walk a source file to find the declarations that need to be compiled. If it can be determined that a source file is known not to contain any declarations the parsing and walking can be skipped as a performance improvement. This commit adds an exposed function for tools that integrate the linker to use to allow short-circuiting of the linker transform. PR Close #40137
33 lines
897 B
Python
33 lines
897 B
Python
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
|
|
|
ts_library(
|
|
name = "test_lib",
|
|
testonly = True,
|
|
srcs = ["linked_compile_spec.ts"],
|
|
deps = [
|
|
"//packages/compiler-cli/linker",
|
|
"//packages/compiler-cli/linker/babel",
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
"//packages/compiler-cli/src/ngtsc/logging",
|
|
"//packages/compiler-cli/src/ngtsc/sourcemaps",
|
|
"//packages/compiler-cli/test/compliance/test_helpers",
|
|
"@npm//@types/babel__core",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "linked",
|
|
bootstrap = ["//tools/testing:node_no_angular_es5"],
|
|
data = [
|
|
"//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package",
|
|
"//packages/compiler-cli/test/compliance/test_cases",
|
|
],
|
|
shard_count = 2,
|
|
tags = [
|
|
"ivy-only",
|
|
],
|
|
deps = [
|
|
":test_lib",
|
|
],
|
|
)
|