Skip to content

Commit e3d46e1

Browse files
authored
[bazel+closure]: Vendor the version of closure library we use (#16742)
We used to have a version of Google Closure Library tucked away in `//third_party/closure/goog` We never really updated it, because we switched to using `rules_closure`, and that bundles a different version of Google Closure Library. This PR vendors the version of Closure back into `third_party/closure/goog` and then updates our builds and tests to use. This is a necessary prelude to updating `rules_closure` to the latest release. That version no longer bundles a copy of closure, so we need to be using a vendored one. However, the version we end up on won't be _this_ version of closure because the later `rules_closure` has an updated closure compiler that doesn't like our code. However, one thing at a time! Let's start by vendoring the thing we're using and remove ourselves from the clutches of a bundled version of the library. * Attempt to minimise the number of files While I am sure this isn't entirely complete, and may have gone too far running `bazel test //javascript/atoms:test-chrome` on `trunk` and this branch give the same test failures, so I'm going to say that this piece of work is now as compact as it can be.
1 parent fabf2c3 commit e3d46e1

File tree

1,131 files changed

+127744
-195845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,131 files changed

+127744
-195845
lines changed

javascript/atoms/BUILD.bazel

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ closure_js_library(
4040
":dom",
4141
":errors",
4242
":events",
43-
"@io_bazel_rules_closure//closure/library/array",
44-
"@io_bazel_rules_closure//closure/library/dom:tagname",
45-
"@io_bazel_rules_closure//closure/library/math:coordinate",
46-
"@io_bazel_rules_closure//closure/library/math:vec2",
47-
"@io_bazel_rules_closure//closure/library/style",
43+
"//third_party/closure/goog/array",
44+
"//third_party/closure/goog/dom:tagname",
45+
"//third_party/closure/goog/math:coordinate",
46+
"//third_party/closure/goog/math:vec2",
47+
"//third_party/closure/goog/style",
4848
],
4949
)
5050

@@ -63,8 +63,8 @@ closure_js_library(
6363
"JSC_USE_OF_GOOG_PROVIDE",
6464
],
6565
deps = [
66-
"@io_bazel_rules_closure//closure/library/array",
67-
"@io_bazel_rules_closure//closure/library/color:names",
66+
"//third_party/closure/goog/array",
67+
"//third_party/closure/goog/color:names",
6868
],
6969
)
7070

@@ -91,15 +91,15 @@ closure_js_library(
9191
":events",
9292
":locators",
9393
":useragent",
94-
"@io_bazel_rules_closure//closure/library/array",
95-
"@io_bazel_rules_closure//closure/library/dom",
96-
"@io_bazel_rules_closure//closure/library/dom:selection",
97-
"@io_bazel_rules_closure//closure/library/dom:tagname",
98-
"@io_bazel_rules_closure//closure/library/math:coordinate",
99-
"@io_bazel_rules_closure//closure/library/structs:map",
100-
"@io_bazel_rules_closure//closure/library/structs:set",
101-
"@io_bazel_rules_closure//closure/library/useragent",
102-
"@io_bazel_rules_closure//closure/library/useragent:product",
94+
"//third_party/closure/goog/array",
95+
"//third_party/closure/goog/dom",
96+
"//third_party/closure/goog/dom:selection",
97+
"//third_party/closure/goog/dom:tagname",
98+
"//third_party/closure/goog/math:coordinate",
99+
"//third_party/closure/goog/structs:map",
100+
"//third_party/closure/goog/structs:set",
101+
"//third_party/closure/goog/useragent",
102+
"//third_party/closure/goog/useragent:product",
103103
],
104104
)
105105

@@ -115,10 +115,10 @@ closure_js_library(
115115
deps = [
116116
":errors",
117117
":useragent",
118-
"@io_bazel_rules_closure//closure/library/array",
119-
"@io_bazel_rules_closure//closure/library/dom",
120-
"@io_bazel_rules_closure//closure/library/dom:nodetype",
121-
"@io_bazel_rules_closure//closure/library/dom:tagname",
118+
"//third_party/closure/goog/array",
119+
"//third_party/closure/goog/dom",
120+
"//third_party/closure/goog/dom:nodetype",
121+
"//third_party/closure/goog/dom:tagname",
122122
],
123123
)
124124

@@ -139,16 +139,16 @@ closure_js_library(
139139
":domcore",
140140
":json",
141141
":useragent",
142-
"@io_bazel_rules_closure//closure/library/array",
143-
"@io_bazel_rules_closure//closure/library/dom",
144-
"@io_bazel_rules_closure//closure/library/dom:nodetype",
145-
"@io_bazel_rules_closure//closure/library/dom:tagname",
146-
"@io_bazel_rules_closure//closure/library/math",
147-
"@io_bazel_rules_closure//closure/library/math:coordinate",
148-
"@io_bazel_rules_closure//closure/library/math:rect",
149-
"@io_bazel_rules_closure//closure/library/string",
150-
"@io_bazel_rules_closure//closure/library/style",
151-
"@io_bazel_rules_closure//closure/library/useragent",
142+
"//third_party/closure/goog/array",
143+
"//third_party/closure/goog/dom",
144+
"//third_party/closure/goog/dom:nodetype",
145+
"//third_party/closure/goog/dom:tagname",
146+
"//third_party/closure/goog/math",
147+
"//third_party/closure/goog/math:coordinate",
148+
"//third_party/closure/goog/math:rect",
149+
"//third_party/closure/goog/string",
150+
"//third_party/closure/goog/style",
151+
"//third_party/closure/goog/useragent",
152152
],
153153
)
154154

@@ -183,12 +183,12 @@ closure_js_library(
183183
":errors",
184184
":json",
185185
":useragent",
186-
"@io_bazel_rules_closure//closure/library/array",
187-
"@io_bazel_rules_closure//closure/library/dom",
188-
"@io_bazel_rules_closure//closure/library/events:browserevent",
189-
"@io_bazel_rules_closure//closure/library/style",
190-
"@io_bazel_rules_closure//closure/library/useragent",
191-
"@io_bazel_rules_closure//closure/library/useragent:product",
186+
"//third_party/closure/goog/array",
187+
"//third_party/closure/goog/dom",
188+
"//third_party/closure/goog/events:browserevent",
189+
"//third_party/closure/goog/style",
190+
"//third_party/closure/goog/useragent",
191+
"//third_party/closure/goog/useragent:product",
192192
],
193193
)
194194

@@ -209,8 +209,8 @@ closure_js_library(
209209
":dom",
210210
":errors",
211211
":locators",
212-
"@io_bazel_rules_closure//closure/library/dom",
213-
"@io_bazel_rules_closure//closure/library/dom:tagname",
212+
"//third_party/closure/goog/dom",
213+
"//third_party/closure/goog/dom:tagname",
214214
],
215215
)
216216

@@ -228,7 +228,7 @@ closure_js_library(
228228
":errors",
229229
":json",
230230
":useragent",
231-
"@io_bazel_rules_closure//closure/library/useragent:all_js",
231+
"//third_party/closure/goog/useragent:all_js",
232232
],
233233
)
234234

@@ -250,10 +250,10 @@ closure_js_library(
250250
":bot",
251251
":errors",
252252
":json",
253-
"@io_bazel_rules_closure//closure/library/array",
254-
"@io_bazel_rules_closure//closure/library/dom:nodetype",
255-
"@io_bazel_rules_closure//closure/library/object",
256-
"@io_bazel_rules_closure//closure/library/useragent",
253+
"//third_party/closure/goog/array",
254+
"//third_party/closure/goog/dom:nodetype",
255+
"//third_party/closure/goog/object",
256+
"//third_party/closure/goog/useragent",
257257
],
258258
)
259259

@@ -265,8 +265,8 @@ closure_js_library(
265265
],
266266
deps = [
267267
":useragent",
268-
"@io_bazel_rules_closure//closure/library/json",
269-
"@io_bazel_rules_closure//closure/library/useragent",
268+
"//third_party/closure/goog/json",
269+
"//third_party/closure/goog/useragent",
270270
],
271271
)
272272

@@ -290,13 +290,13 @@ closure_js_library(
290290
":errors",
291291
":json",
292292
":useragent",
293-
"@io_bazel_rules_closure//closure/library/array",
294-
"@io_bazel_rules_closure//closure/library/dom",
295-
"@io_bazel_rules_closure//closure/library/dom:nodetype",
296-
"@io_bazel_rules_closure//closure/library/math:rect",
297-
"@io_bazel_rules_closure//closure/library/string",
298-
"@io_bazel_rules_closure//closure/library/useragent",
299-
"@io_bazel_rules_closure//closure/library/useragent:product",
293+
"//third_party/closure/goog/array",
294+
"//third_party/closure/goog/dom",
295+
"//third_party/closure/goog/dom:nodetype",
296+
"//third_party/closure/goog/math:rect",
297+
"//third_party/closure/goog/string",
298+
"//third_party/closure/goog/useragent",
299+
"//third_party/closure/goog/useragent:product",
300300
],
301301
)
302302

@@ -309,10 +309,10 @@ closure_js_library(
309309
"JSC_USE_OF_GOOG_PROVIDE",
310310
],
311311
deps = [
312-
"@io_bazel_rules_closure//closure/library/string",
313-
"@io_bazel_rules_closure//closure/library/useragent",
314-
"@io_bazel_rules_closure//closure/library/useragent:product",
315-
"@io_bazel_rules_closure//closure/library/useragent:product_isversion",
312+
"//third_party/closure/goog/string",
313+
"//third_party/closure/goog/useragent",
314+
"//third_party/closure/goog/useragent:product",
315+
"//third_party/closure/goog/useragent:product_isversion",
316316
],
317317
)
318318

@@ -347,9 +347,9 @@ closure_js_library(
347347
":bot",
348348
":errors",
349349
":useragent",
350-
"@io_bazel_rules_closure//closure/library/dom:nodetype",
351-
"@io_bazel_rules_closure//closure/library/string",
352-
"@io_bazel_rules_closure//closure/library/useragent",
350+
"//third_party/closure/goog/dom:nodetype",
351+
"//third_party/closure/goog/string",
352+
"//third_party/closure/goog/useragent",
353353
],
354354
)
355355

javascript/atoms/fragments/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ closure_fragment(
108108
"//javascript/chrome-driver:__pkg__",
109109
],
110110
deps = [
111-
"@io_bazel_rules_closure//closure/library/style",
111+
"//third_party/closure/goog/style",
112112
],
113113
)
114114

javascript/atoms/test/test_bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
// All the files to load. Files are specified in the order they must be
5959
// loaded, NOT alphabetical order.
6060
var files = [
61-
'../../../third_party/closure/goog/base.js',
61+
'/filez/_main/third_party/closure/goog/base.js',
6262
'deps.js'
6363
];
6464

6565
if (location.pathname.lastIndexOf('/filez/_main/javascript/', 0) === 0) {
6666
directoryPath = '';
6767
files = [
68-
'/filez/com_google_javascript_closure_library/closure/goog/base.js',
68+
'/filez/_main/third_party/closure/goog/base.js',
6969
'/filez/_main/javascript/atoms/deps.js',
7070
];
7171
}

javascript/chrome-driver/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ closure_js_library(
1515
deps = [
1616
"//javascript/atoms:dom",
1717
"//javascript/atoms:locators",
18-
"@io_bazel_rules_closure//closure/library/dom",
19-
"@io_bazel_rules_closure//closure/library/math:coordinate",
20-
"@io_bazel_rules_closure//closure/library/math:rect",
21-
"@io_bazel_rules_closure//closure/library/math:size",
22-
"@io_bazel_rules_closure//closure/library/style",
18+
"//third_party/closure/goog/dom",
19+
"//third_party/closure/goog/math:coordinate",
20+
"//third_party/closure/goog/math:rect",
21+
"//third_party/closure/goog/math:size",
22+
"//third_party/closure/goog/style",
2323
],
2424
)
2525

@@ -29,7 +29,7 @@ closure_fragment(
2929
function = "goog.style.getPageOffset",
3030
module = "goog.style",
3131
deps = [
32-
"@io_bazel_rules_closure//closure/library/style",
32+
"//third_party/closure/goog/style",
3333
],
3434
)
3535

javascript/chrome-driver/test/test_bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if (location.pathname.lastIndexOf('/filez/_main/javascript/', 0) === 0) {
6464
directoryPath = '';
6565
files = [
66-
'/filez/com_google_javascript_closure_library/closure/goog/base.js',
66+
'/filez/_main/third_party/closure/goog/base.js',
6767
'/filez/_main/javascript/chrome-driver/deps.js',
6868
];
6969
}

javascript/ie-driver/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ closure_js_library(
2323
"//javascript/atoms:errors",
2424
"//javascript/atoms:locators",
2525
"//javascript/atoms:useragent",
26-
"@io_bazel_rules_closure//closure/library/math:coordinate",
27-
"@io_bazel_rules_closure//closure/library/style",
26+
"//third_party/closure/goog/math:coordinate",
27+
"//third_party/closure/goog/style",
2828
],
2929
)
3030

javascript/private/closure_js_deps.bzl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ def closure_js_deps(name, deps = [], testonly = None, **kwargs):
9898
$(location //javascript/private:closure_make_deps) \\
9999
--closure-path $$(pwd)/external/com_google_javascript_closure_library/closure \\
100100
--no-validate \\
101-
$$FILES | \\
102-
sed 's|../../../javascript/|../../../_main/javascript/|g' \\
101+
$$FILES \\
103102
> $@
104103
""",
105104
tools = ["//javascript/private:closure_make_deps"],

javascript/private/test_suite.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ load("//java:defs.bzl", "selenium_test")
33

44
def closure_test_suite(name, data = [], browsers = None):
55
data = data + [
6-
"@com_google_javascript_closure_library//:com_google_javascript_closure_library",
6+
"//third_party/closure/goog:base",
7+
"//third_party/closure/goog:css",
8+
"//third_party/closure/goog:deps",
9+
"//third_party/closure/goog:library",
10+
"//third_party/closure/goog/testing",
711
]
812

913
selenium_test(

javascript/webdriver/atoms/BUILD.bazel

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ closure_js_library(
3737
"//javascript/atoms:domcore",
3838
"//javascript/atoms:html5",
3939
"//javascript/webdriver:key",
40-
"@io_bazel_rules_closure//closure/library/array",
41-
"@io_bazel_rules_closure//closure/library/dom",
42-
"@io_bazel_rules_closure//closure/library/dom:tagname",
43-
"@io_bazel_rules_closure//closure/library/math:coordinate",
44-
"@io_bazel_rules_closure//closure/library/style",
40+
"//third_party/closure/goog/array",
41+
"//third_party/closure/goog/dom",
42+
"//third_party/closure/goog/dom:tagname",
43+
"//third_party/closure/goog/math:coordinate",
44+
"//third_party/closure/goog/style",
4545
],
4646
)
4747

@@ -55,8 +55,8 @@ closure_js_library(
5555
visibility = ["//visibility:private"],
5656
deps = [
5757
"//javascript/atoms:domcore",
58-
"@io_bazel_rules_closure//closure/library/array",
59-
"@io_bazel_rules_closure//closure/library/dom:tagname",
58+
"//third_party/closure/goog/array",
59+
"//third_party/closure/goog/dom:tagname",
6060
],
6161
)
6262

javascript/webdriver/atoms/inject/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ closure_js_library(
3838
"//javascript/atoms:action",
3939
"//javascript/atoms:inject",
4040
"//javascript/webdriver/atoms:atoms-lib",
41-
"@io_bazel_rules_closure//closure/library/json",
41+
"//third_party/closure/goog/json",
4242
],
4343
)
4444

@@ -68,7 +68,7 @@ closure_js_library(
6868
"//javascript/atoms:inject",
6969
"//javascript/atoms:useragent",
7070
"//javascript/webdriver/atoms:atoms-lib",
71-
"@io_bazel_rules_closure//closure/library/json",
71+
"//third_party/closure/goog/json",
7272
],
7373
)
7474

@@ -97,7 +97,7 @@ closure_js_library(
9797
":execute-script",
9898
"//javascript/atoms:inject",
9999
"//javascript/atoms:locators",
100-
"@io_bazel_rules_closure//closure/library/json",
100+
"//third_party/closure/goog/json",
101101
],
102102
)
103103

0 commit comments

Comments
 (0)