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

RN 0.46 - Realm has no setter or ivar for it's bridge #1121

Closed
ovr opened this issue Jul 6, 2017 · 9 comments
Closed

RN 0.46 - Realm has no setter or ivar for it's bridge #1121

ovr opened this issue Jul 6, 2017 · 9 comments
Assignees
Labels

Comments

@ovr
Copy link
Contributor

ovr commented Jul 6, 2017

When I am using non remote js debug mode, I am getting

image

Version of Realm and Tooling

  • Realm JS SDK Version: 1.8.3
  • Node or React Native: 0.46.0
  • Client OS & Version: iOS

There was similar error but for 0.45 #1049

@ovr
Copy link
Contributor Author

ovr commented Jul 6, 2017

JS Exception after calling executeBlockOnJavaScriptThread on bridge

image

@compojoom
Copy link

I have the same error with disabled JS debug. When js debug is on - the error is not there. (in my case it is 0.46.0rc2

@thatjuan
Copy link

thatjuan commented Jul 6, 2017

+1

@ovr
Copy link
Contributor Author

ovr commented Jul 6, 2017

Yeap, It's exception

image

image

@ovr
Copy link
Contributor Author

ovr commented Jul 6, 2017

So, I started to use ensureOnJavaScriptThread, going to prepare PR

ovr added a commit to ovr/realm-js that referenced this issue Jul 6, 2017
ovr added a commit to ovr/realm-js that referenced this issue Jul 6, 2017
ovr added a commit to ovr/realm-js that referenced this issue Jul 6, 2017
@ovr
Copy link
Contributor Author

ovr commented Jul 6, 2017

@javache Hey bro! You introduced changes inside react-native repository facebook/react-native@8525aac#diff-a2a67635fffd7b690d14dc17ae563a71

So, main question can you give a good advice how to check method exists compatiblity for RN 0.46+

Currently, inside ovr@7161472

I am using

        Class RCTCxxBridgeClass = NSClassFromString(@"RCTCxxBridge");
        if ([RCTCxxBridgeClass instancesRespondToSelector:@selector(ensureOnJavaScriptThread:)]) {
            [bridge ensureOnJavaScriptThread:bridgeInitializer];
        } else {
            [bridge executeBlockOnJavaScriptThread:bridgeInitializer];
        }

Thank you 🍺 🍻

ovr added a commit to ovr/realm-js that referenced this issue Jul 6, 2017
@javache
Copy link

javache commented Jul 6, 2017

If you're going to be using private API's (which is not supported, and will likely break again in future releases), use dispatchBlock:block queue:RCTJSThread, which is implemented in both the old and the new bridge (and works on older releases too)

ovr added a commit to ovr/realm-js that referenced this issue Jul 6, 2017
@ovr
Copy link
Contributor Author

ovr commented Jul 6, 2017

@javache Thank you

fealebenpae pushed a commit that referenced this issue Jul 6, 2017
* [iOS] Support RN 0.46+, #1121

* [iOS] Use bridge dispatchBlock, thank @javache, refs #1121

* [iOS] Drop unneeded expose of private methods for RCTBridge, refs #1121
@fealebenpae
Copy link
Member

Fixed in #1122

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants