Skip to content

Commit

Permalink
v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams committed Jan 14, 2019
1 parent ea99a2d commit 5f3d015
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 122 deletions.
212 changes: 212 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,217 @@
# Changelog

## 🌅 0.6.0

- ### ✨ Features

- **Add three build profiles and infrastructure for their toml config - [fitzgen], [issue/153] [issue/160] [pull/440]**

When originally conceived, `wasm-pack` was exclusively a packaging and publishing tool, which naively assumed
that the crate author would simply run `wasm-pack` when they were ready to publish a wasm package. As a result,
`wasm-pack` always ran `cargo build` in `--release` mode. Since then, `wasm-pack` has grown into an intgrated build
tool used at all stages of development, from idea conception to publishing, and as such has developed new needs.

In previous releases, we've supported a flag called `--debug` which will run `cargo build` in `dev` mode, which
trades faster compilation speed for a lack of optimizations. We've renamed this flag to `--dev` to match `cargo`
and added an additional flag, representing a third, intermediary, build profile, called `--profiling` which
is useful for investigating performance issues. You can see all three flags and their uses in the table below:

| Profile | Debug Assertions | Debug Info | Optimizations | Notes |
|---------------|------------------|------------|---------------|---------------------------------------|
| `--dev` | Yes | Yes | No | Useful for development and debugging. |
| `--profiling` | No | Yes | Yes | Useful when profiling and investigating performance issues. |
| `--release` | No | No | Yes | Useful for shipping to production. |

The meaning of these flags will evolve as the platform grows, and always be tied to the behavior of these flags
in `cargo`. You can learn more about these in the [`cargo profile` documentation].

This PR also introduces a way to configure `wasm-pack` in your `Cargo.toml` file that we intend to use much more
in the future. As a largely convention-based tool, `wasm-pack` will never require that you configure it manually,
however, as our community and their projects mature alongside the tool, it became clear that allowing folks the
ability to drop down and configure things was something we needed to do to meet their needs.

Currently, you can only configure things related to the above-mentioned build profiles. To learn more,
[check out the documentation][profile-config-docs]. As always- there are defaults for you to use, but if
you love to configure, get excited, as your options have grown now and will continue to!

[profile-config-docs]: https://rustwasm.github.io/wasm-pack/book/cargo-toml-configuration.html
[`cargo profile` documentation]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections
[issue/153]: https://github.com/rustwasm/wasm-pack/issues/153
[issue/160]: https://github.com/rustwasm/wasm-pack/issues/160
[pull/440]: https://github.com/rustwasm/wasm-pack/pull/440

- **DEPRECATION: Rename `--debug` to `--dev` to match `cargo` - [fitzgen], [pull/439]**

See the discussion of the build profiles feature above. This is a strict renaming of the previous `--debug` flag,
which will now warn as deprecated.

[pull/439]: https://github.com/rustwasm/wasm-pack/pull/439

- **Pre-build before wasm-pack publish - [csmoe], [issue/438] [pull/444]**

Previously, if you ran `wasm-pack publish` before you had successfully run `wasm-pack build`,
you'd receive an error that a package could not be found- because there would be no `pkg` or
out-directory containing a `package.json`.

In this situation, you would hope that `wasm-pack` would build your package for you when you
ran `wasm-pack publish`. This is slightly complicated by the fact that not everyone wants to
build their package to the default target or to a directory named `pkg`.

To solve this, running `wasm-pack publish` before a successful build will give you an interactive
prompt to build your package- allowing you to specify your out directory as well as the target you'd
like to build to. Check it out in the gif below:

![pre-build publish workflow](https://user-images.githubusercontent.com/35686186/50500909-5984fe80-0a8f-11e9-9de6-43d1423b2969.gif)

[issue/438]: https://github.com/rustwasm/wasm-pack/issues/438
[pull/444]: https://github.com/rustwasm/wasm-pack/pull/444

- **Generate self-.gitignore as part of pkg folder - [RReverser], [pull/453]**

Since `wasm-pack` was first published, the `pkg` directory was intended to be treated as a
build artifact, and as such should never be published to version control. This was
never enforced by any assets generated by `wasm-pack`, however.

Now, when building your package, `wasm-pack` will also generate a `.gitignore` file so that the
`pkg`, or out-directory, will be ignored.

If you use another version control tool, you'll need to still create or edit your own ignore file-
pull requests to support other version control tools are welcome!

If you require editing of the generated `package.json` or add additonal assets to your package
before publishing, you'll want to remove the `.gitignore` file and commit to version control. We
intend to have a solution that makes this workflow significantly easier in upcoming releases!

[RReverser]: https://github.com/RReverser
[pull/453]: https://github.com/rustwasm/wasm-pack/pull/453

- **Support cargo workspaces - [fitzgen], [issue/252] [issue/305] [pull/430]**

Workspaces are a well-liked and used feature of cargo that allow you to build multiple crates
in a single cargo project. Because of how `wasm-pack` handled paths for `target` and out-directories,
we did not support cargo workspaces out of the box. Now they should work well and the feature is
well guarded by tests!

[issue/252]: https://github.com/rustwasm/wasm-pack/issues/252
[issue/305]: https://github.com/rustwasm/wasm-pack/issues/305
[pull/430]: https://github.com/rustwasm/wasm-pack/pull/430

- **Use a global cache for all downloaded binaries - [alexcrichton], [pull/426]**

`wasm-pack` is an integrated build tool that orchestrates several other command line tools to build
your wasm project for you. How `wasm-pack` does this has evolved significantly since it's early versions.
In the last version, a `bin` directory was created to house the tool binaries that `wasm-pack` needed to
build our project, but this had several limitations. Firstly, it created a `bin` directory in your project's
root, which could be confusing. Secondly, it meant that sharing these tools across multiple projects was
not possible. We did this because it gaves us the fine-grained control over the version of these tools that
you used.

Now, `wasm-pack` will not generate a `bin` directory, but rather will use a global cache. We retain the
fine-grained control over the versions of these tools that are used, but allow multiple projects that use
the same tools at the same versions to share the already installed asset. Your global cache will generally
be in your user's home directory- we use the [`dirs` crate] to determine where to place this global cache.
This is not currently customizable but is something we intend to look into doing!

This feature ensures that `wasm-pack` users are downloading a minimal number of binaries from the network,
which, for `wasm-pack` users with multiple projects, should speed up build times.

[`dirs` crate]: https://docs.rs/dirs/1.0.4/dirs/fn.cache_dir.html
[pull/426]: https://github.com/rustwasm/wasm-pack/pull/426

- ### 🤕 Fixes

- **Validate `--target` argument - [csmoe], [issue/483] [pull/484]**

[issue/483]: https://github.com/rustwasm/wasm-pack/issues/483
[pull/484]: https://github.com/rustwasm/wasm-pack/pull/484

- **Fix login - [danwilhem], [issue/486] [pull/487]**

[danwilhem]: https://github.com/danwilhem
[issue/486]: https://github.com/rustwasm/wasm-pack/issues/486
[pull/487]: https://github.com/rustwasm/wasm-pack/pull/487

- **Eliminate unecessary escaping in build success terminal output - [huangjj27], [issue/390] [pull/396]**

[issue/390]: https://github.com/rustwasm/wasm-pack/issues/390
[pull/396]: https://github.com/rustwasm/wasm-pack/pull/396

- **Copy license file(s) to out directory - [mstallmo], [issue/407] [pull/411]**

[issue/407]: https://github.com/rustwasm/wasm-pack/issues/407
[pull/411]: https://github.com/rustwasm/wasm-pack/pull/411

- **Fix paths on Windows - [xmclark], [issue/380] [pull/389]**

[issue/380]: https://github.com/rustwasm/wasm-pack/issues/380
[pull/389]: https://github.com/rustwasm/wasm-pack/pull/389

- **Don't require cdylib crate-type for testing - [alexcrichton], [pull/442]**

[pull/442]: https://github.com/rustwasm/wasm-pack/pull/442

- **Fix wasm-bindgen if lib is renamed via `lib.name` - [alexcrichton], [issue/339] [pull/435]**

[issue/339]: https://github.com/rustwasm/wasm-pack/issues/339
[pull/435]: https://github.com/rustwasm/wasm-pack/pull/435

- **Print standard error only once for failing commands - [fitzgen], [issue/422] [pull/424]**

[issue/422]: https://github.com/rustwasm/wasm-pack/issues/422
[pull/424]: https://github.com/rustwasm/wasm-pack/pull/424

- **Add no-modules to --target flag's help text - [fitzgen], [issue/416] [pull/417]**

[issue/416]: https://github.com/rustwasm/wasm-pack/issues/416
[pull/417]: https://github.com/rustwasm/wasm-pack/pull/417

- ### 🛠️ Maintenance

- **Move binary installation to its own crate - [drager], [issue/384] [pull/415]**

[drager]: https://github.com/drager
[issue/384]: https://github.com/rustwasm/wasm-pack/issues/384
[pull/415]: https://github.com/rustwasm/wasm-pack/pull/415

- **Replace internal `Error` with `failure::Error` - [alexcrichton], [pull/436]**

[pull/436]: https://github.com/rustwasm/wasm-pack/pull/436

- **Update `mdbook` version used by Travis - [fitzgen], [pull/433]**

[pull/433]: https://github.com/rustwasm/wasm-pack/pull/433

- **Read the `Cargo.toml` file only once - [fitzgen], [issue/25] [pull/431]**

[issue/25]: https://github.com/rustwasm/wasm-pack/issues/25
[pull/431]: https://github.com/rustwasm/wasm-pack/pull/431

- **Use `name` field for Travis CI jobs - [fitzgen], [pull/432]**

[pull/432]: https://github.com/rustwasm/wasm-pack/pull/432

- **Add a test for build command - [huangjj27], [pull/408]**

[huangjj27]: https://github.com/huangjj27
[pull/408]: https://github.com/rustwasm/wasm-pack/pull/408

- **Fix typo in test function name for copying the README - [mstallmo], [pull/412]**

[pull/412]: https://github.com/rustwasm/wasm-pack/pull/412

- ### 📖 Documentation

- **Complete template deep dive docs - [danwilhem], [issue/345] [issue/346] [pull/490]**

[issue/345]: https://github.com/rustwasm/wasm-pack/issues/345
[issue/346]: https://github.com/rustwasm/wasm-pack/issues/346
[pull/490]: https://github.com/rustwasm/wasm-pack/pull/490

- **Minor docs updates - [fitzgen], [issue/473] [pull/485]**

[issue/473]: https://github.com/rustwasm/wasm-pack/issues/473
[pull/485]: https://github.com/rustwasm/wasm-pack/pull/485

## 🌄 0.5.1

- ### 🤕 Fixes
Expand Down
Loading

0 comments on commit 5f3d015

Please sign in to comment.