Commit Graph

172 Commits

Author SHA1 Message Date
github-actions[bot] e718915540 Version Packages (#455)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-29 09:49:11 -04:00
Dominik Ferber dcb74ff938 return no-store on flags discovery endpoint (#454) 2026-07-29 09:42:01 -04:00
github-actions[bot] 5ff8eafec9 Version Packages (#451)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-27 10:32:21 -04:00
Dominik Ferber ceb15198f7 [@vercel/flags-core] strip g and y regex flags (#450) 2026-07-27 13:50:24 +00:00
github-actions[bot] bd33058932 Version Packages (#443)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-24 18:06:50 +03:00
Dominik Ferber 622d56e608 fix(flags): remove @sveltejs/kit from peer dependencies (#442)
@sveltejs/kit was declared as an optional peer with a "*" range, causing
npm to auto-install the newest @sveltejs/kit and pull in its transitive
@sveltejs/vite-plugin-svelte → vite peer chain. In non-SvelteKit projects
already on Vite 7 (via Vitest, Storybook, etc.) this produced a hard
ERESOLVE error requiring `npm install --force`.

Move @sveltejs/kit to devDependencies so the sveltekit entrypoint still
builds and type-generates in the monorepo. SvelteKit consumers always have
@sveltejs/kit installed as the framework, so flags/sveltekit continues to
resolve it from their own tree.

fixes #440
2026-07-24 17:39:25 +03:00
github-actions[bot] 3ba3c40940 Version Packages (#441)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-24 15:25:01 +03:00
Sebastian "Sebbie" Silbermann d23d9d2b7a Stop tracing Next.js control-flow errors as span errors (#438)
* Stop tracing Next.js control-flow errors as span errors

The `trace()` helper marked spans as errored via `span.setStatus({ code: 2, message })` for every rejection of the traced function. This included errors that Next.js uses for control flow and that the evaluation layer deliberately re-throws via `isInternalNextError`: redirects, notFound, and the rejected hanging promises of aborted prerenders (`HANGING_PROMISE_REJECTION`).

The hanging-promise case is the noisy one in practice. Whenever a runtime prefetch prerender is aborted while a flag evaluation awaits `connection()` or `cookies()` (for example through an `identify` function that reads the request), the evaluation promise rejects with the `HANGING_PROMISE_REJECTION` digest, and every affected flag span reported "During prerendering, `connection()` rejects when the prerender is complete" as its status description. On heavily prefetched routes this produces a large volume of error-annotated spans for behavior that is entirely expected.

The tracing helper now skips the error status for internal Next.js errors in both the promise rejection path and the synchronous throw path, while still ending the span and preserving span-context attributes. Control flow is unchanged: the error keeps propagating to the caller. `isInternalNextError` moves from `src/next/` to `src/lib/` so the shared tracing module can use it without depending on the Next.js entrypoint; it is a plain digest check with no Next.js imports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* keep tracing framework agnostic (#439)

* Report ignored control-flow errors as successful spans

When `isIgnoredError` classifies an error as control flow, the traced function completed as intended, so the span now gets an explicit Ok status instead of ending with an unset status. This keeps ignored control-flow rejections (like Next.js hanging promise rejections of aborted prerenders) clearly distinguishable from both errored spans and spans that were never finalized.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Dominik Ferber <dominik.ferber@gmail.com>
2026-07-24 15:22:38 +03:00
github-actions[bot] d7fc7e5608 Version Packages (#435)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-20 14:40:44 +03:00
Dominik Ferber 4d6eb10705 [flags] allow passing request when invoking flag (#434)
* accept NextRequest in flag(req)

* add changeset
2026-07-20 14:34:03 +03:00
github-actions[bot] 6de1dcdcdc Version Packages (#431)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-10 15:13:09 +00:00
Marc Brakken 54888657e8 [adapter-launchdarkly] support native Marketplace integration (#418)
* [adapter-launchdarkly] support native Marketplace integration

- Read the Edge Config connection string from EXPERIMENTATION_CONFIG,
  falling back to EDGE_CONFIG for the legacy Vercel integration
- Make LAUNCHDARKLY_PROJECT_SLUG / projectSlug optional; it is only used
  to deep-link flags to the LaunchDarkly dashboard

* [adapter-launchdarkly] read EXPERIMENTATION_CONFIG only

Align with the Statsig adapter: the default adapter reads the Edge Config
connection string from EXPERIMENTATION_CONFIG only and no longer falls back
to EDGE_CONFIG. Legacy Vercel integration users can set EXPERIMENTATION_CONFIG
to their EDGE_CONFIG value or pass edgeConfigConnectionString explicitly.

* [adapter-launchdarkly] mark changeset as major (breaking change)

* Update changelog to have a single recommendation for legacy EDGE_CONFIG env var

* Bring back LAUNCHDARKLY_PROJECT_SLUG as required
2026-07-10 15:03:25 +00:00
github-actions[bot] 0a90e18513 Version Packages (#428)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-10 12:48:49 +03:00
Dominik Ferber 50b1aa4f96 Align rollouts assignments with split assignments (#427)
* [@vercel/flags-core] align rollotus and splits

* avoid extra array

* 100k

* full range

* fix comments

* rename

* shorten comments

* add changeset

* add stderr test
2026-07-09 22:48:48 +03:00
github-actions[bot] 2497853529 Version Packages (#424)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-08 14:26:19 +02:00
Luis Meyer 9dff590bd5 Add FLAGS_EVALUATION metric (#401)
* Add FLAGS_EVALUATION metric

* Track variant IDs in evaluation results

* report null instead of fallback

* bucket to the previous minute

* replace variant null with undefined

* invert

* use option instead of env var

* Add track option to black-box flag tests

* Add evaluation metrics controls and flush reasons

* increase max_count

* defaul track:true

* increase batch

* Bound ingest POSTs to 2000 events per request

Flushes can overshoot the scheduler's MAX_COUNT because the map read
happens in a microtask, so a single POST could exceed the server-side
maxItems cap and be rejected with a 400. Chunk sendIngestEvents so each
POST carries at most MAX_EVENTS_PER_REQUEST events.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Remove count-based flushing from the scheduler

Flushing is now purely time-based (idle window, max window, shutdown).
Batches are only cut down to size when the ingest events are sent, via
the 2000-event chunking in sendIngestEvents, which keeps every POST
below the server-side maxItems cap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* cleanup

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 14:09:45 +02:00
github-actions[bot] 3f87c7844e Version Packages (#422)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-03 11:25:58 +02:00
Luis Meyer d601dba20a Add prepare script changeset (#421) 2026-07-03 11:01:43 +02:00
github-actions[bot] 66c4809b29 Version Packages (#417)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-27 06:52:37 +00:00
Dominik Ferber f60c99d707 [vercel-flags-core] fix datafile serialization (#416) 2026-06-26 17:40:11 +03:00
github-actions[bot] 0b40d46d26 Version Packages (#404)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-17 16:22:35 +03:00
Dominik Ferber 4705ac67cb [@flags-sdk/edge-config] support bulk and simple interface (#403)
* [@flags-sdk/edge-config] support bulk and simple interface

* reword
2026-06-17 13:17:48 +00:00
Dominik Ferber 2cb0b49698 Allow passing an adapter factory directly to flag() (#402)
* Allow passing an adapter factory directly to flag()

flag() now accepts the adapter factory by reference (`adapter: vercelAdapter`)
as a shorthand for calling it (`adapter: vercelAdapter()`). The factory is
resolved once per declaration; passing an instance keeps working. Applies to
both the Next.js and SvelteKit entrypoints.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [@flags-sdk/vercel] reuse adapter instance

* reword changeset

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 16:14:25 +03:00
github-actions[bot] 158634cc5d Version Packages (#400)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-16 17:52:22 +03:00
Luc Leray b0150af9c8 [@vercel/flags-core] quiet noisy stream reconnect logs (#395)
* [@vercel/flags-core] quiet noisy stream reconnect logs

* [@vercel/flags-core] test exhaustion log + guard undefined reason
2026-06-16 14:43:25 +00:00
Dominik Ferber 50725a8dcf add changeset (#399) 2026-06-16 14:33:00 +00:00
github-actions[bot] 5cf0950342 Version Packages (#388)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-05 10:27:31 +02:00
Dominik Ferber 201f9d5988 Add bulk evaluation (#385)
* [flags] avoid re-imports

Avoid re-importing next/headers since it adds unnecessary microtask queue overhead

* [flags] avoid iife microtask queue overhead

* [flags] skip awaits where possible

* [flags] allow bulk eval

* wip

* add bulk mode to playground

* first try of bulk eval

* add bulk evaluation to adapters

* reuse

* simplify

* versions

* rm outdated changeset

* rm outdated changeset

* revert playground

* revert playground flags

* rm logs

* reuse cache of resolved flags for bulk

* simplify

* changesets

* support bulk([]) and bulk({})

* flagKey → key

* allow any type in expectPermutations

* avoid unnecessary mapping

* fix changeset

* validate package.json fields

* update package.json fields

* keep covariant

* adjust adapter types

* Merge bulk into evaluate (#392)

* merge bulk into evaluate

* add pages router compatibility

* better types

* add array test

* add test

* changesets

* use type import

* fix import

* extract readOverrides

* fix import of reportValue

* tracing

* skip bulkDecide for overwritten flags

* update changesets

* [changesets] onlyUpdatePeerDependentsWhenOutOfRange

* add type guard

* adjust changeset
2026-06-05 08:14:29 +00:00
Luis Meyer 7b5ea9a808 Reapply OIDC (#390)
* Reapply "Add oidc support (#374)" (#389)

This reverts commit 357ca676c6.

* bump oidc package

* review

* comments
2026-06-04 16:37:03 +02:00
Luis Meyer 357ca676c6 Revert "Add oidc support (#374)" (#389)
This reverts commit 72d36511d0.
2026-05-28 10:16:43 +03:00
Luis Meyer 72d36511d0 Add oidc support (#374)
* Add oidc support

* changeset

* update tests

* update def script

* fix provider data

* update changeset

* fix createVercelAdapter

* comments

* error
2026-05-28 08:59:00 +02:00
Dominik Ferber 4d90e912a4 [flags-core] perf improvements (#382)
* [flags-core] perf improvements

* add changeset
2026-05-18 13:20:13 +03:00
Vincent Derks bd4d01a9b2 vercel-flags-core: jitter ingest retries and batch-wait window (#371)
Replace the deterministic 100/200ms retry schedule with full-jitter exponential
backoff, jitter MAX_BATCH_WAIT_MS by ±20% to desynchronize concurrent flushes,
and log when a flush exhausts all retries.

Helpers extracted to utils/backoff.ts so they can be reused.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 15:57:15 +02:00
Dominik Ferber 9d425ebba0 set up trusted publisher and sign commits (#370) 2026-05-04 16:06:54 +02:00
github-actions[bot] 2e932e6c62 Version Packages (#361)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-14 17:29:53 +03:00
Dominik Ferber 754646db25 adapt changeset (#362) 2026-04-14 17:28:55 +03:00
Dominik Ferber 80dcdada34 [vercel flags] add progressive rollouts to sdk (#360)
* [vercel flags] add progressive rollouts

* fix slots

* add changeset
2026-04-14 16:55:57 +03:00
github-actions[bot] 1ac83900c8 Version Packages (#357)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-03 14:32:42 +03:00
Dominik Ferber c08f3e5614 [flags/next] perf improvements (#356)
* [flags] avoid re-imports

Avoid re-importing next/headers since it adds unnecessary microtask queue overhead

* [flags] avoid iife microtask queue overhead

* [flags] skip awaits where possible

* add undefined to headersModulePromise type
2026-04-03 11:24:31 +00:00
github-actions[bot] 14ef3fa940 Version Packages (#346)
* Version Packages

* blank commit

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Swarnava Sengupta <swarnava.sengupta@vercel.com>
2026-03-21 23:38:24 +05:30
Swarnava Sengupta b755ffecdf fix: SDK key detection to avoid false positives with third-party identifiers (#345)
The SDK key validation now uses a regex (/^vf_(?:server|client)_/) to require
the format vf_server_* or vf_client_* instead of accepting any string starting
with vf_. This prevents false positives with third-party service identifiers
that happen to start with vf_ (e.g., Stripe identity flow IDs like
vf_1PyHgVLpWuMxVFx...).

Adds isValidSdkKey() helper function and updates parseSdkKeyFromFlagsConnectionString()
to use the stricter validation. Updates all tests to use valid SDK key formats.
2026-03-21 17:39:00 +00:00
github-actions[bot] 471e0048b6 Version Packages (#342)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-20 21:19:04 +02:00
Dominik Ferber ffcc1cd4fc fix changelog (#344) 2026-03-20 19:56:27 +02:00
Dominik Ferber 6bdbe3f89a ignore playground in changesets (#343) 2026-03-20 13:27:11 +00:00
Dominik Ferber 44460570d4 [vercel/flags-core] allow json flags (#335)
* rm unused import

* [vercel-flags] allow json flags

* add flags-playground

* wip

* clean up type

* reword changeset

* rm examples/flags-playground
2026-03-20 14:03:53 +02:00
github-actions[bot] a3b536b504 Version Packages (#340)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-19 16:21:12 +02:00
Dominik Ferber b81963dc14 fix (#339) 2026-03-19 16:18:59 +02:00
github-actions[bot] b199f2083c Version Packages (#333)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-18 15:50:13 +02:00
Dominik Ferber 64619d7c66 @vercel/flags-core: allow specifying entities type when creating clients (#334)
* changeset

* adapt
2026-03-13 11:09:21 +02:00
Dominik Ferber 4a5f56a8c7 skip sending config reads (#330)
* skip sending config read for dev and custom envs

* add changeset

* clean up

* wip
2026-03-13 08:16:47 +01:00