[App Router] Configurable redirects locale prefix behavior - #577
[App Router] Configurable redirects locale prefix behavior#577art-alexeyenko wants to merge 4 commits into
Conversation
|
| Name | Type |
|---|---|
| @sitecore-content-sdk/nextjs | Patch |
| create-content-sdk-app | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
📦 Package Size and Test Coverage Report
|
illiakovalenko
left a comment
There was a problem hiding this comment.
This solution looks even better to me - good proposal! 👍
I have one suggestion below, thinking about the future and keeping our approach library-agnostic.
If you’ve already checked this scenario, great. If not, I’d recommend double-checking it by testing these settings without LocaleProxy, following our documentation: https://doc.sitecore.com/sai/en/developers/content-sdk/20/DEFAULT/disable-multisite-and-locale-proxies.html
…router without locale proxy
illiakovalenko
left a comment
There was a problem hiding this comment.
Please revisit my very first comment regarding the next-intl references in our docs. Also, please double-check the build failure.
illiakovalenko
left a comment
There was a problem hiding this comment.
Looks good to me!
Please see one minor comment below. Once that’s addressed, feel free to merge
| --- | ||
|
|
||
| Add `redirects.localeInPath` so App Router redirect locale handling works when LocaleProxy is removed (`x-sc-locale` is optional). `true`/`false` control path prefixes; default `null` keeps the `x-sc-locale` header fallback (non-breaking). App Router templates set `true`. No newline at end of file | ||
| Add root-level `appLocalePrefix` config so App Router redirect locale handling works when LocaleProxy is removed (`x-sc-locale` is optional). It controls whether App Router redirect targets carry a locale path prefix (`/[locale]/...`) depending on the value: |
There was a problem hiding this comment.
In general, we’re kind of duplicating the changeset we added for the nextjs package here. Could we simplify it and just mention that we’ve started leveraging a new setting in our template(s)? create-content-sdk-aap doesn't really bring this feature
Description / Motivation
isLanguagePreservedfrom [nextjs] Fix pending redirects issues #568next-intllocale prefix behavior conflicts with SXA redirects'isLanguagePreservedswitch - the latter switch overrides outcome, regardless of thelanguagePrefixvalue set fornext-intl. This PR attempts to make the redirect results more predictable and configurable by renaming and reusing thelocaleInPathsetting.Testing Details
Types of changes