tldraw/packages
alex 4048064e78
Feature flags rework (#1474)
This diff tweaks our `debugFlags` framework to support setting different
default value for different environments, makes it easier to define
feature flags, and makes feature flags show up in the debug menu by
default. With this change, feature flags will default to being enabled
in dev and preview environments, but disabled in production.

Specify a feature flag like this:
```ts
const featureFlags = {
      myCoolNewFeature: createFeatureFlag('myCoolNewFeature')
}
```

optionally, pass a second value to control its defaults:
```ts
const featureFlags = {
    featureEnabledInProduction: createFeatureFlag('someFeature', { all: true }),
    customEnabled: createFeatureFlag('otherFeature', {development: true, staging: false, production: false}),
}
```

In code, the value can be read using `featureFlags.myFeature.value`.
Remember to wrap reading it in a reactive context!

### Change Type

- [x] `patch` — Bug Fix

### Test Plan

-

### Release Notes

[internal only change]
2023-05-30 13:06:15 +00:00
..
assets [feature] add laser pointer (#1412) 2023-05-19 11:09:13 +00:00
editor Feature flags rework (#1474) 2023-05-30 13:06:15 +00:00
file-format [refactor] update record names (#1473) 2023-05-26 13:37:59 +00:00
indices Create @tldraw/indices package (#1426) 2023-05-22 08:18:01 +00:00
polyfills avoid lazy race conditions (#1364) 2023-05-12 15:41:40 +00:00
primitives Measure individual words instead of just line breaks for text exports (#1397) 2023-05-22 15:10:03 +00:00
tldraw [chore] refactor user preferences (#1435) 2023-05-25 09:54:29 +00:00
tlschema [tiny] add isPageId (#1482) 2023-05-27 17:53:18 +00:00
tlstore [chore] refactor user preferences (#1435) 2023-05-25 09:54:29 +00:00
tlsync-client [minor] Mark tlsync-client internal APIs (#1481) 2023-05-27 16:18:32 +00:00
tlvalidate avoid lazy race conditions (#1364) 2023-05-12 15:41:40 +00:00
ui Feature flags rework (#1474) 2023-05-30 13:06:15 +00:00
utils Stricter ID types (#1439) 2023-05-24 11:25:41 +00:00