-
Notifications
You must be signed in to change notification settings - Fork 522
Update wasm_bindgen to not use deprecated/unmaintained JS rules #2119
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
Closed
+35
−30
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| """A module for re-exporting the providers used by the rust_wasm_bindgen rule""" | ||
|
|
||
| load( | ||
| "@rules_nodejs//nodejs:providers.bzl", | ||
| _DeclarationInfo = "DeclarationInfo", | ||
| _JSModuleInfo = "JSModuleInfo", | ||
| "@aspect_rules_js//js:providers.bzl", | ||
| _JsInfo = "JsInfo", | ||
| ) | ||
|
|
||
| DeclarationInfo = _DeclarationInfo | ||
| JSModuleInfo = _JSModuleInfo | ||
| JsInfo = _JsInfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is this? The repo seems to come out of nowhere. Is it required to use
aspect_rules_js?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.
tl;dr This is a bit of a wart, yes.
The package we load the JsInfo provider from depends on that repo to define a config setting: https://github.com/aspect-build/rules_js/blob/63862adcfb565b0a53fb45c60dded0f8a7893c49/js/BUILD.bazel#L3C1-L15 This seems designed to support multiple Bazel versions so hopefully it can go away at some point. That repo also has a small usability trick - it automatically calls
bazel_features_depsif you usenpm_translate_lock, and since the vast majority of JS projects use npm packages, they don't have to do anything special here.I do agree it's a bit weird to have to pull this in just to use the provider, @alexeagle perhaps you can consider rearranging the layout to make the providers more standalone?
Uh oh!
There was an error while loading. Please reload this page.
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.
@UebelAndre What do you think? (BTW once we are using bzlmod I think this wouldn't be necessary)
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.
Hm, yeah I see why this is undesirable. We had to make those part of the public API in aspect-build/rules_js#1187 - but maybe rules_rust can load() the providers without having to load that package? providers.bzl is in its own file for this reason.
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.
The problem is the
//docs:docs_depsrule in this repo. The bzl_library requires depending on"@aspect_rules_js//js:providers"to satisfy the stardoc rules/lint, which means anything loaded in//js:BUILDis a dependency. I think if you moved the providers.bzl to its own package (say//js/providers/defs.bzl) it would work.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.
The bzl_library here can just depend on the bzl file directly in srcs to avoid that
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.
Not sure I'm following the suggestion, do you mean like so?
That hits visibility issues: https://github.com/aspect-build/rules_js/blob/main/js/BUILD.bazel#L6-L9
Even ignoring visibility, it will have a problem with missing the js_info bzl
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.
@UebelAndre ping? What can I do to get this PR moving?
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’ll try to make time this weekend to do another pass. Sorry for the delay!