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

Implement transitive support for NPM dependencies #1305

Merged
merged 3 commits into from
Mar 25, 2019

Conversation

alexcrichton
Copy link
Contributor

@alexcrichton alexcrichton commented Feb 28, 2019

This commit implements RFC 8, which enables transitive and transparent
dependencies on NPM. The module attribute, when seen and not part of a
local JS snippet, triggers detection of a package.json next to
Cargo.toml. If found it will cause the wasm-bindgen CLI tool to load
and parse the package.json within each crate and then create a merged
package.json at the end.

Note: this is currently based on #1295 so the first commits can be ignored, and additionally RFC 8 is not FCP'd or merged yet, so merging this should hold off until that happens.

crates/backend/src/encode.rs Outdated Show resolved Hide resolved
This commit implements [RFC 8], which enables transitive and transparent
dependencies on NPM. The `module` attribute, when seen and not part of a
local JS snippet, triggers detection of a `package.json` next to
`Cargo.toml`. If found it will cause the `wasm-bindgen` CLI tool to load
and parse the `package.json` within each crate and then create a merged
`package.json` at the end.

[RFC 8]: rustwasm/rfcs#8
@alexcrichton alexcrichton force-pushed the npm-dependencies branch 4 times, most recently from 2ef2b7d to df0e547 Compare March 22, 2019 16:48
We have very few tests today so this starts to add the basics of a test
suite which compiles Cargo projects on-the-fly which will hopefully help
us bolster the amount of assertions we can make about the output.
@alexcrichton
Copy link
Contributor Author

Ok I've opened a follow-up for this in wasm-pack at rustwasm/wasm-pack#606

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.

None yet

2 participants