Skip to content

Commit

Permalink
Convert from stdweb to wasm-bindgen (rustyscreeps#333)
Browse files Browse the repository at this point in the history
API conversion from stdweb to wasm-bindgen, with enormous assistance from half a dozen amazing contributors whom I couldn't have done it without!

---------

Co-authored-by: William Archbell <[email protected]>
Co-authored-by: Ken Hoover <[email protected]>
Co-authored-by: Ken Hoover <[email protected]>
Co-authored-by: Sebastian Meßmer <[email protected]>
Co-authored-by: chlobes <[email protected]>
Co-authored-by: James Grant <[email protected]>
Co-authored-by: Adam Gastineau <[email protected]>
  • Loading branch information
8 people authored Mar 13, 2023
1 parent 8aba0bd commit 6a7d44d
Show file tree
Hide file tree
Showing 107 changed files with 10,480 additions and 7,965 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
matrix:
toolchain: [stable, nightly]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -37,24 +40,3 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ env.rustc-hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install cargo-web
uses: actions-rs/[email protected]
with:
crate: cargo-web
version: latest
use-tool-cache: true

- name: cargo web build
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: web
args: build --target=wasm32-unknown-unknown

- name: cargo web build --all-features
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: web
args: build --target=wasm32-unknown-unknown --all-features
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Unreleased
==========

### Notably breaking:

- Convert from stdweb to wasm-bindgen as underlying framework. While extensive effort was put into
keeping the API as similar as possible to prior versions, breaking changes are present
throughout the API as well as associated representations, such as resource types' serialized
values; bots still using stdweb APIs should target version 0.9.

0.9.1 (2022-09-08)
==================

Expand Down
27 changes: 15 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[package]
name = "screeps-game-api"
version = "0.9.1"
version = "0.10.0"
authors = ["David Ross <[email protected]>"]
documentation = "https://docs.rs/screeps-game-api/"
edition = "2018"
edition = "2021"
include = [
"Cargo.toml",
"Web.toml",
"src/**/*",
"javascript/**/*",
"tests/**/*",
"examples/**/*",
"README.md",
Expand All @@ -29,20 +28,24 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
arrayvec = "0.5"
enum-iterator = "0.6"
log = "0.4"
arrayvec = "0.7"
enum_dispatch = "0.3"
enum-iterator = "0.7"
js-sys = "0.3"
num-derive = "0.3"
num-traits = "0.2"
parse-display = { version = "0.4", default-features = false, features = [ 'std', 'once_cell' ] }
serde = {version = "1", features = ["derive"]}
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_repr = "0.1"
stdweb = "0.4"
stdweb-derive = "0.5"
wasm-bindgen = "0.2"
serde-wasm-bindgen = "0.4"

[dev-dependencies]
wasm-bindgen-test = "0.3"
bincode = "1.3"

[features]
check-all-casts = []
## Specific features to enable conditional API endpoints

# Enable the function call for pixel generation - only present on official MMO servers
generate-pixel = []
Expand All @@ -53,7 +56,7 @@ inter-shard-memory = []
# Enable score container, collector, and resource - used in season 1
score = []

# Enable symbol containers, decoders, and resources - used in season 2
# Enable symbol container, decoder, and resources - used in season 2
symbols = []

## Sets of the above features for different server environments
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cargo screeps --help
[actions-image]: https://github.com/rustyscreeps/screeps-game-api/actions/workflows/build.yml/badge.svg
[actions-builds]: https://github.com/rustyscreeps/screeps-game-api/actions/workflows/build.yml
[docsrs-badge]: https://docs.rs/screeps-game-api/badge.svg
[cratesio-badge]: http://meritbadge.herokuapp.com/screeps-game-api
[cratesio-badge]: https://img.shields.io/crates/v/screeps-game-api.svg
[docs]: https://docs.rs/screeps-game-api/
[crate]: https://crates.io/crates/screeps-game-api/
[cargo-screeps]: https://github.com/rustyscreeps/cargo-screeps/
Expand Down
1 change: 0 additions & 1 deletion Web.toml

This file was deleted.

4 changes: 0 additions & 4 deletions javascript/console_error.js

This file was deleted.

Loading

0 comments on commit 6a7d44d

Please sign in to comment.