Enable js-only Expo (no native linking required)#127
Merged
Conversation
austenLacy
approved these changes
Jul 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #74
This PR allows running the JS Rollbar client without the
NativeClientnative binding. For unejected Expo apps, or any other JS only React Native app, just npm/yarn install and add to your project:Notes
This no longer throws when the native binding is missing, and omits the message about
react-native link. Since RN 0.60,react-native linkis no longer used (native dependencies are autolinked), so this should be fine. Especially since JS-only apps are becoming more common.I first looked at whether Expo apps could just import the react-native target of Rollbar.js (which is what rollbar-react-native wraps for javascript support.) This would introduce dependencies (buffer, promise) that are currently handled by the rollbar-react-native wrapper. By continuing to use rollbar-react-native, the config is simpler and no new dependencies are added to rollbar.js.
For React Native Web apps, or any app that isn't a native app and runs in a browser, the browser target of Rollbar.js should be used instead. Those environments will use the browser's
onerrorand won't have React Native'sErrorUtils.