Skip to content

Commit 5bf6ac2

Browse files
authored
[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: flutter/flutter#145954
1 parent 7dd395e commit 5bf6ac2

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

packages/web_benchmarks/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.0.0
2+
3+
* **Breaking change:** Removes `CompilationOptions.renderer` and the
4+
`WebRenderer` enum.
5+
16
## 3.1.1
27

38
* Adds `missing_code_block_language_in_doc_comment` lint.

packages/web_benchmarks/lib/src/compilation_options.dart

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,16 @@
88
/// should be built.
99
class CompilationOptions {
1010
/// Creates a [CompilationOptions] object that compiles to JavaScript.
11-
const CompilationOptions.js({
12-
this.renderer = WebRenderer.canvaskit,
13-
}) : useWasm = false;
11+
const CompilationOptions.js() : useWasm = false;
1412

1513
/// Creates a [CompilationOptions] object that compiles to WebAssembly.
16-
const CompilationOptions.wasm()
17-
: useWasm = true,
18-
renderer = WebRenderer.skwasm;
19-
20-
/// The renderer to use for the build.
21-
final WebRenderer renderer;
14+
const CompilationOptions.wasm() : useWasm = true;
2215

2316
/// Whether to build the app with dart2wasm.
2417
final bool useWasm;
2518

2619
@override
2720
String toString() {
28-
return '(renderer: ${renderer.name}, compiler: ${useWasm ? 'dart2wasm' : 'dart2js'})';
21+
return '(compiler: ${useWasm ? 'dart2wasm' : 'dart2js'})';
2922
}
3023
}
31-
32-
/// The possible types of web renderers Flutter can build for.
33-
enum WebRenderer {
34-
/// The HTML web renderer.
35-
html,
36-
37-
/// The CanvasKit web renderer.
38-
canvaskit,
39-
40-
/// The SKIA Wasm web renderer.
41-
skwasm,
42-
}

packages/web_benchmarks/lib/src/runner.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ class BenchmarkServer {
141141
if (compilationOptions.useWasm) ...<String>[
142142
'--wasm',
143143
'--no-strip-wasm',
144-
] else
145-
'--web-renderer=${compilationOptions.renderer.name}',
144+
],
146145
'--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true',
147146
if (!treeShakeIcons) '--no-tree-shake-icons',
148147
'--profile',

packages/web_benchmarks/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: web_benchmarks
22
description: A benchmark harness for performance-testing Flutter apps in Chrome.
33
repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22
5-
version: 3.1.1
5+
version: 4.0.0
66

77
environment:
88
sdk: ^3.3.0

0 commit comments

Comments
 (0)