Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Experimental worker-to-worker bindings support #2173

Conversation

danielrs
Copy link

@danielrs danielrs commented Jan 3, 2022

Adds support for experimental worker-to-worker bindings, letting you call a worker from another worker. The Wrangler config field looks like follows:

experimental_services = [{ name = "foo", service = "foo-service", environment = "production" }]

Where:

  • name is the name of the binding in your worker code (alias binding)
  • service is the service to reference
  • environment is the environment of the script to reference (e.g. production, staging, etc)

Since this feature is experimental, you'll get a warning when you use it:

image

What doesn't work?

  • The API still doesn't support worker-to-worker bindings for previews, so wrangler dev will fail for now

@danielrs danielrs requested a review from a team as a code owner January 3, 2022 19:14
@jyn514
Copy link
Contributor

jyn514 commented Jan 3, 2022

@danielrs what's the upgrade path once this is no longer experimental? Will users need to change experimental_services to services? If so, there should probably be at least one version of wrangler that supports both.

My preference is probably to make the name services to start and keep the warning, though, that removes the need for a transition.

@danielrs
Copy link
Author

danielrs commented Jan 3, 2022

@jyn514 That's the plan, the versions that support both would have a deprecation warning on the old field. Wrangler V2 is already using experimental_services sadly, so that would make wrangler.toml files incompatible with each other.
@threepointone @Electroid What are your thoughts? We can always make Wrangler V2 also use services and keep the warning instead.

@threepointone
Copy link
Contributor

I don't think this feature should be in wrangler v1 at all, tbh. I was under the impression that we landed support in wrangler v2 for internal testing only, not for customers to use.

@ObsidianMinor
Copy link
Contributor

ObsidianMinor commented Jan 3, 2022

It would kinda suck though if we GA service bindings before wrangler2 had an official 1.0 release that's feature compatible with wrangler1.

@danielrs
Copy link
Author

danielrs commented Jan 6, 2022

We all decided to postpone this feature in Wrangler V1 until it becomes GA. We'll keep working on this in Wrangler V2, and maybe backport it once it's ready.

@danielrs danielrs closed this Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants