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
jimberlage 2020-04-16T02:50:43.119Z

This is what I would typically do in a work project. • For shadow-cljs imports where the typical JS import syntax is import { Alert } from 'react-native'; I use :refer to get the same effect. I've found it helps newcomers to clojure from Javascript to see syntax that's visually similar. • When styles are shared, I'll use a def statement so I can merge them in different components. Generally though, I stay away from the Stylesheet.create paradigm, and try to define the styles close to the elements they target instead. • With that, I break up components into smaller molecules, which helps when not using Stylesheet.

Shako Farhad 2020-04-16T19:37:56.130Z

By the way, @jimberlage, what do you think of the setup of the core.cljs file? Am I initiating my app correctly? :o

jimberlage 2020-04-16T20:40:01.138500Z

I'll take a look a bit later and do the same thing I did for this file for ya

Shako Farhad 2020-04-16T21:43:51.138700Z

Wow thank you! Much appreciated! That is awesome!

Shako Farhad 2020-04-16T08:04:03.120300Z

Alright that is great! I will make the appropriate changes! 😄

Shako Farhad 2020-04-16T08:05:24.121900Z

Do you use Reanimated and Gesturehandler? I am not quite sure how to get those into my project and begin using them. The examples online are also kind of lackluster. I have setup my project with NPM but online they want to use yarn to add these modules. And as I understand it, we shouldn't use both yarn and npm for packages, right?

raspasov 2020-04-16T08:16:30.123200Z

@shakof91 I’d stick to yarn for React Native; I don’t have scientific proof for it, but it has been better than npm in my experience

👍 1
raspasov 2020-04-16T08:17:40.124600Z

I have also used Reanimated/Gesturehandler, they are quite good, but only go for them if you really have the use case for them

Shako Farhad 2020-04-16T08:33:55.126200Z

I want to explore them and kind of write up how to use them. How did you import them into your project? Any steps that need to be taken? I see there is something about linking the packages etc. I don't quite understand what that means. I will also restart my project with yarn this time.

jimberlage 2020-04-16T14:12:53.128Z

Linking should be mostly taken care of on newer versions of react-native. Basically, some of the objective-c and java files needed to be told about the existence of objective c and java files in libraries you imported. Now, react-native has an automated way to do that.

Shako Farhad 2020-04-16T14:53:30.128600Z

Ah ok. So as long as I run that link command, it should be taken care of? I am using the cutting edge versions of react and react native. ^^

jimberlage 2020-04-16T15:14:06.129600Z

Yeah, linking shouldn't be a thing you have to consciously run a command to do on new versions of react native. If a library doesn't support auto-linking, they usually call it out in their readme

Shako Farhad 2020-04-16T15:41:24.129900Z

Alright. I understand. Thank you!

dnolen 2020-04-16T20:22:01.130400Z

All right the Reagent tutorial for Krell is done - https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial

❤️ 4
dnolen 2020-04-16T20:23:11.131700Z

I tested that hot-reloading, production build works - I didn't try every combination simulator/device but I'm sure I'll hear from people if something doesn't work

dnolen 2020-04-16T20:23:35.132300Z

as far as features, I'm not sure there is going to be much more - but if you're really itching for something, let me know

dnolen 2020-04-16T20:24:04.132900Z

my main priority on this project will be to be keep the feature set small and work on performance

dnolen 2020-04-16T20:25:13.134100Z

I think we can make simpler version of Metro's cache on device and that would help w/ shorter time to see the app and getting to actually hacking w/ a REPL

⚒️ 3
dnolen 2020-04-16T20:26:22.135Z

oh and another thing, I'm not interested in flags or options for the entry point

dnolen 2020-04-16T20:26:31.135300Z

I just think that kind of customization is gratuitous

dnolen 2020-04-16T20:26:43.135600Z

just return your component from -main that's already a convention

👍 1
dnolen 2020-04-16T20:27:18.136400Z

there's also no real need for integration - the reloader is in the Krell root - so as long your ClojureScript React libs returns a component - there's nothing to do

dotemacs 2020-04-16T20:35:11.138200Z

Thank you for your work @dnolen I’ve already gave it a spin and I like what you’ve done!

dnolen 2020-04-16T20:36:53.138400Z

👍:skin-tone-4:

jimberlage 2020-04-16T21:49:01.141900Z

@shakof91 I think this would work for you: • reagent.core/reactify-component I think does a lot of the heavy lifting to simplify this file. • I removed the refs - but perhaps you needed them to enforce executing only once? You can also store a :first-run? flag in the DB if that will persist across reloads, to get the same effect. • As a personal taste thing, I usually remove the brackets around namespaces I'm loading for side effects. It makes them stand out visually

Shako Farhad 2020-04-16T21:59:16.143300Z

Thank you very much! I will test this out. This looks sooo much better! Also, I actually didn't know you could call rf/dispatch-n. I always wrapped that and dispatch-later in an event. Wow I feel dumb ><

Oliver George 2020-04-16T23:17:42.144500Z

@dnolen I'm hitting an error with the production build step in the tutorial. I wondered if it was a constant folding thing but same error occurs with simple both advanced targets.

TypeError: undefined is not an object (evaluating 'Z.unstable_cancelCallback')

&lt;anonymous&gt;
    main.js:224:85
&lt;anonymous&gt;
    main.js:57:86
&lt;global&gt;
    main.js:57:13
loadModuleImplementation
    require.js:321:11
&lt;global&gt;
    index.js:10
loadModuleImplementation
    require.js:321:11
guardedLoadModule
    require.js:201:44
global code
    index.bundle?platform=ios&amp;dev=true&amp;minify=false:176206:3

Oliver George 2020-04-16T23:26:22.145100Z

Stand down red alert. I re-did the tutorial and it's working.

Oliver George 2020-04-16T23:28:05.146Z

This was the only change. Yeah, confirming that caused the error.

-        reagent {:mvn/version "0.10.0"}}}
+        reagent {:mvn/version "0.10.0"
+                 :exclusions [cljsjs/react cljsjs/react-dom]}}}

dnolen 2020-04-16T23:44:26.146200Z

yeap