Skip to content

Conversation

@dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Jun 19, 2025

Fixes https://jira.cfdata.org/browse/DEVX-2028

add remote bindings support to getPlatformProxy


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because: not a wrangler v3 feature

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner June 19, 2025 23:30
@dario-piotrowicz dario-piotrowicz added e2e Run wrangler + vite-plugin e2e tests on a PR skip-v3-pr Skip validation of presence of a v3 backport PR labels Jun 19, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: 86f2189

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

This PR includes changesets to release 2 packages
Name Type
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

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2028/mixed-mode-get-platform-proxy branch from 478eb47 to 42c2d23 Compare June 19, 2025 23:33
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 19, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 86f2189

remoteProxyConnectionString,
remoteBindingsEnabled
);
buildMiniflareBindingOptions(config, remoteProxyConnectionString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite right. "enabled" and "has a connection string" are subtly different—even without a connection string, "enabled" will affect things like Images local mode and the logged warnings

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.... I don't think I quite follow... 😕

well since this change is quite irrelevant to getPlatformProxy I am also happy to revert this aspect of the PR and revisit this later 🤔

set the process.env cloudflare id and token so that getPlatformProxy can inherit them
refactor `getMiniflareOptionsFromConfig`
pass an args object to `getMiniflareOptionsFromConfig`
@dario-piotrowicz dario-piotrowicz requested a review from vicb June 20, 2025 09:51
Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but overall lgtm

Comment on lines 176 to 182
const {
rawConfig,
targetEnvironment,
options,
remoteProxyConnectionString,
remoteBindingsEnabled,
} = args;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but this destructing seems a bit messy to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree

I was simply passing the values as an object as requested, I am happy to either revert the change or proceed any way you see fit (like always passing args around?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the current version FWIW

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty much entirely a style choice, so I'll leave it up to your judgement @dario-piotrowicz, but fwiw I don't think it necessarily makes sense to change this function to accept an object of options. remoteBindingsEnabled is temporary while we're in the experimental phase, and IMO 4 parameters is a perfectly reasonable numbr of parameters to a function. Making it an options object adds this destructuring, which in my mind just means that there's an extra 7 lines of boilerplate obscuring what this function does. If we want to keep it as an options object, I would find either 1) using args.remoteProxyConnectionString etc... consistently throughout the function body or 2) destructuring in the function definition much clearer to read.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 20, 2025
const maybeRemoteProxySessionWrap =
await maybeStartOrUpdateRemoteProxySession(rawConfig.configPath);
remoteProxySession = maybeRemoteProxySessionWrap?.session;
remoteProxySession = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That look messy to me. IMO the former version looked better!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and by that I also mean that you do not have to implement all comments if they don't make sense to you - even my comments :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't quite what I was suggestion. I was thinking of (await maybeStartOrUpdateRemoteProxySession(config.configPath))?. session.

That said, this was mostly because the intermediate variable didn't add much clarity. What about:

({session: remoteProxySession } = await maybeStartOrUpdateRemoteProxySession(config.configPath)

@CarmenPopoviciu CarmenPopoviciu merged commit 086e29d into main Jun 20, 2025
27 checks passed
@CarmenPopoviciu CarmenPopoviciu deleted the dario/DEVX-2028/mixed-mode-get-platform-proxy branch June 20, 2025 16:38
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 20, 2025
jseba added a commit to jseba/workers-sdk that referenced this pull request Jun 20, 2025
…seba/containers_scope_debug

* 'main' of ssh://github.com/cloudflare/workers-sdk:
  Version Packages (cloudflare#9697)
  add remote bindings support to `getPlatformProxy` (cloudflare#9688)
  feat(containers): add support for handling images that link to the CF registry (cloudflare#9596)
  CC-5418: Set instance_type in wrangler (cloudflare#9633)
  remove warnings during config validations on `experimental_remote` fields (cloudflare#9678)
  add debug logs for workerd (cloudflare#9640)
  `wrangler containers apply` uses `observability` configuration (cloudflare#9558)
  Version Packages (cloudflare#9658)
  Temporarily skip Openapi C3 e2e tests (cloudflare#9691)
  Skip authed fixture on forks (cloudflare#9681)
jseba added a commit to jseba/workers-sdk that referenced this pull request Jun 21, 2025
…seba/containers_scope

* 'main' of ssh://github.com/cloudflare/workers-sdk:
  Add CLAUDE.md for Claude Code guidance (cloudflare#9563)
  Version Packages (cloudflare#9697)
  add remote bindings support to `getPlatformProxy` (cloudflare#9688)
  feat(containers): add support for handling images that link to the CF registry (cloudflare#9596)
  CC-5418: Set instance_type in wrangler (cloudflare#9633)
  remove warnings during config validations on `experimental_remote` fields (cloudflare#9678)
  add debug logs for workerd (cloudflare#9640)
  `wrangler containers apply` uses `observability` configuration (cloudflare#9558)
  Version Packages (cloudflare#9658)
  Temporarily skip Openapi C3 e2e tests (cloudflare#9691)
  Skip authed fixture on forks (cloudflare#9681)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR skip-v3-pr Skip validation of presence of a v3 backport PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants