Fork me on GitHub
#cljsrn
<
2017-09-27
>
rovanion07:09:09

I agree. It's super wierd to come back monday and have new warnings block the view because RN decided that .isMounted is now deprecated.

pesterhazy07:09:59

Our solution to the npm problem was to use yarn and to commit the yarn bundle to the repo

vikeri07:09:36

You mean the yarn.lock file?

pesterhazy07:09:47

This gives you the same results on all laptops

pesterhazy07:09:11

No the actual yarn binary (it's just a single js bundle)

pesterhazy07:09:35

It effectively freezes yarn to a specific version

pesterhazy07:09:09

Yarn.lock must be committed to the repo as well of course

vikeri07:09:51

Ah, have you had problems with different yarn-versions?

pesterhazy08:09:40

different yarn versions resolve package conflicts differently. the result is that one person or another's yarn install will stubbornly insist on updating yarn.lock

vikeri08:09:15

Wow, that’s awful. We never ran in to that issue though

pesterhazy08:09:53

BUT committing the file to the repo is a pretty neat way around the problem

pesterhazy08:09:10

plus people don't have to install yarn anymore - they can just use bin/pinned-yarn

vikeri08:09:31

I don’t know, we have the same issue for our firmware, needing a specific version of gcc. We put it on s3, exclude bin/ from git and then have a script that downloads the executable there when setting up the project.

pesterhazy08:09:56

I have something for you then 🙂

pesterhazy08:09:43

it's still very new but it's built exactly for this purpose

pesterhazy08:09:54

you add a moth.json to your project root, then run moth path --alias my-gcc-4.5 --find bin/gcc. Moth will ensure that the version is present (by comparing the hash) and print out the absolute path to the gcc executable from the downloaded, unpacked archive

pesterhazy08:09:18

best of all, this operation is fast (<150ms) if the dep is up to date

pesterhazy08:09:38

Cloud/s3 support not implemented yet though 🙂

vikeri08:09:28

My only issue is that it is written in Python and not in Clojure 😜

pesterhazy08:09:23

I considered lumo but... python is installed everywhere (for bootstrapping) and has ~40ms startup time

pesterhazy08:09:47

it's perfect for the job

vikeri08:09:57

Yeah I totally get that

pesterhazy08:09:19

moth comes with a neat feature

pesterhazy08:09:52

it has a main binary moth that is only 2k

pesterhazy08:09:09

it requires only python 2.6+ installed on the system

pesterhazy08:09:17

but it knows how to bootstrap itself from the web (like boot/lein)

pesterhazy08:09:07

so if you commit it to the repo, everyone on the team can use it right away

pesterhazy08:09:48

add direnv to that, you can add bin/ to your path, so you can just type moth whatever

pesterhazy08:09:54

it's as if it was installed globally

vikeri08:09:40

direnv looks awesome! Have been looking for something like that

pesterhazy08:09:26

it's really the missing piece of the puzzle for Unix/shells

pesterhazy08:09:46

best kept secret 🙂

rovanion14:09:57

Hmm, how would you use this component: https://github.com/crazycodeboy/react-native-easy-toast ? My current approach doesn't seem to work and I can't figure out if it has something to do with the {DURATION} thing that the example on the README has in the import statement:

(defn create-element [rn-comp opts & children]
  (apply js/React.createElement rn-comp (clj->js opts) children))
(defonce toast  (partial create-element (js/require "react-native-easy-toast")))
... at the bottom of the root view ...
(toast {:ref "toast"})

rovanion15:09:45

From what I find on the error message for RN it is related to errors in the import statement.

rovanion15:09:35

I had to (aget (js/require "react-native-easy-toast") "default") to get out the toast.

rovanion15:09:52

Now I just have to figure out how to do this mutation that they describe in the readme.

rovanion15:09:05

this.refs.toast.show("message") seems quite un-functional.