Skip to content

Commit b788c36

Browse files
committed
Revert "build: add a before-all-other bootstrap script that patches require (angular#34589)" (angular#34730)
This reverts commit c3e8439. PR Close angular#34730
1 parent 66fbc2a commit b788c36

File tree

10 files changed

+43
-34
lines changed

10 files changed

+43
-34
lines changed

packages/core/test/render3/load_domino.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// bootstrap the bazel require patch since this bootstrap script is loaded with
10+
// `--node_options=--require=$(rlocation $(location script.js))`
11+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
12+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
13+
}
14+
915
// Needed to run animation tests
1016
import 'zone.js/lib/node/rollup-main';
1117
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.

packages/zone.js/test/node_bluebird_entry_point.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// bootstrap the bazel require patch since this bootstrap script is loaded with
10+
// `--node_options=--require=$(rlocation $(location script.js))`
11+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
12+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
13+
}
14+
915
// Must be loaded before zone loads, so that zone can detect WTF.
1016
import './test_fake_polyfill';
1117

packages/zone.js/test/node_entry_point.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* found in the LICENSE file at https://angular.io/license
1414
*/
1515

16+
// bootstrap the bazel require patch since this bootstrap script is loaded with
17+
// `--node_options=--require=$(rlocation $(location script.js))`
18+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
19+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
20+
}
21+
1622
// Must be loaded before zone loads, so that zone can detect WTF.
1723
import './node-env-setup';
1824
import './test_fake_polyfill';

packages/zone.js/test/node_entry_point_no_patch_clock.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* found in the LICENSE file at https://angular.io/license
1414
*/
1515

16+
// bootstrap the bazel require patch since this bootstrap script is loaded with
17+
// `--node_options=--require=$(rlocation $(location script.js))`
18+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
19+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
20+
}
21+
1622
// Must be loaded before zone loads, so that zone can detect WTF.
1723
import './node-env-setup';
1824
import './test_fake_polyfill';

packages/zone.js/test/node_error_disable_policy_entry_point.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// bootstrap the bazel require patch since this bootstrap script is loaded with
10+
// `--node_options=--require=$(rlocation $(location script.js))`
11+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
12+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
13+
}
14+
915
process.env['errorpolicy'] = (global as any)['__Zone_Error_BlacklistedStackFrames_policy'] =
1016
'disable';
1117
import './node_error_entry_point';

packages/zone.js/test/node_error_lazy_policy_entry_point.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// bootstrap the bazel require patch since this bootstrap script is loaded with
10+
// `--node_options=--require=$(rlocation $(location script.js))`
11+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
12+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
13+
}
14+
915
process.env['errorpolicy'] = (global as any)['__Zone_Error_BlacklistedStackFrames_policy'] = 'lazy';
1016
import './node_error_entry_point';

tools/defaults.bzl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,11 @@ def jasmine_node_test(bootstrap = [], **kwargs):
268268
"@npm//source-map-support",
269269
"@npm//tslib",
270270
"@npm//xhr2",
271-
"//tools/testing:bazel_patch_require.js",
272271
]
273272
configuration_env_vars = kwargs.pop("configuration_env_vars", []) + [
274273
"angular_ivy_enabled",
275274
]
276-
templated_args = [
277-
# bazel_patch_require.js must be first
278-
# TODO(gregmagolan): remove this once linker has been applied to nodejs_binary targets by default in rules_nodejs
279-
"--node_options=--require=$(rlocation $(location //tools/testing:bazel_patch_require.js))",
280-
] + kwargs.pop("templated_args", [])
275+
templated_args = kwargs.pop("templated_args", [])
281276
for label in bootstrap:
282277
deps += [label]
283278
templated_args += ["--node_options=--require=$(rlocation $(location %s))" % label]

tools/testing/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ load("//tools:defaults.bzl", "ts_library")
22

33
package(default_visibility = ["//visibility:public"])
44

5-
exports_files(["bazel_patch_require.js"])
6-
75
ts_library(
86
name = "browser",
97
testonly = 1,

tools/testing/bazel_patch_require.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

tools/testing/init_node_spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
// bootstrap the bazel require patch since this bootstrap script is loaded with
10+
// `--node_options=--require=$(rlocation $(location script.js))`
11+
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
12+
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
13+
}
14+
915
import 'zone.js/lib/node/rollup-main';
1016
import 'zone.js/lib/zone-spec/long-stack-trace';
1117
import 'zone.js/lib/zone-spec/task-tracking';

0 commit comments

Comments
 (0)