Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: client feature flags #4302

Merged
merged 18 commits into from
Sep 25, 2024
Merged

feat: client feature flags #4302

merged 18 commits into from
Sep 25, 2024

Conversation

thiessenp-cds
Copy link
Contributor

@thiessenp-cds thiessenp-cds commented Sep 20, 2024

Summary | Résumé

Adds a React context provider to allow the client (components) to access feature flags without having to do prop drilling. There is also a slight performance improvement since the feature flags only need to pulled from Redis once per layout/page.

Testing

Test by looking using the new Repeating Sets feature.
First turn off the "Experimental Features" flag in the admin setting. Open the form builder on any form and click the "Add Form Element" button. At the bottom of the dialog there should be no option for Repeating Sets.
Second, turn on the feature, follow the same steps and now the Repeating Sets feature should show in the dialog.

Copy link
Contributor

lib/cache/flags.ts Outdated Show resolved Hide resolved
@thiessenp-cds thiessenp-cds marked this pull request as ready for review September 20, 2024 17:47
@timarney
Copy link
Member

We'll need to update the form filler page as well as it uses

const isAllowGrouping = await allowGrouping();

and passes to

<FormWrapper
            formRecord={formRecord}
            currentForm={currentForm}
            allowGrouping={isAllowGrouping}
          />

@thiessenp-cds
Copy link
Contributor Author

We'll need to update the form filler page as well as it uses

const isAllowGrouping = await allowGrouping();

and passes to

<FormWrapper
            formRecord={formRecord}
            currentForm={currentForm}
            allowGrouping={isAllowGrouping}
          />

Yup, that is one of a number of pages that access that feature flag that way. There is also other feature flags. My plan was to do the forms-forms page and other pages in a followup commit. To me, this seems like less work to review and less chance to miss something in a review.
Or do you see a benefit to adding the feature flag provider AND updating all uses of client feature flags in one PR?

@thiessenp-cds thiessenp-cds merged commit c8ee651 into develop Sep 25, 2024
13 checks passed
@thiessenp-cds thiessenp-cds deleted the feat/client-feature-flag branch September 25, 2024 14:37
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.

2 participants