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
388f3217
Unverified
Commit
388f3217
authored
Mar 26, 2024
by
Kevin Moore
Committed by
GitHub
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Enable WebAssembly compilation everywhere, remove feature flag (#145562)
parent
55528ba1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
4 additions
and
48 deletions
+4
-48
build_web.dart
packages/flutter_tools/lib/src/commands/build_web.dart
+4
-11
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+0
-2
features.dart
packages/flutter_tools/lib/src/features.dart
+0
-18
flutter_features.dart
packages/flutter_tools/lib/src/flutter_features.dart
+0
-3
features_test.dart
packages/flutter_tools/test/general.shard/features_test.dart
+0
-6
flutter_build_wasm_test.dart
...tools/test/integration.shard/flutter_build_wasm_test.dart
+0
-4
fakes.dart
packages/flutter_tools/test/src/fakes.dart
+0
-4
No files found.
packages/flutter_tools/lib/src/commands/build_web.dart
View file @
388f3217
...
...
@@ -97,22 +97,18 @@ class BuildWebCommand extends BuildSubCommand {
);
//
//
Experimental
options
//
WebAssembly compilation
options
//
if
(
featureFlags
.
isFlutterWebWasmEnabled
)
{
argParser
.
addSeparator
(
'Experimental options'
);
}
argParser
.
addSeparator
(
'WebAssembly compilation options'
);
argParser
.
addFlag
(
FlutterOptions
.
kWebWasmFlag
,
help:
'Compile to WebAssembly rather than JavaScript.
\n
$kWasmMoreInfo
'
,
negatable:
false
,
hide:
!
featureFlags
.
isFlutterWebWasmEnabled
,
);
argParser
.
addFlag
(
'strip-wasm'
,
help:
'Whether to strip the resulting wasm file of static symbol names.'
,
defaultsTo:
true
,
hide:
!
featureFlags
.
isFlutterWebWasmEnabled
,
);
}
...
...
@@ -148,16 +144,13 @@ class BuildWebCommand extends BuildSubCommand {
final
List
<
WebCompilerConfig
>
compilerConfigs
;
if
(
boolArg
(
'wasm'
))
{
if
(!
featureFlags
.
isFlutterWebWasmEnabled
)
{
throwToolExit
(
'Compiling to WebAssembly (wasm) is only available on the beta and master channels.'
);
}
if
(
stringArg
(
FlutterOptions
.
kWebRendererFlag
)
!=
argParser
.
defaultFor
(
FlutterOptions
.
kWebRendererFlag
))
{
throwToolExit
(
'"--
${FlutterOptions.kWebRendererFlag}
" cannot be combined with "--
${FlutterOptions.kWebWasmFlag}
"'
);
}
globals
.
logger
.
printBox
(
title:
'
Experimental
feature'
,
title:
'
New
feature'
,
'''
WebAssembly compilation is
experimental
.
WebAssembly compilation is
new. Understand the details before deploying to production
.
$kWasmMoreInfo
'''
,
);
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
388f3217
...
...
@@ -12,7 +12,6 @@ import '../build_info.dart';
import
'../bundle_builder.dart'
;
import
'../devfs.dart'
;
import
'../device.dart'
;
import
'../features.dart'
;
import
'../globals.dart'
as
globals
;
import
'../native_assets.dart'
;
import
'../project.dart'
;
...
...
@@ -240,7 +239,6 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
FlutterOptions
.
kWebWasmFlag
,
help:
'Compile to WebAssembly rather than JavaScript.
\n
$kWasmMoreInfo
'
,
negatable:
false
,
hide:
!
featureFlags
.
isFlutterWebWasmEnabled
,
);
addDdsOptions
(
verboseHelp:
verboseHelp
);
...
...
packages/flutter_tools/lib/src/features.dart
View file @
388f3217
...
...
@@ -42,9 +42,6 @@ abstract class FeatureFlags {
/// Whether custom devices are enabled.
bool
get
areCustomDevicesEnabled
=>
false
;
/// Whether WebAssembly compilation for Flutter Web is enabled.
bool
get
isFlutterWebWasmEnabled
=>
false
;
/// Whether animations are used in the command line interface.
bool
get
isCliAnimationEnabled
=>
true
;
...
...
@@ -70,7 +67,6 @@ const List<Feature> allFeatures = <Feature>[
flutterIOSFeature
,
flutterFuchsiaFeature
,
flutterCustomDevicesFeature
,
flutterWebWasm
,
cliAnimation
,
nativeAssets
,
previewDevice
,
...
...
@@ -146,20 +142,6 @@ const Feature flutterCustomDevicesFeature = Feature(
),
);
/// Enabling WebAssembly compilation from `flutter build web`
const
Feature
flutterWebWasm
=
Feature
(
name:
'WebAssembly compilation from flutter build web'
,
environmentOverride:
'FLUTTER_WEB_WASM'
,
beta:
FeatureChannelSetting
(
available:
true
,
enabledByDefault:
true
,
),
master:
FeatureChannelSetting
(
available:
true
,
enabledByDefault:
true
,
),
);
const
String
kCliAnimationsFeatureName
=
'cli-animations'
;
/// The [Feature] for CLI animations.
...
...
packages/flutter_tools/lib/src/flutter_features.dart
View file @
388f3217
...
...
@@ -44,9 +44,6 @@ class FlutterFeatureFlags implements FeatureFlags {
@override
bool
get
areCustomDevicesEnabled
=>
isEnabled
(
flutterCustomDevicesFeature
);
@override
bool
get
isFlutterWebWasmEnabled
=>
isEnabled
(
flutterWebWasm
);
@override
bool
get
isCliAnimationEnabled
{
if
(
_platform
.
environment
[
'TERM'
]
==
'dumb'
)
{
...
...
packages/flutter_tools/test/general.shard/features_test.dart
View file @
388f3217
...
...
@@ -81,12 +81,6 @@ void main() {
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
testWithoutContext
(
'Flutter web wasm only enable on master'
,
()
{
expect
(
flutterWebWasm
.
getSettingForChannel
(
'master'
).
enabledByDefault
,
isTrue
);
expect
(
flutterWebWasm
.
getSettingForChannel
(
'beta'
).
enabledByDefault
,
isTrue
);
expect
(
flutterWebWasm
.
getSettingForChannel
(
'stable'
).
enabledByDefault
,
isFalse
);
});
testWithoutContext
(
'Flutter web help string'
,
()
{
expect
(
flutterWebFeature
.
generateHelpMessage
(),
'Enable or disable Flutter for web.'
);
...
...
packages/flutter_tools/test/integration.shard/flutter_build_wasm_test.dart
View file @
388f3217
...
...
@@ -6,7 +6,6 @@ import 'dart:io';
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'../src/common.dart'
;
import
'test_utils.dart'
;
...
...
@@ -42,9 +41,6 @@ void main() {
'--wasm'
,
],
workingDirectory:
exampleAppDir
.
path
,
environment:
<
String
,
String
>{
flutterWebWasm
.
environmentOverride
!:
'true'
},
);
expect
(
result
,
const
ProcessResultMatcher
());
...
...
packages/flutter_tools/test/src/fakes.dart
View file @
388f3217
...
...
@@ -469,7 +469,6 @@ class TestFeatureFlags implements FeatureFlags {
this
.
isIOSEnabled
=
true
,
this
.
isFuchsiaEnabled
=
false
,
this
.
areCustomDevicesEnabled
=
false
,
this
.
isFlutterWebWasmEnabled
=
false
,
this
.
isCliAnimationEnabled
=
true
,
this
.
isNativeAssetsEnabled
=
false
,
this
.
isPreviewDeviceEnabled
=
false
,
...
...
@@ -499,9 +498,6 @@ class TestFeatureFlags implements FeatureFlags {
@override
final
bool
areCustomDevicesEnabled
;
@override
final
bool
isFlutterWebWasmEnabled
;
@override
final
bool
isCliAnimationEnabled
;
...
...
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