ref(server-utils): Unify orchestrion injection into a single tracingChannelImport transform - #23075
Open
timfish wants to merge 4 commits into
Open
ref(server-utils): Unify orchestrion injection into a single tracingChannelImport transform#23075timfish wants to merge 4 commits into
tracingChannelImport transform#23075timfish wants to merge 4 commits into
Conversation
…ChannelImport` transform
Contributor
size-limit report 📦
|
timfish
marked this pull request as ready for review
August 6, 2026 06:46
timfish
requested review from
JPeer264,
isaacs,
mydea,
nicohrubec and
s1gr1d
and removed request for
a team
August 6, 2026 06:46
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.
Consolidates the five overlapping orchestrion injection mechanisms (subscribe-injection
transform,
injectDiagnosticsmodule-list banner, Turbopack loader append,onInjectbridge, per-path marker writes) into one always-on
tracingChannelImportoverride thatsplices a single snippet into every instrumented module.
Why:
g.bundler(clobbering earlier pushes), Bun setbundler = true(special-cased inthree places).
subscription design (Node's 1024-channel cap). Now they're only subscribed of they're actually loaded.
customTransformsnever survived webpack/Turbopack's serialized loader options, soinjectChannelSubscriberssilently never worked there.How:
orchestrionModuleInjected("<module>", <factory?>)when themodule is evaluated: records it on the marker, stores its subscriber factory (keyed by
real
state.module.name— no more reverse lookup or path-splitting heuristic), emitsthe client event. Record + emit only — no
addIntegration; Cloudflare listens for theevent instead to install factories registered after per-request
init().g.bundler = g.bundler || [].orchestrion.module-runtime-injected→orchestrion.module-injected.createLoader— transforms are baked into our loadermodule, so only JSON crosses the Turbopack boundary; webpack plugin configures upstream
via
loaderPath/cacheVersioninstead of patching its rule.resolveId/onResolve/aliasfallbacks per bundler; Turbopack gets an absolute-path
importSpecifierloader option.mongodb, …) — they now announce on the marker/event too.
Removed:
injectChannelSubscribers(+ 4 framework call sites), deadshouldInjectDiagnostics,the module-list banner, the Turbopack append snippet,
marker.onInject+ init-timebridge,
registerOrchestrionChannelIntegration, thebundler: truespecial cases.Deps:
@apm-js-collab/code-transformer-bundler-plugins^0.7.3→^0.7.4(adds theloader factory and webpack
customTransformsforwarding this builds on).