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
034adb66
Unverified
Commit
034adb66
authored
Apr 24, 2023
by
Kevin Moore
Committed by
GitHub
Apr 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tool,web] Include more info URI on Wasm init failure (#125312)
parent
9e2e64c7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
build_web.dart
packages/flutter_tools/lib/src/commands/build_web.dart
+2
-1
compile.dart
packages/flutter_tools/lib/src/web/compile.dart
+2
-3
wasm_bootstrap.dart
...ter_tools/lib/src/web/file_generators/wasm_bootstrap.dart
+3
-0
web_constants.dart
packages/flutter_tools/lib/src/web/web_constants.dart
+5
-0
No files found.
packages/flutter_tools/lib/src/commands/build_web.dart
View file @
034adb66
...
@@ -14,6 +14,7 @@ import '../runner/flutter_command.dart'
...
@@ -14,6 +14,7 @@ import '../runner/flutter_command.dart'
show
DevelopmentArtifact
,
FlutterCommandResult
,
FlutterOptions
;
show
DevelopmentArtifact
,
FlutterCommandResult
,
FlutterOptions
;
import
'../web/compile.dart'
;
import
'../web/compile.dart'
;
import
'../web/file_generators/flutter_service_worker_js.dart'
;
import
'../web/file_generators/flutter_service_worker_js.dart'
;
import
'../web/web_constants.dart'
;
import
'build.dart'
;
import
'build.dart'
;
class
BuildWebCommand
extends
BuildSubCommand
{
class
BuildWebCommand
extends
BuildSubCommand
{
...
@@ -91,7 +92,7 @@ class BuildWebCommand extends BuildSubCommand {
...
@@ -91,7 +92,7 @@ class BuildWebCommand extends BuildSubCommand {
}
}
argParser
.
addFlag
(
argParser
.
addFlag
(
FlutterOptions
.
kWebWasmFlag
,
FlutterOptions
.
kWebWasmFlag
,
help:
'Compile to WebAssembly rather than JavaScript.
\n
See
$kWasmPreviewUri
for more information.
'
,
help:
'Compile to WebAssembly rather than JavaScript.
\n
$kWasmMoreInfo
'
,
negatable:
false
,
negatable:
false
,
hide:
!
featureFlags
.
isFlutterWebWasmEnabled
,
hide:
!
featureFlags
.
isFlutterWebWasmEnabled
,
);
);
...
...
packages/flutter_tools/lib/src/web/compile.dart
View file @
034adb66
...
@@ -24,6 +24,7 @@ import '../version.dart';
...
@@ -24,6 +24,7 @@ import '../version.dart';
import
'compiler_config.dart'
;
import
'compiler_config.dart'
;
import
'file_generators/flutter_service_worker_js.dart'
;
import
'file_generators/flutter_service_worker_js.dart'
;
import
'migrations/scrub_generated_plugin_registrant.dart'
;
import
'migrations/scrub_generated_plugin_registrant.dart'
;
import
'web_constants.dart'
;
export
'compiler_config.dart'
;
export
'compiler_config.dart'
;
...
@@ -63,7 +64,7 @@ class WebBuilder {
...
@@ -63,7 +64,7 @@ class WebBuilder {
title:
'Experimental feature'
,
title:
'Experimental feature'
,
'''
'''
WebAssembly compilation is experimental.
WebAssembly compilation is experimental.
See
$kWasmPreviewUri
for more information.
'''
,
$kWasmMoreInfo
'''
,
);
);
}
}
...
@@ -224,8 +225,6 @@ const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kDartSdkJsMapArtif
...
@@ -224,8 +225,6 @@ const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kDartSdkJsMapArtif
},
},
};
};
const
String
kWasmPreviewUri
=
'https://flutter.dev/wasm'
;
String
_buildEventAnalyticsSettings
(
{
String
_buildEventAnalyticsSettings
(
{
required
WebCompilerConfig
config
,
required
WebCompilerConfig
config
,
required
BuildInfo
buildInfo
,
required
BuildInfo
buildInfo
,
...
...
packages/flutter_tools/lib/src/web/file_generators/wasm_bootstrap.dart
View file @
034adb66
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'../web_constants.dart'
;
String
generateWasmBootstrapFile
(
bool
isSkwasm
)
{
String
generateWasmBootstrapFile
(
bool
isSkwasm
)
{
return
'''
return
'''
// Copyright 2014 The Flutter Authors. All rights reserved.
// Copyright 2014 The Flutter Authors. All rights reserved.
...
@@ -18,6 +20,7 @@ String generateWasmBootstrapFile(bool isSkwasm) {
...
@@ -18,6 +20,7 @@ String generateWasmBootstrapFile(bool isSkwasm) {
moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports);
moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports);
} catch (exception) {
} catch (exception) {
console.error(`Failed to fetch and instantiate wasm module:
\
${exception}
`);
console.error(`Failed to fetch and instantiate wasm module:
\
${exception}
`);
console.error('
$kWasmMoreInfo
');
}
}
if (moduleInstance) {
if (moduleInstance) {
...
...
packages/flutter_tools/lib/src/web/web_constants.dart
0 → 100644
View file @
034adb66
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const
String
kWasmMoreInfo
=
'See https://flutter.dev/wasm for more information.'
;
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