Skip to content

Conversation

devoncarew
Copy link
Member

@devoncarew devoncarew commented Apr 20, 2019

Various work in support of #3293:

  • ensure that the hot reload action is disabled for flutter web app runs
  • disable hot reload on save for flutter web app runs
  • fix a bug where some text (like "Build: Running build completed, took 191ms") was erroneously hyperlinked to in the run console
  • change to connecting to service protocol apps via urls (not ports)
  • remove no longer used 'restart recommended...' text
  • fix an issue where a device was being associated with a flutter web launch; this would cause the iOS simulator to be brought to the front when launching flutter web apps
  • fix an issue where already running flutter web apps weren't reloaded when the run button was hit
  • add support for a new daemon.log event, to better support showing output from running flutter web apps
  • refactor the initial flutter web support - add a new FlutterCommand.FLUTTER_WEB_RUN command

Things that are not yet supported:

  • there's a race condition - which we generally lose - which means that the inspector is not aware of running flutter web apps
  • we do not yet provision webdev locally for users (we rely on a manually pub globally activated version existing)

Both of the above issues will need to be resolved for flutter web support (not necessarily in this PR).

@Nullable FlutterDevice device = DeviceService.getInstance(project).getSelectedDevice();

boolean isFlutterWeb = false;
final String filePath = ((SdkRunConfig)runConfig).getFields().getFilePath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to normalize here to ensure windows is supported, or has that already happened in getFilePath?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just restructures the code on the left to remove a level of nesting - it's fundamentally the same as the previous code.

@devoncarew
Copy link
Member Author

Some updates:

  • fix an npe in the inspector (to do with null devices)
  • fix an npe in the perf view (to do with null devices)
  • handle exceptions from the service protocol when trying to get the source location of widgets

With the latest updates, the inspector now works.

Copy link
Member

@jwren jwren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 nits, but LGTM

catch (UnsupportedEncodingException ignored) {
}

BrowserLauncher.getInstance().browse(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want browse() to be called even if there is a caught exception in the try block above? Reading the code here makes it look like browse() here is supposed to be inside the try-block.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point; this shouldn't happen - the UTF-8 encoding should be available - but I'll move the browser call up to within the try block in any case

}
catch (Exception e) {
// Nothing to do if the service can't be acquired.
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e -> ignored for IntelliJ inspections.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@devoncarew devoncarew merged commit ff4e5ff into flutter:master Apr 22, 2019
DaveShuckerow pushed a commit to DaveShuckerow/flutter-intellij that referenced this pull request Apr 24, 2019
DaveShuckerow pushed a commit to DaveShuckerow/flutter-intellij that referenced this pull request Apr 24, 2019
alexander-doroshko pushed a commit to alexander-doroshko/flutter-intellij that referenced this pull request Jan 24, 2020
* clean up to our flutter web support

* remove printlns

* fix inspector npes

* review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants