This commit changes the Angular compiler (ivy-only) to generate `$localize` tagged strings for component templates that use `i18n` attributes. BREAKING CHANGE Since `$localize` is a global function, it must be included in any applications that use i18n. This is achieved by importing the `@angular/localize` package into an appropriate bundle, where it will be executed before the renderer needs to call `$localize`. For CLI based projects, this is best done in the `polyfills.ts` file. ```ts import '@angular/localize'; ``` For non-CLI applications this could be added as a script to the index.html file or another suitable script file. PR Close #31609
82 lines
2.1 KiB
Python
82 lines
2.1 KiB
Python
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
ts_library(
|
|
name = "test_lib",
|
|
testonly = True,
|
|
srcs = glob(
|
|
["**/*.ts"],
|
|
exclude = [
|
|
"**/*_node_only_spec.ts",
|
|
],
|
|
),
|
|
# Visible to //:test_web_all target
|
|
visibility = ["//:__pkg__"],
|
|
deps = [
|
|
"//packages/animations",
|
|
"//packages/animations/browser",
|
|
"//packages/animations/browser/testing",
|
|
"//packages/common",
|
|
"//packages/common/locales",
|
|
"//packages/compiler",
|
|
"//packages/compiler/testing",
|
|
"//packages/core",
|
|
"//packages/core/src/di/interface",
|
|
"//packages/core/src/interface",
|
|
"//packages/core/src/reflection",
|
|
"//packages/core/src/util",
|
|
"//packages/core/testing",
|
|
"//packages/localize",
|
|
"//packages/platform-browser",
|
|
"//packages/platform-browser-dynamic",
|
|
"//packages/platform-browser/animations",
|
|
"//packages/platform-browser/testing",
|
|
"//packages/private/testing",
|
|
"//packages/router",
|
|
"//packages/router/testing",
|
|
"@npm//rxjs",
|
|
"@npm//zone.js",
|
|
],
|
|
)
|
|
|
|
ts_library(
|
|
name = "test_node_only_lib",
|
|
testonly = True,
|
|
srcs = glob(["**/*_node_only_spec.ts"]),
|
|
deps = [
|
|
":test_lib",
|
|
"//packages/compiler",
|
|
"//packages/compiler/testing",
|
|
"//packages/core",
|
|
"//packages/core/src/compiler",
|
|
"//packages/core/testing",
|
|
"//packages/platform-server",
|
|
"//packages/platform-server/testing",
|
|
"//packages/private/testing",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "test",
|
|
bootstrap = ["angular/tools/testing/init_node_spec.js"],
|
|
shard_count = 4,
|
|
deps = [
|
|
":test_lib",
|
|
":test_node_only_lib",
|
|
"//packages/platform-server",
|
|
"//packages/platform-server/testing",
|
|
"//tools/testing:node",
|
|
"@npm//base64-js",
|
|
"@npm//source-map",
|
|
"@npm//zone.js",
|
|
],
|
|
)
|
|
|
|
ts_web_test_suite(
|
|
name = "test_web",
|
|
deps = [
|
|
":test_lib",
|
|
],
|
|
)
|