feat(cloudflare): Derive rpcTracePropagationBindings from the wrangler config - #23491
Merged
JPeer264 merged 3 commits intoAug 28, 2026
Merged
Conversation
Contributor
size-limit report 📦
|
Member
Author
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a85e9fb. Configure here.
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
2 times, most recently
from
August 25, 2026 11:54
562ceae to
ceb803d
Compare
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
from
August 25, 2026 11:56
ceb803d to
16c724f
Compare
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
from
August 26, 2026 07:41
c5b4c26 to
5e5b6a8
Compare
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
2 times, most recently
from
August 26, 2026 10:53
29752e8 to
6a991fa
Compare
JPeer264
marked this pull request as ready for review
August 26, 2026 11:33
JPeer264
requested review from
andreiborza and
isaacs
and removed request for
a team
August 26, 2026 11:33
JPeer264
marked this pull request as draft
August 26, 2026 11:34
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
from
August 26, 2026 11:41
6a991fa to
4e616df
Compare
JPeer264
marked this pull request as ready for review
August 26, 2026 11:55
andreiborza
approved these changes
Aug 28, 2026
andreiborza
approved these changes
Aug 28, 2026
…r config The Vite plugin already knows which bindings resolve to receivers it instruments itself: Durable Object bindings without a `script_name`, and service bindings naming this worker. Those are exactly the bindings whose trailing trace argument is guaranteed to be stripped again, so the plugin adds them to `rpcTracePropagationBindings` and same-deployment RPC traces connect without any configuration. Bindings to other workers stay opt-in. Only bindings whose receiver class the transform wrapped itself are added. A class the user wrapped by hand, or re-exported from another module, runs on its own options and cannot be assumed to strip the argument. The options object only exists once the callback runs with `env`, so the plugin cannot merge at build time. The transform emits an inline callback that wraps the user's one and merges the binding names, so no runtime helper export is needed. Note this default only applies to Vite builds. At runtime a DurableObjectNamespace exposes no origin and a Fetcher does not say which service it points at, so a plain wrangler build still has to list its bindings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…as auto-wrapped `export default Foo`, where a named export already wrapped `Foo`, skips wrapping to avoid `withSentry(withSentry(...))`, but the binding still points at the wrapped class. Mark the default export as auto-wrapped so an entrypoint-less self service binding survives into `rpcTracePropagationBindings`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/rpc-trace-propagation-targets-vite
branch
from
August 28, 2026 11:59
3c8302d to
0598681
Compare
JPeer264
added a commit
that referenced
this pull request
Aug 28, 2026
…ngler config (#23738) Backport of: #23491 ## Differences to the original PR - `packages/cloudflare/src/vite/transform.ts`: the generated options callback also sets `enableRpcTracePropagation: opts?.enableRpcTracePropagation ?? true`. On v10 the receiver still reads that option to continue an incoming trace, and the plugin wrapped those receiver classes itself, so it can turn it on. An explicit value in the user's options wins. Without it the derived bindings would propagate but no receiver span would be created. - `packages/cloudflare/src/vite/index.ts` and the new integration suite's `vite.config.mts`: `autoInstrumentation` lives under `_experimental` on v10, so the doc paragraph and the test config use that shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The Vite plugin already knows which bindings resolve to receivers it instruments itself: Durable Object bindings without a
script_name, and service bindings naming this worker. Those are exactly the bindings whose trailing trace argument is guaranteed to be stripped again, so the plugin adds them torpcTracePropagationBindingsand same-deployment RPC traces connect without any configuration. Bindings to other workers stay opt-in.Only bindings whose receiver class the transform wrapped itself are added. A class the user wrapped by hand, or re-exported from another module, runs on its own options and cannot be assumed to strip the argument.
The options object only exists once the callback runs with
env, so the plugin cannot merge at build time. The transform emits an inline callback that wraps the user's one and merges the binding names, so no runtime helper export is needed.Note this default only applies to Vite builds. At runtime a DurableObjectNamespace exposes no origin and a Fetcher does not say which service it points at, so a plain wrangler build still has to list its bindings.