cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
raspasov 2020-07-15T01:36:28.028500Z

@bhauman is there a config option that I can set for:

optionsUrl: "<http://192.168.1.62:9500/cljs-out/ios/cljsc_opts.json>"

raspasov 2020-07-15T01:36:42.028900Z

I need this to be “192.168.1.62” (my local ip) instead of “localhost”

raspasov 2020-07-15T01:50:54.029900Z

The optionsUrl is in the generated index.js ; I use the local IP so I can test/refresh on a real device rather than the simulator

Oliver George 2020-07-15T11:19:15.030600Z

Anyone having a good time with Krell running on a real android device? I'm seeing odd issues which I think might be race condition related.

Oliver George 2020-07-15T11:19:27.030800Z

e.g. namespaces loading out of order

Oliver George 2020-07-15T11:19:50.031200Z

It's proving hard to pin down

Oliver George 2020-07-15T11:26:12.032400Z

Tends to express itself in errors like these: • "TypeError: goog.debug.freeze is not a function" (common on one big project) • "goog.require could not find: awesome_project.core" • "ReferenceError: re_frame is not defined"

Oliver George 2020-07-15T12:12:28.033800Z

Tentitive theory that perhaps waitForCore needs to wait on more files to avoid a race condition

function waitForCore(cb) {
    // we only care if goog/base.js is actually in the cache, that's enough
    // to bootstrap regardless whether some things must be refetched
    if(KRELL_CACHE.ready
       &amp;&amp; KRELL_CACHE.has(toPath("goog/base.js"))
       &amp;&amp; KRELL_CACHE.has(toPath("goog/deps.js"))         // &lt;-- HERE
       &amp;&amp; KRELL_CACHE.has(toPath("cljs_deps.js"))         // &lt;-- HERE
       &amp;&amp; KRELL_CACHE.has(toPath("krell_repl_deps.js"))) {// &lt;-- HERE
        bootstrap();
        cb();
    } else if(typeof cljs !== 'undefined') {
        console.log("typeof cljs !== 'undefined'")
        cb();
    } else {
        setTimeout(function() { waitForCore(cb); }, 250);
    }
}

Oliver George 2020-07-15T12:12:58.034400Z

@dnolen I think you had a productive android device setup - is that right? we're having trouble.

dnolen 2020-07-15T12:14:37.034700Z

yes that sounds like load order issues - this would only occur during dev

Oliver George 2020-07-15T12:14:46.035Z

That's where we're seeing it

dnolen 2020-07-15T12:15:00.035400Z

but I never saw that after the fixes for android

dnolen 2020-07-15T12:15:24.035900Z

if you look closely at the code for Android in the REPL JS you'll see that there's a few things in place to ensure order

dnolen 2020-07-15T12:15:48.036400Z

it's possible I missed something but it hasn't come up in the emulator or on the device (personally) in some time

dnolen 2020-07-15T12:16:45.037300Z

one thing you could try is that you could bump the tcp-socket dep, I think there were several issues w/ how it worked and some have been addressed

dnolen 2020-07-15T12:17:09.037800Z

I'm back on work that directly needs Krell so I should be more active again on in it the coming weeks

Oliver George 2020-07-15T12:17:43.038300Z

Okay, thanks. I'll give that a try and see what else I can pin down.

dnolen 2020-07-15T12:18:10.038800Z

note the issue really is the tcp-socket library

dnolen 2020-07-15T12:18:28.039400Z

if you don't manually enforce the order then you will eval something out of order

dnolen 2020-07-15T12:18:32.039600Z

and get the errors above

dnolen 2020-07-15T12:18:56.040100Z

(the Java part of it, I never had issues w/ the iOS side)

Oliver George 2020-07-15T12:19:11.040400Z

Certainly would describe what I'm seeing.

Oliver George 2020-07-15T12:26:37.040900Z

Bumping to the latest react-native-tcp-socket doesn't seem to have helped.

Oliver George 2020-07-15T12:30:23.041500Z

I have a feeling the clue is this error which appears in adb logcat > 07-15 19:29:32.163 21032 21195 I ReactNativeJS: 'Bootstrap from cache failed:', { [TypeError: undefined is not an object (evaluating 'KRELL_CACHE.get(toPath("goog/deps.js")).source')]

Oliver George 2020-07-15T12:30:47.041800Z

Anyway, I'm out of ideas for today. Thanks for the suggestions.

dnolen 2020-07-15T13:43:31.042700Z

@olivergeorge ah yeah I was going to say that's the other possibility your cache was corrupted - i.e. the issue is not related to react-native-tcp-socket at all

dnolen 2020-07-15T13:45:32.043800Z

again I didn't observe this with the tutorials nor in our app - but I'll double check - if you can repro in a simpler situation that would be helpful