[APPS][Connections Part 5] Move apps Vite behavior into getVitePlugin#357
Open
sdkennedy2 wants to merge 3 commits into
Open
[APPS][Connections Part 5] Move apps Vite behavior into getVitePlugin#357sdkennedy2 wants to merge 3 commits into
sdkennedy2 wants to merge 3 commits into
Conversation
This was referenced May 11, 2026
Collaborator
Author
Collaborator
Author
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
d7a3e8c to
cb0c1ca
Compare
3b2301a to
91ea1f0
Compare
cb0c1ca to
5ce434d
Compare
Base automatically changed from
sdkennedy2/same-module-connection-id-object-values
to
master
May 11, 2026 18:50
5ce434d to
67e2595
Compare
67e2595 to
ad770f4
Compare
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.

Motivation
build-plugins#353 needs to find action-catalog call sites that are reachable from a
*.backend.*entry file, even when the calls are defined in imported helper modules instead of directly inside the backend entry file.That graph traversal needs more of the Vite/Rollup plugin context available where backend transformation happens: module resolution, module loading, watch-file registration, and eventually TypeScript-to-JavaScript fallback transforms for local modules. Keeping backend transform ownership split between
packages/plugins/apps/src/index.tsandgetVitePluginwould force the graph PR to thread more Vite-specific state through the top-level apps plugin entrypoint.This PR isolates that behavior-neutral ownership move first. The follow-up graph PR can then focus on the actual traversal and extraction behavior instead of mixing it with structural movement.
Changes
Moves existing Vite-owned apps plugin behavior into
getVitePluginwithout changing the connection ID extraction boundary or upload behavior.getVitePluginnow owns:.backend.*transform and proxy generationInjectPosition.MIDDLEcloseBundleThe top-level apps plugin entrypoint now validates options, checks that the bundler is Vite, and delegates Vite-specific behavior to
getVitePlugin.getVitePluginreceives the factorycontextdirectly so it can read Vite/build metadata and use the same ownership boundary that the module traversal PR will extend.The upload/archive/manifest path was also extracted into a focused Vite helper module. That keeps
vite/index.tscentered on Vite hook wiring while preserving the existing frontend/backend archive layout, rootmanifest.jsonshape, upload errors/warnings, and cleanup behavior.This remains behavior-neutral: the transform still uses the current entry-only connection ID extraction path, so imported helper modules are not newly analyzed in this PR.
QA Instructions
Automated:
yarn workspace @dd/apps-plugin typecheckyarn workspace @dd/tests test:unit packages/plugins/apps/src/index.test.ts packages/plugins/apps/src/vite/index.test.ts --runInBandyarn eslint packages/plugins/apps/src/index.ts packages/plugins/apps/src/vite/index.ts packages/plugins/apps/src/vite/handle-upload.ts packages/plugins/apps/src/index.test.ts packages/plugins/apps/src/vite/index.test.ts --quietgit diff --checkBlast Radius
Affects
@dd/apps-pluginVite hook organization only. This PR should preserve generated backend proxies, runtime injection position, backend function registry replacement semantics, upload archive layout, manifest shape, upload cleanup, and dev-server middleware behavior.The review risk is mostly refactor risk around preserving existing hook timing and upload inputs. New module traversal behavior remains isolated to the child PR.
Documentation