Additionally, when you run `carton dev` a new tab with your app is opened in your default browser
automatically. You can now also specify a port to use for the development server with the `--port`
option (`-p` for short).
All `carton` commands that build Swift code now pretty-print error messages in case of failures.
If an error message points to a specific location in your code, surrounding code has its syntax
highlighted in terminals.
`carton test` now automatically passes `--enable-test-discovery` flag when building your tests, so
you no longer need to manually maintain `LinuxMain.swift` and `XCTestManifests.swift` files in your
test suites.
`carton` now uses the `wasm-5.3-SNAPSHOT-2020-10-21-a` toolchain and SDK by default. This and most
of our recent snapshots are built for both Ubuntu 18.04 and 20.04, the latter supported in `carton`
for the first time. `carton` automatically detects the version of your OS and downloads an
appropriate snapshot. Recent snapshots for macOS are also tested on macOS Big Sur on Intel CPUs
(Apple Silicon is not supported yet), and are signed and distributed as `.pkg` files, which `carton`
fully supports now.
Lastly, we've prepared [a prebuilt Docker
image](https://github.com/orgs/swiftwasm/packages/container/package/carton) for you that you can get
by running
```
docker pull ghcr.io/swiftwasm/carton:latest
```
This image has the toolchain and all required dependencies preinstalled.
Many thanks to [@carson-katri](https://github.com/carson-katri),
[@kateinoigakukun](https://github.com/kateinoigakukun), and [@yonihemi](https://github.com/yonihemi)
for their contributions to this release!
**Closed issues:**
- Method with i64 return type fails on Safari 13+14 ([#127](https://github.com/swiftwasm/carton/issues/127))
- Provide a Dockerfile for easier distribution and testing on Linux ([#119](https://github.com/swiftwasm/carton/issues/119))
- Support downloading Ubuntu 20.04 SDK ([#114](https://github.com/swiftwasm/carton/issues/114))
-`carton dev` should open a browser window when server starts ([#92](https://github.com/swiftwasm/carton/issues/92))
**Merged pull requests:**
- Bump JavaScriptKit to 0.8, stop checking revision ([#139](https://github.com/swiftwasm/carton/pull/139)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Avoid repeated `loadingMessage` in `ProcessRunner` ([#138](https://github.com/swiftwasm/carton/pull/138)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Add support for signed `.pkg` archives on macOS ([#137](https://github.com/swiftwasm/carton/pull/137)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Add Dockerfile, mention the Docker image in `README.md` ([#136](https://github.com/swiftwasm/carton/pull/136)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Fix support for Ubuntu 20.04, use GHA for SwiftLint ([#134](https://github.com/swiftwasm/carton/pull/134)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Build on macOS Big Sur with GitHub Actions ([#132](https://github.com/swiftwasm/carton/pull/132)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Remove sudo usage from `install_ubuntu_deps.sh` ([#135](https://github.com/swiftwasm/carton/pull/135)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Add separate Builder class, use WasmTransformer ([#131](https://github.com/swiftwasm/carton/pull/131)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Bump toolchain, use `--enable-test-discovery` ([#130](https://github.com/swiftwasm/carton/pull/130)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Update dependencies ([#133](https://github.com/swiftwasm/carton/pull/133)) via [@ie-ahm-robox](https://github.com/ie-ahm-robox)
- Bump default toolchain, make i64 bug reproducible ([#128](https://github.com/swiftwasm/carton/pull/128)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Pretty print diagnostics ([#122](https://github.com/swiftwasm/carton/pull/122)) via [@carson-katri](https://github.com/carson-katri)
- Update dependencies ([#125](https://github.com/swiftwasm/carton/pull/125)) via [@ie-ahm-robox](https://github.com/ie-ahm-robox)
- Add @carson-katri and @kateinoigakukun to `FUNDING.yml` ([#124](https://github.com/swiftwasm/carton/pull/124)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Update dependencies ([#118](https://github.com/swiftwasm/carton/pull/118)) via [@ie-ahm-robox](https://github.com/ie-ahm-robox)
- Automatically open a browser window when Dev Server starts ([#117](https://github.com/swiftwasm/carton/pull/117)) via [@yonihemi](https://github.com/yonihemi)
- Allow changing dev server's port ([#116](https://github.com/swiftwasm/carton/pull/116)) via [@yonihemi](https://github.com/yonihemi)
are supported by both `carton dev` (served as static files) and `carton bundle` (copied with the
rest of the assets), if any package resources are declared in your `Package.swift`.
New `carton package` command is introduced, which proxies its subcommands to `swift package`
invocations on the currently-installed toolchain. This may be useful in situations where you'd like
to generate an Xcode project file for your app with something like `carton package generate-xcodeproj`. It would be equivalent to `swift package generate-xcodeproj`, but invoked with
the SwiftWasm toolchain instead of the toolchain supplied by Xcode. Many thanks to
[@kateinoigakukun](https://github.com/kateinoigakukun) for the implementation!
Compatibility with Safari 14 is fixed for `carton dev` and is maintained for the new `carton bundle`
command as well.
This version of `carton` ships with new JavaScript runtime compatible with [JavaScriptKit
0.7](https://github.com/swiftwasm/JavaScriptKit/releases/tag/0.7.0). You should update JavaScriptKit
dependency to 0.7 if you had an older version specified in `Package.swift` of your project.
A regression in `carton test` was fixed in the latest 5.3 toolchain snapshot, which became the
default snapshot version in this version of `carton`. In general we advise against having a
`.swift-version` file in your project, but if you need one, please specify
`wasm-5.3-SNAPSHOT-2020-09-25-a` snapshot or a later one from the 5.3 branch in this file for
`carton test` to work.
**Closed issues:**
-`carton` crashes when it fails to instantiate `TerminalController` ([#112](https://github.com/swiftwasm/carton/issues/112))
- Allow carton to use a provided HTML template file ([#100](https://github.com/swiftwasm/carton/issues/100))
- Add static file support ([#38](https://github.com/swiftwasm/carton/issues/38))
- Demo cannot be run on Safari 14 ([#25](https://github.com/swiftwasm/carton/issues/25))
- Use raw stdout if `TerminalController` is unavailable ([#113](https://github.com/swiftwasm/carton/pull/113)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Bump JavaScriptKit to 0.7.2 ([#115](https://github.com/swiftwasm/carton/pull/115)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Bump dependencies and default toolchain snapshot ([#111](https://github.com/swiftwasm/carton/pull/111)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Implement resources copying in `carton bundle` ([#109](https://github.com/swiftwasm/carton/pull/109)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Update node.js dependencies, including wasmer.js ([#108](https://github.com/swiftwasm/carton/pull/108)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Bump JavaScriptKit dependency to 0.6.0 ([#107](https://github.com/swiftwasm/carton/pull/107)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Implement support for static resources in `carton dev` ([#104](https://github.com/swiftwasm/carton/pull/104)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Bump bl from 4.0.2 to 4.0.3 ([#102](https://github.com/swiftwasm/carton/pull/102)) via [@dependabot[bot]](https://github.com/dependabot[bot])
- Implement `--custom-index-page` option ([#101](https://github.com/swiftwasm/carton/pull/101)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Implement `carton bundle` command ([#97](https://github.com/swiftwasm/carton/pull/97)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Update `tokamak` template for the new TokamakUI org ([#98](https://github.com/swiftwasm/carton/pull/98)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Add `carton package` cmd ([#96](https://github.com/swiftwasm/carton/pull/96)) via [@kateinoigakukun](https://github.com/kateinoigakukun)
This release adds a few major features, namely `carton init` and `carton test` commands, `carton sdk local` subcommand, and enables support for linking with Foundation automatically.
for more details on Foundation compatibility (mostly filesystem, socket, multi-threading, and APIs
depending on those are disabled).
The new `carton init` command initializes a new SwiftWasm project for you (similarly to `swift package init`) with multiple templates available at your choice. `carton init --template tokamak`
`carton init`) creates an empty SwiftWasm project with no dependencies. Also, `carton init list-templates` provides a complete list of templates (with only `basic` and `tokamak` available
currently).
The new `carton test` command runs your test suite in the [`wasmer`](https://wasmer.io/)
environment. Unfortunately, this currently requires a presence of `LinuxMain.swift` file and
explicit test manifests, `--enable-test-discovery` flag is not supported yet. Projects that can
build their test suite on macOS can use `swift test --generate-linuxmain` command to generate this
file.
**Breaking changes:**
The bundled `carton dev` JavaScript entrypoint has been updated to fix runtime issues in the
Swift-to-JavaScript bridge API. Because of this, projects that depend on
[JavaScriptKit](https://github.com/swiftwasm/JavaScriptKit) should specify `c90e82f` revision as a
This is a bugfix release that fixes SwiftWasm backtrace reporting in certain cases and also enables
sorting for the output of the `carton sdk versions` subcommand.
**Merged pull requests:**
- Fix backtrace logging for async startWasiTask ([#30](https://github.com/swiftwasm/carton/pull/30)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Sort the output of `carton sdk versions` ([#29](https://github.com/swiftwasm/carton/pull/29)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Support linking with Foundation/CoreFoundation ([#11](https://github.com/swiftwasm/carton/issues/11))
**Merged pull requests:**
- Log archive size when downloading new SDK ([#28](https://github.com/swiftwasm/carton/pull/28)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Update WASI polyfill, print a backtrace on crash ([#27](https://github.com/swiftwasm/carton/pull/27)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
- Support `carton sdk versions` ([#21](https://github.com/swiftwasm/carton/pull/21)) via [@RayZhao1998](https://github.com/RayZhao1998)
- Add a --release flag to the carton dev command ([#19](https://github.com/swiftwasm/carton/pull/19)) via [@ratranqu](https://github.com/ratranqu)
- Add --destination option to the `carton dev` command ([#18](https://github.com/swiftwasm/carton/pull/18)) via [@ratranqu](https://github.com/ratranqu)