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
d72f08f5
Unverified
Commit
d72f08f5
authored
Jul 19, 2022
by
David Iglesias
Committed by
GitHub
Jul 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web][debug] Remove RequireJS timeouts for debug builds. (#107868)
parent
cda8041e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
bootstrap.dart
packages/flutter_tools/lib/src/web/bootstrap.dart
+5
-0
bootstrap_test.dart
.../flutter_tools/test/general.shard/web/bootstrap_test.dart
+31
-1
No files found.
packages/flutter_tools/lib/src/web/bootstrap.dart
View file @
d72f08f5
...
@@ -28,6 +28,7 @@ var styles = `
...
@@ -28,6 +28,7 @@ var styles = `
position: absolute;
position: absolute;
top: 0px;
top: 0px;
left: 0px;
left: 0px;
overflow: hidden;
}
}
.indeterminate {
.indeterminate {
...
@@ -131,6 +132,10 @@ String generateMainModule({
...
@@ -131,6 +132,10 @@ String generateMainModule({
})
{
})
{
return
'''
return
'''
/* ENTRYPOINT_EXTENTION_MARKER */
/* ENTRYPOINT_EXTENTION_MARKER */
// Disable require module timeout
require.config({
waitSeconds: 0
});
// Create the main module loaded below.
// Create the main module loaded below.
define("
$bootstrapModule
", ["
$entrypoint
", "dart_sdk"], function(app, dart_sdk) {
define("
$bootstrapModule
", ["
$entrypoint
", "dart_sdk"], function(app, dart_sdk) {
dart_sdk.dart.setStartAsyncSynchronously(true);
dart_sdk.dart.setStartAsyncSynchronously(true);
...
...
packages/flutter_tools/test/general.shard/web/bootstrap_test.dart
View file @
d72f08f5
...
@@ -21,7 +21,7 @@ void main() {
...
@@ -21,7 +21,7 @@ void main() {
expect
(
result
,
contains
(
'requireEl.setAttribute("data-main", "main_module.bootstrap");'
));
expect
(
result
,
contains
(
'requireEl.setAttribute("data-main", "main_module.bootstrap");'
));
});
});
test
(
'generateBootstrapScript includes loading indicator'
,
()
{
test
(
'generateBootstrapScript includes loading indicator'
,
()
{
final
String
result
=
generateBootstrapScript
(
final
String
result
=
generateBootstrapScript
(
requireUrl:
'require.js'
,
requireUrl:
'require.js'
,
mapperUrl:
'mapper.js'
,
mapperUrl:
'mapper.js'
,
...
@@ -30,6 +30,36 @@ test('generateBootstrapScript includes loading indicator', () {
...
@@ -30,6 +30,36 @@ test('generateBootstrapScript includes loading indicator', () {
expect
(
result
,
contains
(
'"indeterminate"'
));
expect
(
result
,
contains
(
'"indeterminate"'
));
});
});
// https://github.com/flutter/flutter/issues/107742
test
(
'generateBootstrapScript loading indicator does not trigger scrollbars'
,
()
{
final
String
result
=
generateBootstrapScript
(
requireUrl:
'require.js'
,
mapperUrl:
'mapper.js'
,
);
// See: https://regexr.com/6q0ft
final
RegExp
regex
=
RegExp
(
r'(?:\.flutter-loader\s*\{)[^}]+(?:overflow\:\s*hidden;)[^}]+}'
);
expect
(
result
,
matches
(
regex
),
reason:
'.flutter-loader must have overflow: hidden'
);
});
// https://github.com/flutter/flutter/issues/82524
test
(
'generateMainModule removes timeout from requireJS'
,
()
{
final
String
result
=
generateMainModule
(
entrypoint:
'foo/bar/main.js'
,
nullAssertions:
false
,
nativeNullAssertions:
false
,
);
// See: https://regexr.com/6q0kp
final
RegExp
regex
=
RegExp
(
r'(?:require\.config\(\{)(?:.|\s(?!\}\);))*'
r'(?:waitSeconds\:\s*0[,]?)'
r'(?:(?!\}\);).|\s)*\}\);'
);
expect
(
result
,
matches
(
regex
),
reason:
'require.config must have a waitSeconds: 0 config entry'
);
});
test
(
'generateMainModule embeds urls correctly'
,
()
{
test
(
'generateMainModule embeds urls correctly'
,
()
{
final
String
result
=
generateMainModule
(
final
String
result
=
generateMainModule
(
entrypoint:
'foo/bar/main.js'
,
entrypoint:
'foo/bar/main.js'
,
...
...
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