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

Fix sideEffects value in generated package.json should be boolean #649

Closed
wants to merge 2 commits into from

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented May 19, 2019

Make sure these boxes are checked! πŸ“¦βœ…

  • You have the latest version of rustfmt installed
$ rustup component add rustfmt-preview --toolchain nightly
  • You ran cargo fmt on the code base before submitting
  • You reference which issue is being closed in the PR text: There is no issue related to this fix

✨✨ πŸ˜„ Thanks so much for contributing to wasm-pack! πŸ˜„ ✨✨

I'm not heavy user of webpack but sideEffects field of package.json seems boolean or array value.

https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free

But current wasm-pack sets "false" string value to the field. This patch fixes the point.

@rhysd
Copy link
Contributor Author

rhysd commented May 19, 2019

CI failed due to the reason not related to changes of this PR.

https://travis-ci.com/rustwasm/wasm-pack/jobs/201309430

wasm-pack build failed due to

Error: Directory not empty (os error 39)

I guess this is because multiple test cases use the same directory name for test. As you know, Rust runs tests parallelly. So when using the same directory for multiple tests, the directory may be (or may not be) used by other test cases. It would cause some flakiness on testing. I'll try to resolve it and check if my guess is correct or not

@rhysd
Copy link
Contributor Author

rhysd commented May 19, 2019

Travis CI job is now back to normal. Failure on AppVeyor also seems to occur on master branch so it is not related to changes on this PR.

@rhysd rhysd changed the title Fix sideEffects value in generated package.json should be empty Fix sideEffects value in generated package.json should be boolean May 23, 2019
@@ -28,17 +28,17 @@ fn it_should_build_crates_in_a_workspace() {
"Cargo.toml",
r#"
[workspace]
members = ["blah"]
Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure i understand this change- can you explain? otherwise this looks good!

@ashleygwilliams
Copy link
Member

gonna snag this PR and try to work through the test failures. thanks for noticing this! it's a BIG thing to catch!

@ashleygwilliams
Copy link
Member

cannot replicate this locally. can you perchance @steveklabnik ? this is failing on the workspaces test: https://ci.appveyor.com/project/ashleygwilliams/wasm-pack-071k0/builds/24651407#L394

@steveklabnik
Copy link
Contributor

I get eight test failures on both master and with this PR, so I don't think this PR is causing it directly.

@ashleygwilliams
Copy link
Member

i'm gonna remove the commit on this that attempted to address the failures and then merge since i dont think it is related.. we'll see what CI says

@ashleygwilliams
Copy link
Member

closing in favor of #680

ashleygwilliams added a commit that referenced this pull request Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants