Skip to content

Commit 4ee4466

Browse files
committed
web: Make the default WASM module for npm run build be with extensions
1 parent bb1c841 commit 4ee4466

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

.github/workflows/test_web.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
uses: dtolnay/rust-toolchain@stable
5353
with:
5454
targets: wasm32-unknown-unknown
55-
components: rust-src
5655

5756
- name: Cache Cargo output
5857
uses: Swatinem/rust-cache@v2
@@ -118,7 +117,6 @@ jobs:
118117
uses: dtolnay/rust-toolchain@stable
119118
with:
120119
targets: wasm32-unknown-unknown
121-
components: rust-src
122120

123121
- name: Cache Cargo output
124122
uses: Swatinem/rust-cache@v2

web/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ to update to the latest stable version of rust. You may run `rustup update` to d
4545
rust using the above instructions).
4646

4747
For the compiler to be able to output WebAssembly, an additional target has to be added to it: `rustup target add wasm32-unknown-unknown`
48-
Because we use `RUSTC_BOOTSTRAP` in order to use certain Nightly flags with stable Rust you will also need to run `rustup component add rust-src`.
4948

5049
#### Java
5150

@@ -104,8 +103,8 @@ In this project, you may run the following commands to build all packages:
104103
- This will build the wasm binary and every node package (notably selfhosted and extension).
105104
- Output will be available in the `dist/` folder of each package (for example, `./packages/selfhosted/dist`).
106105
- You may also use `npm run build:debug` to disable Webpack optimizations and activate the (extremely verbose) ActionScript debugging output.
107-
- There is `npm run build:dual-wasm` as well, to build a second WebAssembly module that makes use of some WebAssembly extensions,
108-
potentially resulting in better performance in browsers that support them, at the expense of longer build time.
106+
- There is `npm run build:dual-wasm` as well, to build a second WebAssembly module that disables all supported WebAssembly extensions,
107+
potentially resulting in support for more browsers, at the expense of longer build time.
109108
- `npm run build:repro` enables reproducible builds. Note that this also requires a `version_seal.json`, which is not provided in the normal Git repository - only specially-marked reproducible source archives. Running this without a version seal will generate one based on the current state of your environment.
110109
- You will also need to run `rustup component add rust-src` with either of the previous two commands since we rebuild std for the vanilla WASM module.
111110

web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"scripts": {
4646
"build": "npm run build --workspace=ruffle-core && npm run build --workspace=ruffle-demo --workspace=ruffle-extension --workspace=ruffle-selfhosted",
4747
"build:debug": "cross-env NODE_ENV=development CARGO_FEATURES=avm_debug npm run build",
48-
"build:dual-wasm": "cross-env ENABLE_WASM_EXTENSIONS=true npm run build",
49-
"build:repro": "cross-env ENABLE_WASM_EXTENSIONS=true ENABLE_VERSION_SEAL=true npm run build",
48+
"build:dual-wasm": "cross-env BUILD_WASM_MVP=true npm run build",
49+
"build:repro": "cross-env BUILD_WASM_MVP=true ENABLE_VERSION_SEAL=true npm run build",
5050
"demo": "npm run preview --workspace ruffle-demo",
5151
"test": "npm test --workspaces --if-present",
5252
"wdio": "npm run wdio --workspaces --if-present --",

web/packages/core/tools/build_wasm.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function detectWasmOpt() {
155155
return false;
156156
}
157157
}
158-
const buildExtensions = !!process.env["ENABLE_WASM_EXTENSIONS"];
158+
const buildWasmMvp = !!process.env["BUILD_WASM_MVP"];
159159
const wasmSource = process.env["WASM_SOURCE"] || "cargo";
160160
const hasWasmOpt = detectWasmOpt();
161161
if (!hasWasmOpt) {
@@ -167,15 +167,15 @@ if (wasmSource === "cargo_and_store") {
167167
rmSync("../../dist", { recursive: true, force: true });
168168
mkdirSync("../../dist");
169169
}
170-
buildWasm("web-vanilla-wasm", "ruffle_web", hasWasmOpt, false, wasmSource);
171-
if (buildExtensions) {
172-
buildWasm(
173-
"web-wasm-extensions",
174-
"ruffle_web-wasm_extensions",
175-
hasWasmOpt,
176-
true,
177-
wasmSource,
178-
);
170+
buildWasm(
171+
"web-wasm-extensions",
172+
"ruffle_web-wasm_extensions",
173+
hasWasmOpt,
174+
true,
175+
wasmSource,
176+
);
177+
if (buildWasmMvp) {
178+
buildWasm("web-vanilla-wasm", "ruffle_web", hasWasmOpt, false, wasmSource);
179179
} else {
180-
copyStandIn("ruffle_web", "ruffle_web-wasm_extensions");
180+
copyStandIn("ruffle_web-wasm_extensions", "ruffle_web");
181181
}

0 commit comments

Comments
 (0)