Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore($sniffer): Remove $sniffer.hashchange #9497

Merged
merged 1 commit into from
Oct 8, 2014

Conversation

mgol
Copy link
Member

@mgol mgol commented Oct 8, 2014

The hashchange event is not supported only in ancient browsers like Android<2.2
and IE<8. Angular never really supported IE7 and in 1.3 where support for IE8
is dropped it makes even less sense to check for hashchange support.

The hashchange event is not supported only in ancient browsers like Android<2.2
and IE<8. Angular never really supported IE7 and in 1.3 where support for IE8
is dropped it makes even less sense to check for hashchange support.
@mgol mgol self-assigned this Oct 8, 2014
@mgol mgol added this to the 1.3.0 milestone Oct 8, 2014
@mgol
Copy link
Member Author

mgol commented Oct 8, 2014

Relevant caniuse: http://caniuse.com/#feat=hashchange

@@ -256,9 +256,7 @@ function Browser(window, document, $log, $sniffer) {
// html5 history api - popstate event
if ($sniffer.history) jqLite(window).on('popstate', fireUrlChange);
// hashchange event
if ($sniffer.hashchange) jqLite(window).on('hashchange', fireUrlChange);
// polling
else self.addPollFn(fireUrlChange);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's quite a bit of code that's now not used that could be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still needed for ngCookies, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually I'd like to get this out of browser and move it to cookies, but now is not the time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url polling isn't needed for ngCookies, afaik

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caitp not URL pooling, just $browser.addPollFn.

Obviously it could be moved to ngCookies but see what @IgorMinar said above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this CL doesn't get rid of addPollFn though. (unless I'm not seeing something in the diff?)

Maybe I'm just misunderstanding the conversation, I thought you were saying "don't remove this, ngCookies needs it", but the thing ngCookies needs is not removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. @realityking suggested more code can be removed, referring to $browser.addPollFn. I noted that it's still used in ngCookies co cannot be removed; @IgorMinar said it can be moved to ngCookies but not now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IOW This in This is still needed for ngCookies referred to $browser.addPollFn, not the part removed here; sorry I wasn't more clear!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I had missed that itt was used in ngCookies.

@IgorMinar
Copy link
Contributor

lgtm

@mgol mgol merged commit 1beebee into angular:master Oct 8, 2014
@btford btford removed the In Progress label Oct 8, 2014
@mgol
Copy link
Member Author

mgol commented Oct 8, 2014

Landed at 1beebee

@mgol mgol deleted the sniffer.hashchange branch October 8, 2014 17:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants