-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(forms): make FormBuilder
and RadioControlRegistry
tree-shakable
#41126
perf(forms): make FormBuilder
and RadioControlRegistry
tree-shakable
#41126
Conversation
You can preview 5482ea3 at https://pr41126-5482ea3.ngbuilds.io/. |
FormBuilder
class tree-shakableFormBuilder
and RadioControlRegistry
tree-shakable
FormBuilder
and RadioControlRegistry
tree-shakableFormBuilder
and RadioControlRegistry
tree-shakable
You can preview ef68a26 at https://pr41126-ef68a26.ngbuilds.io/. |
2b42649
to
acb48ff
Compare
You can preview acb48ff at https://pr41126-acb48ff.ngbuilds.io/. |
You can preview 419bbe6 at https://pr41126-419bbe6.ngbuilds.io/. |
Note: this change should land after #41146. |
This commit makes the `FormBuilder` class tree-shakable by adding the `providedIn` property to its `@Injectable` decorator. Now if the `FormBuilder` class is not referenced in application's code, it should not be included into its production bundle.
419bbe6
to
69a0c78
Compare
You can preview d35d95a at https://pr41126-d35d95a.ngbuilds.io/. |
This commit makes the `RadioControlRegistry` class tree-shakable by adding the `providedIn` property to its `@Injectable` decorator. Now if the radio buttons are not used in the app (thus no `RadioControlValueAccessor` directive is initialized), the `RadioControlRegistry` should not be included into application's prod bundle.
d35d95a
to
d0d2d59
Compare
You can preview d0d2d59 at https://pr41126-d0d2d59.ngbuilds.io/. |
@@ -450,7 +450,7 @@ | |||
"name": "R3ViewContainerRef" | |||
}, | |||
{ | |||
"name": "RadioControlRegistry" | |||
"name": "RadioControlRegistryModule" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: this change indicates that the RadioControlRegistry
was tree-shaken away, but the RadioControlRegistryModule
shows up here as it's used as the providedIn
value (see below). Note: the FormBuilder
class is not showing up here since it's used in that demo app (forms_reactive
) and the forms_template_driven
golden file never contained it. I've verified that both symbols are not present in a simple app that don't use radio buttons and doesn't reference FormsBuilder
directly.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR makes the
FormBuilder
andRadioControlRegistry
classes tree-shakable by adding theprovidedIn
property to corresponding@Injectable
decorators and excluding these classes from NgModule definitions.Note: this improvement is a part of #41011.
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?