-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(settings): Add nimbus experiments to AppContext #18524
base: main
Are you sure you want to change the base?
Conversation
- Adds uniqueUserId generation which would happen in Backbone into React as a prerequiste. - Adds a new call to experiments in the AppContext.
region = region.toLowerCase(); | ||
} | ||
|
||
initializeNimbus(uniqueUserId, { language, region } as NimbusContextT); |
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 want to get this into AppContext or some other kind of observable state so that I can write a very simple useExperiments
which provides a consumer with the experiment info they need in that final form that they can use anywhere in the app.
I'm not sure what to do with the results from initializeNimbus
here.
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.
Maybe, I should move this to AppContext.initializeAppContext
?
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.
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.
The latest patch now has my current path forward - it doesn't seem like the worst idea since we make gql fetches at the same place, it's going to be one more request that happens now.
* inlined code that was written using Backbone utilities which could not immediately be transferred over. | ||
* @returns a new or existing UUIDv4 for this user. | ||
*/ | ||
function getUniqueUserId(): string { |
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.
Placed this here for now, but I can move it to some other place.
41919cd
to
cfeb790
Compare
cfeb790
to
e6c6818
Compare
Because
This pull request
Issue that this pull request solves
Closes: FXA-9783
Checklist
Put an
x
in the boxes that applyOther information (Optional)
useMemo
is called twice because of StrictMode. This will not happen in a production build.