betaacid / expo-analytics

Google Analytics integration for use with React Native apps built on Expo
MIT License
288 stars 63 forks source link

Updates import of Expo Constants for SDK33 compatibility #34

Closed rossb89 closed 5 years ago

rossb89 commented 5 years ago

Hi there,

Expo v33 has deprecated the use of imports like this from the 'expo' package. https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c#b331

e.g. import { Constants } from 'expo'

A lot of noise gets generated because of this now in the terminal.

This 1 line change is all that's required for v33 compatibility, although it would cause an issue for anyone on expo < v33 so perhaps a version bump is needed :)

ryanvanderpol commented 5 years ago

Thanks, @rossb89! Is expo-constants a separate npm package that needs to be included? or does it come automatically with the expo package?

TeChn4K commented 5 years ago

Yes, you have to manually install expo-constants. Best to use the new expo install command as it take care of your expo version.

TeChn4K commented 5 years ago

So, I think expo-constants is missing in the package.json at the moment

rossb89 commented 5 years ago

Good point.

Seems as well now that if your Expo app is not 'managed' and is using the 'Bare' workflow (i.e an 'ejected' expo app, or react native app that wants to use the Expo API's), then you need to follow more installation instructions to get react-native-unimodules installed in order to use the new separate packages.

On my managed Expo install, after using expo install expo-constants it's added `"expo-constants": "^5.0.1", so I guess this does need to be in the package.json... i'll add it in.

rossb89 commented 5 years ago

By the way - Is there a reason why the dependencies are listed under devDependencies instead of dependencies? :)

ryanvanderpol commented 5 years ago

Thanks, @rossb89! Once that change is submitted I'll approve, merge, and publish a new version.

rossb89 commented 5 years ago

@ryanvanderpol Added into package.json now 👍

ryanvanderpol commented 5 years ago

Thanks! Merging and publishing shortly.

ryanvanderpol commented 5 years ago

This is now published via npm as 1.0.9. Thanks everyone for your help!