René's URL Explorer Experiment


Title: feat(router): Cascading route support by matthewerwin · Pull Request #16416 · angular/angular · GitHub

Open Graph Title: feat(router): Cascading route support by matthewerwin · Pull Request #16416 · angular/angular

X Title: feat(router): Cascading route support by matthewerwin · Pull Request #16416 · angular/angular

Description: If you want the awesomely cool capability of doing things like yoursite.com/@ in your routes in Angular and having the name be an organization or an individual handled by separate modules (a la Twitter-style or Medium-style) you should definitely upvote this PR and help us get it merged! This PR accomplishes: Added cascading routes capability to the router, added new test cases. Previous behavior resulted in dead routes (e.g. direct navigation to a route with canActivate=>false resulted in blank page). Additionally this feature improvement provides conditional routing based on params and other information that could be used to dynamically enable/disable a route while ensuring the user always falls through to a valid route. Fall-through on routing tables instead of having routes themselves redirect is a well-established manner for handling permission-based routing (i.e. guard-based). This PR has been out since Angular 2.0 and is still not merged -- please help us get this done so it isn't an ongoing maintenance task to update it with every version change. This PR passes all latest tests and should be backwards compatible. Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) What kind of change does this PR introduce? (check one with "x") [X] Bugfix [X] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Other... Please describe: What is the current behavior? (You can also link to an open issue here) #16211 Current behavior results in a dead link/route when routes are inaccessible due to canActivate rejecting the promise or returning false. Router attempts to recover state to originating route state when canActivate or other preactivation guards fail (e.g. data loading guard). This either leaves the user clicking a link that does nothing, a blank page if the URL is hit directly (bookmark, external site link, page refresh while canActivate changes since original load). What is the new behavior? New behavior falls through to other valid routes including the default '**' route to give the user a 404 or other message. This allows more sophisticated routing scenarios based on conditionality as well as elegant handling for no-access scenarios that do not redirect. Does this PR introduce a breaking change? (check one with "x") [ ] Yes [ X ] No All tests passed. New tests written to cover the fall through scenarios. If this PR contains a breaking change, please describe the impact and migration path for existing applications: ... Other information:

Open Graph Description: If you want the awesomely cool capability of doing things like yoursite.com/@<user|org> in your routes in Angular and having the name be an organization or an individual handled by separate m...

X Description: If you want the awesomely cool capability of doing things like yoursite.com/@&lt;user|org&gt; in your routes in Angular and having the name be an organization or an individual handled by se...

Opengraph URL: https://github.com/angular/angular/pull/16416

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:89513db2-34f8-fd15-585c-8f733ef37e8b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idED6E:2FA59:C525E0:FE0D01:6B00EBE2
html-safe-noncefcb5c579e34cf7b88831d944d674e76861abf10833eb93e8e0a0c398d8a19b8d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDZFOjJGQTU5OkM1MjVFMDpGRTBEMDE6NkIwMEVCRTIiLCJ2aXNpdG9yX2lkIjoiOTE4ODY3Nzc0NzA3NjU3Njk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0147bab08825400f982b21ff46233166410adcc078ac25539cda8b1d017ae5b3
hovercard-subject-tagpull_request:118203761
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular/pull/16416/files
twitter:imagehttps://avatars.githubusercontent.com/u/1517954?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1517954?s=400&v=4
og:image:altIf you want the awesomely cool capability of doing things like yoursite.com/@<user|org> in your routes in Angular and having the name be an organization or an individual handled by separate m...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular/pull/16416/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F16416%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F16416%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/pull/16416/files
Reloadhttps://github.com/angular/angular/pull/16416/files
Reloadhttps://github.com/angular/angular/pull/16416/files
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests140 (140)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
matthewerwinhttps://github.com/matthewerwin
angular:mainhttps://github.com/angular/angular/tree/main
snaptech:route-guard-flowhttps://github.com/snaptech/angular/tree/route-guard-flow
Conversation 252 https://github.com/angular/angular/pull/16416
Commits 1 https://github.com/angular/angular/pull/16416/commits
Checks 0 https://github.com/angular/angular/pull/16416/checks
Files changed https://github.com/angular/angular/pull/16416/files
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
feat(router): Cascading route support https://github.com/angular/angular/pull/16416/files#top
Show all changes 1 commit https://github.com/angular/angular/pull/16416/files
40dd2a4 feat(router): Cascading route support when route guard => false matthewerwin Nov 23, 2018 https://github.com/angular/angular/pull/16416/commits/40dd2a4e8653beba69db3032fdcbdebe723091d7
Clear filters https://github.com/angular/angular/pull/16416/files
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
router.md https://github.com/angular/angular/pull/16416/files#diff-cb9e7870dcdd28eeeae7ad541fd460d8c950d908fc65de921e187e86a0997962
router.d.ts https://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
apply_redirects.ts https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
apply_redirects.ts https://github.com/angular/angular/pull/16416/files#diff-724decd212b9e26c224ecc85fa99954e60743083e9c7ee81a2e04fd5ed240db9
recognize.ts https://github.com/angular/angular/pull/16416/files#diff-ee124b6c3e5cc6a385caa2cb963cf937fd4b8e0874d7b404ffcb8dba23ae88a6
recognize.ts https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
router.ts https://github.com/angular/angular/pull/16416/files#diff-03cb1ea13f0b5890eb24ce6fef7a42eed85429da0a90cdb48ab06b58c30cb1c1
router_module.ts https://github.com/angular/angular/pull/16416/files#diff-99eedd01338ea4afb9b0f1533729b9c06a95b92cc68b12b786d44ebadba8be03
integration.spec.ts https://github.com/angular/angular/pull/16416/files#diff-c89e4eb845a28c0d2385a4460f9d27259558686f192bdb0fe61953e057be803e
recognize.spec.ts https://github.com/angular/angular/pull/16416/files#diff-78fbded2fb4fb88c19ebe94d6f93048705472f9f6b6603945cf9363a124b4652
router_testing_module.ts https://github.com/angular/angular/pull/16416/files#diff-4528f9089874a35754157408b0ea04517c5b6c07b813be02452c35dc06eb8574
aio/content/guide/router.mdhttps://github.com/angular/angular/pull/16416/files#diff-cb9e7870dcdd28eeeae7ad541fd460d8c950d908fc65de921e187e86a0997962
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/aio/content/guide/router.md
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
goldens/public-api/router/router.d.tshttps://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/goldens/public-api/router/router.d.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/16416/{{ revealButtonHref }}
https://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
https://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
https://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
https://github.com/angular/angular/pull/16416/files#diff-40893fa41164e57dc34328c6fd52ef0b58818e47eccc5b821f24795f9e43c586
packages/router/src/apply_redirects.tshttps://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/packages/router/src/apply_redirects.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/16416/{{ revealButtonHref }}
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
https://github.com/angular/angular/pull/16416/files#diff-c4958945d247eb3842b4117e948efc54b776ad843626c0adca169e5d416582fb
packages/router/src/operators/apply_redirects.tshttps://github.com/angular/angular/pull/16416/files#diff-724decd212b9e26c224ecc85fa99954e60743083e9c7ee81a2e04fd5ed240db9
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/packages/router/src/operators/apply_redirects.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/16416/{{ revealButtonHref }}
https://github.com/angular/angular/pull/16416/files#diff-724decd212b9e26c224ecc85fa99954e60743083e9c7ee81a2e04fd5ed240db9
packages/router/src/operators/recognize.tshttps://github.com/angular/angular/pull/16416/files#diff-ee124b6c3e5cc6a385caa2cb963cf937fd4b8e0874d7b404ffcb8dba23ae88a6
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/packages/router/src/operators/recognize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/16416/{{ revealButtonHref }}
https://github.com/angular/angular/pull/16416/files#diff-ee124b6c3e5cc6a385caa2cb963cf937fd4b8e0874d7b404ffcb8dba23ae88a6
packages/router/src/recognize.tshttps://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
View file https://github.com/snaptech/angular/blob/40dd2a4e8653beba69db3032fdcbdebe723091d7/packages/router/src/recognize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/16416/{{ revealButtonHref }}
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
https://github.com/angular/angular/pull/16416/files#diff-44c1b65f761a41afe66b151124a4be3714cad25e122360a783d81d6c8d37b4b1
Please reload this pagehttps://github.com/angular/angular/pull/16416/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.