Skip to content

Adopt Hydrogen storefront logging - #523

Merged
laugharn merged 1 commit into
release/2026-08-23-hydrogenfrom
feat/hydrogen-storefront-logging
Aug 23, 2026
Merged

laugharn merged 1 commit into
release/2026-08-23-hydrogenfrom
feat/hydrogen-storefront-logging

Conversation

@laugharn

Copy link
Copy Markdown
Collaborator

Summary

  • configure Hydrogen logging once through Next.js server instrumentation
  • add a shared structured HydrogenLogger for Hydrogen runtime entries and app-specific Shopify annotations
  • emit Storefront and Customer Account operation timings at debug level when DEBUG_SHOPIFY is enabled
  • normalize Storefront GraphQL failures to Hydrogen's StorefrontApiError
  • preserve GraphQL locations, path, extensions, operation name, and additional errors
  • send partial GraphQL failures through structured warning context instead of bespoke console output
  • update Storefront API and environment-variable documentation

Intentional boundary

The custom Storefront fetch wrapper remains for behavior Hydrogen does not own:

  • ?operation=<name> URL annotations used in network logs
  • Accept-Encoding: gzip, br
  • operation-level timing annotations

Hydrogen already owns transport normalization, including StorefrontApiError for HTTP/network/response failures and StorefrontTimeoutError for its default timeout. Customer Account API uses a separate client and retains its existing failure contract, while sharing the logger for timing and partial-error output.

Verification

  • focused oxfmt and oxlint — passed, 0 warnings/errors
  • ./node_modules/.bin/tsc --noEmit — passed
  • pnpm build — passed; Next.js compiled successfully and generated 32/32 pages
  • DEBUG_SHOPIFY=true pnpm dev — passed
  • runtime smoke test — HTTP 200 for /collections
  • confirmed structured Storefront operation timing output from the real Next.js startup path
  • git diff --check — passed

@vercel

vercel Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
shop-docs Ready Ready Preview, v0 Aug 23, 2026 4:54pm
shop-template Ready Ready Preview, v0 Aug 23, 2026 4:54pm

@laugharn
laugharn marked this pull request as ready for review August 23, 2026 17:08
@laugharn
laugharn changed the base branch from main to release/2026-08-23-hydrogen August 23, 2026 17:10
@laugharn
laugharn merged commit df27aa3 into release/2026-08-23-hydrogen Aug 23, 2026
7 checks passed
@laugharn
laugharn deleted the feat/hydrogen-storefront-logging branch September 18, 2026 21:56

This branch was successfully deployed

2 active deployments
Preview – shop-docs — bf973fc8 Deployed Aug 23, 2026 by vercel[bot]
Preview – shop-template — bf973fc8 Deployed Aug 23, 2026 by vercel[bot]
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