Skip to content

Commit

Permalink
[constants] Remove deprecated fields (expo#23068)
Browse files Browse the repository at this point in the history
# Why

`model` and `deviceYearClass` were slated to be removed in SDK 45. We
left them around for a bit longer. G'bye

# How

Delete JS and native code, re-generate docs schema.

# Test Plan

CI

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).

---------

Co-authored-by: Expo Bot <[email protected]>
  • Loading branch information
brentvatne and expo-bot authored Jun 24, 2023
1 parent a321dcb commit e6258d3
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 385 deletions.
1 change: 0 additions & 1 deletion apps/test-suite/tests/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function test(t) {
);
[
'deviceName',
'deviceYearClass',
'installationId',
'isDevice',
'sessionId',
Expand Down
2 changes: 1 addition & 1 deletion docs/public/static/data/unversioned/expo-constants.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/expo-constants/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### 💡 Others

- Remove the long-deprecated `Constants.deviceYearClass` and `Constants.platform.ios.model`. These properties now live on `expo-device`. ([#23068](https://github.com/expo/expo/pull/23068) by [@brentvatne](https://github.com/brentvatne))

## 14.4.1 — 2023-06-22

_This version does not introduce any user-facing changes._
Expand Down
1 change: 0 additions & 1 deletion packages/expo-constants/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ repositories {
dependencies {
implementation project(':expo-modules-core')

api 'com.facebook.device.yearclass:yearclass:2.1.0'
api "androidx.annotation:annotation:1.0.0"
implementation "commons-io:commons-io:2.6"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package expo.modules.constants

import org.apache.commons.io.IOUtils

import com.facebook.device.yearclass.YearClass

import expo.modules.core.interfaces.InternalModule
import expo.modules.core.utilities.EmulatorUtilities
import expo.modules.interfaces.constants.ConstantsInterface
Expand Down Expand Up @@ -45,7 +43,6 @@ open class ConstantsService(private val context: Context) : InternalModule, Cons
"sessionId" to sessionId,
"executionEnvironment" to ExecutionEnvironment.BARE.string,
"statusBarHeight" to statusBarHeightInternal,
"deviceYearClass" to deviceYearClass,
"deviceName" to deviceName,
"isDevice" to isDevice,
"systemFonts" to systemFonts,
Expand Down Expand Up @@ -75,8 +72,6 @@ open class ConstantsService(private val context: Context) : InternalModule, Cons

override fun getDeviceName(): String = Build.MODEL

override fun getDeviceYearClass() = YearClass.get(context)

override fun getIsDevice() = !EmulatorUtilities.isRunningOnEmulator()

override fun getStatusBarHeight() = statusBarHeightInternal
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-constants/build/Constants.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 0 additions & 27 deletions packages/expo-constants/build/Constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-constants/build/Constants.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/expo-constants/ios/EXConstantsService.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ FOUNDATION_EXPORT NSString * const EXConstantsExecutionEnvironmentStoreClient;
- (NSArray<NSString *> *)systemFontNames;

+ (NSString *)devicePlatform;
+ (nullable NSString *)deviceModel;
+ (NSNumber *)deviceYear;
+ (NSString *)deviceName;

Expand Down
Loading

0 comments on commit e6258d3

Please sign in to comment.