Fork me on GitHub

The bridging part is very simple; you call a JS function and get back a promise with an [error, result] pair.


You should be able to just use FB’s native modules documentation for Android:


Once you have that, the JS->CLJS part is just normal interop.


@joshmiller thanks alot, I'l learn your links!

👍 4

@ivana We have also integrated a lot of native modules without any major problems. As @joshmiller mentioned it’s not cljs specific at all but just normal js-interop. For many use cases there are libraries out there that integrate native modules for you. Camera for example:

👍 8

Thanks, @vikeri! But espessislly for camera - I had tried to integrate library you mentioned several times, but without a success. I saw a lot of errors, which googled me to a batch issues in this github project, I found out that I should made some non trivial steps to bump its version, and so on... For example, some other libraries also have broken link procedure, and I had to guess what to change directly manually in .java and .gradle files, but in a case of camera I was unlucky and did not guessed.


@ivana I see, yeah a downside is that you will need to know your way around dependencies and some native code, especially on Android. But that you would need to do if you did native anyway. But if you don’t want to meddle too much with native libraries then I can recommend expo.


They have a camera module included.


Thanks again, I know about expo, but it has many limitations. Thats why I desided to try make own native modules, to be independent from side packages, which were written not by me and theirs black-box unsolveable problems.


@ivana Yeah I get that, we’ve “insourced” some native libraries that we needed more control over or that were not maintained. The tooling is not trivial though and needs a decent investment upfront, but if you’re in it for a longer haul it might be worth digging into.


@vikeri anyway, thanks alot! At least I can fork and reverse engeenere it, cause it opensource 🙂


That’s true, good luck


Hi, hopefully this is the right place for this question. I'm in the process of upgrading our project from RN 0.59.5 to 0.61.2. I've gotten the release build to work on device (android), but when I try running in debug (device or emulator), I'm seeing this error in the Metro Bundler:

error: bundling failed: Error: Unable to resolve module `WebSocket` from `figwheel-bridge.js`: WebSocket could not be found within the project.
Has anyone else come across this and/or know how to resolve this? Project was created with latest re-natal. Thanks!


@kenric I actually just came across that in doing the same upgrade


Websocket is included at the global level now; you can just comment out the line var Websocket = require('Websocket')


(in figwheel-bridge.js, if that wasn’t clear)


For anyone else thinking about a similar upgrade, almost everything I dealt with was on the RN/iOS side — there are a bunch of changes to how RN is packaged, it’s all in separate Pods now. There’s allegedly autorequiring where RN will just pull all the cocoapods in your node_modules/ in but it didn’t work for me. I may just have done it wrong.


@joshmiller Thanks for the info/fix!

👍 4