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

Docs: Client-side feature flag querying behavior update #5244

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

markunl
Copy link
Contributor

@markunl markunl commented Nov 1, 2023

Added a detailed explanation into how frontend / client-side SDKs behave with regards to fetching multiple feature flags and network connectivity.

Content has been reviewed/approved by engineering rotation team (Simon and Chris).

Copy link

vercel bot commented Nov 1, 2023

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

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


When the SDK is initialized in the application, an in memory repository is setup and synchronized against the frontent API using the configured token and context. Note that the frontend API is hosted by either the Unleash Proxy/Edge or the upstream Unleash instance directly.

1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their variants (if applicable) is returned as a single request. Disabled flags are not included.
Copy link
Member

Choose a reason for hiding this comment

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

I think what you have is great here, this is a very specific detail so feel free to ignore if you think what you already have is clearer

Suggested change
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their variants (if applicable) is returned as a single request. Disabled flags are not included.
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their resolved variant (if applicable) is returned as a single request. Disabled flags are not included.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @sighphyre here. I think that makes it clearer (as long as the reader understands what "resolved" means. But I might pluralize the word "variant" as well, turning it into "resolved variants":

Suggested change
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their variants (if applicable) is returned as a single request. Disabled flags are not included.
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their resolved variants (if applicable) is returned as a single request. Disabled flags are not included.

But yeah, that's very nitpicky, and I don't know if my suggestion is better. Just wanted to put it out there 💁🏼

Copy link
Member

Choose a reason for hiding this comment

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

The reason I say "variants" rather than "variant" is because the response will only ever return a single variant. You can't use this to check what variants may be available, you just get the calculated single value and never a list

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, no, I figured, but you might get several variants spread over different flags. Pluralizing variants does make it slightly ambiguous, maybe, but you could also misread the singular variant as something like "a set of flags can only resolve to a single variant together". Maybe less likely 💁🏼 But I'm honestly happy with either, just wanted to present a suggestion. Either way, I think adding "resolved" is a fantastic shout, so good catch there 👏🏼 👏🏼 👏🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks both! I went with Simon's suggestion since we're already pluralizing the term "flags". An individual flag may only have one resolved variant, so not pluralizing variants may have slightly less potential for misinterpretation

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

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

This is fantastic! Thank you for doing this!

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

This is a great clarification 🙌🏼


When the SDK is initialized in the application, an in memory repository is setup and synchronized against the frontent API using the configured token and context. Note that the frontend API is hosted by either the Unleash Proxy/Edge or the upstream Unleash instance directly.

1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their variants (if applicable) is returned as a single request. Disabled flags are not included.
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @sighphyre here. I think that makes it clearer (as long as the reader understands what "resolved" means. But I might pluralize the word "variant" as well, turning it into "resolved variants":

Suggested change
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their variants (if applicable) is returned as a single request. Disabled flags are not included.
1. All feature flag evaluation is performed by the Proxy/Edge or Unleash instance. A payload of all enabled flags and their resolved variants (if applicable) is returned as a single request. Disabled flags are not included.

But yeah, that's very nitpicky, and I don't know if my suggestion is better. Just wanted to put it out there 💁🏼

Copy link
Contributor Author

@markunl markunl left a comment

Choose a reason for hiding this comment

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

Thanks both! I went with Simon's suggestion since we're already pluralizing the term "flags". An individual flag may only have one resolved variant, so not pluralizing variants may have slightly less potential for misinterpretation

@markunl markunl merged commit ba9a217 into main Nov 2, 2023
13 checks passed
@markunl markunl deleted the docs-sdk-frontend-update branch November 2, 2023 13:43
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.

3 participants