Skip to content
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

Use js_info macro to populate JsInfo provider (js_rust_wasm_bindgen) #2303

Merged

Conversation

jstuder-gh
Copy link
Contributor

Uses the js_info macro in aspect_rules_js to create the JsInfo provider and provide defaults for any field that is not explicitly set.

Resolves #2302

Showcases a bug currently in with the way the JsInfo provider is
populated. There are fields missing and attempts to read from them will
result in error
The js_info macro will populate unspecified fields with empty lists
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Would you also be willing to leave an example showing a direct consumer to js_test? I've found this more closely resembles js_binary but will report that execution still works.

@jstuder-gh
Copy link
Contributor Author

jstuder-gh commented Dec 3, 2023

I'm not sure I understand. Sorry if a naive question, but can you specify a rule that consume the result of a test target?

Or do you mean a direct consumer to the first js_library and then that gets fed into the js_test?

@UebelAndre
Copy link
Collaborator

I’d like to keep the original test target but add your more library + test combo

One test that directly consumes the WASM data and another that
indirectly consumes (through intermediate js_library)
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jstuder-gh
Copy link
Contributor Author

Ok, I split it out into two tests as you suggested. One that consumes the WASM data directly and one the consumes it indirectly (via an intermediate js_library)

@UebelAndre UebelAndre merged commit 742cb46 into bazelbuild:main Dec 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

js_rust_wasm_bindgen (aspect_rules_js binding) results in error when including in js_library
2 participants