This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-28
Channels
- # announcements (5)
- # aws (16)
- # beginners (62)
- # calva (2)
- # cljdoc (17)
- # cljs-dev (2)
- # clojure (89)
- # clojure-brasil (1)
- # clojure-europe (3)
- # clojure-italy (12)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (10)
- # clojure-uk (26)
- # clojurescript (45)
- # cursive (4)
- # data-science (6)
- # datavis (1)
- # datomic (15)
- # duct (5)
- # fulcro (55)
- # juxt (1)
- # kaocha (2)
- # leiningen (1)
- # off-topic (101)
- # pathom (12)
- # portkey (4)
- # quil (5)
- # re-frame (9)
- # reagent (2)
- # reitit (28)
- # shadow-cljs (114)
- # spacemacs (9)
- # speculative (2)
- # sql (3)
- # test-check (18)
Hi!
check
is giving me a warning that I'm not sure how to address:
helpers.cljs:
101: if (isa? (type p) clojure.lang.MapEntry)
------ WARNING #56 -------------------------------------------------------------
File: .........../helpers.cljs:101:24
Property lang never defined on clojure
@aisamu that should be cljs.core/MapEntry
. clojure.lang.MapEntry
does not exist in CLJS
What's the simplest way to get my clojurescript app to read some text from a file and display it on the web page?
Seems like a really basic task but I've been struggling with it for the past hour - maybe there's some fundamental concept that I'm not understanding ?
I have a Clojure library that processes inputs and outputs images and text files, trying to get the simplest possible thing together with Clojurescript for a browser-based dashboard to the functions
enter something in a text field, and the backend runs and shows the generated image and text from the clj script on the browser page
@qythium clojure library? dumb question maybe, but its built for clojure script right?
Yes, as far as I understand the usual model is to have a cljs frontend which somehow interfaces with a clj backend
@idiomancy shadow-cljs does far more than figwheel. but yes for browser builds it does offer the same features that figwheel does including life reload and css reload
@qythium that is not an easy question to answer. you'll need a HTTP server. the client would send a POST request to the server which would then reply with the results. gets a bit trickier with images since the browser can't send a POST request for images. sounds really basic but really isn't. 🙂
With images at least I can have a [:img {:src ...}]
tag and have the clj code write directly to the source location.. is that a completely wrong way of going about things?
is there a minimal example of a client/server app with that sort of communication that I can look at?
any kind of server will do. I would use fulcro/pathom but that is probably major overkill for what you want
I find that most of the tutorials and examples out there seem to assume a full working knowledge of the javascript ecosystem and web architecture, can be pretty overwhelming 😕
lots of moving parts but yeah the "getting started" experience overall is still pretty bad for clojure
I tried Luminus some time ago and it seemed really overkill for what I had in mind, there were so many different interconnected parts spread over many files - is that really the sort of minimal setup needed?
that is more minimal https://gist.github.com/weavejester/585915
maybe the wiki helps https://github.com/ring-clojure/ring/wiki
I just pushed [email protected]
. One thing I tried to tweak is how warnings are handled in the console. So if you have lots of warnings in libraries you don't control they should be less annoying now.
@thheller just tried 2.7.18, but getting this:
------ ERROR -------------------------------------------------------------------
File: jar:file:/Users/wilker.lucio/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/spec/gen/alpha.cljs:35:3
--------------------------------------------------------------------------------
32 | (apply @quick-check-ref args))
33 |
34 | (def ^:private for-all*-ref
35 | (dynaload 'clojure.test.check.properties/for-all*))
---------^-----------------------------------------------------------------
StringIndexOutOfBoundsException: String index out of range: -1
java.lang.String.substring (String.java:1931)
clojure.core/subs (core.clj:4986)
clojure.core/subs (core.clj:4981)
(I didn't had this in 2.7.15, trying versions in the middle to see if I can find where it stopped working
2.7.17
works fine, 2.7.18
doesn't compile
@thheller maybe you have to require spec?
@wilkerlucio @hoopes should be fixed in 2.7.19
. thanks for the report.
maybe some weird dep we have
checking here too
I could reproduce the error manually. just no idea why it didnt' happen when compiling those files
I noticed something, in the past I had some highlight.js warnings and they used to came in yellow color, now they are white, not sure if was intentional, but other than that the compilation is good now! thanks man!
------ WARNING #1 - :undeclared-var --------------------------------------------
Resource: common_core/schema.cljc:121:32
Use of undeclared Var common-core.schema/clojure
--------------------------------------------------------------------------------
and a lot of those now ^^^ 😛probably, this is an internal lib but most people don't try it with cljs, so I have to go there an fix it
real ones seem 6
------ WARNING #5 - :undeclared-var --------------------------------------------
Resource: bide/core.cljs:176:36
Use of undeclared Var bide.core/EventType
--------------------------------------------------------------------------------
------ WARNING #1 - :undeclared-var --------------------------------------------
Resource: cljs_time/internal/parse.cljs:139:27
Use of undeclared Var cljs-time.internal.parse/Interval
--------------------------------------------------------------------------------
------ WARNING #2 - :undeclared-var --------------------------------------------
Resource: cljs_time/internal/parse.cljs:340:31
Use of undeclared Var cljs-time.internal.parse/Interval
--------------------------------------------------------------------------------
------ WARNING #3 - :undeclared-var --------------------------------------------
Resource: cljs_time/coerce.cljs:29:18
Use of undeclared Var cljs-time.coerce/UtcDateTime
--------------------------------------------------------------------------------
------ WARNING #4 - :undeclared-var --------------------------------------------
Resource: common_core/schema.cljc:121:32
Use of undeclared Var common-core.schema/clojure
--------------------------------------------------------------------------------
------ WARNING #5 - :undeclared-var --------------------------------------------
Resource: common_core/schema.cljc:122:32
Use of undeclared Var common-core.schema/clojure
--------------------------------------------------------------------------------
------ WARNING #6 - :undeclared-var --------------------------------------------
Resource: pushy/core.cljs:88:39
Use of undeclared Var pushy.core/EventType
--------------------------------------------------------------------------------
i got the same first three as @wilkerlucio too - cljs-time
warnings
ok those warnings are fix. apart from the common-core.schema/clojure
. Those are probably some invalid clojure classes like clojure.lang.MapEntry
was so the warnings are probably legit
@hoopes I also found that same runtime error you described, is that fixed as well @thheller?
awesome, thanks
@wilkerlucio if you get a chance please check what your internal lib uses. good chance the warnings are actually legit but would like confirmation.
I'm pretty sure they are legit 🙂
like I told you, this is a cljc file, but 90% of the people only try it in clj
I keep fixing things there
let me do a quick check here
actually, this is what I found in the line looking at the sources:
clojure.lang.IPersistentVector
clojure.lang.IPersistentSet
are those supposed to be available on cljs? I'm not sure
ok, makes sense then