Fork me on GitHub
#clojurescript
<
2019-11-05
>
lilactown00:11:20

lumo ships the self-hosted compiler that runs in Node.js

lilactown00:11:12

thheller is specifically talking about a web app. you would have to send all of the code for the CLJS compiler to the browser, as well as not be able to optimize away any of your code because that could break things without knowing all of the code that will be executed

lilactown00:11:29

lumo doesn’t care as much because when you install it, it installs the CLJS compiler once on your system and it works only a desktop or server. for a web app, every user would download and run the compiler every time they visited your site, including people on mobile devices

scknkkrer08:11:20

Anyone, who are using com.taoensso/tower with clojurescript ?

orestis13:11:35

Just a friendly reminder — it’s considered bad form in this Slack to @ people who are not currently active in a channel.

borkdude13:11:26

I want to export a dom node as an image. I looked at this some years ago and then found https://github.com/tsayen/dom-to-image. Would that still be a good choice in 2019?

robertkrahn15:11:20

We've been using it in lively.next for creating previews of objects users create which can be anything, including canvas nodes and stuff like google maps. Worked and works pretty well for this, some CSS transformations and props can be a bit glitchy. https://github.com/LivelyKernel/lively.next/blob/master/lively.morphic/rendering/morph-to-image.js

robertkrahn15:11:06

"real" objects at the top, dom-to-image renderings below.

robertkrahn15:11:34

if I remember correctly, dom nodes are removed while rendering so if you render a node that is on screen it'll disappear

robertkrahn15:11:02

I also vaguely remember that there was an issue with images / iframes from other domains when those don't do cors.

borkdude19:11:51

@U08LZDL1H Hi. I'm using the library, but I'm having issues with rendering font-awesome icons. Did you run into this?

borkdude19:11:47

Actually I'm using dom-to-image-more which seems like a sequel to dom-to-image

robertkrahn19:11:27

just tested it and it seems to work fine with our (old) version of dom-to-image. left are font-awesome icons (also an old version from 2017) rendered via css and right a png image

borkdude19:11:14

OK. I just discovered the issue. Will post a link to the Github issue when I've finished it.

borkdude13:11:46

No new commits since 2017 but that might also mean that it's done

sudakatux18:11:42

I was wondering if anyone new how to translate React render props to reagent

sudakatux18:11:07

Thats... basically what i want to do but i could not figure out how

sudakatux18:11:29

tried many things and i could not figure it out. thanks in advance

sudakatux19:11:15

Thanks ill give that a shot

sudakatux19:11:26

did not try the as-element

sudakatux19:11:28

@thheller Thanks that fixed it

👍 4
kwladyka19:11:32

Can somebody past an example how to deploy CljureScript library using deps.edn to Clojars? I guess with https://github.com/slipset/deps-deploy but what about pom.xml etc.? The best if it can be example in github actions 🙂

dnolen20:11:00

does Clojars supports deps.edn? if not you need to generate pom.xml

Alex Miller (Clojure team)20:11:05

Clojars is a Maven repo and Maven does not know anything about deps.edn

kwladyka20:11:25

clojure -Spom
env CLOJARS_USERNAME=username CLOJARS_PASSWORD=password clj -A:deploy
Is it all? It is my first time deploying to Clojars. No compilation before, to js -> cljs or other steps? Is it as simple as that?

lilactown20:11:53

you don’t compile it, no

kwladyka20:11:00

If not compile what is this jar file?

{:deploy {:extra-deps {deps-deploy {:mvn/version "RELEASE"}}
          :main-opts ["-m" "deps-deploy.deps-deploy" "deploy"
		      "path/to/my.jar"]}}
https://github.com/slipset/deps-deploy#usage

kwladyka20:11:45

Should I use Signing?

kwladyka20:11:25

How will clojars know the version and name of the project?

lilactown20:11:15

I don’t know, I don’t use deps.edn for deploying to clojars

lilactown20:11:22

I just create a dummy project.clj and use leiningen

lilactown20:11:27

I’m lazy like that

kwladyka20:11:47

hmm it could be an option

kwladyka20:11:47

But I would like to know how to do deploy to clojars with deps.edn. I will appreciate if somebody can paste an example 🙂

lilactown20:11:29

I don’t know, sorry

kwladyka20:11:54

I know, but maybe somebody else will answer. Thank you for help.

kwladyka21:11:11

Do you have example with dummy project.clj in public repo?

kwladyka23:11:01

@U4YGF4NGM are you sure there is no cljs compilation before push to clojars?

kwladyka23:11:11

So how clojars get the code?

lilactown23:11:35

yes. any compilation would be broken when you include it in your cljs project

lilactown23:11:43

you put the source files in a jar, just like with Clojure libraries

kwladyka23:11:43

oh my fault, I asked in wrong way. I was thinking about jar file.

kwladyka20:11:42

hmm so it could be as simple as that 🙂 Thank you!

kwladyka20:11:47
replied to a thread:you don’t compile it, no

But I would like to know how to do deploy to clojars with deps.edn. I will appreciate if somebody can paste an example 🙂

Saurabh Jain20:11:13

Hi guys, I am facing issue while installing clojure inside the docker..any pointers please. I am trying to install it with Java 11

Saurabh Jain21:11:27

I am working on tap-mssql for pipelinewise that is written in clojure language. To create an image of my pipelinewise doker I need to install clojure as well that requires leiningen (RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein && mv lein /usr/local/bin/lein && chmod a+x /usr/local/bin/lein). when it installs clojure it is giving this error java.io.IOException: Cannot run program "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java" (in directory "/pipelinewise/.virtualenvs/tap-mssql"): error=2, No such file or directory at java.lang.ProcessBuilder.start (ProcessBuilder.java:1128) java.lang.ProcessBuilder.start (ProcessBuilder.java:1071) java.lang.Runtime.exec (Runtime.java:591) jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2) jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke (Method.java:566) clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167) clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102) leiningen.core.eval$sh.invokeStatic (eval.clj:179) leiningen.core.eval$sh.doInvoke (eval.clj:173) clojure.lang.RestFn.applyTo (RestFn.java:137)

Saurabh Jain21:11:50

I have version JAVA 11 installed but is it checking for 8..

darwin22:11:45

here is how I install java + lein in my testing docker image (based on ubuntu): https://github.com/binaryage/dirac/blob/master/test/docker/Dockerfile

kwladyka20:11:46

Just thinking… or maybe I shouldn’t care about clojars and just let people use hashes for library in deps.edn? Probably not a common standard. Is it? What is the current standard? As I understand I should deploy to clojars. Should I?

andy.fingerhut21:11:49

It depends upon your target audience. I would guess that to reach a wide audience of Clojure developers, deploying to either Clojars or Maven central will enable those who use boot or Leiningen to use your JAR file, whereas deploying source code only to a public git repo will limit your audience to those who use tools.deps.

andy.fingerhut21:11:14

I have not used it, but this wiki page of deps.edn based tools: https://github.com/clojure/tools.deps.alpha/wiki/Tools mentions deps-deploy with the description "A Clojure library to deploy your stuff to clojars"

kwladyka21:11:35

yes, but not sure from the doc how to set version or name of the clojars deploy

kwladyka21:11:31

That is why I would like to see example to not lose hours of my life to figure out things 🙂

andy.fingerhut22:11:38

There is a #tools-deps channel that might be a better target audience for your question

👍 4
dpsutton21:11:10

has anyone ever used cljsjs/react-popper? looking for some simple examples if so

dpsutton21:11:04

or if anyone has a good tooltip solution for cljs

kwladyka21:11:30

I use material-ui. Whatever solution should work.

kwladyka21:11:23

Personally I like to choose material-ui or different ready design to use instead of making everything myself from the beginning

dpsutton21:11:01

in this product we already have a design language. so ideally something that is just a tooltip without bringing in others is a requirement

kwladyka21:11:49

Unfortunately I can’t recommend you such a solution. I don’t use library only for tooltip. Maybe just add a few lines of CSS?

dpsutton22:11:16

that's what we've been doing. but that runs into issues with overflows and if your tooltip is near the window edge

dpsutton22:11:27

i don't know of a few lines of CSS that can solve window detection

kwladyka22:11:22

not sure about this issue too

kwladyka22:11:36

so maybe a few js lines are needed too 😉

dpsutton22:11:48

yeah. this is the principle issue we are trying to solve. refining the existing solution

kwladyka22:11:44

probably you can check source code of bootstrap twitter tooltip or material-ui and rewrite it in clojurescript

dpsutton22:11:11

they use poppler.js which is quite a bit of stuff going on

dpsutton22:11:47

(although would be ecstatic to learn of such a solution)

dabrazhe22:11:01

Is there a quick way to unload a require , eg remove http from the namespace after (require '[httplib.client :as http])

thheller22:11:29

thats not required in CLJS

borkdude22:11:48

@kwladyka I use deps.edn in all of my newer projects for development, but I also mirror the deps in a project.clj which I use to build uberjars and deploy. Contributors can use either tool for development.

dpsutton22:11:25

i think there's also a lein plugin that will use deps.edn as the single source of truth for deps

borkdude22:11:47

There's also one for boot (it even works with git deps)

borkdude22:11:15

I hope eventually tools.deps can be used within all those other tools so they can support git deps out of the box

borkdude22:11:46

I'm not suggesting not to use those, I just shared what I've been doing for several projects, just 2 cts 🙂

kwladyka22:11:50

I though you had some issues maybe

borkdude22:11:50

I had some issues around AOT using deps.edn, that's mostly why I switched to lein for that, but there might be tools which handle it well