This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-15
Channels
- # beginners (16)
- # cljs-dev (12)
- # clojure (9)
- # clojure-berlin (5)
- # clojure-russia (16)
- # clojure-uk (26)
- # clojurescript (48)
- # community-development (2)
- # cursive (1)
- # data-science (10)
- # datomic (7)
- # emacs (27)
- # figwheel-main (31)
- # fulcro (6)
- # hoplon (47)
- # immutant (1)
- # jobs (1)
- # jobs-discuss (33)
- # off-topic (3)
- # onyx (34)
- # protorepl (5)
- # re-frame (26)
- # reagent (1)
- # reitit (1)
- # shadow-cljs (80)
- # spacemacs (44)
- # specter (4)
- # testing (1)
- # tools-deps (4)
I was able to compile a 16k lines of clojurescript code and make it an npm module, easilly consumable by a react web app
A question about publishing the npm package: is it advised to include the generated js.map files?
@viebel you can but most tools do not read them although I do think that webpack supports it somehow
Thanks @thheller. Does somebody know how webpack makes use of the js.map files?
Hi guys. I have a big react app written on TypeScript. I wanna migrate it to clojurescript using shadow cljs. So basically I’m interested in interop between clojurescript and JavaScript (and vice versa). Is there some examples how to do so?
@denis_krivosheev what kind of interop examples do you need? 1. accessing javascript code from clojurescript 2. accessing npm modules from clojurescript
3. both
The main issue here is using cljs from js files
I read the docs and it suggests to use goog: prefix... and compiler is going to understand that
But I don’t understand how
For now the root of my app is going to be in typescript and I want to use clojurescript from there
And also use some ts from cljs
do you want to integrate clojurescript into your code base?
There is a video demo that @thheller did
Sounds awesome. Where can I find it?
Great thanks!
It is a bit old so some of the shadow-cljs commands have changed
I think you need to run shadow-cljs compile npm
My turn to ask for support
I am seeing the following error when running npm watch test
Jul 15, 2018 6:13:41 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - HTTP server for :test available at
shadow-cljs - server version: 2.4.5
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 57924
shadow-cljs - nREPL server running on port 57926
shadow-cljs - watching build :test
[:test] Configuring build.
[:test] Compiling ...
[:test] Build failure:
------ ERROR -------------------------------------------------------------------
File: jar:file:/home/viebel/.m2/repository/thheller/shadow-cljs/2.4.5/shadow-cljs-2.4.5.jar!/shadow/cljs/devtool
s/client/hud.cljs:1:1
--------------------------------------------------------------------------------
1 | (ns shadow.cljs.devtools.client.hud
-------^------------------------------------------------------------------------
Invalid :refer, var cljs.core.async/go does not exist
--------------------------------------------------------------------------------
2 | (:require
3 | [shadow.dom :as dom]
4 | [shadow.xhr :as xhr]
5 | [shadow.animate :as anim]
--------------------------------------------------------------------------------
npm compile test
works fine
here is my shadow-cljs.edn
{:lein true
:builds {:npm
{:target :npm-module
:output-dir "."}
:test
{:target :browser-test
:test-dir "resources/public/js/test"
:devtools {:http-port 8021
:http-root "resources/public/js/test"}}}}
anybody can help solving this issue?
Figwheel has an option to start a ring server to serve the frontend. Does shadow have something similar? Couldn't find anything in the guide
When I start shadow-cljs server
from cmd-line, it says:
shadow-cljs - Using IP "192.168.1.43" from Interface "en0"
Can I get it to listen on 0.0.0.0 or localhost instead? Currently I have to restart the server every time my ip changes.Seems it’s just using the first one from this fn-call: https://github.com/thheller/shadow-cljs/blob/eaa84c584905dbcf97e6fa8f78a6d955d4ac00fd/src/main/shadow/cljs/devtools/api.clj#L666 So maybe it’s not configurable?
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server.clj#L173 this is the relevant line
@oscar Precisely, there seems to be support only for static file serving, not running a full ring api
Hey guys so I'm trying to use this tool https://github.com/sass/node-sass However this
(:require ["node-sass" :as sass])
(sass/render {:file 'path-to-file'})
errors with Invalid symbol: 'path-to-file'thanks @thheller That solved the issue
@grav its always listening on 0.0.0.0
unless otherwise specified. the fixed IP is also gone for a couple of releases now.
@urbanslug 'path-to-file'
thats a symbol in CLJS, must use "path-to-file"
. ie. double quotes
and you probably need to either use clj->js
or #js {:file ...}
as node-sass
expects a JS object not a CLJS map
@thheller Ah I see. I thought that error was weird. Aren't symbols things that resolve to something?
has anyone used node-sass?
I get an interesting error that dirname is not defined
basically from https://github.com/sass/node-sass/blob/master/lib/extensions.js#L10
defaultBinaryDir = path.join(__dirname, '..', 'vendor')
Yeah it pointed to this in the readme https://github.com/sass/libsass
Ok so this is how I'm doing it rn. I have a project cljs file along the following lines:
{...
scripts: {
sass: "node-sass ...",
dev: "shadow-cljs watch app;",
repl: "shadow-cljs cljs-repl app;"
}}
so for dev I run all 3 in different split screensis this kinda what you mean or are you saying there's a way to configure shadow-cljs in the .edn file?