Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion webdev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## 3.9.0-wip

## 3.9.0

- Fix webdev failing to compile in aot mode due to missing DDS arguments.
- Bump `dds` to `^5.3.0`.
- Bump `dwds` to `^27.0.3`.
- Fix issue where hot restarts/reloads without local file changes would sometimes cause DDC to hang.
- Add 'web-hot-reload' experimental feature flag.
- Use the DDC Library Bundle module format by default.
- If your use case depends on internal details of the old (AMD) module format, you can restore it by passing`--module-format amd`. The old module format will be removed in a future release, so please let us know.
- Remove the requirement for the `--canary` flag when selecting the `--module-format=ddc` option.

## 3.8.2

Expand Down
8 changes: 1 addition & 7 deletions webdev/lib/src/command/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ class Configuration {
);
}
}

if (moduleFormat == 'ddc' && !canaryFeatures) {
throw InvalidConfiguration(
'Flag "--$moduleFormatFlag=ddc" requires --$canaryFeaturesFlag.',
);
}
}

/// Creates a new [Configuration] with all non-null fields from
Expand Down Expand Up @@ -336,7 +330,7 @@ class Configuration {

bool get webHotReload => _webHotReload ?? false;

String get moduleFormat => _moduleFormat ?? 'amd';
String get moduleFormat => _moduleFormat ?? 'ddc';

bool get usesDdcLibraryBundle =>
canaryFeatures || (moduleFormat == 'ddc') || webHotReload;
Expand Down
2 changes: 1 addition & 1 deletion webdev/lib/src/command/shared.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void addSharedArgs(
)
..addOption(
moduleFormatFlag,
defaultsTo: 'amd',
defaultsTo: 'ddc',
allowed: ['amd', 'ddc'],
help: 'Sets the module format DDC uses for compilation.',
hide: true,
Expand Down
2 changes: 1 addition & 1 deletion webdev/lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webdev/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: webdev
# Every time this changes you need to run `dart run build_runner build`.
version: 3.9.0-wip
version: 3.9.0
# We should not depend on a dev SDK before publishing.
# publish_to: none
description: >-
Expand Down
15 changes: 1 addition & 14 deletions webdev/test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ void main() {
test('default configuration is correctly applied', () {
final configuration = Configuration.fromArgs(null);
expect(configuration.hostname, equals('localhost'));
expect(configuration.moduleFormat, equals('ddc'));
});

test('arg configuration takes precedence to default configuration', () {
Expand Down Expand Up @@ -162,18 +163,4 @@ void main() {
throwsA(isA<InvalidConfiguration>()),
);
});

test('moduleFormat ddc + canaryFeatures false throws', () {
expect(
() => Configuration(moduleFormat: 'ddc', canaryFeatures: false),
throwsA(isA<InvalidConfiguration>()),
);
});

test('moduleFormat ddc throws if canaryFeatures not set', () {
expect(
() => Configuration(moduleFormat: 'ddc'),
throwsA(isA<InvalidConfiguration>()),
);
});
}
23 changes: 14 additions & 9 deletions webdev/test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ class TestRunner {
}) async {
final fullArgs = [_webdevBin, ...args];

if (!raw) {
// 'help' doesn't accept additional args.
final isHelp =
args.contains('help') || args.contains('--help') || args.contains('-h');

if (!raw && !isHelp) {
if (canaryFeatures) {
final dashDashIndex = fullArgs.indexOf('--');
if (dashDashIndex != -1) {
Expand All @@ -80,14 +84,15 @@ class TestRunner {
}
}

if (ddcModuleFormat == ModuleFormat.ddc) {
final dashDashIndex = fullArgs.indexOf('--');
final extraArgs = ['--module-format', 'ddc'];
if (dashDashIndex != -1) {
fullArgs.insertAll(dashDashIndex, extraArgs);
} else {
fullArgs.addAll(extraArgs);
}
final moduleFormatStr = ddcModuleFormat == ModuleFormat.ddc
? 'ddc'
: 'amd';
final dashDashIndex = fullArgs.indexOf('--');
final extraArgs = ['--module-format', moduleFormatStr];
if (dashDashIndex != -1) {
fullArgs.insertAll(dashDashIndex, extraArgs);
} else {
fullArgs.addAll(extraArgs);
}
}

Expand Down
Loading