-
Notifications
You must be signed in to change notification settings - Fork 337
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: added cookies to support activation/deactivation of experiments from ExperimentProvider in Docs #2511
Docs: added cookies to support activation/deactivation of experiments from ExperimentProvider in Docs #2511
Conversation
abbe933
to
b94e4fe
Compare
✅ Deploy Preview for gestalt ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
b1ff233
to
c6be74a
Compare
@@ -6,7 +6,6 @@ import docgen, { type DocGen } from '../../docs-components/docgen.js'; | |||
import PageHeader from '../../docs-components/PageHeader.js'; | |||
import MainSection from '../../docs-components/MainSection.js'; | |||
import QualityChecklist from '../../docs-components/QualityChecklist.js'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change, should be reverted for a cleaner PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not unrelated, I'm not gonna put a single PR to remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it's cleanup that can be addressed the next time someone does work on this file. As it stands, anyone looking into the git history of this file will see this PR, adding noise to their search as this PR has no material changes to the file.
docs/pages/web/textfield.js
Outdated
: 'Activate experiments', | ||
onClick: () => | ||
setExperiments( | ||
experiments === generatedDocGen?.displayName ? '' : generatedDocGen?.displayName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is all-or-nothing, yes? We should provide users more granularity here. Users should be able to toggle individual experiments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried stringifying an array of experiments but it couldn't get it to work. It's not like we have >1 experiments at the time for each single component. This is a first iteration of this implementation. With the cmp name I hit both desktop and web.
If there's need for refactoring this to allow overlapping experiments we can rethink the implementation in a future PR.,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What didn't work about stringifying an array or object of experiments?
docs/pages/web/textfield.js
Outdated
iconAccessibilityLabel="Component under experiment" | ||
message={ | ||
experiments === generatedDocGen?.displayName | ||
? 'The current Textfield example is displaying experimental changes.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consider consolidating this text by using a template literal and moving the logic to where it's needed, e.g.
message={`The current TextField example is ${experiments === generatedDocGen?.displayName ? '' : 'NOT '}displaying experimental changes.`}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
c6be74a
to
39489c6
Compare
39489c6
to
44a62e9
Compare
Summary
What changed?
Docs: added cookies to support activation/deactivation of experiments from ExperimentProvidern in Docs
Why?
Be able to support SlimBanner's primaryAction to toggle between active/inactive experiments to visualize changes from experiments.
Implemented in Textfield. See https://deploy-preview-2511--gestalt.netlify.app/web/textfield
Next ones:
Links
Checklist