Fork me on GitHub
#cljsrn
<
2018-11-26
>
vikeri15:11:30

@frankie NodeJS doesn’t really support ES6 modules out of the box so I suspect you’ll have to use babel or webpack to compile those files. What we do is just to mock out all dependencies using https://github.com/mfncooper/mockery since I don’t want to test the external libraries anyway.

frankiesardo15:11:59

Ah, nice that's helpful

frankiesardo15:11:22

Have you got an example on how to integrate that with cljs and expo?

vikeri10:11:41

I don’t use expo unfortunately. Pro tip though, if you use re-frame + spec, focus on testing business logic since we haven’t have a single error in a component since we started almost 3 years ago. re-frame + spec works so well that we only test the handlers, subscriptions and other logic since that’s where the errors typically occur.

rith8723:11:35

hello folks, i inherited this cljsrn codebase and I'm trying to upgrade the android SDK to v26 with React 16.4 and RN 0.56. the debug build works great but the release build fails with the following call stack:

2018-11-21 10:31:30.731 16727-16790/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: , PID: 16727
    com.facebook.react.common.JavascriptException: Can't find variable: a, stack:
    <unknown>@12:60553
    <unknown>@12:60366
    <unknown>@12:518500
    c@2:822
    i@2:394
    t@2:324
    global code@322:8
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
any ideas on how to get the non-minified version of the call stack? is the minification done by the cljs to js compiler? or the RN bundler/packager? i'm currently using advanced optimizations on the cljs to js compiler. if i switch it to whitespace optimizations, then i get a build error
transform[stderr]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
i can work around it by doing the bundling separately
node --expose-gc --max_old_space_size=4096 ./node_modules/react-native/local-cli/cli.js bundle --verbose --platform android --dev true --reset-cache --entry-file index.android.js --bundle-output /usr/src/app/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /usr/src/app/android/app/build/intermediates/res/merged/release
But I hit another failure
Unable to load script from assets 'index.android.bundle'.
Any ideas what else I can try?