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
f3e8ae7d
Unverified
Commit
f3e8ae7d
authored
Apr 06, 2023
by
Kevin Moore
Committed by
GitHub
Apr 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flutter tool: add experimental output during wasm build (#124166)
parent
667220c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
build_web.dart
packages/flutter_tools/lib/src/commands/build_web.dart
+5
-5
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-0
compile.dart
packages/flutter_tools/lib/src/web/compile.dart
+11
-0
No files found.
packages/flutter_tools/lib/src/commands/build_web.dart
View file @
f3e8ae7d
...
...
@@ -11,7 +11,7 @@ import '../globals.dart' as globals;
import
'../html_utils.dart'
;
import
'../project.dart'
;
import
'../runner/flutter_command.dart'
show
DevelopmentArtifact
,
FlutterCommandResult
;
show
DevelopmentArtifact
,
FlutterCommandResult
,
FlutterOptions
;
import
'../web/compile.dart'
;
import
'build.dart'
;
...
...
@@ -98,14 +98,14 @@ class BuildWebCommand extends BuildSubCommand {
if
(
featureFlags
.
isFlutterWebWasmEnabled
)
{
argParser
.
addSeparator
(
'Experimental options'
);
argParser
.
addFlag
(
'wasm'
,
help:
'Compile to WebAssembly rather than JavaScript.'
,
FlutterOptions
.
kWebWasmFlag
,
help:
'Compile to WebAssembly rather than JavaScript.
\n
See
$kWasmPreviewUri
for more information.
'
,
negatable:
false
,
);
}
else
{
// Add the flag as hidden. Will give a helpful error message in [runCommand] below.
argParser
.
addFlag
(
'wasm'
,
FlutterOptions
.
kWebWasmFlag
,
hide:
true
,
);
}
...
...
@@ -134,7 +134,7 @@ class BuildWebCommand extends BuildSubCommand {
throwToolExit
(
'"build web" is not currently supported. To enable, run "flutter config --enable-web".'
);
}
final
bool
wasmRequested
=
boolArg
(
'wasm'
);
final
bool
wasmRequested
=
boolArg
(
FlutterOptions
.
kWebWasmFlag
);
if
(
wasmRequested
&&
!
featureFlags
.
isFlutterWebWasmEnabled
)
{
throwToolExit
(
'Compiling to WebAssembly (wasm) is only available on the master channel.'
);
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
f3e8ae7d
...
...
@@ -126,6 +126,7 @@ class FlutterOptions {
static
const
String
kWebBrowserFlag
=
'web-browser-flag'
;
static
const
String
kWebRendererFlag
=
'web-renderer'
;
static
const
String
kWebResourcesCdnFlag
=
'web-resources-cdn'
;
static
const
String
kWebWasmFlag
=
'wasm'
;
}
/// flutter command categories for usage.
...
...
packages/flutter_tools/lib/src/web/compile.dart
View file @
f3e8ae7d
...
...
@@ -56,6 +56,15 @@ class WebBuilder {
bool
noFrequencyBasedMinification
=
false
,
String
?
outputDirectoryPath
,
})
async
{
if
(
isWasm
)
{
globals
.
logger
.
printBox
(
title:
'Experimental feature'
,
'''
WebAssembly compilation is experimental.
See
$kWasmPreviewUri
for more information.'''
,
);
}
final
bool
hasWebPlugins
=
(
await
findPlugins
(
flutterProject
)).
any
((
Plugin
p
)
=>
p
.
platforms
.
containsKey
(
WebPlugin
.
kConfigKey
));
final
Directory
outputDirectory
=
outputDirectoryPath
==
null
...
...
@@ -165,3 +174,5 @@ const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kDartSdkJsMapArtif
NullSafetyMode
.
unsound
:
HostArtifact
.
webPrecompiledSdkSourcemaps
,
},
};
const
String
kWasmPreviewUri
=
'https://flutter.dev/wasm'
;
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