Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Commit d764bc5

Browse files
committed
refactor(Compiler): Ignore the "debug" argument, always build in "release" mode.
In practice both modes emitted identical code anyway (goldens do not change as a result of this CL, for example), and this now avoids additional confusion. We can remove the field in future CLs. PiperOrigin-RevId: 200609044
1 parent 6665eeb commit d764bc5

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

angular/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### Breaking changes
2+
3+
* The compilation mode `--debug` (sparingly used externally) is now no longer
4+
supported. Some flags and code paths in the compiler still check/support it
5+
but it will be removed entirely by the final release and should no longer
6+
be used. We will rely on assertion-based tree-shaking (from `Dart2JS`)
7+
going forward to emit debug-only conditional code.
8+
19
### New features
210

311
* The `from` attribute added to `<style>` tags created for component styles
@@ -20,7 +28,7 @@
2028
import 'dart:html';
2129
2230
void handleFocus(FocusEvent e) {
23-
// Failed when 'e' is was a CustomEvent or not strictly a FocusEvent.
31+
// Failed when 'e' was a CustomEvent or not strictly a FocusEvent.
2432
}
2533
```
2634

angular_compiler/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* `CompilerFlags` no longer parses and supports the `'debug'` option and
2+
`genDebugInfo` is always `false`, and is deprecated pending removal in a
3+
future version.
4+
15
## 0.4.0-alpha+14
26

37
* Maintenance release.

angular_compiler/lib/src/cli/flags.dart

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:build/build.dart' as build;
33
import 'package:logging/logging.dart';
44
import 'package:meta/meta.dart';
55

6-
const _argDebugMode = 'debug';
76
const _argProfileFor = 'profile';
87
const _argLegacyStyle = 'use_legacy_style_encapsulation';
98

@@ -21,14 +20,6 @@ const _argNoEmitInjectableFactories = 'no-emit-injectable-factories';
2120
/// with an option to use defaults set by bazel or pub's build systems.
2221
class CompilerFlags {
2322
static final _argParser = new ArgParser()
24-
..addFlag(
25-
_argDebugMode,
26-
defaultsTo: null,
27-
help: ''
28-
'Whether to run the code generator in debug mode. This is '
29-
'useful for local development but should be disabled for '
30-
'production builds.',
31-
)
3223
..addFlag(
3324
_argLegacyStyle,
3425
defaultsTo: null,
@@ -65,6 +56,7 @@ class CompilerFlags {
6556
);
6657

6758
/// Whether to emit extra code suitable for testing and local development.
59+
@Deprecated('This value is always `false`')
6860
final bool genDebugInfo;
6961

7062
/// May emit extra code suitable for profiling or tooling.
@@ -157,7 +149,6 @@ class CompilerFlags {
157149
// Check for invalid (unknown) arguments when possible.
158150
if (options is Map) {
159151
final knownArgs = const [
160-
_argDebugMode,
161152
_argI18nEnabled,
162153
_argProfileFor,
163154
_argLegacyStyle,
@@ -176,7 +167,6 @@ class CompilerFlags {
176167
}
177168
}
178169

179-
final debugMode = options[_argDebugMode];
180170
final i18nEnabled = options[_argI18nEnabled];
181171
final profileFor = options[_argProfileFor];
182172
final useLegacyStyle = options[_argLegacyStyle];
@@ -185,7 +175,7 @@ class CompilerFlags {
185175
final noEmitInjectableFactories = options[_argNoEmitInjectableFactories];
186176

187177
return new CompilerFlags(
188-
genDebugInfo: debugMode ?? defaultTo.genDebugInfo,
178+
genDebugInfo: false,
189179
i18nEnabled: i18nEnabled ?? defaultTo.i18nEnabled,
190180
profileFor: _toProfile(profileFor, log) ?? defaultTo.profileFor,
191181
useLegacyStyleEncapsulation:

0 commit comments

Comments
 (0)