Repository navigation
[vite-plugin] Support remote Hyperdrive bindings in v1 - #16407
petebacondarwin wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 09d02f9 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 |
|
@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. |
Enable remote Hyperdrive bindings in Vite plugin v1 dev/preview by backporting the independently useful retained proxy changes from #14900. With
remote: truein 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.
Note
This is a contribution from an AI agent: Codex, preparing maintainer-requested v1 backports.