Skip to content

feat: add binding for flag evaluation#6456

Open
roerohan wants to merge 6 commits intocloudflare:mainfrom
roerohan:roerohan/flagship-worker-binding
Open

feat: add binding for flag evaluation#6456
roerohan wants to merge 6 commits intocloudflare:mainfrom
roerohan:roerohan/flagship-worker-binding

Conversation

@roerohan
Copy link
Copy Markdown
Member

Add a new wrapped binding for flags. Includes the public module, internal implementation, type definitions, updated type snapshots, and tests with a mock service.

Add a new wrapped binding for feature flags, following the same pattern
as the AI binding. Includes the public module (cloudflare:flags), internal
implementation (cloudflare-internal:flags-api), type definitions, updated
type snapshots, and tests with a mock service.
@roerohan roerohan requested review from a team as code owners March 30, 2026 12:26
@roerohan roerohan requested a review from vicb March 30, 2026 12:26
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@roerohan roerohan closed this Mar 30, 2026
@roerohan roerohan reopened this Mar 30, 2026
Copy link
Copy Markdown
Collaborator

@danlapid danlapid left a comment

Choose a reason for hiding this comment

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

Hey, thanks for your contribution, but,

  1. We're not doing any more new wrapped bindings, only full JSRPC bindings are permitted as per the guide in the internal wiki.
  2. I have not reviewed any SPEC/design doc on the new binding, please send those over at your earliest convenience.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 30, 2026

Merging this PR will degrade performance by 12.99%

❌ 1 regressed benchmark
✅ 69 untouched benchmarks
⏩ 129 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
Encode_ASCII_32[TextEncoder][0/0/32] 2.6 ms 3 ms -12.99%

Comparing roerohan:roerohan/flagship-worker-binding (22004c5) with main (5ecc6bf)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

roerohan and others added 2 commits March 30, 2026 19:09
…tract

Switch from HTTP fetch to JSRPC, aligning with the real FlagshipBinding
entrypoint (evaluate(flagKey, context?)). Add EvaluationContext parameter
to all public methods for targeting rules. Update mock to extend
WorkerEntrypoint, regenerate type snapshots.
roerohan and others added 2 commits April 1, 2026 00:29
…nitions

The Flags binding is a JSRPC binding handled by the control plane. Only
types/defines/flags.d.ts and the generated snapshots are needed in workerd.
Remove src/cloudflare/flags.ts, internal/flags-api.ts, and all test files.
@roerohan roerohan requested a review from danlapid March 31, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants