From 5bf6ac248535c2d9e980b2e962382ad2874884e9 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Fri, 15 Nov 2024 12:13:10 -0800 Subject: [PATCH] [web_benchmarks] Remove `WebRenderer` enum. (#8103) Removes the `WebRenderer` enum, and its uses in the `CompilationOptions` class. This is a breaking change because it's removing public API (`CompilationOptions.renderer`, `WebRenderer`), but in *practice* people shouldn't need any changes to their code (since the `CompilationOptions` class is used through named constructors). In any case, labeling as `v4.0.0`. Related: https://github.com/flutter/flutter/issues/145954 --- packages/web_benchmarks/CHANGELOG.md | 5 ++++ .../lib/src/compilation_options.dart | 25 +++---------------- packages/web_benchmarks/lib/src/runner.dart | 3 +-- packages/web_benchmarks/pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 0c85d4399095..934507cfbde3 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.0 + +* **Breaking change:** Removes `CompilationOptions.renderer` and the + `WebRenderer` enum. + ## 3.1.1 * Adds `missing_code_block_language_in_doc_comment` lint. diff --git a/packages/web_benchmarks/lib/src/compilation_options.dart b/packages/web_benchmarks/lib/src/compilation_options.dart index 30a349c25201..0a02a8ecbffe 100644 --- a/packages/web_benchmarks/lib/src/compilation_options.dart +++ b/packages/web_benchmarks/lib/src/compilation_options.dart @@ -8,35 +8,16 @@ /// should be built. class CompilationOptions { /// Creates a [CompilationOptions] object that compiles to JavaScript. - const CompilationOptions.js({ - this.renderer = WebRenderer.canvaskit, - }) : useWasm = false; + const CompilationOptions.js() : useWasm = false; /// Creates a [CompilationOptions] object that compiles to WebAssembly. - const CompilationOptions.wasm() - : useWasm = true, - renderer = WebRenderer.skwasm; - - /// The renderer to use for the build. - final WebRenderer renderer; + const CompilationOptions.wasm() : useWasm = true; /// Whether to build the app with dart2wasm. final bool useWasm; @override String toString() { - return '(renderer: ${renderer.name}, compiler: ${useWasm ? 'dart2wasm' : 'dart2js'})'; + return '(compiler: ${useWasm ? 'dart2wasm' : 'dart2js'})'; } } - -/// The possible types of web renderers Flutter can build for. -enum WebRenderer { - /// The HTML web renderer. - html, - - /// The CanvasKit web renderer. - canvaskit, - - /// The SKIA Wasm web renderer. - skwasm, -} diff --git a/packages/web_benchmarks/lib/src/runner.dart b/packages/web_benchmarks/lib/src/runner.dart index 4e52a88f61ab..9a1eb231fe5b 100644 --- a/packages/web_benchmarks/lib/src/runner.dart +++ b/packages/web_benchmarks/lib/src/runner.dart @@ -141,8 +141,7 @@ class BenchmarkServer { if (compilationOptions.useWasm) ...[ '--wasm', '--no-strip-wasm', - ] else - '--web-renderer=${compilationOptions.renderer.name}', + ], '--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true', if (!treeShakeIcons) '--no-tree-shake-icons', '--profile', diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index 1fdc26d8201a..ed3ca89f9ffa 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,7 +2,7 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 3.1.1 +version: 4.0.0 environment: sdk: ^3.3.0