This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-16
Channels
- # announcements (1)
- # babashka (23)
- # beginners (157)
- # boot (3)
- # calva (2)
- # chlorine-clover (12)
- # cider (14)
- # clara (5)
- # clj-kondo (6)
- # cljs-dev (61)
- # cljsrn (30)
- # clojure (65)
- # clojure-argentina (8)
- # clojure-berlin (2)
- # clojure-europe (13)
- # clojure-france (9)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-nl (6)
- # clojure-portugal (2)
- # clojure-romania (2)
- # clojure-uk (76)
- # clojurescript (56)
- # conjure (52)
- # core-async (37)
- # datomic (209)
- # duct (17)
- # emacs (17)
- # exercism (1)
- # fulcro (26)
- # graalvm (5)
- # instaparse (2)
- # jackdaw (9)
- # jobs-discuss (27)
- # joker (2)
- # juxt (23)
- # leiningen (4)
- # malli (11)
- # midje (3)
- # pedestal (2)
- # quil (2)
- # re-frame (78)
- # reagent (8)
- # reitit (18)
- # remote-jobs (1)
- # ring (2)
- # ring-swagger (1)
- # shadow-cljs (29)
- # sql (11)
- # test-check (12)
- # tools-deps (5)
- # xtdb (16)
- # yada (4)
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
.
By the way, @U4QC052UQ, what do you think of the setup of the core.cljs file? Am I initiating my app correctly? :o
I'll take a look a bit later and do the same thing I did for this file for ya
Wow thank you! Much appreciated! That is awesome!
Alright that is great! I will make the appropriate changes! 😄
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?
@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
I have also used Reanimated/Gesturehandler, they are quite good, but only go for them if you really have the use case for them
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.
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.
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. ^^
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
Alright. I understand. Thank you!
All right the Reagent tutorial for Krell is done - https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial
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
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
my main priority on this project will be to be keep the feature set small and work on performance
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
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
Thank you for your work @dnolen I’ve already gave it a spin and I like what you’ve done!
@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
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 ><
@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')
<anonymous>
main.js:224:85
<anonymous>
main.js:57:86
<global>
main.js:57:13
loadModuleImplementation
require.js:321:11
<global>
index.js:10
loadModuleImplementation
require.js:321:11
guardedLoadModule
require.js:201:44
global code
index.bundle?platform=ios&dev=true&minify=false:176206:3
Stand down red alert. I re-did the tutorial and it's working.
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]}}}