Skip to content

Commit ca7c7b0

Browse files
committed
Major refactoring
Merge branch 'refactor'
2 parents 77ba91c + 1d2ea7c commit ca7c7b0

File tree

16 files changed

+826
-743
lines changed

16 files changed

+826
-743
lines changed

.github/workflows/pages.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ jobs:
2727
uses: actions/configure-pages@v5
2828
- name: Build
2929
run: |
30-
mkdir -p examples/cubes/web/webgpu/pkg examples/cubes/web/webgl2/pkg
31-
cp examples/cubes/index.html examples/cubes/web/webgpu
32-
cp examples/cubes/index.html examples/cubes/web/webgl2
33-
wasm-pack build --target web examples/cubes --out-dir web/webgpu/pkg --features webgpu
34-
wasm-pack build --target web examples/cubes --out-dir web/webgl2/pkg
30+
mkdir -p examples/web/simple
31+
cp examples/simple/index.html examples/web/simple
32+
wasm-pack build --target web examples/simple --out-dir ../web/simple/pkg
33+
mkdir -p examples/web/cubes
34+
cp examples/cubes/index.html examples/web/cubes
35+
wasm-pack build --target web examples/cubes --out-dir ../web/cubes/pkg
3536
- name: Upload artifact
3637
uses: actions/upload-pages-artifact@v3
3738
with:
38-
path: "examples/cubes/web"
39+
path: "examples/web"
3940

4041
deploy:
4142
environment:

Cargo.lock

Lines changed: 25 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
[workspace]
2-
members = ["examples/cubes"]
2+
members = ["examples/cubes", "examples/simple"]
33

44
[workspace.package]
5-
version = "0.2.0"
5+
version = "0.3.0"
66
edition = "2024"
77

88
[workspace.dependencies]
99
bevy = { version = "0.16.1", default-features = false, features = [
1010
"bevy_core_pipeline",
1111
"bevy_log",
12-
"webgl2",
1312
] }
1413
wasm-bindgen = "0.2.100"
1514
web-sys = { version = "0.3.77", features = [
1615
"Document",
16+
"EventTarget",
1717
"Window",
1818
"HtmlVideoElement",
1919
"HtmlMediaElement",
20-
"TextTrack",
21-
"TextTrackCueList",
22-
"TextTrackKind",
23-
"VttCue",
2420
] }
2521

2622
[package]
@@ -37,7 +33,7 @@ webgpu = ["bevy/webgpu"]
3733
[dependencies]
3834
bevy = { workspace = true }
3935
crossbeam-channel = "0.5.15"
40-
enumset = "1.1.7"
36+
gloo-events = "0.2.0"
4137
js-sys = "0.3.77"
4238
wasm-bindgen = { workspace = true }
4339
wasm-bindgen-futures = "0.4.50"
@@ -46,5 +42,9 @@ web-sys = { workspace = true }
4642
# https://github.com/bevyengine/bevy/issues/11079
4743
wgpu-types = "24.0.0"
4844

45+
[dev-dependencies]
46+
bevy = { workspace = true, default-features = true }
47+
console_error_panic_hook = "0.1.7"
48+
4949
[profile.release]
5050
opt-level = "s"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ To run the demo locally:
99
```sh-session
1010
$ cargo install wasm-pack
1111
$ wasm-pack build --target web examples/cubes --features webgpu
12-
$ python -m http.server -d examples/cubes # now open http://localhost:8000/
12+
$ python3 -m http.server -d examples/cubes # now open http://localhost:8000/
1313
```

examples/cubes/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
name = "cubes"
33
version.workspace = true
44
edition.workspace = true
5+
publish = false
56

67
[lib]
78
crate-type = ["cdylib", "rlib"]
89

9-
[features]
10-
webgpu = ["bevy_web_video/webgpu"]
11-
1210
[dependencies]
1311
bevy_web_video = { path = "../.." }
14-
bevy = { workspace = true, default-features = true }
12+
bevy = { workspace = true, features = ["webgpu"], default-features = true }
1513
wasm-bindgen = { workspace = true }
1614
web-sys = { workspace = true }
1715
console_error_panic_hook = "0.1.7"

examples/cubes/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Bevy Web Video</title>
77
<script type="module">
8-
import init, { start } from "./pkg/cubes.js";
8+
import init from "./pkg/cubes.js";
99
await init();
10-
start();
1110
</script>
1211
</head>
1312
<body></body>

0 commit comments

Comments
 (0)