Title: setUpLocationSync causes an duplicate navigation events · Issue #21610 · angular/angular · GitHub
Open Graph Title: setUpLocationSync causes an duplicate navigation events · Issue #21610 · angular/angular
X Title: setUpLocationSync causes an duplicate navigation events · Issue #21610 · angular/angular
Description: Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for this method state that "History.pushState does n...
Open Graph Description: Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for this met...
X Description: Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for ...
Opengraph URL: https://github.com/angular/angular/issues/21610
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"setUpLocationSync causes an duplicate navigation events","articleBody":"Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for this method state that \"History.pushState does not fire onPopState, so the Angular location doesn't detect it. The workaround is to attach a location change listener\"(https://github.com/angular/angular/blob/e4c53f8529b88ea574f41010b3277374a6f42fe1/packages/router/upgrade/src/upgrade.ts#L55). Without this code, the Angular router does not respond to location changes initiated by AngularJS, regardless of whether the pages themselves are associated w/ AngularJS or Angular content. For example, AngularJS-based navigation links would fail to trigger a routing event between two Angular pages.\r\n\r\nWhile this code works for AngularJS-initiated location changes, it currently produces duplicate NavigationStart, etc. events for Angular-initiated changes. The AngularJS router sees that the browser location has changed and triggers a location change event, which in turn triggers an additional NavigationStart event in Angular. It appears that we need some way to trigger Angular navigation only for location changes that originate in AngularJS.\r\n\r\nThis issue is currently causing duplicate router events for any Angular-driven page transition in dual-router apps, which is a performance issue.","author":{"url":"https://github.com/bourey","@type":"Person","name":"bourey"},"datePublished":"2018-01-17T21:48:18Z","url":"https://github.com/angular/angular/issues/21610"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:39dfb7ef-627e-b966-78a8-59be2af3cbf2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2C6:2652DC:1E50452:26AA3F8:6B015161 |
| html-safe-nonce | 4b39e726ac10288694ccd335c20dfbbc1f8325ee51e4cb9cf6fcce9e86077865 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkM2OjI2NTJEQzoxRTUwNDUyOjI2QUEzRjg6NkIwMTUxNjEiLCJ2aXNpdG9yX2lkIjoiMjgzMzQ3ODQ4NDg5NzEyNDcwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 35576c91537e810869fd34faecd3468d8b5a800ab34304c61b5d2a2803b43f9f |
| hovercard-subject-tag | issue:289425467 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/21610/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c0b9b5490b93b588d5a104d5baa96f0ca94108bc3f6f185f4a1d01c33e614c3/angular/angular/issues/21610 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c0b9b5490b93b588d5a104d5baa96f0ca94108bc3f6f185f4a1d01c33e614c3/angular/angular/issues/21610 |
| og:image:alt | Angular's router upgrade code provides a setUpLocationSync method which listens for AngularJS-initiated $locationChangeStart events, then calls Angular's router.navigateByUrl. The docs for this met... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bourey |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width