Fork me on GitHub
#clojurescript
<
2017-01-19
>
tianshu02:01:54

have asked a same question before, but still no idea for now. If I want to introduce a third party library which has a lot of .js. for example:

.
├── Editor
│   ├── MultiDecorator.js
│   ├── __test__
│   │   ├── MultiDecorator.js
│   │   └── index.js
│   ├── createCompositeDecorator.js
│   ├── defaultKeyBindingPlugin.js
│   ├── index.js
│   ├── moveSelectionToEnd.js
│   └── proxies.js
├── index.js
├── modifiers
│   ├── moveToEndOfSelectedBlock.js
│   └── moveToStartOfSelectedBlock.js
└── utils
    ├── composeDecorators.js
    ├── createCompositeDecorator.js
    ├── createEditorStateWithText.js
    └── moveSelectionToEnd.js
I need to add them all into :foreign-libs and require one by one?

anmonteiro02:01:52

@doglooksgood probably easier if you bundle everything with Webpack for example, and use that single bundle as a foreign lib

anmonteiro02:01:00

is there any reason you can't do that?

tianshu02:01:25

I just wondering if there's a simpler way to do this. Maybe I should bundle all js libraries into one file with webpack?

tianshu02:01:59

I'll have a try.

grounded_sage03:01:26

I've got the cheekiest bug. It doesn't work but as soon as I put in some println's is goes away haha.

thheller09:01:15

@grounded_sage sounds like something lazy being forced by println

thheller09:01:37

ie. for map etc

pesterhazy09:01:33

@grounded_sage it's a very common Clojure(script) gotcha

grounded_sage11:01:44

Apparently it has to do with a macro expansion. I will get a handle of this stuff one day!

jannis11:01:25

How far away are we from a new ClojureScript release? I’m looking forward to data readers support. 🙂

jannis11:01:19

With that not being available yet: is there another way to add custom tagged literals in CLJS?

dnolen12:01:49

@jannis there’s some spec things that need fixing

lorenzoi17:01:35

Any good clojurescript video tutorials?

lorenzoi17:01:04

(println "Please")

dnolen17:01:59

you might want to take a look at https://lambdaisland.com

lorenzoi18:01:54

no, you have to pay for it 😢

dotemacs18:01:27

Lambda Island is a product of a lone developer, with great tutorials. Paying for it is a good thing IMO

PB19:01:44

Is anyone here coding in a docker environment and if so. What steps did you take to get your environment to push changes to your browser?

dnolen19:01:30

@lorenzoi I’m not aware of any high quality free ones, sorry

mruzekw19:01:20

@lorenzoi I watch a lot of conference videos relating to CLJS. There are a couple Cognitect webinars as well

rafaelzlisboa19:01:19

@petr haven’t done this myself, but some workmates did. we did this both with boot with boot-reload and leiningen with figwheel. problems to be solved were something related to file watcher strategy (the default wasn’t working with docker, but there was another option that did) and forwarding the port to the host (with -pN:N?) so it’s accessible by the browser

gdeer8120:01:13

I just watched one of the free lamda island videos and that definitely looks like it's worth the money

rparra21:01:51

how long does the free trial period from lambda island last?

Ethan Miller21:01:49

If I have the following function with a precondition assertion:

(defn- total-pages [total per-page]
  {:pre [(<= 0 total) (pos? per-page)]}
  (-> (if (zero? total) 1 total)
      (/ per-page)
      (Math/ceil)
      (int)))
How would I write a test for the precondition assertion exception?

pandeiro22:01:28

@petr The major things you need are a docker image with lein and/or boot (there are several on docker hub), a port mapping between your app's ports (and any repl/dev ports) and your host network ports, as @rafaelzlisboa mentioned, and a volume mount of your project into the container. All those things can be set up pretty easily in a docker-compose file so you don't have to type everything all the time.

pandeiro22:01:12

@ezmiller77 (is (thrown? AssertionError ... ))

pandeiro22:01:39

Check the class of the exception/error, I probably have it wrong

7h3kk1d22:01:33

Is there a ring alternative for runnning cljs on node?

samcf22:01:12

Beginner to CLJS here, quick question: find myself needing to access a thing in the REPL (a function that is partially applied with some derived stuff), but its defined in the main fn. Anyway to expose that to the REPL without needing to set it to a var in the ns scope?

samcf22:01:52

I'm using figwheel, fyi

7h3kk1d23:01:20

Also a beginner but from what I understand you need to have some sort of reference to it.

7h3kk1d23:01:36

So you’d either need to store it in a var or have a way to recreate it.

brthrjon23:01:21

@samcf what editor do you use?

samcf23:01:32

IntelliJ with Cursive

brthrjon23:01:33

i don't know those, but i'm sure there must be a way to do it from your editor. vim has firplace, which allows you to eval a form by essentially selecting it...

7h3kk1d23:01:36

You can’t do that with derived stuff though right?