perf(common): remove unused methods from DomAdapter#41102
perf(common): remove unused methods from DomAdapter#41102crisbeto wants to merge 1 commit intoangular:masterfrom
Conversation
bfd3cc2 to
c7b6bc4
Compare
|
There is a minor typo in the description.
|
67e6231 to
ca1fd92
Compare
There was a problem hiding this comment.
The DominoAdapter had a special case for property reads of href that turned them into getAttribute('href') so this check wasn't actually doing anything, as far as I could tell.
jelbourn
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: size-tracking
jelbourn
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: fw-security
80cfd1a to
259431d
Compare
|
@crisbeto running tests in Google's codebase indicated that this change breaks a lot of targets (85%) due to the usage of removed methods in older versions of FlexLayout and deprecated |
259431d to
9f3e671
Compare
|
|
|
@crisbeto FYI we've performed the necessary refactoring in Google's codebase to get it ready for this change. I will run more broad set of tests tonight to see if there are other places that'd require a cleanup and will keep you updated. Thank you. |
The `DomAdapter` is present in all Angular apps and its methods aren't tree shakeable. These changes remove the methods that either aren't being used anymore or were only used by our own tests. Note that these changes aren't breaking, because the adapter is an internal API. The following methods were removed: * `getProperty` - only used within our own tests. * `log` - Guaranteed to be defined on `console`. * `logGroup` and `logGroupEnd` - Only used in one place. It was in the DomAdapter for built-in null checking. * `logGroupEnd` - Only used in one place. It was placed in the DomAdapter for built in null checking. * `performanceNow` - Only used in one place that has to be invoked through the browser console. * `supportsCookies` - Unused. * `getCookie` - Unused. * `getLocation` and `getHistory` - Only used in one place which appears to have access to the DOM already, because it had direct accesses to `window`. Furthermore, even if this was being used in a non-browser context already, the `DominoAdapter` was set up to throw an error. The following APIs were changed to be more compact: * `supportsDOMEvents` - Changed to a readonly property. * `remove` - No longer returns the removed node.
9f3e671 to
6c12ac2
Compare
|
FYI, Global Presubmit is successful. I've started a new presubmit with a subset of targets to verify that the most recent changes are ok too and once presubmit is done, this PR should be ready to go. |
|
Note to Caretaker: PullApprove still wants the |
|
FYI, discussed with @crisbeto that this PR should go into master only to avoid any potential breakages in patch versions. |
|
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. |
The
DomAdapteris present in all Angular apps and its methods aren't tree shakeable. These changes remove the methods that either aren't being used anymore or were only used by our own tests. Note that these changes aren't breaking, because the adapter is an internal API.The following methods were removed:
getProperty- only used within our own tests.log- Guaranteed to be defined onconsole.logGroupandlogGroupEnd- Only used in one place. It was placed in theDomAdapterfor built-in null checking.performanceNow- Only used in one place that has to be invoked through the browser console.supportsCookies- Unused.getCookie- Unused.getLocationandgetHistory- Only used in one place which appears to have access to the DOM already, because it had direct accesses towindow. Furthermore, even if this was being used in a non-browser context already, theDominoAdapterwas set up to throw an error.The following APIs were changed to be more compact:
supportsDOMEvents- Changed to a readonly property.remove- No longer returns the removed node.