perf(forms): use internal ngDevMode flag to tree-shake error messages in prod builds (#37821)

This commit adds a guard before throwing any forms errors. This will tree-shake
error messages which cannot be minified. It should also help to reduce the
bundle size of the `forms` package in production by ~20%.

Closes #37697

PR Close #37821
This commit is contained in:
Sonu Kapoor
2020-06-29 08:17:13 -04:00
committed by Misko Hevery
parent 6e643d9874
commit 201a546af8
14 changed files with 71 additions and 68 deletions

View File

@ -221,15 +221,6 @@
{
"name": "FormControlName"
},
{
"name": "FormErrorExamples_formControlName"
},
{
"name": "FormErrorExamples_formGroupName"
},
{
"name": "FormErrorExamples_ngModelGroup"
},
{
"name": "FormGroup"
},
@ -497,9 +488,6 @@
{
"name": "RangeValueAccessor"
},
{
"name": "ReactiveErrors"
},
{
"name": "ReactiveFormsComponent"
},
@ -608,9 +596,6 @@
{
"name": "TRANSITION_ID"
},
{
"name": "TemplateDrivenErrors"
},
{
"name": "TemplateFormsComponent"
},
@ -701,9 +686,6 @@
{
"name": "_keyMap"
},
{
"name": "_noControlError"
},
{
"name": "_randomChar"
},
@ -716,9 +698,6 @@
{
"name": "_testabilityGetter"
},
{
"name": "_throwError"
},
{
"name": "addComponentLogic"
},
@ -1628,9 +1607,6 @@
{
"name": "u"
},
{
"name": "unimplemented"
},
{
"name": "unwrapRNode"
},