Fork me on GitHub
#clojurescript
<
2018-10-29
>
henrik09:10:34

Has anyone tried deploying ClojureScript to http://cloudflareworkers.com ?

Wagk09:10:59

Hello, regarding reagent; is it a good idea to pass into a component a callback that updates a ratom?

Wagk09:10:37

ah I just read that it doesn't update

henrik09:10:27

@polkafreaku You’ve probably hit the point at which re-frame starts becoming relevant.

henrik10:10:30

A rule of thumb I use for myself is that when I start wanting to wrap updates and reads to/from ratoms in functions, the project has grown enough for re-frame to be a better choice than plain Reagent.

👍 4
Wagk10:10:59

I'll look into reframe

Wagk10:10:14

out of curiosity though, is there any way to hack it?

borkdude10:10:31

@henrik good rule of thumb

👍 4
henrik13:10:55

Yeah, I’ve tried delaying it, and I just end up with poorly implemented version of a quarter of re-frame ^_^

Petrus Theron15:10:29

Self-hosted ClojureScript error when trying to eval (+ 1 2 3) : WARNING: Use of undeclared Var cljs.user/+ at line 1. What am I doing wrong? Is this loader related? Caused by shadow-cljs?

lilactown15:10:30

@petrus have you loaded the bootstrap bundle as well?

Petrus Theron15:10:19

I have two builds in my shadow.cljs.edn, one with :target :browser, and another with :target :bootstrap. I run shadow-cljs watch app bootstrap. Is that what you mean by bootstrap bundle?

lilactown15:10:43

yes good. so you've created the bootstrap bundle

lilactown15:10:02

are you calling shadow.cljs.bootstrap.browser/boot-init?

👍 4
lilactown15:10:28

I also found that using cljs.env/default-compiler-env as vs-env was useful, can't remember why

Petrus Theron15:10:29

thx, I wasn't calling boot/init. Will this work in release, though? Feels odd to pass in js/bootstrap as path.

lilactown15:10:26

yes, it will work in release

lilactown15:10:48

it has to know where to load the bootstrapped bundle from

lilactown15:10:57

that shouldn't change between dev/release builds

Petrus Theron15:10:35

What is the "bootstrapped bundle"? Is it like a standalone build with a set of namespaces?

lilactown16:10:42

> CLJS analyzer cache, macro JS files, .cljs files, etc.

Petrus Theron15:10:19

I have two builds in my shadow.cljs.edn, one with :target :browser, and another with :target :bootstrap. I run shadow-cljs watch app bootstrap. Is that what you mean by bootstrap bundle?

lilactown15:10:28

I also found that using cljs.env/default-compiler-env as vs-env was useful, can't remember why

Petrus Theron15:10:29

thx, I wasn't calling boot/init. Will this work in release, though? Feels odd to pass in js/bootstrap as path.

mf19:10:51

Hi, I have a small ClojureScript library that I have been developing with the Clojure CLI tooling. I'm now at the stage where I want to publish my library so that I can use it in another of my apps (which is built with boot). I think I'm correct in my assumption that the easiest path is for me to generate a JAR (not an uberjar) and publish to Clojars. It doesn't look like the Clojure CLI provides any tools out of the box for building a JAR. What's the easiest way to package up my library into a JAR that is ready for Clojars publishing (ideally without the need for requiring Boot or Leiningen)?

aisamu19:10:07

(You can generate a maven pomfile with -Spom)

mf19:10:55

Thanks @U1UQEM078, depstar looks like it could be a good option. I notice you pointed me to the seancorfield/depstar fork of healthfinch/depstar. Is there specific functionality only available in the fork?

👍 4
aisamu19:10:29

IIRC it adds a manifest

aisamu19:10:40

regular depstar (and pack) can create a simple jar if you don't need that!

mf19:10:03

Under what circumstances is a manifest appropriate (sorry for the noob question)?

mf19:10:36

I'm assuming it's necessary if publishing to Clojars

aisamu20:10:47

IIRC, it's usually required for making runnable jars and wars. I'm not sure what clojars expects there 😕

mf20:10:16

Ok, well my library is designed to be utilised by other ClojureScript apps, as opposed to being runnable itself

mf20:10:43

So maybe I don't need a manifest...

mf20:10:32

Anyway, I appreciate the info. Thanks

dominicm21:10:17

I wrote how to do this with my library pack

mf08:10:56

Thanks @U09LZR36F, looks like Pack is a good option

mf08:10:24

I'll have a play with it

dominicm08:10:20

Feel free to ping me directly or in #juxt if you have any questions 🙂

mf08:10:06

Thank you, much appreciated

iha219:10:48

I’m trying to use atoms to update by content in reagent

iha219:10:02

It doesn’t seem to work.

iha219:10:17

But when I work with the online example it works fine

cullan19:10:26

@iha2 Let's see a bit of the code in question please.

iha219:10:53

Sorry I was just preparing it a bit

lilactown19:10:34

@iha2 wheres the definition of infix-expression?

iha219:10:08

Put it up there

👍 4
lilactown19:10:49

how are you putting num-cell and display on the page?

lilactown19:10:24

ah, so display needs to be a component

lilactown19:10:49

the dereferencing of infix-expression has to happen inside of a component when it's rendered

lilactown19:10:15

right now it is dereferenced once when def display occurs and never again

iha219:10:54

:man-bowing: Thank you thank thank you

aron20:10:08

Hello... I'm trying to get off the ground with a cljs repl connected to the browser. The caveat is that my server is running on a separate host. This means two things: (1) cljs.main --repl can't launch the browser, but that's fine because I can connect directly to my host gargan.jupiter:9000; (2) I need the browser to supply the repl using the same host and port, but it keeps trying to connect to localhost:9000

aron20:10:52

That red is my browser trying to connect to localhost:9000

aron20:10:11

It seems like I need --repl-opts '{:host "gargan.jupiter"}' but that doesn't seem to do anything

aron20:10:15

Actually who cares, just going to add an ssh tunnel and move on...