mirror of
https://github.com/vercel/flags.git
synced 2026-09-19 03:49:23 +08:00
e22887a007
Extracts the bulk-evaluation orchestration into shared/evaluate.ts (`evaluateFlags` + the BULKABLE / BULK_IDENTIFY_REF markers), parameterized by how standalone flags are invoked and which errors are framework control flow. Next wraps it in its bulkStore ALS and invokes standalone flags via `flagFn()`; behavior and public .d.ts are unchanged. SvelteKit gains a real bulk `evaluate(flags, request, secret?)` (src/sveltekit/evaluate.ts) exported from flags/sveltekit and used by its `precompute`. SvelteKit's flag() now stamps `adapter`, `config`, and the bulk markers so adapters implementing `bulkDecide` resolve a whole group in one call. Adds 2 bulk-evaluate tests. Documents the framework contract (context resolution, secret strategy, isFrameworkError, invokeStandalone, output integration) in shared/README.md so adding a new framework only means writing a thin adapter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>