Skip to content

[workers-shared] Add a native asset worker entrypoint - #17351

Merged
krplata merged 1 commit into
mainfrom
krystian/native-asset-worker-entrypoint
Dec 3, 2026
Merged

krplata merged 1 commit into
mainfrom
krystian/native-asset-worker-entrypoint

Conversation

@krplata

@krplata krplata commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Add a new entrypoint AssetWorkerNative to the asset handler, which reads the asset config, manifest, and optional KV namespace from ctx.props. Separate deployment inputs from shared bindings so the native and default entrypoints can use the same serving code. The default entrypoint continues to read its deployment inputs from env.

https://jira.cfdata.org/browse/EW-11212


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: the new entrypoint is internal to the Workers runtime and introduces no customer-facing API or configuration changes.

A picture of a cute animal (not mandatory, but encouraged)

FullSizeRender

Devin Review

@changeset-bot

changeset-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8f3b1dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Dec 3, 2026
@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team December 3, 2026 14:32
@workers-devprod

workers-devprod commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/deploy-config
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@krplata
krplata force-pushed the krystian/native-asset-worker-entrypoint branch from 082e500 to cf2e7bc Compare December 3, 2026 14:32
devin-ai-integration[bot]

This comment was marked as resolved.

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Approved — I found no issues. The default entrypoint behaves as before. In the native entrypoint, missing props or a missing KV namespace returns a 500 through handleError. The tests compare responses from the native and default entrypoints.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns. The native entrypoint's config, manifest and KV namespace come from ctx.props, which are set by the caller of the service binding, not by the incoming request. If the KV namespace is missing, the request fails instead of being served.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md updates are needed.


📋 Code Quality: ✅ LGTM

  • AssetWorkerInner.fetch passes this.env as both the shared bindings and the deployment inputs, and passes EntrypointType.Inner. runFetchRequest reads the cohort from ctx.version?.cohort, the same context the old code read it from.
  • AssetWorkerNative: if ctx.props is undefined, the code throws inside the try and handleError returns a 500. A missing KV namespace causes an error only when a manifest entry has to be served; a path that is not in the manifest still gets a 404.
  • EntrypointType.Native = 2 is added after the existing values, so the numbers already logged for Outer and Inner do not change.
  • The handler.ts and headers.ts changes only narrow Env to SharedBindings.

📝 Documentation: ✅ LGTM

This entrypoint is internal, so no documentation changes are needed.


Reviewed commit: 8f3b1dd4

@krplata
krplata force-pushed the krystian/native-asset-worker-entrypoint branch from cf2e7bc to 88e3fee Compare December 3, 2026 14:33
devin-ai-integration[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@17351

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@17351

@cloudflare/cli-shared-helpers

npm i https://pkg.pr.new/@cloudflare/cli-shared-helpers@17351

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@17351

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@17351

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@17351

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@17351

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@17351

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@17351

@cloudflare/test-server

npm i https://pkg.pr.new/@cloudflare/test-server@17351

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@17351

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@17351

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@17351

wrangler

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

commit: 8f3b1dd

AssetWorkerNative reads the asset config, manifest, and optional KV
namespace from ctx.props so callers can supply them per invocation.

Separate deployment inputs from shared bindings so the native and
default entrypoints can use the same serving code. The default
entrypoint continues to read its deployment inputs from env.
@krplata
krplata force-pushed the krystian/native-asset-worker-entrypoint branch from 88e3fee to 8f3b1dd Compare December 3, 2026 14:42
@krplata krplata added the ci:no-changeset-required Skip pull request checks for a valid changeset label Dec 3, 2026
@krplata
krplata enabled auto-merge (squash) December 3, 2026 14:59

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

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 Dec 3, 2026
@krplata
krplata disabled auto-merge December 3, 2026 15:56
@krplata
krplata enabled auto-merge (squash) December 3, 2026 15:59
@krplata
krplata merged commit 701ac9e into main Dec 3, 2026
93 of 98 checks passed
@krplata
krplata deleted the krystian/native-asset-worker-entrypoint branch December 3, 2026 17:09
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:no-changeset-required Skip pull request checks for a valid changeset

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants