This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-11
Channels
- # architecture (11)
- # bangalore-clj (1)
- # beginners (42)
- # boot (28)
- # chestnut (1)
- # cider (1)
- # cljs-dev (28)
- # cljsrn (7)
- # clojure (124)
- # clojure-austin (1)
- # clojure-italy (10)
- # clojure-russia (3)
- # clojure-spec (29)
- # clojure-uk (32)
- # clojurescript (62)
- # core-async (22)
- # data-science (7)
- # datascript (5)
- # datomic (8)
- # events (1)
- # fulcro (15)
- # funcool (1)
- # jobs (1)
- # keechma (10)
- # lein-figwheel (4)
- # lumo (4)
- # mental-health (1)
- # off-topic (21)
- # om (10)
- # onyx (8)
- # parinfer (29)
- # pedestal (1)
- # planck (4)
- # portkey (2)
- # protorepl (1)
- # random (1)
- # re-frame (12)
- # ring (3)
- # spacemacs (6)
- # uncomplicate (63)
has anyone else had problems with namespaced maps in clojurescript? when I do #:: {:a 1} in clojurescript 1.9.854 I get: clojure.lang.ExceptionInfo: Invalid token: :: {:type :reader-exception, :line 1, :column 4, :file "NO_SOURCE_FILE"}
@atroche Can't repro that:
$ java -jar cljs.jar -m cljs.repl.node
ClojureScript Node.js REPL server listening on 53986
To quit, type: :cljs/quit
cljs.user=> *clojurescript-version*
"1.9.854"
cljs.user=> #:: {:a 1}
#:cljs.user{:a 1}
hi, i was wondering if there鈥檚 a cljs library that works similarly to cyclejs, but with core.async instead of rxjs?
@mfikes thanks, that's interesting! I'm trying it in figwheel:
app:cljs.user=> *clojurescript-version*
"1.9.854"
app:cljs.user=> #:: {:a 1}
clojure.lang.ExceptionInfo: Invalid token: :: {:type :reader-exception, :line 1, :column 4, :file "NO_SOURCE_FILE"}
and it's not just at the repl, it also just fails to compile. worth filing an issue on figwheel's github, or might I be doing something obviously wrong?also, when trying to reproduce your node example:
java -jar clojurescript-1.9.854.jar -m cljs.repl.node
no main manifest attribute, in clojurescript-1.9.854.jar
where can I get a jar which lets me run cljs.repl.node like you do?@atroche I can鈥檛 repro with Figwheel.
Prompt will show when Figwheel connects to your application
To quit, type: :cljs/quit
ios:cljs.user=> *clojurescript-version*
"1.9.854"
ios:cljs.user=> #:: {:a 1}
#:cljs.user{:a 1}
It is probably worth checking to make sure you don鈥檛 have an old version of org.clojure/tools.reader
on your classpath.What's the idiomatic way to require/import goog.string.format? Seems to just be a function
(require '[goog.string :as gstr]
'goog.string.format)
See Sometimes symbols are *not auto-included* when requiring their parent namespace. This happens when those symbols are in their own file and require specific inclusion
on the page
and then use it with gstr/format
FWIW, this case is covered here https://clojurescript.org/reference/google-closure-library#requiring-a-function
I think I looked at something out of date: http://clojurescriptmadeeasy.com/blog/when-do-i-use-require-vs-import.html Probably from the github wiki. Thanks, I should familiarise myself with that site more
i got a question about using specs in clojurescript. When i try to generate a value for a spec that i defined with s/def in another namespace i get Error: Unable to construct gen at: [] for: . It works fine when I generate for a spec in the current namespace. What am I missing?
^ this one is more recent
Does anybody have any experience with chromex and writing Chrome Extensions? Is the ClojureScript runtime overhead worth it? What are some architecture best practices (a la re-frame)?
And what about compatibility with Firefox, and the WebExtensions API in general?
@darwin has created a custom chrome extension for a better ClojureScript REPL debugger Dirac https://github.com/binaryage/dirac
IIRC he's also documented how to build a chrome extension from ClojureScript
@mfikes I think i figured out a minimal repro: (ns specbasics.repro (:require [cljs.spec.alpha :as s])) (s/def ::spec1 string?) (ns specbasics.repro-test (:require [cljs.test :refer-macros [deftest testing is]] [specbasics.repro :as repro] [cljs.spec.alpha :as s] [cljs.spec.gen.alpha :as gen] [clojure.test.check.generators] )) (deftest valid-repro-test (let [example1 (gen/generate (s/gen string?))] (is (string? example1 )) (is (string? (gen/generate (s/gen repro/spec1))) )))
i feel like I am missing something pretty basic with importing but could not figure out what
@newres I immediately get a much better error message than the one you seem to be encountering:
cljs.user=> (require 'specbasics.repro-test)
WARNING: Use of undeclared Var specbasics.repro/spec1 at line 14 /Users/mfikes/Desktop/src/specbasics/repro_test.cljs
Hi, I am trying to use :npm-deps
with 1.9.854 and I am getting a Error: Cannot find module 'module-deps'
, does anyone hit this problem?
OK, the real problem is Uncaught Error: Undefined nameToPath for module$home$tiago_antao$stats$node_modules$vega_lite$build$package_json
(vega-lite is a charting library that I am trying to use on clojurescript
@tiagoantao can you try master?
before I look into your problem I鈥檇 like to know if it鈥檚 not fixed in master already
@anmonteiro Sure, but it will take me a bit as I am using leiningen
doesn鈥檛 have to take a bit
clone ClojureScript and ./script/build
note down the version number
and use it in Lein
thanks!
@anmonteiro I've got Error: Cannot find module '@cljs-oss/module-deps'
(but figwheel starts OK) but then I get a less ugly variation of the error above: Uncaught Error: Undefined nameToPath for vega_lite
on the browser
do you have a package.json
file in your project鈥檚 directory?
@anmonteiro yep, I just updated figwheel to 0.5.12 and still no joy
k I鈥檒l take a look
can you paste the modules you鈥檙e trying to consume and how you鈥檙e requiring them?
thanks, here it is:
from project.clj:
:compiler {:main stats.core
:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/stats.js"
:output-dir "resources/public/js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload]
:language-in :es5
:npm-deps {:vega-lite "2.0.0-beta.10"}
:pretty-print false
:optimizations :none
:static-fns true}}
The code:
(ns stats.core
"Stats playground"
{:author "Tiago Antao"}
(:require vega-lite))
@anmonteiro : but a bare bones project that just requires vega-lite
should expose this
(I hope)
@tiagoantao I think you just need to add :install-deps true
to your compiler options
Closure Compiler does seem to have a little bit of trouble converting everything in vega-lite
but I can load it in the browser
you鈥檙e probably just not installing deps
@anmonteiro Thanks! Indeed I get a lot of errors on the console (`require is not defined` for example). I do have at least one that seems serious: goog.require could not find: vega_lite