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
d3a41816
Unverified
Commit
d3a41816
authored
Feb 13, 2020
by
Jonah Williams
Committed by
GitHub
Feb 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure all source maps load correctly for release and profile (#50702)
parent
a833effb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
17 deletions
+30
-17
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+1
-0
devfs_web.dart
packages/flutter_tools/lib/src/web/devfs_web.dart
+21
-10
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+1
-0
web_asset_server_test.dart
...r_tools/test/general.shard/web/web_asset_server_test.dart
+7
-7
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
d3a41816
...
...
@@ -400,6 +400,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
urlTunneller:
urlTunneller
,
buildMode:
debuggingOptions
.
buildInfo
.
mode
,
enableDwds:
_enableDwds
,
entrypoint:
globals
.
fs
.
file
(
target
).
uri
,
);
final
Uri
url
=
await
device
.
devFS
.
create
();
if
(
debuggingOptions
.
buildInfo
.
isDebug
)
{
...
...
packages/flutter_tools/lib/src/web/devfs_web.dart
View file @
d3a41816
...
...
@@ -53,6 +53,7 @@ class WebAssetServer implements AssetReader {
UrlTunneller
urlTunneller
,
BuildMode
buildMode
,
bool
enableDwds
,
Uri
entrypoint
,
)
async
{
try
{
final
InternetAddress
address
=
(
await
InternetAddress
.
lookup
(
hostname
)).
first
;
...
...
@@ -63,7 +64,7 @@ class WebAssetServer implements AssetReader {
// In release builds deploy a simpler proxy server.
if
(
buildMode
!=
BuildMode
.
debug
)
{
final
ReleaseAssetServer
releaseAssetServer
=
ReleaseAssetServer
();
final
ReleaseAssetServer
releaseAssetServer
=
ReleaseAssetServer
(
entrypoint
);
shelf
.
serveRequests
(
httpServer
,
releaseAssetServer
.
handle
);
return
server
;
}
...
...
@@ -318,8 +319,10 @@ class WebDevFS implements DevFS {
@required
this
.
urlTunneller
,
@required
this
.
buildMode
,
@required
this
.
enableDwds
,
@required
this
.
entrypoint
,
});
final
Uri
entrypoint
;
final
String
hostname
;
final
int
port
;
final
String
packagesFilePath
;
...
...
@@ -385,6 +388,7 @@ class WebDevFS implements DevFS {
urlTunneller
,
buildMode
,
enableDwds
,
entrypoint
,
);
return
Uri
.
parse
(
'http://
$hostname
:
$port
'
);
}
...
...
@@ -552,15 +556,22 @@ String _filePathToUriFragment(String path) {
}
class
ReleaseAssetServer
{
ReleaseAssetServer
(
this
.
entrypoint
);
final
Uri
entrypoint
;
// Locations where source files, assets, or source maps may be located.
final
List
<
Uri
>
_searchPaths
=
<
Uri
>[
globals
.
fs
.
directory
(
getWebBuildDirectory
()).
uri
,
globals
.
fs
.
directory
(
Cache
.
flutterRoot
).
parent
.
uri
,
globals
.
fs
.
currentDirectory
.
childDirectory
(
'lib'
).
uri
,
globals
.
fs
.
directory
(
Cache
.
flutterRoot
).
uri
,
globals
.
fs
.
currentDirectory
.
uri
,
];
Future
<
shelf
.
Response
>
handle
(
shelf
.
Request
request
)
async
{
Uri
fileUri
;
if
(
request
.
url
.
toString
()
==
'main.dart'
)
{
fileUri
=
entrypoint
;
}
else
{
for
(
final
Uri
uri
in
_searchPaths
)
{
final
Uri
potential
=
uri
.
resolve
(
request
.
url
.
path
);
if
(
potential
==
null
||
!
globals
.
fs
.
isFileSync
(
potential
.
toFilePath
()))
{
...
...
@@ -569,7 +580,7 @@ class ReleaseAssetServer {
fileUri
=
potential
;
break
;
}
}
if
(
fileUri
!=
null
)
{
final
File
file
=
globals
.
fs
.
file
(
fileUri
);
final
Uint8List
bytes
=
file
.
readAsBytesSync
();
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
d3a41816
...
...
@@ -289,6 +289,7 @@ void main() {
urlTunneller:
null
,
buildMode:
BuildMode
.
debug
,
enableDwds:
false
,
entrypoint:
Uri
.
base
,
);
webDevFS
.
requireJS
.
createSync
(
recursive:
true
);
webDevFS
.
dartSdk
.
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/general.shard/web/web_asset_server_test.dart
View file @
d3a41816
...
...
@@ -40,7 +40,7 @@ void main() {
});
test
(
'release asset server serves correct mime type and content length for png'
,
()
=>
testbed
.
run
(()
async
{
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
();
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
(
Uri
.
base
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'web'
,
'assets'
,
'foo.png'
))
..
createSync
(
recursive:
true
)
..
writeAsBytesSync
(
kTransparentImage
);
...
...
@@ -54,7 +54,7 @@ void main() {
}));
test
(
'release asset server serves correct mime type and content length for JavaScript'
,
()
=>
testbed
.
run
(()
async
{
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
();
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
(
Uri
.
base
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'web'
,
'assets'
,
'foo.js'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'function main() {}'
);
...
...
@@ -68,7 +68,7 @@ void main() {
}));
test
(
'release asset server serves correct mime type and content length for html'
,
()
=>
testbed
.
run
(()
async
{
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
();
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
(
Uri
.
base
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'web'
,
'assets'
,
'foo.html'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'<!doctype html><html></html>'
);
...
...
@@ -82,7 +82,7 @@ void main() {
}));
test
(
'release asset server serves content from flutter root'
,
()
=>
testbed
.
run
(()
async
{
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
();
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
(
Uri
.
base
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'flutter'
,
'bar.dart'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'void main() { }'
);
...
...
@@ -93,8 +93,8 @@ void main() {
}));
test
(
'release asset server serves content from project directory'
,
()
=>
testbed
.
run
(()
async
{
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
();
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'
lib'
,
'
bar.dart'
))
final
ReleaseAssetServer
assetServer
=
ReleaseAssetServer
(
Uri
.
base
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'bar.dart'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'void main() { }'
);
final
Response
response
=
await
assetServer
...
...
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