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
45c95b26
Commit
45c95b26
authored
Nov 11, 2016
by
John McCutchan
Committed by
GitHub
Nov 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance fixes for hot reload when using a prebuilt loader (#6821)
parent
cccd917a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
+36
-4
executable.dart
packages/flutter_tools/lib/executable.dart
+3
-0
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+4
-2
hot.dart
packages/flutter_tools/lib/src/hot.dart
+18
-2
context.dart
packages/flutter_tools/test/src/context.dart
+11
-0
No files found.
packages/flutter_tools/lib/executable.dart
View file @
45c95b26
...
...
@@ -39,6 +39,7 @@ import 'src/devfs.dart';
import
'src/device.dart'
;
import
'src/doctor.dart'
;
import
'src/globals.dart'
;
import
'src/hot.dart'
;
import
'src/runner/flutter_command_runner.dart'
;
/// Main entry point for commands.
...
...
@@ -90,6 +91,8 @@ Future<Null> main(List<String> args) async {
context
[
DevFSConfig
]
=
new
DevFSConfig
();
if
(
context
[
Doctor
]
==
null
)
context
[
Doctor
]
=
new
Doctor
();
if
(
context
[
HotRunnerConfig
]
==
null
)
context
[
HotRunnerConfig
]
=
new
HotRunnerConfig
();
dynamic
result
=
await
runner
.
run
(
args
);
_exit
(
result
is
int
?
result
:
1
);
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
45c95b26
...
...
@@ -20,6 +20,8 @@ typedef void DevFSProgressReporter(int progress, int max);
class
DevFSConfig
{
/// Should DevFS assume that symlink targets are stable?
bool
cacheSymlinks
=
false
;
/// Should DevFS assume that there are no symlinks to directories?
bool
noDirectorySymlinks
=
false
;
}
DevFSConfig
get
devFSConfig
=>
context
[
DevFSConfig
];
...
...
@@ -521,12 +523,12 @@ class DevFS {
Stream
<
FileSystemEntity
>
files
=
directory
.
list
(
recursive:
recursive
,
followLinks:
false
);
await
for
(
FileSystemEntity
file
in
files
)
{
if
(
file
is
Link
)
{
if
(!
devFSConfig
.
noDirectorySymlinks
&&
(
file
is
Link
))
{
// Check if this is a symlink to a directory and skip it.
final
String
linkPath
=
file
.
resolveSymbolicLinksSync
();
final
FileSystemEntityType
linkType
=
FileStat
.
statSync
(
linkPath
).
type
;
if
(
linkType
==
FileSystemEntityType
.
DIRECTORY
)
{
// Skip links to directories.
continue
;
}
}
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
45c95b26
...
...
@@ -12,6 +12,7 @@ import 'package:stack_trace/stack_trace.dart';
import
'application_package.dart'
;
import
'asset.dart'
;
import
'base/context.dart'
;
import
'base/logger.dart'
;
import
'base/process.dart'
;
import
'base/utils.dart'
;
...
...
@@ -27,6 +28,15 @@ import 'resident_runner.dart';
import
'toolchain.dart'
;
import
'vmservice.dart'
;
class
HotRunnerConfig
{
/// Should the hot runner compute the minimal Dart dependencies?
bool
computeDartDependencies
=
true
;
/// Should the hot runner assume that the minimal Dart dependencies do not change?
bool
stableDartDependencies
=
false
;
}
HotRunnerConfig
get
hotRunnerConfig
=>
context
[
HotRunnerConfig
];
const
bool
kHotReloadDefault
=
true
;
String
getDevFSLoaderScript
(
)
{
...
...
@@ -132,6 +142,10 @@ class HotRunner extends ResidentRunner {
}
bool
_refreshDartDependencies
()
{
if
(!
hotRunnerConfig
.
computeDartDependencies
)
{
// Disabled.
return
true
;
}
if
(
_dartDependencies
!=
null
)
{
// Already computed.
return
true
;
...
...
@@ -364,8 +378,10 @@ class HotRunner extends ResidentRunner {
bundleDirty:
rebuildBundle
,
fileFilter:
_dartDependencies
);
devFSStatus
.
stop
();
// Clear the set after the sync.
_dartDependencies
=
null
;
if
(!
hotRunnerConfig
.
stableDartDependencies
)
{
// Clear the set after the sync so they are recomputed next time.
_dartDependencies
=
null
;
}
printTrace
(
'Synced
${getSizeAsMB(_devFS.bytes)}
.'
);
return
true
;
}
...
...
packages/flutter_tools/test/src/context.dart
View file @
45c95b26
...
...
@@ -9,10 +9,13 @@ import 'package:flutter_tools/src/base/context.dart';
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/devfs.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/hot.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:flutter_tools/src/ios/simulators.dart'
;
import
'package:flutter_tools/src/usage.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:test/test.dart'
;
...
...
@@ -54,6 +57,14 @@ void testUsingContext(String description, dynamic testMethod(), {
testContext
[
OperatingSystemUtils
]
=
os
;
}
if
(!
overrides
.
containsKey
(
DevFSConfig
))
{
testContext
[
DevFSConfig
]
=
new
DevFSConfig
();
}
if
(!
overrides
.
containsKey
(
HotRunnerConfig
))
{
testContext
[
HotRunnerConfig
]
=
new
HotRunnerConfig
();
}
if
(!
overrides
.
containsKey
(
IOSSimulatorUtils
))
{
MockIOSSimulatorUtils
mock
=
new
MockIOSSimulatorUtils
();
when
(
mock
.
getAttachedDevices
()).
thenReturn
(<
IOSSimulator
>[]);
...
...
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