@vllnt/convex-flags 0.1.1-canary.cc73cb4 → 0.2.0-canary.4c68b39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -34
- package/README.md +49 -13
- package/dist/component/mutations.d.ts +3 -1
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +22 -2
- package/dist/component/mutations.js.map +1 -1
- package/docs/API.md +30 -18
- package/llms.txt +10 -7
- package/package.json +2 -5
- package/src/component/mutations.ts +24 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,17 +4,57 @@ All notable changes to this project are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
5
5
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.2.0] - 2026-11-28
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- The package ships `docs/API.md`, `CHANGELOG.md` and `llms.txt`, so the docs in
|
|
12
|
+
`node_modules/@vllnt/convex-flags/` match the installed version (`llms.txt` links to them with
|
|
13
|
+
relative paths).
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Breaking:** `define` now rejects a key with a non-ASCII or control character (anything outside
|
|
18
|
+
printable ASCII, `0x20` to `0x7E`), a leading `$`, or more than 1024 characters, with
|
|
19
|
+
`ConvexError({ code: "INVALID_ARGUMENT" })`. `all` returns a record keyed by flag key and Convex
|
|
20
|
+
rejects such field names, so one stored key of this kind made every `all` and `useFlags` call
|
|
21
|
+
fail, for all flags. A leading `_` is still accepted. What to do: rename such keys in your code;
|
|
22
|
+
to clean up keys stored earlier, call `list`, filter the keys with the same rule and `remove` each
|
|
23
|
+
one. Every call except `define` (and the `all` query, which such keys break) still accepts them:
|
|
24
|
+
`get`, `evaluate`, `list`, `update`, `enable`, `disable`, `archive`, `restore`, `setOverride`,
|
|
25
|
+
`clearOverride` and `remove`. `define` the flag under a valid key first to keep it; `remove` also
|
|
26
|
+
deletes that key's overrides, so re-create the ones you need under the new key. See README
|
|
27
|
+
"Limits and gotchas" and the cleanup example under "Common tasks".
|
|
28
|
+
- **Breaking:** management mutations except `remove` reject an empty flag `key`, and
|
|
29
|
+
`setOverride` / `clearOverride` an empty `subjectRef`, with `INVALID_ARGUMENT`; `define` and
|
|
30
|
+
`update` reject rollout weights (flag-level and rule-level) that are `NaN`, infinite or negative
|
|
31
|
+
with `INVALID_ARGUMENT`. In 0.1.0 these calls were accepted: empty keys and subject refs were
|
|
32
|
+
stored as-is, and invalid weights were silently ignored (`NaN`, negative) or skewed bucketing
|
|
33
|
+
(`Infinity`). What to do: pass a non-empty `key` and `subjectRef`, and weights that are finite
|
|
34
|
+
and `>= 0` (`0` turns a split off). Rows stored earlier: a flag with an empty key is still served
|
|
35
|
+
by `get`, `evaluate`, `list` and `all`, and can be deleted with `remove("")`, which also deletes
|
|
36
|
+
its overrides; every other management call on it throws `INVALID_ARGUMENT`. An override with an
|
|
37
|
+
empty `subjectRef` still applies when the context's `subjectRef` is `""`; `setOverride` and
|
|
38
|
+
`clearOverride` cannot reach it, and `remove` of its flag deletes it.
|
|
39
|
+
- **Breaking:** rollouts with any non-whole-number weight are re-bucketed (see Fixed), so some
|
|
40
|
+
subjects get a different value after upgrading; rollouts whose weights are all whole numbers are
|
|
41
|
+
unaffected. What to do: nothing, unless a subject must keep its value; then pin it with
|
|
42
|
+
`setOverride` before upgrading.
|
|
43
|
+
- `engines.node` is now `>=20` (was `>=18`). No `convex` release in the `^1.45.0` peer range
|
|
44
|
+
supports Node 18 (`convex` 1.45 to 1.48 need Node 20, 1.49 and later Node 22). The `convex` peer
|
|
45
|
+
range is unchanged (`^1.45.0`).
|
|
46
|
+
- Management mutations (`define`, `update`, `enable`, `disable`, `archive`, `restore`,
|
|
47
|
+
`setOverride`) skip the write when nothing changed, so idempotent re-defines no longer bump
|
|
48
|
+
`updatedAt` or re-run every `evaluate`/`all` subscription.
|
|
49
|
+
- Docs: README rewritten in a fixed, agent-first order (when to use, install, quick start, an API
|
|
50
|
+
table linking every export and `Flags` method to `docs/API.md`, common tasks, every error code
|
|
51
|
+
with its fix, limits and gotchas, compatibility, how to use `/test` in a consuming app);
|
|
52
|
+
`docs/API.md` has one heading per export and documents every entry point, evaluation order and
|
|
53
|
+
error code; a shorter `package.json` description and more keywords, and the homepage is now
|
|
54
|
+
`oss.vllnt.com/packages/convex-flags`.
|
|
9
55
|
|
|
10
56
|
### Fixed
|
|
11
57
|
|
|
12
|
-
- The published tarball no longer includes the React and status test files.
|
|
13
|
-
- Management mutations reject an empty flag `key`, and `setOverride` / `clearOverride` an empty
|
|
14
|
-
`subjectRef`, with `ConvexError({ code: "INVALID_ARGUMENT" })`.
|
|
15
|
-
- `define` and `update` reject rollout weights (flag-level and rule-level) that are `NaN`,
|
|
16
|
-
infinite or negative with `INVALID_ARGUMENT`; previously they were silently ignored or skewed
|
|
17
|
-
bucketing.
|
|
18
58
|
- Rollouts with a non-whole-number weight now split subjects by their weights. In 0.1.0 some of
|
|
19
59
|
these weights bucketed unevenly: weights summing to 1 (such as `0.5` / `0.5`) sent every subject
|
|
20
60
|
to the first split, other sets were skewed (`1.5` / `1.5` served about 67% / 33%), and a split
|
|
@@ -22,35 +62,13 @@ All notable changes to this project are documented here. The format is based on
|
|
|
22
62
|
rollouts are re-bucketed once on upgrade, so some of their subjects change value. Rollouts whose
|
|
23
63
|
weights are all whole numbers, and rows stored with an `Infinity` weight before weights were
|
|
24
64
|
validated, bucket exactly as before.
|
|
65
|
+
- The published tarball no longer includes the test files `src/react/index.test.ts` and
|
|
66
|
+
`src/status-backward-compat.test.ts`, which 0.1.0 shipped.
|
|
25
67
|
|
|
26
|
-
###
|
|
68
|
+
### Internal
|
|
27
69
|
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
`updatedAt` or re-run every `evaluate`/`all` subscription.
|
|
31
|
-
- Upgrade dev tooling (vitest 5.1.1, vite 8.3, convex 1.51, convex-test 0.0.73, prettier 3.10,
|
|
32
|
-
jsdom 31, `@vllnt/typescript` 3 with `exactOptionalPropertyTypes` kept off), and override the
|
|
33
|
-
vulnerable transitive `handlebars`, `deepmerge-ts` and `minimatch` releases.
|
|
34
|
-
- Adopt pnpm 10 with a release-age gate; releases are published only from CI with npm trusted
|
|
35
|
-
publishing and provenance.
|
|
36
|
-
- Document the component error codes and how to use `/test` in a consuming app.
|
|
37
|
-
- The package now ships `docs/API.md`, `CHANGELOG.md` and `llms.txt`, so the docs in
|
|
38
|
-
`node_modules/@vllnt/convex-flags/` match the installed version. `llms.txt` links to these
|
|
39
|
-
files with relative paths, and a `test:package` CI check fails when a required file is missing
|
|
40
|
-
from the tarball or a contributor-only file is included.
|
|
41
|
-
- `docs/API.md` lists every entry point and its exports, the `./react` option and ref types, and
|
|
42
|
-
how a rollout that cannot bucket inside a matched rule falls back to the flag value.
|
|
43
|
-
- Canary builds publish on every qualifying push to `main` (dist-tag `canary` only, never
|
|
44
|
-
`latest`), including docs-only changes to the shipped files.
|
|
45
|
-
- `engines.node` is now `>=20`, matching what `convex` itself requires (no `convex` version in
|
|
46
|
-
the peer range supports Node 18).
|
|
47
|
-
- README rewritten in a fixed, agent-first order (when to use, install, quick start, an API table
|
|
48
|
-
linking every export and `Flags` method to `docs/API.md`, common tasks, every error code with its
|
|
49
|
-
fix, limits and gotchas, compatibility), with one `docs/API.md` heading per export, a
|
|
50
|
-
"When to use" section and the errors link in `llms.txt`, and a shorter `package.json`
|
|
51
|
-
description and keywords; `pnpm test:package` now installs the packed tarball in a temporary app,
|
|
52
|
-
checks this docs contract (`scripts/check-documentation.mjs`), type-checks the README examples
|
|
53
|
-
against convex 1.45.0 and React 18 and runs the README test example.
|
|
70
|
+
- Tooling, CI and release updates (pnpm 10 with a 7-day release-age gate, CI-only publishing with
|
|
71
|
+
provenance, a canary on every push to `main`).
|
|
54
72
|
|
|
55
73
|
## [0.1.0] - 2026-09-01
|
|
56
74
|
|
package/README.md
CHANGED
|
@@ -357,6 +357,38 @@ export const flagKeys = internalQuery({
|
|
|
357
357
|
});
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
+
Find and remove flag keys stored before 0.2.0 that `define` now rejects. They
|
|
361
|
+
make every `all` and `useFlags` call fail; `list` and `remove` still accept
|
|
362
|
+
them. To keep such a flag, read it with `get` and `define` it under a valid key
|
|
363
|
+
before you remove the old one. `remove` also deletes the old key's overrides, so
|
|
364
|
+
re-create the ones you need under the new key:
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
// convex/cleanup.ts
|
|
368
|
+
import { v } from "convex/values";
|
|
369
|
+
|
|
370
|
+
import { internalMutation } from "./_generated/server";
|
|
371
|
+
import { flags } from "./flags";
|
|
372
|
+
|
|
373
|
+
/** Keys `define` rejects: more than 1024 characters, a leading `$`, or a
|
|
374
|
+
* character outside printable ASCII. */
|
|
375
|
+
function unusableKey(key: string): boolean {
|
|
376
|
+
return key.length > 1024 || key.startsWith("$") || !/^[\x20-\x7e]*$/.test(key);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export const removeUnusableKeys = internalMutation({
|
|
380
|
+
args: {},
|
|
381
|
+
returns: v.array(v.string()),
|
|
382
|
+
handler: async (ctx) => {
|
|
383
|
+
const keys = (await flags.list(ctx))
|
|
384
|
+
.map((flag) => flag.key)
|
|
385
|
+
.filter(unusableKey);
|
|
386
|
+
for (const key of keys) await flags.remove(ctx, key);
|
|
387
|
+
return keys;
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
```
|
|
391
|
+
|
|
360
392
|
Mount the component twice for two separate sets of flags. Each named mount has
|
|
361
393
|
its own tables:
|
|
362
394
|
|
|
@@ -389,7 +421,7 @@ Management methods throw these errors from the component. Reads (`get`, `list`,
|
|
|
389
421
|
| Code | Message | Cause | Fix |
|
|
390
422
|
| ------------------ | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
391
423
|
| `FLAG_NOT_FOUND` | contains `FLAG_NOT_FOUND` (a plain `Error`) | `update`, `enable`, `disable`, `archive`, `restore`, `remove` or `setOverride` got a key that was never defined, or was removed | Call `define` first, or check with `get(ctx, key)`; keys are case-sensitive |
|
|
392
|
-
| `INVALID_ARGUMENT` | `key must be non-empty`, `subjectRef must be non-empty`, `rollout weights must be finite and non-negative` | A management method got an empty `key`; `setOverride` / `clearOverride` got an empty `subjectRef`; `define` / `update` got a split weight that is `NaN`, infinite or negative (flag-level or in a rule) | Pass non-empty strings; use weights `>= 0` (a `0` weight turns a split off) |
|
|
424
|
+
| `INVALID_ARGUMENT` | `key must be non-empty`, `subjectRef must be non-empty`, `rollout weights must be finite and non-negative`, `key must be at most 1024 characters`, `key must not start with '$'`, `key must contain only printable ASCII characters` | A management method other than `remove` got an empty `key`; `setOverride` / `clearOverride` got an empty `subjectRef`; `define` / `update` got a split weight that is `NaN`, infinite or negative (flag-level or in a rule); `define` got a new key that `all` cannot return (more than 1024 characters, a leading `$`, or a character outside printable ASCII such as `é`, a tab or a control character) | Pass non-empty strings; use weights `>= 0` (a `0` weight turns a split off); use printable ASCII keys of at most 1024 characters that do not start with `$` |
|
|
393
425
|
|
|
394
426
|
`INVALID_ARGUMENT` is a `ConvexError` whose `data` is `{ code, message }`: read
|
|
395
427
|
`error.data.code`. `FLAG_NOT_FOUND` is a plain `Error` whose message contains
|
|
@@ -445,16 +477,20 @@ client must see it. Arguments of the wrong type (for example an object as
|
|
|
445
477
|
queries do not re-run.
|
|
446
478
|
- `clearOverride` on a missing override or flag does nothing. `remove` deletes
|
|
447
479
|
the flag's overrides too.
|
|
448
|
-
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
`
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
480
|
+
- Every management call rejects an empty key except `remove`: 0.1.0 stored
|
|
481
|
+
flags with key `""`, and `remove(ctx, "")` deletes such a flag and its
|
|
482
|
+
overrides (or throws `FLAG_NOT_FOUND` when there is none). `get`, `evaluate`,
|
|
483
|
+
`list` and `all` still serve it until then.
|
|
484
|
+
- Flag keys: `define` accepts printable ASCII keys (`0x20` to `0x7E`, spaces
|
|
485
|
+
and symbols included) of at most 1024 characters that do not start with `$`,
|
|
486
|
+
and throws `INVALID_ARGUMENT` for any other key. These are Convex's rules for
|
|
487
|
+
an object field name, and `all` (so `useFlags`) returns a record keyed by flag
|
|
488
|
+
key: one such key made every `all` call fail, for all flags. A leading `_` is
|
|
489
|
+
accepted and `all` returns it, but Convex documents record keys as not
|
|
490
|
+
starting with `_`, so avoid it in new keys. Only `define` checks this: `get`,
|
|
491
|
+
`evaluate`, `list`, `update`, `setOverride`, `clearOverride` and `remove`
|
|
492
|
+
still accept a key stored before 0.2.0, so you can find and remove it (see
|
|
493
|
+
Common tasks).
|
|
458
494
|
- `all` returns one field per flag, and Convex limits an object to 1024 fields,
|
|
459
495
|
so with more than 1024 flags `all` and `useFlags` fail (Convex's documented
|
|
460
496
|
limit, not tested here). Use `evaluate` per key for larger sets. `list` and
|
|
@@ -543,8 +579,8 @@ example and the `docs/API.md` signatures of `register`, `useFlag` and
|
|
|
543
579
|
- Its `flags` and `overrides` tables are reachable only through the component's
|
|
544
580
|
functions, and it never reads host tables.
|
|
545
581
|
- Flag keys, subject refs and attribute names are opaque strings. On writes the
|
|
546
|
-
component rejects
|
|
547
|
-
|
|
582
|
+
component rejects empty keys (except in `remove`, for cleanup) and subject
|
|
583
|
+
refs, and `define` rejects keys that `all` cannot return (see Limits and gotchas); it never interprets them.
|
|
548
584
|
|
|
549
585
|
Report vulnerabilities as described in
|
|
550
586
|
[SECURITY.md](https://github.com/vllnt/convex-flags/blob/main/SECURITY.md).
|
|
@@ -86,7 +86,9 @@ export declare const archive: import("convex/server").RegisteredMutation<"public
|
|
|
86
86
|
export declare const restore: import("convex/server").RegisteredMutation<"public", {
|
|
87
87
|
key: string;
|
|
88
88
|
}, Promise<null>>;
|
|
89
|
-
/** Permanently delete a flag and any per-subject overrides it owns.
|
|
89
|
+
/** Permanently delete a flag and any per-subject overrides it owns. An empty
|
|
90
|
+
* key is accepted (unlike every other mutation) so a row stored with key `""`
|
|
91
|
+
* before keys were validated can still be deleted. */
|
|
90
92
|
export declare const remove: import("convex/server").RegisteredMutation<"public", {
|
|
91
93
|
key: string;
|
|
92
94
|
}, Promise<null>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAgHA;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDA0CjB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BjB,CAAC;AAWH,wDAAwD;AACxD,eAAO,MAAM,MAAM;;iBAOjB,CAAC;AAEH,0DAA0D;AAC1D,eAAO,MAAM,OAAO;;iBAOlB,CAAC;AAiBH;mDACmD;AACnD,eAAO,MAAM,OAAO;;iBAOlB,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,OAAO;;iBAOlB,CAAC;AAEH;;sDAEsD;AACtD,eAAO,MAAM,MAAM;;iBAkBjB,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,WAAW;;;;iBA6BtB,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,aAAa;;;iBAgBxB,CAAC"}
|
|
@@ -19,6 +19,24 @@ function assertNonEmpty(fields) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
/** Longest flag key `all` can return: Convex's object field-name limit. */
|
|
23
|
+
const MAX_KEY_LENGTH = 1024;
|
|
24
|
+
/** Reject a new flag key that Convex cannot use as a field name. `all` returns
|
|
25
|
+
* a record keyed by flag key, so one such key would make every `all` call (and
|
|
26
|
+
* `useFlags`) fail. Mirrors Convex's field-name check: at most 1024 characters,
|
|
27
|
+
* no leading `$`, printable ASCII (0x20-0x7E) only. A leading `_` is accepted
|
|
28
|
+
* by that check and is allowed. */
|
|
29
|
+
function assertValidKey(key) {
|
|
30
|
+
if (key.length > MAX_KEY_LENGTH) {
|
|
31
|
+
invalidArgument(`key must be at most ${MAX_KEY_LENGTH} characters`);
|
|
32
|
+
}
|
|
33
|
+
if (key.startsWith("$")) {
|
|
34
|
+
invalidArgument("key must not start with '$'");
|
|
35
|
+
}
|
|
36
|
+
if (!/^[\x20-\x7e]*$/.test(key)) {
|
|
37
|
+
invalidArgument("key must contain only printable ASCII characters");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
22
40
|
/** Reject rollout weights that cannot bucket: NaN, infinite, or negative. Zero
|
|
23
41
|
* is allowed (it excludes a split). */
|
|
24
42
|
function assertRollouts(rollouts, rules) {
|
|
@@ -80,6 +98,7 @@ export const define = mutation({
|
|
|
80
98
|
returns: v.id("flags"),
|
|
81
99
|
handler: async (ctx, args) => {
|
|
82
100
|
assertNonEmpty({ key: args.key });
|
|
101
|
+
assertValidKey(args.key);
|
|
83
102
|
assertRollouts([args.rollout], args.rules);
|
|
84
103
|
const now = Date.now();
|
|
85
104
|
const existing = await findByKey(ctx, args.key);
|
|
@@ -193,12 +212,13 @@ export const restore = mutation({
|
|
|
193
212
|
return null;
|
|
194
213
|
},
|
|
195
214
|
});
|
|
196
|
-
/** Permanently delete a flag and any per-subject overrides it owns.
|
|
215
|
+
/** Permanently delete a flag and any per-subject overrides it owns. An empty
|
|
216
|
+
* key is accepted (unlike every other mutation) so a row stored with key `""`
|
|
217
|
+
* before keys were validated can still be deleted. */
|
|
197
218
|
export const remove = mutation({
|
|
198
219
|
args: { key: v.string() },
|
|
199
220
|
returns: v.null(),
|
|
200
221
|
handler: async (ctx, args) => {
|
|
201
|
-
assertNonEmpty({ key: args.key });
|
|
202
222
|
const flag = await findByKey(ctx, args.key);
|
|
203
223
|
if (flag === null) {
|
|
204
224
|
flagNotFound();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,CAAC,EAAc,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKvE,KAAK,UAAU,SAAS,CAAC,GAAgB,EAAE,GAAW;IACpD,OAAO,MAAM,GAAG,CAAC,EAAE;SAChB,KAAK,CAAC,OAAO,CAAC;SACd,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;SAC5C,MAAM,EAAE,CAAC;AACd,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED;sDACsD;AACtD,SAAS,cAAc,CAAC,MAA8B;IACpD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YACjB,eAAe,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;AACH,CAAC;AAED;uCACuC;AACvC,SAAS,cAAc,CACrB,QAAoC,EACpC,KAAyB;IAEzB,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,KA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AAI,EAAE,CAAC;YACtB,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
package/docs/API.md
CHANGED
|
@@ -17,21 +17,25 @@ installed version.
|
|
|
17
17
|
`./package.json` is exported as-is. A flag value is a typed primitive,
|
|
18
18
|
`boolean | string | number` ([`VariantValue`](#variantvalue)): a boolean flag is
|
|
19
19
|
the two-variant case, string and number flags are multivariate. Flag keys and
|
|
20
|
-
subject refs are opaque host strings. On writes the component rejects
|
|
21
|
-
ones
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
subject refs are opaque host strings. On writes the component rejects empty
|
|
21
|
+
ones (except [`remove`](#remove), which accepts an empty key for cleanup), and
|
|
22
|
+
[`define`](#define) also rejects keys that [`all`](#all) cannot return.
|
|
23
|
+
|
|
24
|
+
Flag keys: `all` returns a record keyed by flag key, and Convex rejects an
|
|
25
|
+
object field name that is longer than 1024 characters, starts with `$`, or
|
|
26
|
+
contains a character outside printable ASCII (`0x20` to `0x7E`). Before 0.2.0
|
|
27
|
+
`define` stored such a key and every `all` call then failed, for all flags, for
|
|
28
|
+
example with
|
|
28
29
|
`Field name café has invalid character 'é': Field names can only contain non-control ASCII characters`
|
|
29
|
-
or `Field name $beta starts with a '$', which is reserved.`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
or `Field name $beta starts with a '$', which is reserved.` Since 0.2.0 `define`
|
|
31
|
+
throws `INVALID_ARGUMENT` for a new key that breaks these rules. A leading `_`
|
|
32
|
+
is accepted, and `all` returns it on convex 1.51, but Convex documents record
|
|
33
|
+
keys as not starting with `_`, so avoid it in new keys. Read and cleanup paths
|
|
34
|
+
do not check keys: `get`, `evaluate`, `list`, `update`, `setOverride`,
|
|
35
|
+
`clearOverride` and `remove` still accept a key stored earlier. To clean up,
|
|
36
|
+
call `list`, keep the keys where
|
|
37
|
+
`key.length > 1024 || key.startsWith("$") || !/^[\x20-\x7e]*$/.test(key)`,
|
|
38
|
+
and `remove` each one (`define` it under a valid key first to keep the flag).
|
|
35
39
|
|
|
36
40
|
## Client
|
|
37
41
|
|
|
@@ -65,7 +69,10 @@ of `definition` are cleared. The status (active or archived) is kept on replace;
|
|
|
65
69
|
a new flag starts active. A definition identical to the stored one writes
|
|
66
70
|
nothing, so `updatedAt` is kept.
|
|
67
71
|
|
|
68
|
-
- `definition.key` must be non-empty
|
|
72
|
+
- `definition.key` must be non-empty, at most 1024 characters, not start with
|
|
73
|
+
`$`, and contain only printable ASCII characters, `0x20` to `0x7E`
|
|
74
|
+
(`INVALID_ARGUMENT`; see [Entry points](#entry-points)). Only `define` checks
|
|
75
|
+
this; the other methods accept a key stored before 0.2.0.
|
|
69
76
|
- Every split weight, flag-level or in a rule, must be finite and `>= 0`
|
|
70
77
|
(`INVALID_ARGUMENT`).
|
|
71
78
|
|
|
@@ -124,7 +131,10 @@ remove(ctx, key: string): Promise<null>
|
|
|
124
131
|
```
|
|
125
132
|
|
|
126
133
|
Permanently deletes a flag and all of its per-subject overrides. Throws
|
|
127
|
-
`FLAG_NOT_FOUND
|
|
134
|
+
`FLAG_NOT_FOUND` when no flag has that key. Unlike every other mutation it
|
|
135
|
+
accepts an empty key, so `remove(ctx, "")` deletes a flag that 0.1.0 stored with
|
|
136
|
+
key `""`, and its overrides. It also accepts the keys `define` rejects since
|
|
137
|
+
0.2.0 (see [Entry points](#entry-points)).
|
|
128
138
|
|
|
129
139
|
### `setOverride`
|
|
130
140
|
|
|
@@ -199,7 +209,9 @@ all(ctx, context?: EvalContext): Promise<Record<string, FlagEvaluation>>
|
|
|
199
209
|
Evaluates every defined flag against the same context, keyed by flag key: the
|
|
200
210
|
bootstrap payload for a reactive client. Overrides for `context.subjectRef` are
|
|
201
211
|
applied. Unknown keys are simply absent. It throws while any stored key is not a
|
|
202
|
-
valid Convex
|
|
212
|
+
valid Convex field name; `define` rejects such keys since 0.2.0, and a key
|
|
213
|
+
stored earlier can be found with `list` and removed (see
|
|
214
|
+
[Entry points](#entry-points)).
|
|
203
215
|
|
|
204
216
|
`all` returns one field per flag, and Convex limits an object to 1024 fields
|
|
205
217
|
(including return values), so with more than 1024 flags `all` and `useFlags`
|
|
@@ -462,7 +474,7 @@ See [Rollouts](#rollouts).
|
|
|
462
474
|
| Code | Thrown by | Condition | Message |
|
|
463
475
|
| ------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
464
476
|
| `FLAG_NOT_FOUND` | `update`, `enable`, `disable`, `archive`, `restore`, `remove`, `setOverride` | The flag key does not exist | contains `FLAG_NOT_FOUND` |
|
|
465
|
-
| `INVALID_ARGUMENT` | every mutation (`key`); `setOverride`, `clearOverride` (`subjectRef`); `define`, `update` | `key` or `subjectRef` is empty
|
|
477
|
+
| `INVALID_ARGUMENT` | every mutation except `remove` (`key`); `setOverride`, `clearOverride` (`subjectRef`); `define`, `update` (weights); `define` (key rules) | `key` or `subjectRef` is empty; a rollout weight (flag-level or in a rule) is `NaN`, infinite or negative; a `define` key is longer than 1024 characters, starts with `$` or has a character outside printable ASCII | `key must be non-empty`, `subjectRef must be non-empty`, `rollout weights must be finite and non-negative`, `key must be at most 1024 characters`, `key must not start with '$'`, `key must contain only printable ASCII characters` |
|
|
466
478
|
|
|
467
479
|
`FLAG_NOT_FOUND` is a plain JavaScript `Error("FLAG_NOT_FOUND")`, not a
|
|
468
480
|
structured `ConvexError` payload. `INVALID_ARGUMENT` is a `ConvexError` whose
|
package/llms.txt
CHANGED
|
@@ -19,13 +19,16 @@ caller `default` (reason `default`) or `false` (reason `unknown`) and never
|
|
|
19
19
|
throws. `update`, `enable`, `disable`, `archive`, `restore`, `remove` and
|
|
20
20
|
`setOverride` throw a plain `Error` whose message contains `FLAG_NOT_FOUND` for
|
|
21
21
|
a key that does not exist (`define` creates it, `clearOverride` does nothing);
|
|
22
|
-
empty keys
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
outside printable ASCII
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`
|
|
22
|
+
empty keys (except in `remove`, which deletes a flag stored with key `""`)
|
|
23
|
+
or subject refs, `NaN`, infinite or negative weights, and (in
|
|
24
|
+
`define` only) keys longer than 1024 characters, starting with `$` or with a
|
|
25
|
+
character outside printable ASCII throw `ConvexError` with `data.code`
|
|
26
|
+
`INVALID_ARGUMENT`. `all` returns a record keyed by flag key, so such a key,
|
|
27
|
+
if stored before 0.2.0, makes every `all` call fail: find it with `list` and
|
|
28
|
+
delete it with `remove`, which still accept it. A leading `_` is accepted but
|
|
29
|
+
best avoided. `all` also fails (Convex's documented 1024-fields-per-object
|
|
30
|
+
limit) when there are more than 1024 flags; use `evaluate` per key for larger
|
|
31
|
+
sets. React hooks `useFlag` and
|
|
29
32
|
`useFlags` take the host's own public queries. The host owns auth and the
|
|
30
33
|
meaning of keys, subjects and attributes.
|
|
31
34
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/convex-flags",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-canary.4c68b39",
|
|
4
4
|
"description": "Convex component for feature flags in TypeScript: kill switches, variants, attribute targeting, percentage rollouts, per-subject overrides and React hooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"packageManager": "pnpm@10.34.8",
|
|
7
|
+
"packageManager": "pnpm@10.34.8+sha512.f627a8e971343afe49dfd0f63d028234201dfa831d5cb588733e1e5f8db26bf16989a32161ab5c1b4db3b1fdbc373160606b5b89e002df6dd19a85adf91fc5a8",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"src",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@edge-runtime/vm": "^5.0.0",
|
|
72
|
-
"@testing-library/react": "^16.3.3",
|
|
73
72
|
"@types/react": "^19.3.0",
|
|
74
73
|
"@types/react-dom": "^19.3.0",
|
|
75
74
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
@@ -79,8 +78,6 @@
|
|
|
79
78
|
"convex": "^1.51.0",
|
|
80
79
|
"convex-test": "^0.0.73",
|
|
81
80
|
"eslint": "^9.39.5",
|
|
82
|
-
"jsdom": "^31.0.1",
|
|
83
|
-
"prettier": "^3.10.1",
|
|
84
81
|
"react": "^19.3.1",
|
|
85
82
|
"react-dom": "^19.3.1",
|
|
86
83
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
@@ -28,6 +28,26 @@ function assertNonEmpty(fields: Record<string, string>): void {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/** Longest flag key `all` can return: Convex's object field-name limit. */
|
|
32
|
+
const MAX_KEY_LENGTH = 1024;
|
|
33
|
+
|
|
34
|
+
/** Reject a new flag key that Convex cannot use as a field name. `all` returns
|
|
35
|
+
* a record keyed by flag key, so one such key would make every `all` call (and
|
|
36
|
+
* `useFlags`) fail. Mirrors Convex's field-name check: at most 1024 characters,
|
|
37
|
+
* no leading `$`, printable ASCII (0x20-0x7E) only. A leading `_` is accepted
|
|
38
|
+
* by that check and is allowed. */
|
|
39
|
+
function assertValidKey(key: string): void {
|
|
40
|
+
if (key.length > MAX_KEY_LENGTH) {
|
|
41
|
+
invalidArgument(`key must be at most ${MAX_KEY_LENGTH} characters`);
|
|
42
|
+
}
|
|
43
|
+
if (key.startsWith("$")) {
|
|
44
|
+
invalidArgument("key must not start with '$'");
|
|
45
|
+
}
|
|
46
|
+
if (!/^[\x20-\x7e]*$/.test(key)) {
|
|
47
|
+
invalidArgument("key must contain only printable ASCII characters");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
31
51
|
/** Reject rollout weights that cannot bucket: NaN, infinite, or negative. Zero
|
|
32
52
|
* is allowed (it excludes a split). */
|
|
33
53
|
function assertRollouts(
|
|
@@ -106,6 +126,7 @@ export const define = mutation({
|
|
|
106
126
|
returns: v.id("flags"),
|
|
107
127
|
handler: async (ctx, args) => {
|
|
108
128
|
assertNonEmpty({ key: args.key });
|
|
129
|
+
assertValidKey(args.key);
|
|
109
130
|
assertRollouts([args.rollout], args.rules);
|
|
110
131
|
const now = Date.now();
|
|
111
132
|
const existing = await findByKey(ctx, args.key);
|
|
@@ -235,12 +256,13 @@ export const restore = mutation({
|
|
|
235
256
|
},
|
|
236
257
|
});
|
|
237
258
|
|
|
238
|
-
/** Permanently delete a flag and any per-subject overrides it owns.
|
|
259
|
+
/** Permanently delete a flag and any per-subject overrides it owns. An empty
|
|
260
|
+
* key is accepted (unlike every other mutation) so a row stored with key `""`
|
|
261
|
+
* before keys were validated can still be deleted. */
|
|
239
262
|
export const remove = mutation({
|
|
240
263
|
args: { key: v.string() },
|
|
241
264
|
returns: v.null(),
|
|
242
265
|
handler: async (ctx, args) => {
|
|
243
|
-
assertNonEmpty({ key: args.key });
|
|
244
266
|
const flag = await findByKey(ctx, args.key);
|
|
245
267
|
if (flag === null) {
|
|
246
268
|
flagNotFound();
|