Commit Graph

33 Commits

Author SHA1 Message Date
Dominik Ferber 2532e99ea8 chore: fix open Dependabot security alerts (#470)
Bumps the vulnerable transitive dependencies flagged by Dependabot via
pnpm overrides, and the direct nanoid dependency in the examples.

- nanoid >= 4 -> ^5.1.16 (GHSA infinite loop on negative/zero size)
- brace-expansion >= 4 -> ^5.0.9 (DoS via unbounded intermediate arrays)
- dompurify -> ^3.4.13 (XSS via detached subtree after IN_PLACE hook removal)
- fast-uri -> ^3.1.5 (host confusion via backslash authority introducer)
- js-yaml 3 -> ^3.15.1, js-yaml 4 -> ^4.3.1 (quadratic CPU in !!omap)
- mermaid -> ^11.16.1 (DoS, prototype pollution, CSS injection)
- postcss -> ^8.5.23 (arbitrary .map file read via sourceMappingURL)
- @sveltejs/kit -> ^2.70.2 (ReDoS in Accept header content negotiation)

image-size (alerts #979, #980) has no patched release yet, so it is left
as-is. It is only used at build time by the docs site.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 20:14:54 +02:00
Dominik Ferber 6dbf589e0c upgrade toolbar and others (#447) 2026-07-26 13:42:26 +00:00
Dominik Ferber 42cc02cacd upgrade more packages (#446) 2026-07-26 13:20:24 +00:00
Dominik Ferber 1f000784e5 upgrade vite & vitest (#445) 2026-07-26 08:25:37 -04:00
Dominik Ferber 0cf1f2b201 upgrade next and postcss (#444)
* upgrade postcss

* [snippets] upgrade postcss

* upgrade next

* upgrade postcss

* upgrade pnpm-lock
2026-07-26 07:35:48 -04:00
Rich Haines d8ed11ef08 Migrate docs app to @vercel/geistdocs (#391)
* Migrate docs app to Geistdocs canary

* Fix docs proxy matcher

* Use Geistdocs UI exports

* Update Geistdocs to 1.3.0

* upgrade geistdocs and fix svelte logo

* add copy prompt to certain docs pages

* migrate to 1.5.0

* refactor(docs): use geistdocs v1.5 Badge, CommandPrompt, ThemeAwareImage

Remove the local copies now exported by @vercel/geistdocs@1.5 and import
them from the package instead:

- Badge -> @vercel/geistdocs/components/badge (provider-list)
- CommandPrompt -> @vercel/geistdocs/components/command-prompt (install-command)
- ThemeAwareImage -> @vercel/geistdocs/components/theme-aware-image
  (docs MDX components); migrate the SvelteKit MDX call site to the new
  src={{ light, dark }} API.

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

* fix(docs): restore install switcher width animation

The hero "For humans / For agents" switcher called router.refresh() on
every toggle (added in #366). That remounts/reconciles the switcher
subtree mid-toggle, resetting the CommandPrompt's measured width state so
the command-line width spring never plays — the line snapped instead of
growing.

Drop the refresh: this flag's only consumer is the switcher itself, so the
optimistic override already shows the correct command and the cookie
persists the choice across reloads (the server reads it and renders the
matching prebuilt `[code]`). The refresh changed nothing visible and only
broke the animation. startTransition() does not help, since router.refresh
already runs as a transition.

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

* refactor(docs): render home code blocks with geistdocs CodeBlock

Replace the hand-rolled shiki token renderer in HighlightedCode with
fumadocs highlight() + the geistdocs CodeBlock, highlighting with the
shared geistShikiTheme so the home page "Effortless setup" blocks match
the documentation (same syntax colors, header, language icon, copy
button, radius). transformerIcon() fills the filename icon slot; the
caption is preserved below.

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

* fix(docs): equal-height home code blocks

Grow each HighlightedCode block to fill its grid cell (h-full root +
flex-1 wrapper forcing the Card to h-full) so both columns share the
taller block's height and their captions align. The Card and its <pre>
share bg-background-100, so the shorter block fills seamlessly.

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

* chore(docs): drop dead shadcn tokens (chart-*, sidebar-primary)

Only chart-1..5 and sidebar-primary are unused by both the app and the
geistdocs/fumadocs package CSS. The other shadcn tokens (secondary,
card-foreground, the remaining sidebar-* set, etc.) must stay: the package
stylesheet consumes them via var(--token) for its fd-* utility mappings
and the #nd-sidebar rule, and does not self-define them — the consuming
app has to provide them.

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

* refactor(docs): migrate consumers off shadcn tokens to Geist scale

Switch every shadcn-token consumer (select, switch, iframe-browser, the
home marketing pages, and the illustrations SVGs) to the Geist --ds-*
scale using the geistdocs PR #75 mapping (foreground->gray-1000,
muted->gray-100, muted-foreground->gray-800, border/input->gray-alpha-400,
ring->gray-600, destructive->red-800, background/card/popover->
background-100, accent->gray-100, etc.).

With no consumers left, drop the entire local shadcn layer from
geistdocs.css (the @theme --color-* mappings and the :root/.dark oklch
palette) and instead override fumadocs --color-fd-* and #nd-sidebar to
--ds-* (so the package's docs UI keeps working without the raw palette),
matching the geistdocs template. The geist utilities themselves come from
@vercel/geistdocs/styles.css.

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

* Update geistdocs.css

* migrate to 1.6.0

* chore(docs): bump @vercel/geistdocs to 1.6.1

Picks up the Next.js logo gradient-id fix so the framework logo renders
correctly in the mobile docs menu.

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

* Update pnpm-lock.yaml

* fix(docs): drop language icons from landing-page code blocks

The home "Effortless setup" snippets are Next.js examples, but the
language-based transformerIcon rendered a React glyph for the .tsx block.
Remove the icons (these blocks never had them) and hide the now-empty
header icon slot so the filename stays flush.

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

* chore(docs): drop redundant streamdown @source

The streamdown @source pointed at a transitive dep path that doesn't
resolve under pnpm (matched nothing). Streamdown is now sourced upstream
from @vercel/geistdocs's own styles.css, so this line is unneeded.

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

* update

* bump @vercel/geistdocs

* Update pnpm-lock.yaml

* update

---------

Co-authored-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:37:35 +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
Dominik Ferber bd31a462a6 Add package.json metadata & validation script (#387)
* validate package.json fields

* update package.json fields
2026-05-25 15:49:46 +03:00
Dominik Ferber 9d425ebba0 set up trusted publisher and sign commits (#370) 2026-05-04 16:06:54 +02:00
Dominik Ferber 9142790975 only build publishable packages during release process (#348)
* clean up

* fix release process
2026-03-21 21:17:04 +02:00
Vincent Derks c63be2d147 Added check to check skills size (#338)
* Added check to check skills size

* Change glob -> readdirSync

* Shorten description length

* Added check for name, compatibility and body

* Added back some parts that were removed to avoid regressions

* More cleanup

* Feedback: Used grey-matter for frontmatter parsing

* Added pnpm setup and install deps in Skills Quality job

* Refine triggers
2026-03-19 09:36:31 +00:00
Anthony Shew 8b5af40701 chore: Upgrade turbo version (#323) 2026-03-10 15:51:39 +02:00
Dominik Ferber e5f3e34428 [docs] depend on workspace version of flags (#314)
* fix dep

* add packageManager

* move devDeps to top-level
2026-03-09 18:26:11 +02:00
Dominik Ferber 2db1530275 Upgrade dependencies (#313)
* upgrade

* update biome

* upgrade more
2026-03-09 12:24:42 +00:00
Dominik Ferber d94c1df4a2 fix logos (#281) 2026-02-23 07:09:37 +02:00
Dominik Ferber 53149f5e81 add client (#255)
* prepare

* origin

* prepare script

* step

* redo peer deps

* wip

* continue

* every 5 secs

* connect flag network

* add shirt-shop-vercel

* upgrade

* push

* update endpoint

* add vercel getProviderData

* fix importts

* Add retries to flag network datasource (#237)

* Fix React Server Components CVE vulnerabilities (#235)

Updated dependencies to fix Next.js and React CVE vulnerabilities.

The fix-react2shell-next tool automatically updated the following packages to their secure versions:
- next
- react-server-dom-webpack
- react-server-dom-parcel  
- react-server-dom-turbopack

All package.json files have been scanned and vulnerable versions have been patched to the correct fixed versions based on the official React advisory.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>

* Add retries to flag network datasource when stream closes

Implements automatic retry logic with exponential backoff when the flag network
stream unexpectedly closes. The stream will retry with delays increasing from
1s to a maximum of 30s, allowing the datasource to recover from temporary
network issues while falling back to bundled definitions if initial connection
fails.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* Revert package.json and pnpm-lock changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>

* use ndjson (#238)

* try

* try

* use debugLog

* replace testkey

* never retry on 4xx

* Track FLAG_CONFIG_READ events

* update @biomejs/biome

* send user-agent, rm terminate handling, fix tests

* extract usage-tracker and add tests

* rm EdgeConfigDataSource

* export EvaluationParams and EvaluationResult

* drop edge-config dep

* drop edge config from @flags-sdk/vercel

* adapt @flags-sdk/vercel

* fix integration tests

* wip

* assert ingest requests

* race initial connection, retry in background, abort on shutdown

* rm store

* make readBundledDefinitions async

* read from @vercel/flags-definitions/definitions.json

* add ensureFallback fn

* getDefaultFlagsClient() → flagsClient

* rm process.pid

* rm webpackIgnore: true

* require fallbacks at build time on vercel only

* test in layout

* vercel-flags prepare --verbose

* rm prebuild script

* ensure fallback from instrumentation.ts

* rm last process.pid

* print warning

* Track duration and cache status for config reads

* add tests

* await stream in initialize method

* consumeStream → runStreamLoop

* replace subscribe with doInitialize

* add webpackIgnore

* make @vercel/flags-core a peer dep

* fresh start

* debug

* step

* next-connection

* avoid opening stream during builds

* undo next specific exports

* handle abort

* fake

* poc

* clean up imports

* next-js exports

* upgrade next

* move "use cache" up

* move "use cache" handling to client

* split index.default.ts and index.next-js.ts

* separate

* jsdoc

* use scoped map instead of passing ref

* move jsdoc

* rename

* keep dataSource private, clean clientMap

* reset retryCount on connection; abort on 401

* break after 10 retries

* add backoff with jitter + limit

* add usage tracking and read fallback

* refactor

* extract stream-connection, update tests

* add tests

* reduce test amount

* add perf metadata

* add BaseEvaluationResult

* getData → read

* rm shirt-shop-vercel

* drop next-connection

* update pnpm-lock

* getMetadata → getInfo

* add getDatafile

* DataSourceData → Datafile

* merge metrics into datafile

* simplify metrics

* use embed for getDatafile

* add comment

* comment

* bring shirt-shop-vercel back

* try setCacheLife

* support cache components in OpenFeature import

* use new format

* rm cli

* fix origin

* use bundler

* simplify

* ensure warning is highlighted in build logs

* warn only once

* ensureFallback → getFallbackDatafile

* improve perf

* avoid creating new objects

* fix type issues

* stop exposing createRawClient

* fix: mark stream reconnection loop as intentional fire-and-forget

Add void operator before async IIFE to explicitly indicate the floating
promise is intentional, preventing linter warnings and making the code
intent clearer to future maintainers.

* fix: handle malformed JSON in stream messages gracefully

Wrap JSON.parse in try/catch to prevent crashes from malformed server
responses. Logs a warning and skips the invalid message instead of
crashing the stream connection handler.

* fix: add bounds checking for variant index access

Add getVariant() helper that throws a descriptive error if the variant
index is out of bounds. This prevents silent undefined returns when
variant indices are invalid, making issues easier to debug in production.

* fix: prevent concurrent initialization race condition

Add initializingPromise to coordinate concurrent initialize() calls.
The fast boolean check is preserved for the hot path, while concurrent
calls during initialization now await the same promise instead of
triggering multiple initializations.

* fix: add timeout and retry logic to fetchDatafile

- Add 10-second timeout using AbortController to prevent indefinite hangs
- Add exponential backoff retry (up to 3 attempts) for transient failures
- Skip retries for 4xx client errors (except 429 rate limiting)
- Improves resilience against network issues in production

* fix: prevent race condition in ensureStream

Use local variable for abortController and store streamPromise
immediately after creation. This prevents concurrent calls from
creating multiple streams or overwriting the abort controller
before the promise is stored.

* fix: prevent race condition in read() by capturing data reference

Capture this.data reference at the start of read() to ensure consistent
state throughout the method. The onMessage callback from the stream can
update this.data during async operations, which could cause inconsistent
behavior if the reference changes mid-operation.

* comments

* add streaming connectionState

* update usage

* fix init

* try to avoid hanging promise

* update attw, add types

* get rid of unnecessary async/await

* avoid printing the warning

* distinct warnings

* don't export cachedFns

* add CLAUDE.md

* jsdoc

* clear timeout

* export Datafile

* avoid exposing data sources

* simplify

* types

* avoid dangling timeout

* more options

* tests

* allow options in createClient

* DatafileInput

* better options

* Update event tracking to use streams

* Revert "Update event tracking to use streams"

This reverts commit cff740a18c.

* fix datafile input type

* type

* handle shutdown and re-init

* defensive

* retry stream for up to 15 minutes

* Update event reporting to use ndjson for more events

* Revert "Update event reporting to use ndjson for more events"

This reverts commit f70a7bfc59.

* Add debug logs to the usage tracker

* [adapter-vercel] fix getProviderData

* [adapter-vercel] only return vercel flags from getProviderData

* fix

* rm getInfo

* rm tgz

* rm example

* rm next/connection from gitignore

* rm unused deps

* use DatafileInput type

* fix tests

* ensure pollCount > 0

* fix type issues

* fix retry logic

* upgrade @sveltejs/kit

* resolve ci issues

---------

Co-authored-by: Luis Meyer <luis.meyer@vercel.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2026-02-09 11:45:00 +02:00
Vincent Derks 9e2432073d Updated @changeset/cli to 2.29.8 (#253) 2026-02-06 12:08:46 +01:00
Vincent Derks a0f0d9f5c2 Removed next-14 (#243) 2026-02-06 09:02:27 +01:00
Dominik Ferber 0910327c65 add next-16 tests (#195)
* add next-16 tests

* upgrade biome

* upgrade react in next-16

* tsconfig

* try with middleware.ts

* Revert "try with middleware.ts"

This reverts commit 894b6ed5ce.

* Revert "try adding executablePath"

This reverts commit a4991996fe.

* ensure x-middleware-rewrite

* test x-nextjs-cache

* rm playwright --ui

* adjust biome schema version

* disable getStaticPaths in pages router

* try chromium

* re-enable ci playwright workaround
2025-10-25 00:49:34 +03:00
Dominik Ferber f2eba9c624 upgrade pnpm (#198)
* extract @flags-sdk/utils

* init

* split package

* rename createFlagsClient to createClient

* add TODO

* wip

* add openfeature adapter

* reuse InlineDataSource

* fix type in test

* expose OpenFeature adapter

* implement OpenFeature adapter

* wip

* wip

* convert shirt-shop

* move store into flags-core

* split up data-source

* add READMEs

* upgrade to pnpm v10

* update comment

* undo example changes

* rm flags/utils

* fix biome issues

* rm status test

* tests
2025-10-25 00:13:34 +03:00
Dominik Ferber 98ad9fb352 rm @vercel/style-guide (#193)
* add format command

* drop @vercel/style-guide

* copy over rules frmo @vercel/style-guide
2025-10-17 15:31:55 +03:00
Dominik Ferber 735a6eee06 rm jest (#192) 2025-10-17 14:39:46 +03:00
Dominik Ferber ba4eec7b23 replace eslint and prettier with biome (#187)
* remove @pyra/eslint-config

* wip

* wip

* convert shirt-shop-api

* convert shirt-shop

* convert snippets

* convert next-13

* convert next-14

* convert next-15

* eslint configs

* upgrade prettier

* use eslint v9

* run prettier

* resolve type-check

* adjust eslint

* drop Next.js v13

* fix next-14

Avoid accidentally using implicitly installed eslint v8

* update lockfile

* rm @eslint/eslintrc

* add @next/eslint-plugin-next

* biome

* biome fixes

* wip

* apply formatting

* tabs

* rm prettier

* spaces

* fix svelte

* update lockfile

* single quotes

* format all

* rm eslint-disable comments

* upgrade playwright

* upgrade publint

* upgrade playwright ci workflow

* try chromium headless

* try adding executablePath
2025-10-15 23:38:17 +03:00
Dominik Ferber a5bfb13c43 extended example (#84)
* wip

* adapt nav

* store management

* ssr cart

* clean up

* fix stableId issue

* allow image sorting

* toast on ProceedToCheckoutButton

* move actions, extract components

* Add PPR to Cart (#85)

* toast on Shop now

* allow delay

* loading spinner

* wip

* fix animations

* show cart count

* Extend shirt-shop demo with dynamic flag usage (#86)

* better metadata

* wip

* move cart to api

* wip

* respect free shipping

* add example banner

* init shadcn

* reorg

* remove relative paths from components

* do not link footer

* wip

* remove shadcn setup

* api-server » shirt-shop-api

* /api/:cartId » /api/cart/:cartId

* add delayFlag desc

* fix cart count

* remove quantity

* fine tune animation

* shrink

* list envs, fix Link

* change flag names

* set cart-id from middleware

* append headers

* allow cloning

* add BACKEND_URL fallback
2025-03-04 17:05:13 +01:00
Dominik Ferber 646778643e convert summer-sale to shirt-shop (#79)
* convert summer-sale to shirt-shop

* update deps

* canary for snippets

* expect errors

* upgrade deps

* ComponentRef

* steps
2025-02-28 11:04:12 +02:00
Dominik Ferber 422435c0eb rename (#68)
* @vercel-flags » flags

* update lockfile

* fix name
2025-02-20 19:54:09 +02:00
Aaron Morris cf532daf20 Update flags package json (#62)
* (flags) remove index from exports

* Update tsup.config, use clean:true instead of rimraf

* Add changeset

* pnpm-lock

* update tsup config, remove unused provider entrypoints

* tsup.config: update entry format

* Add attw check in CI

* Update .changeset/tidy-schools-retire.md

---------

Co-authored-by: Dominik Ferber <dominik.ferber@gmail.com>
2025-02-14 09:45:24 +02:00
Dominik Ferber 55fe9b5e3c change from .com to .dev (#38) 2025-01-17 13:32:02 +02:00
Dominik Ferber 7e21d4f6be update README and package.json files (#35)
* update README

* add metadata to package.json

* add changeset

* add sveltekit keyword
2025-01-16 18:18:43 +02:00
Dominik Ferber 6876875a13 remove partial-prerendering example (#15)
* remove partial-prerendering example

This is now available as a snippet, so we no longer need a dedicated application

* update lockfile
2025-01-10 19:27:33 +02:00
Dominik Ferber 8152ef3371 split up docs (#7)
* wip

* init collection

* convert identify

* convert precompute

* convert adapters

* convert marketing-pages

* convert feature-flags-in-edge-middleware

* remove docs

* rename to snippets

* rename collection to snippets

* eslint

* list examples on landing page

* remove unused code
2024-12-18 11:27:26 +02:00
Dominik Ferber 33b661f231 update turbo 2024-12-12 15:32:19 +02:00
Dominik Ferber db89f0dfb1 Init 2024-12-12 13:01:06 +02:00