-
Notifications
You must be signed in to change notification settings - Fork 337
Extract sitemap route handling into reusable @bigcommerce/catalyst-sitemap package #2549
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
base: sitemap-index-proxy
Are you sure you want to change the base?
Extract sitemap route handling into reusable @bigcommerce/catalyst-sitemap package #2549
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
Co-authored-by: bookernath <[email protected]>
Co-authored-by: bookernath <[email protected]>
… core integration Co-authored-by: bookernath <[email protected]>
ab9aafd to
605bc45
Compare
This PR extracts the sitemap route handling logic from
core/app/sitemap.xml/route.tsinto a new reusable package@bigcommerce/catalyst-sitemapthat can be trivially included as a route handler with configurable parameters.Problem
The sitemap route handler was tightly coupled to the core application with hardcoded dependencies on locale configuration and client setup. This made it difficult to:
Solution
Created a new package
@bigcommerce/catalyst-sitemapthat provides acreateSitemapHandlerfunction accepting configuration for:Usage
Before (76 lines of route logic):
After (8 lines using the package):
Key Benefits
Implementation Details
The package preserves all existing functionality:
typeandpageparametersThe interface is designed to be framework-agnostic while optimized for Next.js App Router usage.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.ionode install.mjs(dns block)https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.138/linux64/chrome-linux64.zipnode install.mjs(http block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.