Week 1: Contribution Baseline
Summary
Date: 2020-03-16 to 2020-03-21
- Amethyst compiles to a WASM library.
- Repository forks and branches are created.
- Contribution guide is written.
- Basic CI check is set up.
Repository | Commit Range |
---|---|
pong_wasm | 9b403f69^..9f6240fe |
amethyst | 8044b2a5^..0af12f84 |
rendy | 27e5cdc1^..757c4aa9 |
glutin (fork) | f29d87a3 |
gfx-rs (fork) | 3e6db5f0 |
winit (fork) | 26e4374a^..04225a39 |
builder (CI agent) | 13730efd^..2bb67aae |
End Result
$ wasm-pack build -- --features "wasm gl"
# ..
[INFO]: :-) Done in 37.87s
[INFO]: :-) Your wasm pkg is ready to publish at ./pkg.
Implementation
Based off the #2040
branch, which has the changes to use the new winit
event loop introduced in winit 0.20.0
.
-
Get amethyst to compile with
winit 0.22.0
for better WASM support. (winit#1478) -
Attempt to compile amethyst with
wasm-pack
.Instructions from https://rustwasm.github.io/docs/book/ were followed to package the library.
When building with:
wasm-pack build --target no-modules -- --features "wasm gl"
-
If it fails due to usage of a
-sys
library, feature gate the dependency and the code that uses it. -
If it fails and requires a code change:
- Fork the repository.
- Create a
wasm
branch. - Amend the code.
- Point
amethyst
at the forked repository. - Make a pull request back to the original repository.
Repeat until
wasm-pack
succeeds. -
-
Create end-to-end application, and make sure it compiles:
pong_wasm
. -
Write contribution guidelines. (amethyst#2171)
Make it easy:
- Links to all forks and branches.
- Cut and paste commands.
- Setup and development instructions.
-
Create CI job to build amethyst as a WASM library. (amethyst#2175)
Note: CI agent needs
wasm32-unknown-unknown
target, andrust-src
component. -
Publicise the WASM effort on the community forum and chat server.