Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f98df595
Unverified
Commit
f98df595
authored
Aug 08, 2019
by
Jonah Williams
Committed by
GitHub
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure resident web runner usage to avoid SDK users that don't support dwds (#37815)
parent
41cc80c5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
28 deletions
+79
-28
executable.dart
packages/flutter_tools/lib/executable.dart
+5
-0
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+34
-13
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+1
-1
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+5
-5
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+2
-3
web_runner.dart
packages/flutter_tools/lib/src/web/web_runner.dart
+26
-0
build_web_test.dart
...ter_tools/test/general.shard/commands/build_web_test.dart
+1
-1
resident_web_runner_cold_test.dart
...ols/test/general.shard/resident_web_runner_cold_test.dart
+2
-2
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+2
-2
web_fs_test.dart
...ges/flutter_tools/test/general.shard/web/web_fs_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/executable.dart
View file @
f98df595
...
...
@@ -10,6 +10,7 @@ import 'src/base/context.dart';
// avoid introducing the dependency into google3. Not all build* packages
// are synced internally.
import
'src/build_runner/build_runner.dart'
;
import
'src/build_runner/resident_web_runner.dart'
;
import
'src/build_runner/web_compilation_delegate.dart'
;
import
'src/codegen.dart'
;
...
...
@@ -46,6 +47,7 @@ import 'src/commands/upgrade.dart';
import
'src/commands/version.dart'
;
import
'src/runner/flutter_command.dart'
;
import
'src/web/compile.dart'
;
import
'src/web/web_runner.dart'
;
/// Main entry point for commands.
///
...
...
@@ -100,5 +102,8 @@ Future<void> main(List<String> args) async {
// the build runner packages are not synced internally.
CodeGenerator:
()
=>
const
BuildRunner
(),
WebCompilationProxy:
()
=>
BuildRunnerWebCompilationProxy
(),
// The web runner is not supported internally because it depends
// on dwds.
WebRunnerFactory:
()
=>
DwdsWebRunnerFactory
(),
});
}
packages/flutter_tools/lib/src/resident_web_runner.dart
→
packages/flutter_tools/lib/src/
build_runner/
resident_web_runner.dart
View file @
f98df595
...
...
@@ -8,19 +8,40 @@ import 'package:dwds/dwds.dart';
import
'package:meta/meta.dart'
;
import
'package:vm_service_lib/vm_service_lib.dart'
as
vmservice
;
import
'application_package.dart'
;
import
'base/common.dart'
;
import
'base/file_system.dart'
;
import
'base/logger.dart'
;
import
'base/terminal.dart'
;
import
'base/utils.dart'
;
import
'build_info.dart'
;
import
'convert.dart'
;
import
'device.dart'
;
import
'globals.dart'
;
import
'project.dart'
;
import
'resident_runner.dart'
;
import
'web/web_fs.dart'
;
import
'../application_package.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../base/terminal.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../convert.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
import
'../resident_runner.dart'
;
import
'../web/web_runner.dart'
;
import
'web_fs.dart'
;
/// Injectable factory to create a [ResidentWebRunner].
class
DwdsWebRunnerFactory
extends
WebRunnerFactory
{
@override
ResidentRunner
createWebRunner
(
Device
device
,
{
String
target
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
})
{
return
ResidentWebRunner
(
device
,
target:
target
,
flutterProject:
flutterProject
,
debuggingOptions:
debuggingOptions
,
ipv6:
ipv6
,
);
}
}
// TODO(jonahwilliams): remove this constant when the error message is removed.
// The web engine is currently spamming this message on certain pages. Filter it out
...
...
packages/flutter_tools/lib/src/
web
/web_fs.dart
→
packages/flutter_tools/lib/src/
build_runner
/web_fs.dart
View file @
f98df595
...
...
@@ -30,7 +30,7 @@ import '../bundle.dart';
import
'../cache.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
import
'chrome.dart'
;
import
'
../web/
chrome.dart'
;
/// The name of the built web project.
const
String
kBuildTargetName
=
'web'
;
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
f98df595
...
...
@@ -21,10 +21,10 @@ import '../emulator.dart';
import
'../globals.dart'
;
import
'../project.dart'
;
import
'../resident_runner.dart'
;
import
'../resident_web_runner.dart'
;
import
'../run_cold.dart'
;
import
'../run_hot.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../web/web_runner.dart'
;
const
String
protocolVersion
=
'0.5.3'
;
...
...
@@ -414,12 +414,12 @@ class AppDomain extends Domain {
ResidentRunner
runner
;
if
(
await
device
.
targetPlatform
==
TargetPlatform
.
web_javascript
)
{
runner
=
ResidentWebRunner
(
flutterDevice
.
device
,
debuggingOptions:
options
,
runner
=
webRunnerFactory
.
createWebRunner
(
device
,
flutterProject:
flutterProject
,
ipv6:
ipv6
,
target:
target
,
debuggingOptions:
options
,
ipv6:
ipv6
,
);
}
else
if
(
enableHotReload
)
{
runner
=
HotRunner
(
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
f98df595
...
...
@@ -19,13 +19,12 @@ import '../macos/xcode.dart';
import
'../project.dart'
;
import
'../reporting/reporting.dart'
;
import
'../resident_runner.dart'
;
import
'../resident_web_runner.dart'
;
import
'../run_cold.dart'
;
import
'../run_hot.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../tracing.dart'
;
import
'../version.dart'
;
import
'../web/web_runner.dart'
;
import
'daemon.dart'
;
abstract
class
RunCommandBase
extends
FlutterCommand
with
DeviceBasedDevelopmentArtifacts
{
...
...
@@ -430,7 +429,7 @@ class RunCommand extends RunCommandBase {
ipv6:
ipv6
,
);
}
else
if
(
webMode
)
{
runner
=
Resident
WebRunner
(
runner
=
webRunnerFactory
.
create
WebRunner
(
devices
.
single
,
target:
targetFile
,
flutterProject:
flutterProject
,
...
...
packages/flutter_tools/lib/src/web/web_runner.dart
0 → 100644
View file @
f98df595
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:meta/meta.dart'
;
import
'../base/context.dart'
;
import
'../device.dart'
;
import
'../project.dart'
;
import
'../resident_runner.dart'
;
WebRunnerFactory
get
webRunnerFactory
=>
context
.
get
<
WebRunnerFactory
>();
// Hack to hide web imports for google3.
abstract
class
WebRunnerFactory
{
const
WebRunnerFactory
();
/// Create a [ResidentRunner] for the web.
ResidentRunner
createWebRunner
(
Device
device
,
{
String
target
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
});
}
packages/flutter_tools/test/general.shard/commands/build_web_test.dart
View file @
f98df595
...
...
@@ -12,7 +12,7 @@ import 'package:flutter_tools/src/commands/build.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/resident_web_runner.dart'
;
import
'package:flutter_tools/src/
build_runner/
resident_web_runner.dart'
;
import
'package:flutter_tools/src/version.dart'
;
import
'package:flutter_tools/src/web/compile.dart'
;
import
'package:mockito/mockito.dart'
;
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart
View file @
f98df595
...
...
@@ -11,8 +11,8 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/resident_web_runner.dart'
;
import
'package:flutter_tools/src/
web
/web_fs.dart'
;
import
'package:flutter_tools/src/
build_runner/
resident_web_runner.dart'
;
import
'package:flutter_tools/src/
build_runner
/web_fs.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service_lib/vm_service_lib.dart'
;
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
f98df595
...
...
@@ -13,8 +13,8 @@ import 'package:flutter_tools/src/device.dart';
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/resident_web_runner.dart'
;
import
'package:flutter_tools/src/
web
/web_fs.dart'
;
import
'package:flutter_tools/src/
build_runner/
resident_web_runner.dart'
;
import
'package:flutter_tools/src/
build_runner
/web_fs.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service_lib/vm_service_lib.dart'
;
...
...
packages/flutter_tools/test/general.shard/web/web_fs_test.dart
View file @
f98df595
...
...
@@ -10,7 +10,7 @@ import 'package:flutter_tools/src/base/os.dart';
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/
web
/web_fs.dart'
;
import
'package:flutter_tools/src/
build_runner
/web_fs.dart'
;
import
'package:http_multi_server/http_multi_server.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment