Skip to content

standard flags extension - #627

Draft
dferber90 wants to merge 7 commits into
standardfrom
standard-flags-extension
Draft

dferber90 wants to merge 7 commits into
standardfrom
standard-flags-extension

Conversation

@dferber90

Copy link
Copy Markdown
Collaborator

No description provided.

dferber90 and others added 6 commits November 21, 2026 17:53
The flags of all flags files with one source can be imported from
flags:<source>, e.g. `import { summerSale } from 'flags:self'`, as well
as from their file. writeFlagsFileSources writes .flags/<source>.ts with
re-exports of each file, .flags/aliases.json for the framework plugins,
and flags/generated.d.ts with the type of each flag from its file. A key
in two files of one source fails a build. The dev servers write the
modules again after each change of a flags file.

Co-Authored-By: Claude <noreply@anthropic.com>
formatFlagsFile of flags/tooling formats a flags file and keeps its
comments. `flags format [paths...] [--check]` formats the files in place
or checks them in CI. `flags format --stdin` is for editors: Zed uses it
as the external formatter of the language Flags, because an extension of
Zed can not give a formatter without a language server.

Co-Authored-By: Claude <noreply@anthropic.com>
…declaration files always

Flags files:
- `flag <name> { key: "…" }`: the name is the export which the code
  imports, `key` is the key in the flag management system (the default is
  the name). A flag can set its own `source`. Two flags with the same key
  and source are an error (DuplicateKey). The grammars of Tree-sitter, Zed
  and VS Code follow.

Types:
- The SDK writes the declaration file of each flags file (`app.d.flags.ts`)
  also when tsconfig.json has the content mapper. Editors with an older
  TypeScript (e.g. vtsls of Zed) read it, and TypeScript 7.1 with
  --runExternalCode still uses the content mapper.
- `writeFlagsFileDeclaration` of flags/tooling writes one file if it
  changed. The loaders of Next.js and Vite and flags/register use it.
  `usesContentMapper` is gone.
- SPEC: the empty environment of the content mapper comes from
  node_modules/.bin/tsc of TypeScript 7.1 beta on Node.js 22
  (process.execve without env), not from TypeScript.

Example examples/standard/node-flags-files: a plain Node.js server with
src/app.flags, `node --import flags/register`, and the content mapper of
TypeScript 7.1 beta (type-check:content-mapper, needs Node.js 24).

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

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flags-playground Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-dev Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-flagsmith Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-growthbook Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-launchdarkly Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-openfeature Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-posthog Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-reflag Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-snippets Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-statsig Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
flags-sdk-sveltekit-snippets Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
shirt-shop Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC
shirt-shop-api Ready Ready Preview, v0 Nov 24, 2026 11:10am UTC

@socket-security

socket-security Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​tree-sitter-cli@​0.27.2921008394100
Addednpm/​typescript@​7.1.0-beta991008910090

View full report

This branch was successfully deployed

14 active deployments
Preview – flags-sdk-dev — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-snippets — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-growthbook — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-sveltekit-snippets — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-openfeature — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-vercel — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-playground — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – shirt-shop-api — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-launchdarkly — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-posthog — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-flagsmith — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-statsig — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – flags-sdk-reflag — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
Preview – shirt-shop — fbb41e3e Deployed Nov 24, 2026 by vercel[bot]
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.

1 participant