PostHog / posthog-js

Send usage data from your web app or site to PostHog, with autocapture.
https://posthog.com/docs/libraries/js
Other
302 stars 126 forks source link

fix(surveys): Process feature_flag_keys on Survey object #1548

Closed Phanatic closed 3 days ago

Phanatic commented 3 days ago

Changes

As part of adaptive survey collection, we introduced a new feature flag that the surveys component should use to filter out surveys to be shown to people. The common pattern has become :

  1. Add a flag to the API
  2. Add the same flag as a check to getActiveMatchingSurveys

Instead, this PR now uses the feature_flag_keys array to find the names of the feature flags to check in the survey component. With this change, one can just add a new flag to the feature_flag_keys in the Surveys API in posthog.com and the survey component will automatically pick it up.

Checklist

vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 22, 2024 5:02pm
github-actions[bot] commented 3 days ago

Size Change: +2.81 kB (+0.09%)

Total Size: 3.14 MB

Filename Size Change
dist/array.full.es5.js 255 kB +312 B (+0.12%)
dist/array.full.js 358 kB +278 B (+0.08%)
dist/array.full.no-external.js 357 kB +278 B (+0.08%)
dist/array.js 172 kB +278 B (+0.16%)
dist/array.no-external.js 171 kB +278 B (+0.16%)
dist/main.js 173 kB +278 B (+0.16%)
dist/module.full.js 358 kB +278 B (+0.08%)
dist/module.full.no-external.js 357 kB +278 B (+0.08%)
dist/module.js 172 kB +278 B (+0.16%)
dist/module.no-external.js 171 kB +278 B (+0.16%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/all-external-dependencies.js` | 206 kB | | `dist/dead-clicks-autocapture.js` | 14.3 kB | | `dist/exception-autocapture.js` | 9.36 kB | | `dist/external-scripts-loader.js` | 2.29 kB | | `dist/recorder-v2.js` | 115 kB | | `dist/recorder.js` | 115 kB | | `dist/surveys-preview.js` | 57.6 kB | | `dist/surveys.js` | 63.2 kB | | `dist/tracing-headers.js` | 1.75 kB | | `dist/web-vitals.js` | 10.3 kB |

compressed-size-action