Changes in iOS 12.3 may break builds
See original GitHub issueDescription
(please donāt kill me for not following the template š- this is more of a āheads upā than a bug report)
In iOS 12.3, it looks like Apple is introducing a new type called symbol
to the JavaScriptCore API:
(from /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JSValueRef.h
)
/*!
@enum JSType
@abstract A constant identifying the type of a JSValue.
@constant kJSTypeUndefined The unique undefined value.
@constant kJSTypeNull The unique null value.
@constant kJSTypeBoolean A primitive boolean value, one of true or false.
@constant kJSTypeNumber A primitive number value.
@constant kJSTypeString A primitive string value.
@constant kJSTypeObject An object value (meaning that this JSValueRef is a JSObjectRef).
@constant kJSTypeSymbol A primitive symbol value.
*/
typedef enum {
kJSTypeUndefined,
kJSTypeNull,
kJSTypeBoolean,
kJSTypeNumber,
kJSTypeString,
kJSTypeObject,
kJSTypeSymbol API_AVAILABLE(macosx(10.14.4), ios(12.3))
} JSType;
This has certain consequences for Realm: https://github.com/realm/realm-js/blob/91d87fe0a94ae3101b6bb57f33c8d64ed96465d6/src/jsc/jsc_value.hpp#L44-L54
Since the kJSTypeSymbol
enum value is not handled in the above switch
statement, builds on Xcode 10.2 Beta (10P82s) will fail with this error:
I was able to resolve the error by adding this:
case kJSTypeSymbol: return "symbol";
Iām not sure what side effects that change has so I havenāt made a PR yet.
Version of Realm and Tooling
- Realm JS SDK Version: 2.21.1
- Node or React Native: React Native
- Client OS & Version: Building for iOS 12.2 (so Iām not sure why this issue is occuring with
API_AVAILABLE(macosx(10.14.4), ios(12.3))
) - Which debugger for React Native: None
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top GitHub Comments
Fixed By Adding
Example
@rajivshah3 Thanks for the update. We are in the process of updating and preparing our CI system with the latest Apple releases (still waiting for next Xcode version).