Commit graph

145 commits

Author SHA1 Message Date
Jonah Williams 0a73ecf6df
[flutter_tools] use initially parsed package config for language version, sound mode determination (#70323) 2020-11-13 09:41:11 -08:00
Jonah Williams 39bc68b6a2
[flutter_tools] dont use autodetect enum for web (#70189) 2020-11-10 12:49:38 -08:00
Yegor 879466eac2
default to unsound nullability for web (#70120) 2020-11-09 13:49:02 -08:00
Gary Roumanis 16daed86c3
Persist Chrome Default Directory (#69921) 2020-11-06 10:54:04 -08:00
Jonah Williams a0860f6e87
[flutter_tools] retry sever socket setup (and port selection if port is unspecified) (#69351)
Fixes #69348

If the web development server fails to bind, then retry up to 5 times. If a port was not provided, select a new free port each time.
2020-10-29 20:07:34 -07:00
Angjie Li 3056f4194a
Fix issue with --web-renderer. (#69319) 2020-10-29 14:43:06 -07:00
Angjie Li 2bbd004682
Support --web-renderer options which would allow user to specify which rendering backend to use. (#68848) 2020-10-28 17:32:09 -07:00
Jonah Williams 0f28edac65
[flutter_tools] null safety mode is used for dill naming (#68898)
* [flutter_tools] null safety mode is used for dill naming

* add bad test case
2020-10-23 15:39:58 -07:00
Yegor ea3b08f333
Respond to HTTP POST requests with 404 in WebAssetServer (#68492)
* Respond to POST with 404 in WebAssetServer
2020-10-19 16:21:39 -07:00
Alexandre Ardhuin 73301a35a2
Sync lints (#68136) 2020-10-15 15:37:04 -07:00
Yegor 0b78110b26
Work around the glibc bug that causes rare Chrome crashes (#67466)
Work around the glibc bug that causes rare Chrome crashes
2020-10-07 19:29:47 -07:00
Mouad Debbar b42e34690a
[web] Update index.html template to support new path strategy (#67081) 2020-10-02 15:12:04 -07:00
Mouad Debbar 5d6321b509
[web] Respond with 404 to non-found asset or package files (#67088) 2020-10-02 11:02:03 -07:00
Jonah Williams e819f292b3
[flutter_tools] do not require a dependency on devtools server (#66842)
Re-arrange the implementation of the devtools launcher so that google3 is not required to depend on any devtools packages. Also renames the build_runner folders to isolated to better clarify their intention.
2020-09-29 18:15:56 -07:00
Jonah Williams 0e9c6a3d5f
[flutter_tools] do not crash if chrome preference save fails (#66705)
Crash reporting shows at least one occurrence of this due to a windows file lock. That could happen if there is another running chrome instance, or perhaps a virus scanner is running. Print out the error and do not crash.
2020-09-29 13:00:11 -07:00
Mouad Debbar 31254fbe03
[web] Change the web server to support path url strategy (#66606) 2020-09-25 15:42:03 -07:00
Jonah Williams 943b41bd61
[flutter_tools] allow device classes to provide platform-specific interface for devFS Sync (#66266) 2020-09-22 16:57:04 -07:00
Michael R Fairhurst 7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
Balvinder Singh Gambhir 3dde3e034c
[flutter_tools] generates version.json for web using flutter tool (#64644)
Generates version.json in web directory of project. version.json can be used in the future version of package_info which will support web. version.json has the following keys : app_name, version and build_number. This file is generated every time a user runs or builds the project.

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2020-09-15 11:21:54 -07:00
Jaime Blasco 0699c18e99
[flutter_tool] [web] Remove x-frame-options header during debug (#62115)
Currently flutter run -d web creates a server with the x-frame-options: SAMEORIGIN added by default (shelf add it's by default). This doesn't allow you to use it inside a frame.

I am trying to build an embedded simulator in vscode and it requires using an iframe.

With this PR I remove the header for debug and profile mode.
2020-09-03 13:33:39 -07:00
Jonah Williams 69fd5c50a2
[flutter_tools] null assertions off by default for web (#64186)
Like Android/iOS, only enable --null-assertions if asked. Previously this was enabled by default for web, but in general this has proved to be too breaking to enable by default.

#61042
2020-08-19 14:52:47 -07:00
Jonah Williams cb7770b3a5
[flutter_tools] add support for enable null safety asserts (#61114)
Enable null safety asserts for web debug mode. This induces runtime asserts at the boundaries between null safe and non-null safe libraries. Adds integration test that validates assertion error is thrown.

#61042
2020-07-15 09:54:39 -07:00
Jonah Williams e666ea8de4
[flutter_tools] cleanups to web runner functionality (#61178)
Skip unnecessary parsing of chrome URI. Ensure stack traces are initialized in web server. Disclaimer on web server that it does not support debugging and remove help message. Fix generated entrypoint to check for main(List<String> args)

- Fixes #59643
- Fixes #55084
- Fixes #60417
2020-07-13 15:12:46 -07:00
Danny Tuppeny f8135add8e
Add a flag for using WS for debug backend (#61359) 2020-07-13 13:31:04 -07:00
Anna Gringauze 9cbe1dccf3
Added web compiler debug metadata (#61265)
Made flutter tools serve metadata produced by the frontend server:

pass --experimental-emit-metadata flag to flutter engine
store and serve metadata from web asset server
store and serve merged metadata from web asset server
add tests to verify that metadata is served from memory
update dwds version so it can read metadata
configure dwds to read metadata from file
Prerequisite changes (landed):

sdk: https://dart-review.googlesource.com/c/sdk/+/150181
flutter engine: flutter/engine#19168
webdev:dart-lang/webdev#1064
2020-07-10 16:36:43 -07:00
Jonah Williams ae9ac9f211
[flutter_tools] support starting in canvaskit with FLUTTER_WEB_USE_SKIA=true (#60708) 2020-07-01 22:53:03 -07:00
Jonah Williams 7ca324ac01
[flutter_tools] support sound null-safety mode for the web (#60570)
In web debug mode, infer sound null safety by default. When sound null safety is enabled, provide a separate dill and precompiled Dart SDK. Release builds do not need this setting since we run dart2js from source.

Fixes #59873
2020-06-30 12:29:42 -07:00
Jonah Williams e1538d1b88
[flutter_tools] last pass on general.shard unit tests (#60263)
Last batch of test fixes for general shard.
2020-06-26 13:36:06 -07:00
Jonah Williams 82a6f9bf0b
[flutter_tools] remove most use of global packages path (#60231)
The global packages path could cause tests to fail when it would be overriden to unexpected (in test setup) values. Remove most usage and make it a configuration on buildInfo, along with most other build information. Cleanup the asset builder to require the .packages path and the resident runners to no longer require it, since they already have the information in build_info.

It needs to stick around for the fuchsia deps we do not control.

Filled #60232 for remaining work.
2020-06-25 12:52:14 -07:00
Jonah Williams 2a7ee930c3
[flutter_tools] Update WebAssetServer to avoid context, fix tests (#60224)
WebAssetServer could fail if some of the global statics it depended on were initialized in a different order. Fix this by removing globals.

Delete dwds startup test that needs to spawn a real server.
2020-06-24 16:19:49 -07:00
Jonah Williams 5d61bff294
[flutter_tools] even more test fixes (#60156)
Fix tests broken under tester
2020-06-24 10:23:59 -07:00
Jonah Williams dd49e57be2
[flutter_tools] more test fixes (#60144)
Fixes additional bugs uncovered by tester, style fixes to prevent suggested imports.
2020-06-23 17:53:00 -07:00
Jonah Williams 37db92beeb
[versions] update all versions and fix tool tests (#60127)
Update all versions, specifically file which fixes some bugs that caused tests to fail if run in different orders:

- systemTemp directories created by MemoryFileSystem will allot names based on the file system instance instead of globally.
- MemoryFile.readAsLines()/readAsLinesSync() no longer treat a final newline in the file as the start of a new, empty line.
- RecordingFile.readAsLine()/readAsLinesSync() now always record a final newline.
2020-06-23 15:48:37 -07:00
Danny Tuppeny 96711b00ce
Don't crash on requests for invalid package URLs (#59250) 2020-06-12 09:25:04 -07:00
Jonah Williams 6067571fab
[flutter_tools] support flutter run -d edge (#56173)
Support Microsoft Edge as a device for flutter run when web is enabled. Currently this only works on Windows, and does not include a validator for edge.

Fixes #55322
2020-06-09 12:03:51 -07:00
Jonah Williams 4f88ed1d3c
[flutter_tools] only restrict devices based on arch + buildMode, not emulator status (#58887)
instead of restricting profile/release mode based on whether the tool thinks the device is an emulator, restrict based on the device target architecture and the requested build mode. Notably, this enables release mode on x86_64 Android emulators, but not x86 emulators since we do not support that as an AOT target.

This does not add release mode support for simulators, since this requires us to build and upload artifacts for simulator/x86_64
2020-06-08 11:20:15 -07:00
Jonah Williams f5de6aadd4
[flutter_tools] remove zone level overrides of verbose and daemon logging (#57448)
Make it possible for all FlutterCommands to be global free, by moving instantiation to inside the Zone context. Additionally, provide VerboseLogger and NotifyLogger (daemon) at the top level and remove from command-specific overrides.

This allows removing a work around where web devices needed to look up directly from the context in non-test code.

Technically the output preferences are still zone injected, but these will be moved soon as they were not being used correctly by the top level command (the injection comes after ArgParser reads the overflow values, causing numerous wrap issues)
2020-06-04 16:35:36 -07:00
Jonah Williams 3bc4a82605
[flutter_tools] avoid serving files outside of expected paths (#58653) 2020-06-04 11:53:04 -07:00
Zachary Anderson 6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
Jonah Williams 9b7b9d795e
[flutter_tools] reland remove flutter view cache (#56387)
Fixes #56194

Remove caching of FlutterView and poll forever if the list of flutter views is empty. Added test for missing release mode logic.
2020-05-05 12:09:51 -07:00
Jonah Williams d98d3a973f
Revert "[flutter_tools] remove flutter view cache (#56223)" (#56385)
This reverts commit 209bdcb669.
2020-05-05 11:15:33 -07:00
Jonah Williams 209bdcb669
[flutter_tools] remove flutter view cache (#56223)
Remove caching of FlutterView. Perhaps the FlutterView RPC might return an empty list if the VM is not quite up yet? We had some old logic to poll the flutter views RPC for up to 200ms. That doesn't seem like a great approach, so instead we could forgo it entirely and trust that either the views come up before the developer tries to interact, or we crash.
2020-05-05 10:47:01 -07:00
Jonah Williams 72397fd448
[flutter_tools] Lazily inject logger into web devices (#55961)
Constructing the WebDevices with the global logger too early will lead to them grabbing the StdoutLogger when running in daemon mode. This prevents IDEs from seeing the correct debug message.
2020-04-29 11:35:40 -07:00
Jonah Williams 2aa9016652
[flutter_tools] ensure etag headers are ascii (#55704) 2020-04-27 15:02:15 -07:00
Jonah Williams 2f0d41b2a6
[flutter_tools] set test directory base as additional root, allow running without index.html (#55531) 2020-04-24 09:09:53 -07:00
Jonah Williams f2761b6b04
[flutter_tools] refactor Chrome launch logic to remove globals/statics (#55160) 2020-04-22 01:28:51 -07:00
Jonah Williams b7e30cfc26
[flutter_tools] update compilation to use package config (#54467) 2020-04-20 14:02:49 -07:00
Anna Gringauze b69b2a8c9e
Convert expression evaluation exceptions to errors (#54916) 2020-04-17 10:40:02 -07:00
Jonah Williams c141a53f9a
[flutter_tools] support any as a special web-hostname (#54715) 2020-04-15 10:55:01 -07:00
Jonah Williams 412e4dd50e
[flutter_tools] migrate devfs web to package_config (#54299) 2020-04-08 14:41:11 -07:00