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

Make a "trampoline" crate to avoid unneeded dependencies in a proc-macro crate #5

Merged
merged 4 commits into from
Jun 3, 2023

Conversation

fjarri
Copy link
Owner

@fjarri fjarri commented Jun 3, 2023

wasm-bindgen causes some issues when building as a part of a proc-macro (see rustwasm/wasm-bindgen#3457). But we still want to enforce the correct version bounds on it, so that the generated code did not turn out to be incorrect/un-compileable. This PR creates a proc-macro wasm-bindgen-derive-macro crate and simply re-exports TryFromJsValue in wasm-bindgen-derive. wasm-bindgen-derive-macro only contains proc-macro dependencies (syn and so on), and wasm-bindgen-derive contains the dependencies for the generated code (wasm-bindgen and js-sys)

Fixes #3

@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Merging #5 (3186af9) into master (955ed47) will increase coverage by 12.41%.
The diff coverage is 93.28%.

@@             Coverage Diff             @@
##           master       #5       +/-   ##
===========================================
+ Coverage   80.91%   93.33%   +12.41%     
===========================================
  Files           1        2        +1     
  Lines         131      135        +4     
===========================================
+ Hits          106      126       +20     
+ Misses         25        9       -16     
Impacted Files Coverage Δ
wasm-bindgen-derive/src/lib.rs 100.00% <ø> (+19.08%) ⬆️
wasm-bindgen-derive-macro/src/lib.rs 93.28% <93.28%> (ø)

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.

Compilation in release mode fails on latest nightly
1 participant