Skip to content

Commit fb4d554

Browse files
authored
Updated wasm_bindgen rules to only require core rules_nodejs rules (bazelbuild#1311)
1 parent 1590670 commit fb4d554

File tree

6 files changed

+11
-24
lines changed

6 files changed

+11
-24
lines changed

docs/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ bzl_library(
88
name = "docs_deps",
99
srcs = [
1010
"@bazel_tools//tools:bzl_srcs",
11-
"@build_bazel_rules_nodejs//:bzl",
1211
"@com_google_protobuf//:bzl_srcs",
12+
"@rules_nodejs//nodejs:bzl",
1313
],
1414
deps = [
1515
"@bazel_skylib//lib:paths",

docs/WORKSPACE.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_repositori
2727

2828
rust_wasm_bindgen_repositories()
2929

30-
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
31-
32-
node_repositories()
33-
3430
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
3531

3632
http_archive(

examples/WORKSPACE.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ rust_repository_set(
6363
# Examples dependencies
6464
###############################################################################
6565

66+
http_archive(
67+
name = "build_bazel_rules_nodejs",
68+
sha256 = "e328cb2c9401be495fa7d79c306f5ee3040e8a03b2ebb79b022e15ca03770096",
69+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.2/rules_nodejs-5.4.2.tar.gz"],
70+
)
71+
6672
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
6773

6874
node_repositories()

wasm_bindgen/providers.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
"""A module for re-exporting the providers used by the rust_wasm_bindgen rule"""
22

33
load(
4-
"@build_bazel_rules_nodejs//:providers.bzl",
4+
"@rules_nodejs//nodejs:providers.bzl",
55
_DeclarationInfo = "DeclarationInfo",
6-
_JSEcmaScriptModuleInfo = "JSEcmaScriptModuleInfo",
76
_JSModuleInfo = "JSModuleInfo",
8-
_JSNamedModuleInfo = "JSNamedModuleInfo",
97
)
108

119
DeclarationInfo = _DeclarationInfo
12-
JSEcmaScriptModuleInfo = _JSEcmaScriptModuleInfo
1310
JSModuleInfo = _JSModuleInfo
14-
JSNamedModuleInfo = _JSNamedModuleInfo

wasm_bindgen/repositories.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def rust_wasm_bindgen_repositories(register_default_toolchain = True):
2929

3030
maybe(
3131
http_archive,
32-
name = "build_bazel_rules_nodejs",
33-
sha256 = "ddb78717b802f8dd5d4c01c340ecdc007c8ced5c1df7db421d0df3d642ea0580",
34-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.0/rules_nodejs-4.6.0.tar.gz"],
32+
name = "rules_nodejs",
33+
sha256 = "26766278d815a6e2c43d2f6c9c72fde3fec8729e84138ffa4dabee47edc7702a",
34+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.2/rules_nodejs-core-5.4.2.tar.gz"],
3535
)
3636

3737
# Load dependencies of the default toolchain and register it.

wasm_bindgen/wasm_bindgen.bzl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ load("//rust/private:transitions.bzl", "wasm_bindgen_transition")
2020
load(
2121
"//wasm_bindgen:providers.bzl",
2222
"DeclarationInfo",
23-
"JSEcmaScriptModuleInfo",
2423
"JSModuleInfo",
25-
"JSNamedModuleInfo",
2624
)
2725

2826
_WASM_BINDGEN_DOC = """\
@@ -131,7 +129,6 @@ def _rust_wasm_bindgen_impl(ctx):
131129
# Return a structure that is compatible with the deps[] of a ts_library.
132130
declarations = depset(ts_out)
133131
es5_sources = depset(js_out)
134-
es6_sources = depset(js_out)
135132

136133
return [
137134
DefaultInfo(
@@ -146,14 +143,6 @@ def _rust_wasm_bindgen_impl(ctx):
146143
direct_sources = es5_sources,
147144
sources = es5_sources,
148145
),
149-
JSNamedModuleInfo(
150-
direct_sources = es5_sources,
151-
sources = es5_sources,
152-
),
153-
JSEcmaScriptModuleInfo(
154-
direct_sources = es6_sources,
155-
sources = es6_sources,
156-
),
157146
]
158147

159148
rust_wasm_bindgen = rule(

0 commit comments

Comments
 (0)