Skip to content

[vite-plugin] Support remote Hyperdrive bindings in v1 - #16407

Draft
petebacondarwin wants to merge 2 commits into
codex/vite-v1-backport-16183from
codex/vite-v1-backport-14900
Draft

petebacondarwin wants to merge 2 commits into
codex/vite-v1-backport-16183from
codex/vite-v1-backport-14900

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

Enable remote Hyperdrive bindings in Vite plugin v1 dev/preview by backporting the independently useful retained proxy changes from #14900. With remote: true in wrangler.jsonc, the edge proxy must expose the live Hyperdrive connection string and serializable readable/writable streams. Also retain the original session cleanup fixes and regression tests: preserve startup errors if teardown fails, and share a single disposal promise even on failure.

The original main plugin changes use v2's cf-config/local-env pipeline, which v1 intentionally removed. V1 already converts Wrangler configuration and passes the session URL to unstable_getMiniflareWorkerOptions for both development and preview. Its matching Wrangler/Miniflare releases provide configuration validation, optional local credentials, and the local TCP bridge. No removed public package source, tests, helpers, fixtures, v2 config pipeline, or installed-Wrangler CLI tests are copied here.

Draft and publication-blocked. Stacked on existing #16379, which supplies all intended runtime/helper pins once: Miniflare 5.20261019.2-beta / Wrangler 4.152.0 and matching workers-utils 0.48.0, workers-auth 0.15.0, deploy-helpers 0.22.2, containers-shared 0.23.2. They remain unpublished in pending main release #16377. This PR adds only three retained source/test files and one plugin minor changeset; its lockfile diff against #16379 is empty. Preserve actual published parent lock metadata, private workspace references, and v1 removals.

Validation: using temporarily restored published parent manifest pins and its real frozen lockfile, the retained proxy builds, type-checks, and passes all 31 remote-binding tests, including three original cleanup regressions. Formatting and whitespace pass. Restored intended draft manifests afterward; the diagnostic parent pins are not committed. These checks validate the retained adapter/cleanup source, not remote Hyperdrive end-to-end or the unpublished versions. After publication, regenerate the lockfile in #16379, run build/check/types and retained suites on this stack, and validate Hyperdrive through the plugin's dev/preview integration before marking ready. Do not substitute copied Miniflare or Wrangler tests for plugin validation.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this backports the existing Wrangler Hyperdrive remote option to v1; the plugin changeset documents its use, and full integration validation awaits publication.

Note

This is a contribution from an AI agent: Codex, preparing maintainer-requested v1 backports.

@petebacondarwin petebacondarwin added blocked Blocked on other work product:hyperdrive Relating to Cloudflare Hyperdrive: https://developers.cloudflare.com/hyperdrive/ package:vite-plugin Relating to the `@cloudflare/vite-plugin` package feature:remote-bindings Relating to Cloudflare Workers Remote bindings support labels Oct 21, 2026
@changeset-bot

changeset-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 09d02f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin Minor

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

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

@mack-erel (recorded author of #14900) and @edmundhung (verified human ant-core approver), could you please check this Vite plugin v1 backport and approve it when it is ready and looks good?

V1 needs the retained proxy-worker adapter for Hyperdrive connection strings/socket streams, plus the original retained session-cleanup fixes/tests. Its existing Wrangler-config dev/preview pipeline provides the integration once the dependencies publish; the v2 cf-config changes and removed public-package source/tests are excluded. Earlier #16379 supplies all intended runtime/helper pins, without repeating them here. This remains draft because Miniflare 5.20261019.2-beta, Wrangler 4.152.0, and matching helpers are unpublished; full plugin validation and lockfile regeneration must follow publication. The retained proxy builds/type-checks and all 31 remote-binding tests pass against the published parent versions.

@petebacondarwin
petebacondarwin added this pull request to stack #16411 October 21, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked on other work feature:remote-bindings Relating to Cloudflare Workers Remote bindings support package:vite-plugin Relating to the `@cloudflare/vite-plugin` package product:hyperdrive Relating to Cloudflare Hyperdrive: https://developers.cloudflare.com/hyperdrive/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant