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
60d0fef1
Unverified
Commit
60d0fef1
authored
Mar 10, 2020
by
Jonah Williams
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] move stack_trace_mapper and require.js into memory file system (#52276)
parent
4ce34f25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
devfs_web.dart
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
+4
-15
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+2
-0
No files found.
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
60d0fef1
...
@@ -511,14 +511,16 @@ class WebDevFS implements DevFS {
...
@@ -511,14 +511,16 @@ class WebDevFS implements DevFS {
if
(
bundleFirstUpload
)
{
if
(
bundleFirstUpload
)
{
generator
.
addFileSystemRoot
(
outputDirectoryPath
);
generator
.
addFileSystemRoot
(
outputDirectoryPath
);
final
String
entrypoint
=
globals
.
fs
.
path
.
basename
(
mainPath
);
final
String
entrypoint
=
globals
.
fs
.
path
.
basename
(
mainPath
);
webAssetServer
.
writeFile
(
'/require.js'
,
requireJS
.
readAsStringSync
());
webAssetServer
.
writeFile
(
'/dart_stack_trace_mapper.js'
,
stackTraceMapper
.
readAsStringSync
());
webAssetServer
.
writeFile
(
'/
$entrypoint
'
,
globals
.
fs
.
file
(
mainPath
).
readAsStringSync
());
webAssetServer
.
writeFile
(
'/
$entrypoint
'
,
globals
.
fs
.
file
(
mainPath
).
readAsStringSync
());
webAssetServer
.
writeFile
(
'/manifest.json'
,
'{"info":"manifest not generated in run mode."}'
);
webAssetServer
.
writeFile
(
'/manifest.json'
,
'{"info":"manifest not generated in run mode."}'
);
webAssetServer
.
writeFile
(
'/flutter_service_worker.js'
,
'// Service worker not loaded in run mode.'
);
webAssetServer
.
writeFile
(
'/flutter_service_worker.js'
,
'// Service worker not loaded in run mode.'
);
webAssetServer
.
writeFile
(
webAssetServer
.
writeFile
(
'/main.dart.js'
,
'/main.dart.js'
,
generateBootstrapScript
(
generateBootstrapScript
(
requireUrl:
_filePathToUriFragment
(
requireJS
.
path
)
,
requireUrl:
'/require.js'
,
mapperUrl:
_filePathToUriFragment
(
stackTraceMapper
.
path
)
,
mapperUrl:
'/dart_stack_trace_mapper.js'
,
entrypoint:
'/
$entrypoint
.lib.js'
,
entrypoint:
'/
$entrypoint
.lib.js'
,
),
),
);
);
...
@@ -605,19 +607,6 @@ class WebDevFS implements DevFS {
...
@@ -605,19 +607,6 @@ class WebDevFS implements DevFS {
));
));
}
}
String
_filePathToUriFragment
(
String
path
)
{
if
(
globals
.
platform
.
isWindows
)
{
final
bool
startWithSlash
=
path
.
startsWith
(
'/'
);
final
String
partial
=
globals
.
fs
.
path
.
split
(
path
).
skip
(
startWithSlash
?
2
:
1
).
join
(
'/'
);
if
(
partial
.
startsWith
(
'/'
))
{
return
partial
;
}
return
'/
$partial
'
;
}
return
path
;
}
class
ReleaseAssetServer
{
class
ReleaseAssetServer
{
ReleaseAssetServer
(
this
.
entrypoint
);
ReleaseAssetServer
(
this
.
entrypoint
);
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
60d0fef1
...
@@ -367,6 +367,8 @@ void main() {
...
@@ -367,6 +367,8 @@ void main() {
invalidatedFiles:
<
Uri
>[],
invalidatedFiles:
<
Uri
>[],
);
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/require.js'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/dart_stack_trace_mapper.js'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/main.dart'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/main.dart'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/manifest.json'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/manifest.json'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/flutter_service_worker.js'
),
isNotNull
);
expect
(
webDevFS
.
webAssetServer
.
getFile
(
'/flutter_service_worker.js'
),
isNotNull
);
...
...
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