Skip to content

feat(tanstackstart-react): Run middleware rules and component annotation in one transform plugin - #27078

Draft
timfish wants to merge 1 commit into
ref/bundler-plugins-annotation-rulefrom
ref/tanstackstart-transform-plugin
Draft

timfish wants to merge 1 commit into
ref/bundler-plugins-annotation-rulefrom
ref/tanstackstart-transform-plugin

Conversation

@timfish

@timfish timfish commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Fourth step of phase 2 of the call-site rewriter (#25776).

The SDK builds one transform plugin from its middleware rules and the component annotation rule. A route file that matched both was parsed twice and got two source maps. Now it is parsed once and gets one map. The SDK drops the transform plugin of sentryVitePlugin, so annotation runs only once.

Behaviour changes:

  • Middleware auto-instrumentation and component annotation now also run in the dev server. Before, both ran only in a build.
  • The plugin sentry-tanstack-middleware-auto-instrument is now named sentry-vite-transform.

The tanstackstart-react E2E app covers the middleware rules in a build. No E2E test covers the dev server.

@timfish
timfish added this pull request to stack #27076 December 2, 2026 12:10
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 6 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (manual upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 1m Details

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 058d176 (PR test merge using base PR #27077 at fa7f1a6)

Against: fa7f1a6 (base PR #27077) · base run #68579

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.64 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.62 kB - -
@sentry/browser (incl. Tracing) 53.98 kB - -
@sentry/browser (incl. Tracing Core) 40.82 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.98 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.86 kB - -
@sentry/browser (incl. Tracing, Replay) 93.96 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.8 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.75 kB - -
@sentry/browser (incl. Feedback) 48.51 kB - -
@sentry/browser (incl. sendFeedback) 31.2 kB - -
@sentry/browser (incl. FeedbackAsync) 36.26 kB - -
@sentry/browser (incl. Metrics) 31.96 kB - -
@sentry/browser (incl. Logs) 32.25 kB - -
@sentry/browser (incl. Metrics & Logs) 32.91 kB - -
@sentry/react 32.5 kB - -
@sentry/react (incl. Tracing) 56.46 kB - -
@sentry/vue 38.99 kB - -
@sentry/vue (incl. Tracing) 57.05 kB - -
@sentry/svelte 30.68 kB - -
@sentry/effect (client) 42.21 kB - -
@sentry/effect (client, incl. Tracing) 55.02 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.5 kB - -
@sentry/remix (Remix 3 client bundle) 59.47 kB - -
CDN Bundle 32.45 kB - -
CDN Bundle (incl. Tracing) 54.12 kB - -
CDN Bundle (incl. Logs, Metrics) 35.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.57 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.15 kB - -
CDN Bundle (incl. Tracing, Replay) 91.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.85 kB - -
CDN Bundle - uncompressed 94.67 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.02 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.01 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.65 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.4 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.45 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.08 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300 kB - -
@sentry/nextjs (client) 59.75 kB - -
@sentry/sveltekit (client) 54.8 kB - -
@sentry/astro (client) - rolldown, without tracing 35.73 kB +0.01% +1 B 🔺
@sentry/core/server 45.91 kB - -
@sentry/core/browser 14.55 kB - -
@sentry/node 157.66 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.63 kB - -
@sentry/node - without tracing 89.66 kB - -
@sentry/node - without channel injection 146.99 kB - -
@sentry/aws-serverless 100.57 kB - -
@sentry/cloudflare (withSentry) - minified 212.87 kB - -
@sentry/cloudflare (withSentry) 493.43 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 215.81 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 238.29 kB - -

View base workflow run

…on in one transform plugin

The SDK builds one transform plugin from its middleware rules and the component annotation rule, so a route file is parsed once and gets one source map. The plugin is also added in development.
@timfish
timfish force-pushed the ref/tanstackstart-transform-plugin branch from 1cb4484 to f7a4679 Compare December 2, 2026 14:41

This branch has not been deployed

No deployments
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