-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: depend on bazel-skylib at runtime #3056
Conversation
This allows us to always publish regular bzl_library targets. We can also stop carefully vendoring skylib and shipping our own copy. Eventually we would run into a provider problem, where our vendored copy doesn't have the same provider symbol as the real repo. BREAKING CHANGE: build_bazel_rules_nodejs now depends on bazel_skylib. You can install it in your WORKSPACE directly, or use our helper macro like so:
950146c
to
c6643c9
Compare
@@ -25,6 +25,10 @@ http_archive( | |||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz"], | |||
) | |||
|
|||
load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_dependencies") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this pattern around. rules_docker uses it
load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", rules_nodejs_dependencies = "dependencies")
rules_nodejs_dependencies()
It avoids the unnecessary scoping in the rnj repo. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rules_docker:
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes users use the re-assignment syntax in the load statement that they may not have seen, and is overall more complex to have a second name for the thing (some users might not re-assign)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rules_docker kinda needs it since they have so many language ecosystems to namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👾
This allows us to always publish regular bzl_library targets. We can also stop carefully vendoring skylib and shipping our own copy.
Eventually we would run into a provider problem, where our vendored copy doesn't have the same provider symbol as the real repo.
BREAKING CHANGE:
build_bazel_rules_nodejs now depends on bazel_skylib.
You can install it in your WORKSPACE directly, or use our helper macro like so: