-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New change detection strategy onPushStrict #14628
Copy link
Copy link
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: change detectionfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: change detectionfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
I'm submitting a ...
Current behavior
We only have two change detection strategies:
DefaultandOnPushExpected behavior
New strategy 'onPushStrict' (working title) OR default behavior if component has not output's:
What is the motivation / use case for changing the behavior?
Lets say we have a component which is a "closed system": It gets input and any changes inside of the component will ONLY affect this component.
For example a component which has no input at all. It gets an image of a webcam from the server and displays it. There would be no need to run change detection for the whole application.
Lets make this example more problematic: The component subscribes to document event "mousemove" and does something with the event. EVERY mousemove (alot per second!) will then trigger change detection for the whole app if none of the outside components use OnPush.
Angular version:
2.4.X or 4.x.x