Firebase, ExpoKit, and bare confusion

I’m encountering a good bit of confusion about eject and ExpoKit vs “bare” in my attempt to use Firebase with my app. The suggested workflow in the docs (sorry I’m not allowed to link it, forum restriction for new users) of using the Firebase js-sdk in a managed flow won’t work for me because my app requires offline support and the js-sdk doesn’t support it. The managed workflow is absolutely amazing so I am loathed to be forced to leave it and deal with platform specific stuff.

There is a lot of seemingly conflicting information out there. The blog post about Firebase support (sorry again, not allowed to link it) seems to indicate that Firebase support is being worked on as a first class thing for bare apps. This gist seems to indicate that this effort was abandoned just a few months later. This post indicates that the goal is to switch everybody over to a bare workflow but the blog post about ExpoKit in 2019 says that the ExpoKit workflow will still be a first class thing and that people may continue using it.

That leads me to a couple questions which hopefully @notbrent can provide insight on:

  1. Is the ExpoKit workflow going to remain a supported and first class workflow?
  2. What is the best course of action for somebody who needs full firebase support now? The bare workflow doesn’t seem like an option because it excludes OTA update and push notifications needed for my use case. The ExpoKit workflow seems to have an uncertain future.

I am quite new to the world of RN and Expo so I may be misunderstanding something or missing a key piece of information. Sorry if that is the case!

Perhaps a deprecation warning is in order on those expo-firebase blog posts and repos? In addition the docs should perhaps mention that Firebase js-sdk doesn’t support offline persistence as I think that may be a big caveat for a lot of apps.

Thanks in advance for any insights.

There is a lot of seemingly conflicting information out there. This post seems to indicate that Firebase support is being worked on as a first class thing for bare apps. This gist seems to indicate that this effort was abandoned just a few months later.

I updated that first post to add the information from the gist and explain that it is outdated, thanks for pointing this out!

  1. Is the ExpoKit workflow going to remain a supported and first class workflow?

Our thinking on ExpoKit has evolved over time. ExpoKit in its current monolithic form will likely not, but the bare workflow - where you install the unimodules that you need in a typical React Native app - will definitely be supported and, in some cases like the firebase native sdk, recommended. We will continue to support ExpoKit until we have made the updates API available for use in bare React Native apps. This is discussed a bit under “The Future of ExpoKit” in this post https://blog.expo.io/you-can-now-use-expo-apis-in-any-react-native-app-7c3a93041331 (blog posts aren’t the best place to store and share information but in this case when talking about evolving plans it seems appropriate).

  1. What is the best course of action for somebody who needs full firebase support now? The bare workflow doesn’t seem like an option because it excludes OTA update and push notifications needed for my use case.

You should be able to use react-native-firebase in an ExpoKit app, it may take a bit of work though, I’m unsure about the state of that.

Thanks so much for the quick and informative reply! Perhaps consider also adding a deprecation notice to the example project in case people stumble upon it through search.

I understand much more clearly now that the bare workflow will be just as capable as ExpoKit in the future. I may have missed that somewhere if it is already stated in the docs.

Is there any documentation about migrating from ExpoKit to the bare workflow and how difficult this process might be? It seems for my app I will need to use ExpoKit in the near term for react-native-firebase and offline support. I am not certain if that will paint us into a corner when the bare workflow becomes the preferred method.

Also – thanks for all the great work. Expo is totally awesome and has allowed us to rapidly prototype a transition from a web/pwa to native for our app. It’s magic!

1 Like

we’ll definitely provide some guidance for how to migrate away from ExpoKit when the time comes :slight_smile: glad the information was helpful and that expo has been useful for your team!

How much of a headache would you estimate it will be to migrate from ExpoKit to bare? Would it be a quick refactor or a lot of heavy lifting?

I think it depends on each project. For a simple project it would be quick provided that you’re already keeping up of the latest SDK updates.

I ended up going with pure react native. I tried to eject to ExpoKit but I ran into lots of dependency issues when adding react-native-firebase because expo is several versions behind on lots of things.

that makes sense. you can still use many expo apis in your app just fine as per https://blog.expo.io/you-can-now-use-expo-apis-in-any-react-native-app-7c3a93041331 – this is basically what the bare workflow is :slight_smile: bare react-native with whatever expo apis you want to use