https://github.com/dart-lang/webdev/issues/2516
- Updates restart/reload code to accept a resetCompiler boolean to
disambiguate between whether this is a full restart and whether to reset
the resident compiler.
- Adds code to call reloadSources in DWDS and handle the response
(including any errors).
- Adds code to invoke reassemble.
- Adds code to emit a script that DWDS can later consume that contains
the changed sources and their associated libraries. This is used to hot
reload. The bootstrapper puts this in the global window. DWDS should be
updated to accept it in the provider itself. See
https://github.com/dart-lang/webdev/issues/2584.
- Adds code to parse module metadata from the frontend server. This is
identical to the implementation in DWDS % addressing type-related lints.
- Adds tests that run the existing hot reload tests but with web. Some
modifications are mode, including waiting for Flutter runs to finish
executing, and skipping a test that's not possible on the web.
Needs DWDS 24.3.4 to be published first and used before we can land.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.
**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.
---------
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
The test was immediately checking the contents of stdout after the daemon indicated that the hot reload had completed. This could cause a race since the reloaded code may not have had time to execute.
Fixes https://github.com/flutter/flutter/issues/158245
The stream subscriptions in the device's VmService are used by other parts of FlutterVmService and other components throughout flutter_tools. Components that listen to streams should not call VmService.streamCancel because that will interfere with other users who still want the events.
See https://github.com/flutter/flutter/issues/153049
See https://github.com/flutter/flutter/issues/153563
When DevTools is active HotRunner.attach makes a deferred RPC to a DevTools service. That RPC appears to cause issues if it executes at the wrong time during the hot restart.
Passing the --no-devtools flag works around this by disabling the RPC.
See https://github.com/flutter/flutter/issues/153049
In service of https://github.com/flutter/flutter/issues/146879 and https://github.com/flutter/flutter/issues/145812. In these issues, we see what appears to be the flutter tool getting stuck somewhere during hot reload. It may help if we knew were exactly where we are getting stuck (preparing assets, writing them to device, etc.).
This PR adds a new parameter to `FlutterTestDriver::run`, `verbose`. When verbose is set, `FlutterTestDriver` will run `flutter` with `--verbose` in its tests. Keep in mind that `FlutterTestDriver` only prints logs from `flutter` when a test fails, so this shouldn't spam the logs of passing tests.
This PR sets the parameter when invoking the flaky tests from https://github.com/flutter/flutter/issues/146879 and #145812, so we should see more detailed logs in future flakes.
While this is a low risk PR, you can verify the change by intentionally breaking hot reload code, clearing the cached tool binaries, and then running either of these tests.
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated.
Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
Integration tests must only go through the real file system/process manager/platform. The global indirection makes this code harder to understand than if it directly referred to the concrete instances that are being used.
Update the integration shard to use a const instance of a LocalFIleSystem, LocalProcessManager, and LocalPlatform. Remove global usage and apply testWithoutContext.
For #61407 , we need to be able to find all widgets that of a given type. Previously I experimented with using the type name, but of course this does not handles subtypes. The actual check needs to be an is check.
Since there is no way to convert a String to a Type at runtime for use in this check, we can instead evaluate an expression which assigns a closure to a field. The idea for this was inspired by how the dart devtools adds debug functionality to older versions of flutter.
Since the reload feature is not complete yet, adds an integration test which simulates how it will eventually behave
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.
- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
Move FlutterView and related RPCs to the package:vm_service implementation. Update some getIsolate calls with catchError to match previous behavior.
- Updates tests that were previously mocking FlutterViews to use real views
- Moves the FlutterView cache from VM to FlutterDevice
- Catch SentinelException during Isolate.kill
* Update project.pbxproj files to say Flutter rather than Chromium
Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
* Update the copyright notice checker to require a standard notice on all files
* Update copyrights on Dart files. (This was a mechanical commit.)
* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).
* Clean up the copyrights in non-Dart files. (Manual edits.)
Also, make sure templates don't have copyrights.
* Fix some more ORGANIZATIONNAMEs