-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike: SEO-friendly URLs (ISREST-925,#33) #11
Conversation
f44e1b9
to
b570038
Compare
fa57f95
to
ccb78ab
Compare
@shauke pointed out that I needed to make the route (!) contain the actually matched path format. Since the matcher decides this on its own we don't know this before the matcher has run. I also introduced a Possible TODO: |
ccb78ab
to
c306aa7
Compare
c83093e
to
f5db0f2
Compare
f5db0f2
to
09cba8e
Compare
new matchers are contained in new files next to the current ones
09cba8e
to
f1204c2
Compare
f1204c2
to
17b617f
Compare
waiting for possible interaction with mapping library (https://github.com/intershop/intershop-pwa/projects/2#card-31666961) |
Ideas integrated into #110 |
This PR prepares custom URL formats for products and categories.
It consists of two parts:
Provide custom matchers for product and category routes that define the same URL format like before. Thus, this is non-breaking and could be merged.⚠️ Important for review: Look at the new structure!
Define a second implementation for the matchers (and URL generators) to provide a different URL pattern. Caution: No tests added here because this is just a concept proof. Once we agreed on a URL format, we should also add tests for the matcher.
TODO:
Notes for documentation
TODO: Find a better place for this!
matcher
propertyCustomRoute
.CustomRoute
contains the matcher, a function for generating route URLs and all possible matched formatsRouterLink
androuter.navigateByUrl()
Matcher function
UrlMatcher
by Angularroute.data
to empty object of no route data is definednull
/undefined
route.data.format
to the actually matched route format, e.g.product/:sku/**
. Also add this format to the list of all possible formats in theCustomRoute
objectposParams
: all extracted params from the route, likesku
orcategoryUniqueId
. Each as instance ofUrlSegment
consumed
: the part of the path that was covered by the matcher. This is necessary for when a sub-module contains other routes. Usually not interesting in our scenarios, thus returns the whole array of UrlSegments (url
) in most cases