Skip to content

Fix preview config values not being correctly used with remote bindings in the vite plugin#10534

Merged
dario-piotrowicz merged 1 commit intomainfrom
dario/10460/vite-remote-bindings-preview-ids
Sep 4, 2025
Merged

Fix preview config values not being correctly used with remote bindings in the vite plugin#10534
dario-piotrowicz merged 1 commit intomainfrom
dario/10460/vite-remote-bindings-preview-ids

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Fixes #10460

If the user provides some preview value for some remote binding in their config, like preview_database_id in a D1 binding, those values should be used instead of the standard values.

This behavior is correctly applied by wrangler but it is not by the vite-plugin, this function addresses that by updating the unstable_convertConfigBindingsToStartWorkerBindings utility (used by the vite-plugin)


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix of expected behavior
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: bugfix to a non-v3 feature

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner September 2, 2025 18:08
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 2, 2025

🦋 Changeset detected

Latest commit: 6c9df3f

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

This PR includes changesets to release 3 packages
Name Type
@cloudflare/vite-plugin Patch
wrangler Patch
@cloudflare/vitest-pool-workers Patch

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 2, 2025

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main dario/10460/vite-remote-bindings-preview-ids might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10534
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Sep 2, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10534

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10534

miniflare

npm i https://pkg.pr.new/miniflare@10534

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10534

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10534

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10534

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10534

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10534

wrangler

npm i https://pkg.pr.new/wrangler@10534

commit: 6c9df3f

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Sep 4, 2025
@dario-piotrowicz dario-piotrowicz merged commit dceb550 into main Sep 4, 2025
42 of 44 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/10460/vite-remote-bindings-preview-ids branch September 4, 2025 17:30
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Remote bindings not using preview D1 DB

3 participants