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 api dependent features #4778

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Sep 19, 2023

About the changes

Client API support for dependent feature toggles.

  • behind a flag
  • modelling dependencies as optional to make it very forgiving at the type level in the transitional period when we're adding a new feature
  • the new left join with dependencies will only take effect if there are actual dependencies inserted. Since insert is also behind a flag it is safe to proceed

Important files

Discussion points

@vercel
Copy link

vercel bot commented Sep 19, 2023

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

Name Status Preview Comments Updated (UTC)
unleash-docs ❌ Failed (Inspect) Sep 19, 2023 1:12pm
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 1:12pm

@@ -17,20 +17,20 @@ export class DependentFeaturesService {
}

async upsertFeatureDependency(
parentFeature: string,
childFeature: string,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was a mistake in previous PR

.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
expect(res.body.features[0]).toMatchObject({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the basis for the client spec for SDKs

@@ -195,6 +201,16 @@ export default class FeatureToggleClientStore
) {
this.addSegmentIdsToStrategy(feature, r);
}
if (r.parent && !isAdmin && dependentFeaturesEnabled) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to touch admin API in this PR, only client API to start SDK work

@kwasniew kwasniew changed the title Client api dependent features feat: Client api dependent features Sep 19, 2023
@kwasniew kwasniew merged commit 85c7f84 into main Sep 20, 2023
21 of 24 checks passed
@kwasniew kwasniew deleted the client-api-dependent-features branch September 20, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants