Skip to content

Commit 86231e2

Browse files
HixieCommit Queue
authored and
Commit Queue
committed
Remove the widget cache experiment.
Bug: flutter/flutter#132157 Change-Id: Ie87ba74b8ed99477cc5032824286adb07f1157d6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319871 Reviewed-by: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent 963068b commit 86231e2

File tree

4 files changed

+1
-464
lines changed

4 files changed

+1
-464
lines changed

pkg/front_end/lib/widget_cache.dart

Lines changed: 0 additions & 188 deletions
This file was deleted.

pkg/frontend_server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ This API stability does not cover any of the source code APIs.
1515
* The frontend_server kernel compilation and expression evaluation for kernel should be considered "stable".
1616
* The frontend_server JavaScript compilation is semi-stable, but clients should anticipate coordinated breaking changes in the future.
1717
* The frontend_server JavaScript expression evaluation is experimental and is expected to change significantly from Dec 2020 through the end of 2021.
18-
* Specific flags like the --flutter-widget-cache may be added for experimentation and should not be considered stable.
18+
* Specific flags may be added for experimentation and should not be considered stable.

pkg/frontend_server/lib/frontend_server.dart

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import 'package:dev_compiler/dev_compiler.dart'
2626
import 'package:front_end/src/api_unstable/ddc.dart' as ddc
2727
show IncrementalCompiler;
2828
import 'package:front_end/src/api_unstable/vm.dart';
29-
import 'package:front_end/widget_cache.dart';
3029
import 'package:kernel/ast.dart' show Library, Procedure, LibraryDependency;
3130
import 'package:kernel/binary/ast_to_binary.dart';
3231
import 'package:kernel/kernel.dart'
@@ -211,9 +210,6 @@ ArgParser argParser = ArgParser(allowTrailingOptions: true)
211210
defaultsTo: 'amd')
212211
..addFlag('dartdevc-canary',
213212
help: 'Enable canary features in dartdevc compiler', defaultsTo: false)
214-
..addFlag('flutter-widget-cache',
215-
help: 'Enable the widget cache to track changes to Widget subtypes',
216-
defaultsTo: false)
217213
..addFlag('print-incremental-dependencies',
218214
help: 'Print list of sources added and removed from compilation',
219215
defaultsTo: true)
@@ -436,7 +432,6 @@ class FrontendCompiler implements CompilerInterface {
436432
/// Nullable fields
437433
final ProgramTransformer? transformer;
438434
bool? unsafePackageSerialization;
439-
WidgetCache? _widgetCache;
440435

441436
_onDiagnostic(DiagnosticMessage message) {
442437
switch (message.severity) {
@@ -623,9 +618,6 @@ class FrontendCompiler implements CompilerInterface {
623618
);
624619

625620
incrementalSerializer = _generator.incrementalSerializer;
626-
if (options['flutter-widget-cache']) {
627-
_widgetCache = WidgetCache(component);
628-
}
629621
} else {
630622
if (options['link-platform']) {
631623
// TODO(aam): Remove linkedDependencies once platform is directly embedded
@@ -964,7 +956,6 @@ class FrontendCompiler implements CompilerInterface {
964956
await writeDillFile(results, _kernelBinaryFilename,
965957
incrementalSerializer: _generator.incrementalSerializer);
966958
}
967-
_updateWidgetCache(deltaProgram);
968959

969960
_outputStream.writeln(boundaryKey);
970961
await _outputDependenciesDelta(results.compiledSources!);
@@ -1188,7 +1179,6 @@ class FrontendCompiler implements CompilerInterface {
11881179
@override
11891180
void acceptLastDelta() {
11901181
_generator.accept();
1191-
_widgetCache?.reset();
11921182
}
11931183

11941184
@override
@@ -1202,13 +1192,11 @@ class FrontendCompiler implements CompilerInterface {
12021192
@override
12031193
void invalidate(Uri uri) {
12041194
_generator.invalidate(uri);
1205-
_widgetCache?.invalidate(uri);
12061195
}
12071196

12081197
@override
12091198
void resetIncrementalCompiler() {
12101199
_generator.resetDeltaState();
1211-
_widgetCache?.reset();
12121200
_kernelBinaryFilename = _kernelBinaryFilenameFull;
12131201
}
12141202

@@ -1219,31 +1207,6 @@ class FrontendCompiler implements CompilerInterface {
12191207
incrementalSerialization: incrementalSerialization);
12201208
}
12211209

1222-
/// If the flutter widget cache is enabled, check if a single class was modified.
1223-
///
1224-
/// The resulting class name is written as a String to
1225-
/// `_kernelBinaryFilename`.widget_cache, or else the file is deleted
1226-
/// if it exists.
1227-
///
1228-
/// Should not run if a full component is requested.
1229-
void _updateWidgetCache(Component partialComponent) {
1230-
if (_widgetCache == null || _generator.fullComponent) {
1231-
return;
1232-
}
1233-
final String? singleModifiedClassName =
1234-
_widgetCache!.checkSingleWidgetTypeModified(
1235-
_generator.lastKnownGoodResult?.component,
1236-
partialComponent,
1237-
_generator.lastKnownGoodResult?.classHierarchy,
1238-
);
1239-
final File outputFile = File('$_kernelBinaryFilename.widget_cache');
1240-
if (singleModifiedClassName != null) {
1241-
outputFile.writeAsStringSync(singleModifiedClassName);
1242-
} else if (outputFile.existsSync()) {
1243-
outputFile.deleteSync();
1244-
}
1245-
}
1246-
12471210
Uri _ensureFolderPath(String path) {
12481211
String uriPath = Uri.file(path).toString();
12491212
if (!uriPath.endsWith('/')) {

0 commit comments

Comments
 (0)