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

Expo: avoid using deprecated constants #1665

Merged
merged 5 commits into from
Jan 21, 2022
Merged

Conversation

imjoehaines
Copy link
Contributor

Goal

This PR migrates away from a number of deprecated constants, notably fixing a deprecation warning from Constants.platform.ios.model raised in the current version of @bugsnag/expo

Previous constant New constant
Constants.platform.ios.model Device.modelName
Constants.platform.android.versionCode Application.nativeBuildVersion
Constants.platform.ios.buildNumber1 Application.nativeBuildVersion
Constants.platform.ios.platform Device.modelId
Constants.platform.ios.systemVersion Device.osVersion
Constants.isDevice Device.isDevice

Footnotes

  1. This isn't actually deprecated, but Application.nativeBuildVersion is equivalent and it seemed sensible to use the same value for both iOS & Android

Constants.isDevice has been deprecated
This is deprecated in favour of Application.nativeBuildVersion

Application.nativeBuildVersion seems equivalent for iOS as well,
so I've switched both platforms to use it
@imjoehaines imjoehaines requested a review from djskinner January 20, 2022 14:38
@github-actions
Copy link

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 41.58 kB 12.80 kB
After 41.58 kB 12.80 kB
± No change No change

code coverage diff

Ok File Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-expo-app/app.js 96.55%
(+0.12%)
93.75%
(-1.25%)
100%
(+0%)
96.55%
(+0.12%)
🔴 /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-expo-device/device.js 100%
(+0%)
90%
(-1.67%)
100%
(+0%)
100%
(+0%)

Total:

Lines Branches Functions Statements
81.58%(+0%) 71.26%(-0.1%) 82.67%(+0%) 80.66%(+0.01%)

Generated by 🚫 dangerJS against 5476463

@imjoehaines imjoehaines merged commit 84cf0f4 into next Jan 21, 2022
@imjoehaines imjoehaines deleted the avoid-deprecated-constants branch January 21, 2022 10:03
@imjoehaines imjoehaines mentioned this pull request Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants