Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/web_benchmarks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
25 changes: 3 additions & 22 deletions packages/web_benchmarks/lib/src/compilation_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
3 changes: 1 addition & 2 deletions packages/web_benchmarks/lib/src/runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ class BenchmarkServer {
if (compilationOptions.useWasm) ...<String>[
'--wasm',
'--no-strip-wasm',
] else
'--web-renderer=${compilationOptions.renderer.name}',
],
'--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true',
if (!treeShakeIcons) '--no-tree-shake-icons',
'--profile',
Expand Down
2 changes: 1 addition & 1 deletion packages/web_benchmarks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down