Repository navigation
[vite-plugin] Remove the cf-vite delegate - #16759
petebacondarwin wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 657126f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| "bin": { | ||
| "cf-vite": "./bin/cf-vite" | ||
| }, | ||
| "files": [ |
There was a problem hiding this comment.
The current cf resolver still selects @cloudflare/vite-plugin and attempts to spawn <pluginRoot>/bin/cf-vite when no project/framework command is available. Removing the package’s bin directory here therefore makes cf dev fail for those projects, and runBuild() has the same fallback for deploy/preview flows. The open cloudflare/cf#286 does not replace this resolver or the build fallback, so this must remain unreleased until a compatible cf version routes both paths through Vite and the release is gated on that version.
|
I'm Bonk, and I've done a quick review of your PR. Removes the internal
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
Remove the experimental internal
cf-viteexecutable so Vite projects use Vite's CLI or their framework's own dev/build commands. This removes the shim, CLI source and parsers, package bin/file wiring, separate build entry, delegate-only caller-name/force-local environment bridges, obsolete tests, and guidance. The Vite plugin export and normal Vite CLI workflows remain supported.remoteBindings: falseis the configuration path for local bindings; the sharedCLOUDFLARE_PREVIEW_BUILDcontract remains in place. Includes a minor changeset for the experimental executable removal.Remaining release dependency: a compatible cf release from cloudflare/cf#540 and its RC companion #634. Autoconfig 0.13.0 is published and includes workers-sdk#16803. Current cf releases still resolve
<pluginRoot>/bin/cf-vitewhen no framework dev/build command is detected. This affectscf dev,cf build,cf deploy,cf workers versions create,cf previews deploy, and other workflows that build first.Autoconfig now owns the choice of Vite versus Vite+, including native fallback commands for projects without a detected framework command. It retains local plugin/tool resolution and v2 compatibility checks, reads the selected package's binary metadata, and returns dev/build commands for cf to execute through its shared project command runner. The cf companion preserves argument/mode forwarding, Preview context, credential isolation, and exit handling, and shuts down the complete command tree so
vp devcannot leave its child Vite server running. Native tool options apply; callers must use the plugin'sremoteBindingsoption instead of the removed delegate's--localflag.Land and release the cf changes next. Record the minimum compatible cf release here and in release communication before merging/releasing this removal. That routing works with the plugin before and after removal. This PR remains draft pending the compatible cf release. Combined smoke tests with the updated cf#540 and this plugin build passed for both Vite and Vite+:
cf devserved a Worker and stopped on SIGTERM, and builds emitted the correct staging mode and normal/Preview context withcf-viteabsent.Validation (Node.js 22.22.1, pnpm 10.33.0):
pnpm checkpassed (204 tasks).pnpm -F @cloudflare/vite-plugin testpassed (259 tests in 30 files); the focused config, Preview environment, and package source-map tests also passed.vite dev --host 127.0.0.1 --port 0 --strictPortand stopped on SIGTERM. Nativevite build --mode stagingemitted Build Output with the correct mode for both normal and Preview builds.SOURCEMAPS=falserelease builds passed package source-map tests. Packed package inspection confirmed the plugin export and types remain, no executable orcf-vitebuild artifacts are included, and the release package has no source maps.A picture of a cute animal (not mandatory, but encouraged)
Note
This is a contribution from an AI agent: Codex.