Skip to content

Commit

Permalink
[flutter_tools] enable wasm compile on beta channel (#143779)
Browse files Browse the repository at this point in the history
Wasm compilation is now available on `master` and `beta` channels.
  • Loading branch information
kevmoo authored Feb 21, 2024
1 parent 6c78e36 commit bc33439
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/commands/build_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class BuildWebCommand extends BuildSubCommand {
final List<WebCompilerConfig> compilerConfigs;
if (boolArg('wasm')) {
if (!featureFlags.isFlutterWebWasmEnabled) {
throwToolExit('Compiling to WebAssembly (wasm) is only available on the master channel.');
throwToolExit('Compiling to WebAssembly (wasm) is only available on the beta and master channels.');
}
if (stringArg(FlutterOptions.kWebRendererFlag) != argParser.defaultFor(FlutterOptions.kWebRendererFlag)) {
throwToolExit('"--${FlutterOptions.kWebRendererFlag}" cannot be combined with "--${FlutterOptions.kWebWasmFlag}"');
Expand Down
4 changes: 4 additions & 0 deletions packages/flutter_tools/lib/src/features.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ const Feature flutterCustomDevicesFeature = Feature(
const Feature flutterWebWasm = Feature(
name: 'WebAssembly compilation from flutter build web',
environmentOverride: 'FLUTTER_WEB_WASM',
beta: FeatureChannelSetting(
available: true,
enabledByDefault: true,
),
master: FeatureChannelSetting(
available: true,
enabledByDefault: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void main() {

testWithoutContext('Flutter web wasm only enable on master', () {
expect(flutterWebWasm.getSettingForChannel('master').enabledByDefault, isTrue);
expect(flutterWebWasm.getSettingForChannel('beta').enabledByDefault, isFalse);
expect(flutterWebWasm.getSettingForChannel('beta').enabledByDefault, isTrue);
expect(flutterWebWasm.getSettingForChannel('stable').enabledByDefault, isFalse);
});

Expand Down

0 comments on commit bc33439

Please sign in to comment.