Skip to content

Commit

Permalink
Delete code to fallback to the dart:html version of the app. (#2713)
Browse files Browse the repository at this point in the history
Leave the index_fallback.html as an escape hatch to debug if users hit issues or IDEs need to fallback.
  • Loading branch information
jacob314 authored Feb 18, 2021
1 parent 78b9b69 commit 5ec3df5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 81 deletions.
40 changes: 0 additions & 40 deletions packages/devtools_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,10 @@ import 'src/analytics/stub_provider.dart'
import 'src/app.dart';
import 'src/config_specific/framework_initialize/framework_initialize.dart';
import 'src/config_specific/ide_theme/ide_theme.dart';
import 'src/config_specific/load_fallback_app/load_fallback_app.dart';
import 'src/debugger/syntax_highlighter.dart';
import 'src/preferences.dart';

void main() async {
final defaultOnError = FlutterError.onError;
var numErrors = 0;
var fallbackVersionDialogShown = false;

// The SKIA/CanvasKit version of Flutter Web is newer than other platforms
// and depends on WebGL so we need to detect whether it is behaving badly
// to give users the option to reopen DevTools using a fallback slower version
// that may be more stable.
// TODO(jacobr): remove this error listening code once
// https://github.com/flutter/devtools/issues/2125 is fixed.
if (const bool.fromEnvironment('FLUTTER_WEB_USE_SKIA')) {
FlutterError.onError = (FlutterErrorDetails details) {
if (defaultOnError != null) {
defaultOnError(details);
}
final bool overflowError = details.toString().contains('overflowed');

if (overflowError) {
// Overflow errors do not indicate a CanvasKit specific problem and
// occur frequently in debug builds of apps so we filter them out to
// avoid distraction. We could alternately suppress this code completely
// in debug builds but it is risky to add code that runs in release
// builds but not debug builds.
return;
}
// TODO(jacobr): detect SKIA specific errors and warn on the first SKIA
// specific error rather than waiting for multiple errors.
numErrors++;
if (numErrors >= 20 && !fallbackVersionDialogShown) {
fallbackVersionDialogShown = true;
promptToLoadFallbackApp(
"The Flutter web backend ('CanvasKit') has encountered multiple errors.\n"
'Would you like to open a fallback version of DevTools that is '
'slower but does not depend on WebGL?',
);
}
};
}

final ideTheme = getIdeTheme();

final preferences = PreferencesController();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5ec3df5

Please sign in to comment.