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

[Feature Request] Remote Config #176

Closed
jhuleatt opened this issue Nov 1, 2019 · 3 comments · Fixed by #204
Closed

[Feature Request] Remote Config #176

jhuleatt opened this issue Nov 1, 2019 · 3 comments · Fixed by #204
Assignees

Comments

@jhuleatt
Copy link
Collaborator

jhuleatt commented Nov 1, 2019

Remote Config now supports web! Let's include it in ReactFire.

@jhuleatt jhuleatt assigned jhuleatt and davideast and unassigned jhuleatt Nov 1, 2019
@jhuleatt
Copy link
Collaborator Author

jhuleatt commented Nov 8, 2019

Since Remote Config requires some top-level configuration, maybe we make a Provider component like FirebaseAppProvider:

function App() {
  <FirebaseAppProvider firebaseConfig={myConfig}>
    <RemoteConfigProvider
      minimumFetchIntervalMillis={3600000}
      defaultConfig={{ message: "welcome" }}
    >
      <MyComponent />
    </RemoteConfigProvider>
  </FirebaseAppProvider>;
}

function MyComponent() {
  const welcomeMessage = useRemoteConfigValue("message");
  return <h1>{welcomeMessage}</h1>;
}

I'm not sure how we'd lazy load the SDK in this situation, though. I guess we could return the defaultConfig values until the SDK is loaded? Could lead to flashes of content.

@jhuleatt
Copy link
Collaborator Author

FYI #170 introduces useRemoteConfig to lazy load the Remote Config SDK

@jhuleatt
Copy link
Collaborator Author

Chatted with @jamesdaniels and a couple more ideas came up:

  • If a dev only wants to get one value from Remote Config (to stop UI flickering), add a noFlicker flag. Probably to the useRemoteConfigValue hook. This would only return the first value from Remote Config, and no updates.
  • Similarly, if the developer wants to guarantee the value came from the server and not the local cache, have an onlyFresh (name TBD) flag

These would help hide some of the complexity of Remote Config

@FirebaseExtended FirebaseExtended locked and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants