Skip to content

[wrangler] add artifacts binding support#13326

Open
mattzcarey wants to merge 8 commits intocloudflare:mainfrom
mattzcarey:feat/artifacts-binding
Open

[wrangler] add artifacts binding support#13326
mattzcarey wants to merge 8 commits intocloudflare:mainfrom
mattzcarey:feat/artifacts-binding

Conversation

@mattzcarey
Copy link
Copy Markdown
Contributor

@mattzcarey mattzcarey commented Apr 7, 2026

Summary

Add wrangler configuration, deployment, and type generation support for the Artifacts binding (16 files changed, 294 insertions).

Binding config

// wrangler.jsonc
{
	"artifacts": [{ "binding": "MY_ARTIFACTS", "namespace": "default" }],
}

Type generation

Generates Artifacts type reference from the workerd type definitions:

interface Env {
	MY_ARTIFACTS: Artifacts;
}

Changes (16 files)

packages/workers-utils (7 files)

File Change
src/config/config.ts Add artifacts: [] default
src/config/environment.ts Add artifacts binding type definition (binding + namespace, both required)
src/config/validation.ts Add validateArtifactsBinding validator, ConfigBindingFieldName, friendlyBindingNames, bindingTypeFriendlyNames, notInheritable call, safeBindings entry, previews allowed keys + validation
src/types.ts Add artifacts to WorkerMetadataBinding union + Binding union, import CfArtifacts
src/worker.ts Add CfArtifacts interface
src/map-worker-metadata-bindings.ts Handle "artifacts" case in metadata binding mapping
tests/.../normalize-and-validate-config.test.ts Add artifacts: [] to expected defaults + 4 new test cases (object error, null error, valid bindings, invalid bindings)

packages/wrangler (9 files)

File Change
src/api/startDevWorker/utils.ts Add "artifacts" case in convertConfigToBindings
src/deploy/config-diffs.ts Add artifacts: true to reorderable bindings
src/deployment-bundle/create-worker-upload-form.ts Extract + serialize artifacts bindings to upload metadata
src/preview/shared.ts Add "artifacts" case in getBindingValue + extract artifacts in extractConfigBindings
src/type-generation/index.ts Add artifacts loop in both collectCoreBindings and collectCoreBindingsPerEnvironment (generates Artifacts type)
src/utils/add-created-resource-config.ts Add "artifacts" to ValidKeys exclusion
src/utils/print-bindings.ts Extract + display artifacts bindings in CLI output
src/__tests__/type-generation.test.ts Add MY_ARTIFACTS binding to mock config + MY_ARTIFACTS: Artifacts to 3 expected type output blocks

Root

File Change
.changeset/artifacts-binding-support.md Minor changeset for wrangler + @cloudflare/workers-utils

  • Tests
    • Tests included/updated
    • 4 new validation tests for artifacts bindings (object, null, valid, invalid)
    • Type generation test updated with artifacts binding mock + expected output in all 3 test blocks
    • All 510 workers-utils tests pass, all 100 type-generation tests pass
  • Public documentation
    • Documentation not necessary because: Artifacts is a new product not yet publicly documented. Docs PR is incoming and will be linked here once created.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 0a533dc

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

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

@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch from 443ef3e to bc7c37b Compare April 7, 2026 13:13
@jamesopstad jamesopstad requested review from jamesopstad and removed request for jamesopstad April 10, 2026 11:47
@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch 2 times, most recently from 8b20700 to b2a644d Compare April 15, 2026 11:38
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 15, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 0a533dc

@mattzcarey mattzcarey marked this pull request as ready for review April 15, 2026 11:56
@workers-devprod workers-devprod requested review from a team and vicb and removed request for a team April 15, 2026 11:57
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 15, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch from 15abfc4 to c863b00 Compare April 15, 2026 11:58
devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch from 8111fb7 to 6806c5b Compare April 15, 2026 12:23
@mattzcarey mattzcarey changed the title feat: add artifacts binding support to wrangler [wrangler] add artifacts binding support Apr 15, 2026
@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch from 6806c5b to 9c677cc Compare April 15, 2026 12:25
@mattzcarey mattzcarey force-pushed the feat/artifacts-binding branch from dcd0292 to d3475c8 Compare April 15, 2026 17:42
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

mattzcarey and others added 2 commits April 15, 2026 23:02
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

LGTM 😄

@dario-piotrowicz
Copy link
Copy Markdown
Member

Note

The types are being introduced in cloudflare/workerd#6508 but the API is not fully finalized just yet

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

4 participants