diff --git a/packages/flutter_tools/lib/src/commands/build_web.dart b/packages/flutter_tools/lib/src/commands/build_web.dart index def82bd560..fe3a141b4f 100644 --- a/packages/flutter_tools/lib/src/commands/build_web.dart +++ b/packages/flutter_tools/lib/src/commands/build_web.dart @@ -14,6 +14,7 @@ import '../runner/flutter_command.dart' show DevelopmentArtifact, FlutterCommandResult, FlutterOptions; import '../web/compile.dart'; import '../web/file_generators/flutter_service_worker_js.dart'; +import '../web/web_constants.dart'; import 'build.dart'; class BuildWebCommand extends BuildSubCommand { @@ -91,7 +92,7 @@ class BuildWebCommand extends BuildSubCommand { } argParser.addFlag( FlutterOptions.kWebWasmFlag, - help: 'Compile to WebAssembly rather than JavaScript.\nSee $kWasmPreviewUri for more information.', + help: 'Compile to WebAssembly rather than JavaScript.\n$kWasmMoreInfo', negatable: false, hide: !featureFlags.isFlutterWebWasmEnabled, ); diff --git a/packages/flutter_tools/lib/src/web/compile.dart b/packages/flutter_tools/lib/src/web/compile.dart index ab09203110..004ac1a50a 100644 --- a/packages/flutter_tools/lib/src/web/compile.dart +++ b/packages/flutter_tools/lib/src/web/compile.dart @@ -24,6 +24,7 @@ import '../version.dart'; import 'compiler_config.dart'; import 'file_generators/flutter_service_worker_js.dart'; import 'migrations/scrub_generated_plugin_registrant.dart'; +import 'web_constants.dart'; export 'compiler_config.dart'; @@ -63,7 +64,7 @@ class WebBuilder { title: 'Experimental feature', ''' WebAssembly compilation is experimental. - See $kWasmPreviewUri for more information.''', + $kWasmMoreInfo''', ); } @@ -224,8 +225,6 @@ const Map> kDartSdkJsMapArtif }, }; -const String kWasmPreviewUri = 'https://flutter.dev/wasm'; - String _buildEventAnalyticsSettings({ required WebCompilerConfig config, required BuildInfo buildInfo, diff --git a/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart b/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart index a8440b1803..c2ee17b496 100644 --- a/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart +++ b/packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import '../web_constants.dart'; + String generateWasmBootstrapFile(bool isSkwasm) { return ''' // Copyright 2014 The Flutter Authors. All rights reserved. @@ -18,6 +20,7 @@ String generateWasmBootstrapFile(bool isSkwasm) { moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports); } catch (exception) { console.error(`Failed to fetch and instantiate wasm module: \${exception}`); + console.error('$kWasmMoreInfo'); } if (moduleInstance) { diff --git a/packages/flutter_tools/lib/src/web/web_constants.dart b/packages/flutter_tools/lib/src/web/web_constants.dart new file mode 100644 index 0000000000..9eba6ace6c --- /dev/null +++ b/packages/flutter_tools/lib/src/web/web_constants.dart @@ -0,0 +1,5 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +const String kWasmMoreInfo = 'See https://flutter.dev/wasm for more information.';