From a813ae07e287ab8a60d7a1ecc08684a468f8cc0b Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Mon, 9 Sep 2019 17:34:09 -0700 Subject: [PATCH] test: make expanding_rows test work in g3 (#32568) This PR modifies the `expanding_rows` test so that it works in g3. 1. `index,ts` must be named `index_aot.ts` 2. Scripts should be loaded via `ts_devserver` and not as an explicit script tag in the HTML. PR Close #32568 --- .../benchmarks/src/expanding_rows/BUILD.bazel | 20 ++++++++------ .../benchmarks/src/expanding_rows/index.html | 26 ++----------------- .../expanding_rows/{index.ts => index_aot.ts} | 0 3 files changed, 14 insertions(+), 32 deletions(-) rename modules/benchmarks/src/expanding_rows/{index.ts => index_aot.ts} (100%) diff --git a/modules/benchmarks/src/expanding_rows/BUILD.bazel b/modules/benchmarks/src/expanding_rows/BUILD.bazel index 08362e9e72..9b1f32f75f 100644 --- a/modules/benchmarks/src/expanding_rows/BUILD.bazel +++ b/modules/benchmarks/src/expanding_rows/BUILD.bazel @@ -32,7 +32,7 @@ ts_library( ng_rollup_bundle( name = "bundle", - entry_point = ":index.ts", + entry_point = ":index_aot.ts", deps = [ ":application_lib", "@npm//rxjs", @@ -41,26 +41,30 @@ ng_rollup_bundle( ts_devserver( name = "prodserver", + index_html = "index.html", + port = 4200, static_files = [ - ":bundle.min_debug.js", - ":bundle.min.js", "@npm//:node_modules/zone.js/dist/zone.js", - "index.html", + ], + deps = [ + ":bundle.min.js", ], ) ts_devserver( name = "devserver", - entry_module = "angular/modules/benchmarks/src/expanding_rows/index", - index_html = "index.html", + entry_module = "angular/modules/benchmarks/src/expanding_rows/index_aot", + # Uncomment this to run devserver. This is due to limitation of ts_devserver + # that produces `index.html` by default so there cannot be two ts_devserver + # rules in a single Bazel package. + # index_html = "index.html", + port = 4200, scripts = [ "@npm//:node_modules/tslib/tslib.js", "//tools/rxjs:rxjs_umd_modules", ], - serving_path = "/index.js", static_files = [ "@npm//:node_modules/zone.js/dist/zone.js", - "index.html", ], deps = [":application_lib"], ) diff --git a/modules/benchmarks/src/expanding_rows/index.html b/modules/benchmarks/src/expanding_rows/index.html index 402a1fc8d8..802754abdd 100644 --- a/modules/benchmarks/src/expanding_rows/index.html +++ b/modules/benchmarks/src/expanding_rows/index.html @@ -11,29 +11,7 @@

Change Detection Benchmark

...
- loading... - - + Loading... - \ No newline at end of file + diff --git a/modules/benchmarks/src/expanding_rows/index.ts b/modules/benchmarks/src/expanding_rows/index_aot.ts similarity index 100% rename from modules/benchmarks/src/expanding_rows/index.ts rename to modules/benchmarks/src/expanding_rows/index_aot.ts