Skip to content

feat(react-router): Add support for Hydrogen with RR7 #17145

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Jul 24, 2025

Hydrogen switched from Remix v2 to React Router 7 (framework mode) from version 2025.5.0.

This PR adds support for React Router 7 (framework) SDK, adding a new entry point for cloudflare environments, and making a few structural changes.

  • Added @sentry/react-router/cloudflare entrypoint, similarly to what we have done on @sentry/remix/cloudflare.
  • Added injectTraceMetaTags to support ReadableStream which is used instead of PipeableStream (which we cover on getMetaTagTransformer for node environments), on cloudflare environments.
  • Added a new E2E test package for Hydrogen + RR7.

Note: Needs documentation update if approved.

@onurtemizkan onurtemizkan changed the title feat: Add support for Hydrogen with RR7 feat(react-router): Add support for Hydrogen with RR7 Jul 24, 2025
Copy link
Contributor

github-actions bot commented Jul 24, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.76 kB - -
@sentry/browser - with treeshaking flags 22.35 kB - -
@sentry/browser (incl. Tracing) 39.41 kB - -
@sentry/browser (incl. Tracing, Replay) 77.52 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.39 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.23 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.35 kB - -
@sentry/browser (incl. Feedback) 40.45 kB - -
@sentry/browser (incl. sendFeedback) 28.44 kB - -
@sentry/browser (incl. FeedbackAsync) 33.34 kB - -
@sentry/react 25.5 kB - -
@sentry/react (incl. Tracing) 41.38 kB - -
@sentry/vue 28.2 kB - -
@sentry/vue (incl. Tracing) 41.21 kB - -
@sentry/svelte 23.79 kB - -
CDN Bundle 25.28 kB - -
CDN Bundle (incl. Tracing) 39.28 kB - -
CDN Bundle (incl. Tracing, Replay) 75.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 80.82 kB - -
CDN Bundle - uncompressed 73.86 kB - -
CDN Bundle (incl. Tracing) - uncompressed 116.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 230.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.35 kB - -
@sentry/nextjs (client) 43.44 kB - -
@sentry/sveltekit (client) 39.84 kB - -
@sentry/node-core 47.48 kB -0.01% -1 B 🔽
@sentry/node 144.12 kB - -
@sentry/node - without tracing 91.58 kB - -
@sentry/aws-serverless 103.03 kB - -

View base workflow run

@onurtemizkan onurtemizkan force-pushed the onur/hydrogen-rr7 branch 2 times, most recently from e84f411 to 305c9c2 Compare July 25, 2025 08:39
@onurtemizkan onurtemizkan marked this pull request as ready for review July 25, 2025 13:48
});

return stream;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Stream Handling and Data Type Inconsistency

The injectTraceMetaTags function has two bugs. It incorrectly assumes the </head> tag will always be contained within a single ReadableStream chunk. If the tag is split across chunks, the includes check fails, preventing Sentry trace meta tags from being injected and breaking distributed tracing. Additionally, the function outputs inconsistent data types: it encodes modified HTML as Uint8Array but passes through unmodified chunks as their original type (e.g., string), which can cause issues for downstream consumers.

Locations (1)

Fix in CursorFix in Web

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