This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-19
Channels
- # announcements (1)
- # aws (9)
- # beginners (136)
- # boot (4)
- # cider (11)
- # clara (36)
- # clojure (337)
- # clojure-europe (5)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-spec (9)
- # clojure-uk (112)
- # clojured (7)
- # clojurescript (93)
- # core-async (2)
- # cursive (30)
- # datomic (6)
- # duct (4)
- # emacs (2)
- # figwheel (1)
- # figwheel-main (7)
- # fulcro (153)
- # kaocha (1)
- # off-topic (12)
- # om-next (1)
- # pedestal (58)
- # planck (6)
- # re-frame (15)
- # reitit (11)
- # shadow-cljs (113)
- # spacemacs (1)
- # specter (3)
- # vim (8)
Thin wrapper around Ant Design React components using Reagent https://github.com/hypaer/ant-man
is there a one-liner to start cljs node repl with cli (`clj`)?
found it: clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}}}' -m cljs.main --repl-env node
Quick question. If I want to translate const { specificComponent } = require('some-library')
into ClojureScript, how would that work?
@gekkostate you can try (def SpecificComponent (.-specificComponent (js/require 'some-library')))
Ok, sweet! I’m trying to basically grab this: https://electronjs.org/docs/api/dialog
I tried the what you said above (replaced js/require
with nodejs/require
) and I get “Can’t access property of undefined.”
Interesting! So, I’m using the (def Electron (nodejs/require "electron"))
and the app runs successfully (meaning it found the package) but doesn’t work for a component? 😛
It’s in electron but according to the link above, it says we have to reference .remote
So I tried (def dialog (-.dialog (.remote Electron)))
No, it’s not working. 😞 I’m eventually calling it as (.-showOpenDialog dialog)
YES! It works 😄 WOOO. So I referenced Electron
directly. I did (.showOpenDialog (.-remote.dialog Electron)
Thanks a ton!
@borkdude macros are clojure code so usual tools should apply, when having complex macros I tend to refactor a macro to just call into a clojure function, this function then can be debugged from plain clojure, if you really need printing during a macro call System/out should work
yeah. I have some problem with a macro in a .cljc file which does something depending on an env variable. it’s very finicky to see when it’s called.
the macroexpansion etc is correct, I just want to see why it’s being triggered while it shouldn’t be
I’m undefining some specs in a test, but CLJS spec also does some things at macro-expansion time, so they are undefined in other tests too
I guess I’ll just have to write a different test suite for that one test, since I can’t dynamically switch between defined and undefined
Any recommendations on csv parsers? I’m using https://github.com/testdouble/clojurescript.csv but it’s severely lacking on the read functionality. I was using clojure/data.csv
but can’t seem to use it with Clojurescript.
why isn't :parallel-build true
the default?
Hello guys
is there anybody experienced any problem with font-awesome icons in clojurescript project?
@joelsanchez historically there were some bugs so wasn't enabled by default
i'm not able to access resources/public/fonts/ content using http calls, actually i proxyed the jar behind nginx
We’re using the public CDN for FontAwesome, but even so, it seems like you ought to be able to access the files in your local resources directories. I assume you’re not having problems with things like resources/public/css
and resources/public/js
, etc?
Actually, I’m looking at the setup instructions, and it has a webfonts
directory instead of just a fonts
directory, maybe there’s something misconfigured? https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself
@manutter51 so you only refer to CDN urls in your index.html ?
is it working with https or http ? are you using jar directly or as proxy with apache or nginx ?
Actually, what we’re currently using is just one line in the basic index.html
page:
<script defer src=""></script>
It’s working fine both in local dev and in our “production” jar, which we have behind nginx
(but of course the fontawesome stuff is coming directly from fontawesome, we’re not getting it through nginx)
in production you are using https ?
it was working fine with me in http mode , when i cconverting to use https i got lost icons
Yeah, if you’re going direct to http://fontawesome.com via https, it should work fine when your app server also goes to https.
Let me double-check if our “prod” server is https
okay sure
btw which is better to use the url like above or download it at js dir and use it like static file ?
ah, ok, no, we’re not behind https yet — I remember now, nginx was so we could put it on port 80
We use the http://fontawesome.com url on the theory that they’ve got more powerful servers than we do.
ah ok
that's really good, thanks 🙂
:thumbsup:
What I want: representation of HTML DOM as CLJS data structures, PLUS a relationship to navigate to/from those data structures and the corresponding DOM object references. Don't really care how I get there, whether starting with hiccup and generating DOM or walking existing DOM and generating hiccup (or whatever). Just for purposes of experimentation. Anybody know of some existing code that does this? Doesn't seem hard, but it's for a side project, and it would be great if this was already done and could save me a little time.
not sure if I fully understand, but one way from DOM->cljs could be done by extending cljs protocols on DOM types: https://github.com/binaryage/dirac/blob/master/src/shared/dirac/shared/dom/shim.cljs#L14-L36
it is a bit dangerous, but if you have js env fully under your control it could be a way to go
what is the closest cljs thing to java.io.OutputStream
? I'm working on porting the [bencode](https://github.com/nrepl/bencode) library to cljs.
that seems like it would be to node specific and its an instance, i probably want a class/interface
[redacted snippet]
I’ve put a macro in a .cljc file, but I don’t understand why the compiler is giving me such sass.Ok I figured out the immediate issue: When in cljc\cljc you don’t need :require-macros
, only in .cljs files. However, that code wouldn’t work or solve the problem anyway since I’m relying on clj->js.
Greetings! I'm trying to use some :npm-deps
. However (:require ["some-npm-module" :as xx])
does not work. But on the page served by figwheel required module is available as someNpmModule$$module$Users$myusername$Desktop$myproject$node_modules$some_npm_module$dist$commands
. Help :)
Do you also have :install-deps? https://clojurescript.org/reference/compiler-options#npm-deps
basically, this variable in chrome dev console contains everything module provides, so it is downloaded and visible, but in a funky way
I used js/require
in lein + re-natal setup ~2years ago, and it worked there.
Here I am trying to get away with tools.deps + :npm-deps (+ figwheel-main), and understand nothing
no clue, David, what would be preferred way? Module in question is prosemirror
, e.g. but more recent versions:
https://github.com/braintripping/re-view/blob/master/prosemirror/src/deps.cljs#L1-L10
:npm-deps is an advanced feature, more reliable option is to use https://clojurescript.org/guides/webpack or shadow-cljs
@dnolen @jayzawrotny it turned out default settings (or I messed it up at some point) of figwheel-main put compiled main.js in project root, and I had some stale main.js in target/public/cljs-out/
it's possible :npm-deps
could seem to work - but remember no guarantee advanced compilation will actually work