Skip to content

feat(core): TRAC-282 support empty and custom locale subfolders#3023

Closed
funivan wants to merge 1 commit into
canaryfrom
TRAC-282
Closed

feat(core): TRAC-282 support empty and custom locale subfolders#3023
funivan wants to merge 1 commit into
canaryfrom
TRAC-282

Conversation

@funivan
Copy link
Copy Markdown
Contributor

@funivan funivan commented May 25, 2026

What / Why

Extends merchant-configured per-locale URL subfolders (TRAC-421) so Catalyst routes correctly for every shape the BC Control Panel can emit. The Storefront GraphQL API exposes the configured subfolder as Locale.path, which can be:

  • a non-empty string — that locale serves at /${path}/
  • an empty string "" — that locale serves at the root /
  • null — not configured; fall back to the locale code (/${code}/)

Only one locale can serve at /. The CP default wins when its path is empty or null. Otherwise the first non-default locale with an explicit empty path takes the root.

Supported cases

Given locales [fr (default), es-es, es-mx, uk]:

# path per locale URLs
1 null, null, null, null (no custom subfolders) / → fr, /es-es/, /es-mx/, /uk/
2 "", "es", "", "" / → fr, /es/ → es-es, /es-mx/, /uk/
3 "fr", "es", "", "" /fr/, /es/, /es-mx/, /uk/
4 "", "es", "es-mx", "uk" / → fr, /es/, /es-mx/, /uk/
5 "fr", "es", "es-mx", "" /fr/, /es/, /es-mx/, / → uk

JIRA

TRAC-282

Testing

  • Manual: configure each of the five cases above in CP and confirm URL routing, clearLocaleFromPath behavior, and getMetadataAlternates produce the expected hreflang entries.
  • Confirm legacy stores (all path: null) keep current behavior.

Migration

None. Stores without configured subfolders continue to work as before.

Extends merchant-configured per-locale URL subfolders to handle every CP
configuration shape, distinguishing `Locale.path = ""` (explicit root) from
`Locale.path = null` (unconfigured/legacy fallback). The locale at `/` is the
CP default when its path is empty or null, otherwise the first non-default
locale with an explicit empty path. Locales without a custom path fall back
to `/${code}` as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Error Error May 25, 2026 12:16pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

🦋 Changeset detected

Latest commit: 279f135

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 83 89

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 76 89 65 89
Accessibility 95 98 100 100
Best Practices 100 100 95 95
SEO 88 88 71 71

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.5 s 3.8 s 3.7 s 3.2 s
CLS 0 0 0 0
FCP 1.2 s 1.2 s 2.6 s 2.7 s
TBT 0 ms 0 ms 0 ms 0 ms
Max Potential FID 40 ms 50 ms 30 ms 30 ms
Time to Interactive 3.6 s 3.8 s 3.7 s 3.2 s

Full Unlighthouse report →

@funivan funivan marked this pull request as draft May 25, 2026 12:35
@funivan funivan closed this May 25, 2026
@funivan funivan deleted the TRAC-282 branch May 25, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant