[web] hide the --web-renderer option in the tool (#152683)

Hide the `--web-renderer` option in the Flutter Tool. The defaults already cover all fully supported modes:

- `flutter build web` provides canvaskit + dart2js
- `flutter build web --wasm` provides skwasm + dart2wasm

We do not want to encourage production usage of any other permutations (e.g. `auto` or `html`), in particular those that simply do not work (e.g. `skwasm` + dart2js).

Fixes https://github.com/flutter/flutter/issues/140096
Fixes https://github.com/flutter/flutter/issues/151786
This commit is contained in:
Yegor
2024-08-07 11:40:58 -07:00
committed by GitHub
parent 7c8feb94a5
commit e8d2e5814e
3 changed files with 77 additions and 4 deletions

View File

@@ -707,11 +707,28 @@ abstract class FlutterCommand extends Command<void> {
);
}
// This option is deprecated and is no longer publicly supported, and
// therefore is hidden.
//
// The option still exists for internal testing, and to give existing users
// time to migrate off the HTML renderer, but it is no longer advertised as a
// supported mode.
//
// See also:
// * https://github.com/flutter/flutter/issues/151786
// * https://github.com/flutter/flutter/issues/145954
void usesWebRendererOption() {
argParser.addOption(
hide: true,
FlutterOptions.kWebRendererFlag,
allowed: WebRendererMode.values.map((WebRendererMode e) => e.name),
help: 'The renderer implementation to use when building for the web.',
help: 'This option is deprecated and will be removed in a future Flutter '
'release.\n'
'Selects the renderer implementation to use when building for the '
'web. The supported renderers are "canvaskit" when compiling to '
'JavaScript, and "skwasm" when compiling to WebAssembly. Other '
'renderer and compiler combinations are no longer supported. '
'Consider migrating your app to a supported renderer.',
allowedHelp: CliEnum.allowedHelp(WebRendererMode.values)
);
}