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

Added implementation instructions for features #286

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Added implementation instructions for features #286

merged 2 commits into from
Mar 14, 2022

Conversation

Auz
Copy link
Contributor

@Auz Auz commented Mar 11, 2022

Instructions automatically pop up on the first feature

@vercel
Copy link

vercel bot commented Mar 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/growthbook/docs/EBzExF2gh3G5ZEd8QFirGeU8wmpF
✅ Preview: Canceled

[Deployment for 870fcc7 canceled]

id: "react",
display: "React",
language: "tsx",
boolean: `import { useFeature } from "@growthbook/growthbook-react";
Copy link
Member

Choose a reason for hiding this comment

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

Forgot to import IfFeatureEnabled component

value: `color := gb.Feature(${JSON.stringify(
feature.id
)}).GetValueWithDefault("blue")
fmt.Println(color)`,
Copy link
Member

Choose a reason for hiding this comment

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

Should this be more generic instead of color? Might look weird if the feature has nothing to do with colors.

}`,
value: `$color = $growthbook->getValue(${JSON.stringify(
feature.id
)}, "blue");
Copy link
Member

Choose a reason for hiding this comment

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

Same here. More generic instead of using color.

<p>
Read the{" "}
<a href={o.docs} target="_blank" rel="noopener noreferrer">
{o.id} SDK docs
Copy link
Member

Choose a reason for hiding this comment

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

Should this use display instead of id?

setFullSnippet(true);
}}
>
full implementation guide
Copy link
Member

Choose a reason for hiding this comment

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

Calling this a guide makes me think it will take me to a tutorial instead of just another code snippet. Maybe "full implementation example" instead?

@@ -41,6 +43,11 @@ export default function FeaturePage() {
experiments: { [key: string]: ExperimentInterfaceStringDates };
}>(`/feature/${fid}`);

const { features } = useFeaturesList();

const firstFeature = features?.length === 0;
Copy link
Member

Choose a reason for hiding this comment

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

This is not a reliable way to do this. It's a race condition that will only work some of the time and worse may open the modal randomly on page load even if the person has many features already. Better to have the "create feature" modal add a query string when redirecting if it's the first feature.

@Auz Auz merged commit 26b8e4a into main Mar 14, 2022
@Auz Auz deleted the first-feature branch March 14, 2022 04:55
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.

None yet

2 participants