feat: add binding for flag evaluation#6456
Conversation
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.
|
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. |
danlapid
left a comment
There was a problem hiding this comment.
Hey, thanks for your contribution, but,
- We're not doing any more new wrapped bindings, only full JSRPC bindings are permitted as per the guide in the internal wiki.
- I have not reviewed any SPEC/design doc on the new binding, please send those over at your earliest convenience.
Merging this PR will degrade performance by 12.99%
Performance Changes
Comparing Footnotes
|
…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.
…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.
Add a new wrapped binding for flags. Includes the public module, internal implementation, type definitions, updated type snapshots, and tests with a mock service.