This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-08
Channels
- # bangalore-clj (5)
- # beginners (6)
- # boot (66)
- # cider (48)
- # cljsrn (14)
- # clojure (699)
- # clojure-austin (2)
- # clojure-berlin (1)
- # clojure-boston (5)
- # clojure-dev (3)
- # clojure-india (7)
- # clojure-italy (24)
- # clojure-nl (5)
- # clojure-russia (33)
- # clojure-spec (30)
- # clojure-uk (64)
- # clojure-ukraine (22)
- # clojurescript (123)
- # clojurewest (1)
- # cursive (18)
- # datascript (44)
- # datomic (12)
- # dirac (46)
- # figwheel (1)
- # gsoc (5)
- # hoplon (6)
- # immutant (29)
- # instaparse (1)
- # juxt (26)
- # lein-figwheel (5)
- # leiningen (4)
- # luminus (8)
- # mount (56)
- # off-topic (60)
- # om (67)
- # om-next (1)
- # onyx (8)
- # proton (28)
- # re-frame (125)
- # ring (3)
- # ring-swagger (3)
- # specter (22)
- # testing (2)
- # unrepl (1)
- # untangled (91)
@mobileink connected perhaps, but I doubt it has much of a real impact. It's a problem fairly common in programming, we can sit an argue if something is a co-monad or a lens, or a byfunctor-plasmatic-rebounder, but in the end all that really matters is how it enables me to write better code, and if the gain is worth the cost.
side note: hence why I use a "good enough" functional language. If the compiler forced me to keep my functions pure, it would be more trouble than it would be worth.
So when we discuss these things I'm more interested in stuff like "do this and we can automate testing, do that and you get parallelism for almost free". Pure functions are just a tool that helps me with those goals.
@tbaldridge my original concern was to understand just what people mean by SSR, and you have helped clarify that, so thanks.
in hiccup
, I can add a class like [:div.blue]
, but if I have hiccup-producing fn (defn custom [] ...)
, is there a convenient way to do [custom.blue]
?
does using a (go ... ) basically force all exceptions within the block to the line where the go is defined ?
@josh.freckleton I think convetient way is [tag_name {:class "blue"}]
I mean if custom
is a function you can just pass attributes there and merge them with attributes you set inside
@rm thanks, that makes sense
I was sorta hoping there was something as clean as [tag.blue]
, but ah well 🙂
https://gist.github.com/anonymous/e5a9075a8f9c4f20eba7be22c8770915 <-- anyone know why I'm getting a blank screen? 😞
rofl, welcome to OpenGL
getting a triangle to show on a black screen is the "Hello World!" of OpenGL, and yes it will probably take a ton of time to debug
Look for log messages/check every thing that returns an error code for an error code
@tbaldridge : weird thing is: I got textured triangle working -- except that tdemo code didn't use any vertices (it hard coded the vertex location based on the vertex shader [i.e. x, y,z were functions of the vertex_id) So then I see another tutorial on rendering a rectangle; and I'm like clearly I can combine these two, and get a textured rectangled and viola, I get a rectangle that is all black (which is not the texture)
When running a clojure script repl in emacs I tried (.log js/console "foo")
I got
CompilerException java.lang.RuntimeException: No such namespace: js, compiling:(*cider-repl CLJS zebra*:45:21)
Which is the whole point, no?@urbanslug: https://github.com/magomimmo/modern-cljs may be of interest to you
take into account that few colleagues of mine are upgrading the modern-cljs series to the latest available boot version and used libs. It should take a couple of days to have the job done.
@U0EH09SLX : (1) thanks for creating this series! this is what made boot click for me, (2) you probably want to send this to @urbanslug , as that's the person who's looking to learn 🙂
@qqq @urbanslug 🙂 I did not verify every single tutorial of the series that has been updated by 3 internals of my company. Aside from few details I should correct, hopefully everything should work with the updated boot, boot tasks and dependencies as expected.
@U0EH09SLX :thumbsup:
@U0EH09SLX : I'm a big fan of your writing style; I wish you would write more tutorials.
is it possible to get lein cljsbuild test
to not run every build before running the tests? i'd like it to just run the test build.
i think i should be able to do it using profiles but i don't know if that's idiomatic
has anyone else encountered this error?
SyntaxError: Invalid regular expression: range out of order in character class
referencing a line in the compiled js: goog.i18n.bidi.rtlCharReg_ = new RegExp("[" + goog.i18n.bidi.rtlChars_ + "]");
I’m guessing there’s a “-” in goog.i18n.bidi.rtlChars_
that’s making the regex unhappy?
If so you’ll need to remove it from goog.i18n.bidi.rtlChars_
and make it the first or last character in the string.
yeah. it's not in my code of course. i can't find anything yet on the web that sheds any light on whether i'm doing something wrong 🙂
except for one other individual in the IRC channel who apparently found this issue.
Hrm, I probably can’t help then, sry
@timvisher is there anything in your dependencies you could upgrade to the latest version? I found that IRC conversation (I guess it’s the same one) and it sounds like a case of “new CLJS + old libs"
@manutter51 i've been in the process of trying to do that. at the moment my deps are clojurescript 1.9.… and clojure 1.8.0
but my project's an absolute mess of comments at this point. i'm considering trying to just greenfield it and copy stuff in one at a time 🙂
I’ve done that 🙂
Hi all! Has anybody ever tried to let maven compile a clojurescript project featuring externs-including dependencies? I’m using clojure-maven-plugin, making it run a build script where I just invoke
cljs.build.api/build
. With the :advanced
optimizations, however, externs are not included. With lein-cljsbuild, externs present inside a dependency jar would be automatically included, and I don’t know how to imitate this behaviour in my scriptWhat does your build script look like?
Have you tried running lein run -m clojure.main path/to/your/build/script.clj
?
Hey all. On a newly generated re-frame project i'm getting the folloiwng error when trying to compile a ns within cider: Caused by: clojure.lang.ExceptionInfo: No such namespace
This error as well: `clojure.lang.ExceptionInfo: failed compiling file:/home/me/code/fudge/src/cljs/fudge/core.cljs {:file #object[java.io.File 0x52e7523e "/home/me/code/fudge/src/cljs/fudge/core.cljs"]}
It looks like you have your source paths set up incorrectly
@spinningtopsofdoom this is a brand new project setup by reframe, what should I be looking for?
@U08UTJ5PB You'll want to check that your :source-paths
contains the directory that your ClojureScript in
and that the directory you are passing in for your ClojureScript build is coorect
and finally make sure the ClojureScript namespace matches the directory layout (e.g. (ns foo.bar)
should be in src/foo/bar.cljs
@spinningtopsofdoom Thanks for your answer. This is my script:
(require 'cljs.build.api)
(cljs.build.api/build "src/main/clojure-app"
{:output-to "src/main/webapp/docroot/js/main.js"
:output-dir "target/js"
:optimizations :advanced})
Running it as you suggested correctly compiles the project (i.e. includes the externs). Unfortunately I cannot rely on leiningen in the environment where this will have to be built...@stepugnetti how does your project.clj look? something using :profiles
?
@spinningtopsofdoom Right. This is my project.clj
(defproject my-project "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[reagent "0.6.0"]
[re-frame "0.9.2"]
[cljsjs/react-bootstrap "0.30.7-0"]
[cljsjs/react-router "0.13.2-0"]
[org.clojure/java.classpath "0.2.3"]]
:plugins [[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5"]]
:source-paths ["src/main/clojure-app"]
:clean-targets ["target/js" "src/main/webapp/docroot/js"]
:cljsbuild {:builds [{:id “mp"
:source-paths ["src/main/clojure-app"]
:compiler {:output-to "src/main/webapp/docroot/js/main.js"
:output-dir "target/js"
:optimizations :advanced}}]}
:profile {:dev {:cljsbuild {:builds [{:id “mp"
:figwheel true
:source-paths ["src/main/clojure-app"]
:compiler {:output-to "src/main/webapp/docroot/js/main.js"
:output-dir "src/main/webapp/docroot/js/include"
:asset-path "src/main/webapp/docroot/js/include"
:main “my-project.core"
:optimizations :none}}]}}})
(Sorry fo the bad layout)
And I misspelled :profiles
, so probably the :dev
map has no effect
@stepugnetti I haven't compiled ClojureScript with just maven but I believe David Nolen has. You might want to ask him.
@stepugnetti Checkout the last section in https://clojurescript.org/reference/dependencies
No, my pom has been assembled manually since it has a complex structure because of some other part of the project entirely developed in Java.
@spinningtopsofdoom Thanks! This means that it is a problem with the classpath indeed.
No problem glad you found the problem
hello, is there a way to use figwheel inside my own component system? I want to keep only my server up so less overhead is imposed. Is this a good way?
@vinnyataide sure, there’s figwheel-sidecar.system/figwheel-system
@anmonteiro that's awesome! thanks
@vinnyataide it’s also easy to combine with Socket REPL
this is how I do my dev - one VM that runs webserver, Figwheel compilation process, 2 Socket REPLs (one Clojure, one Figwheel)
@dnolen do you have an example project?
or a tuto?
@dnolen do you use the handler options on figwheel?
the :ring-handler one
I'll think how the pieces fit together and try to understand
oh ok
thank you!
very cool tool agnostic solution
Do most collection functions work on JavaScript arrays?
It seems like count
does.
I'm assuming using CLJS functions like count
with arrays is more idiomatic than (.-length array)
.
(count #js[1 2 3])
returns 3, though.
Oh, didn't happen to notice "Also works on strings, arrays, and Maps" in its docstring. Thanks!
Which is more idiomatic to use, (count array)
or (alength array)
?
depends, if you want to be explicit that you are doing interop and the array
is 100% a js array use alength
, if you are writing a piece of generic code count
should be used instead
Okay.
not really cljs specific, but which open source databases do you webdevs use for storing user specific data such as roles/permissions, saved documents, etc?
monger (mongo) and clojure seems alright from an edn->json / json->edn perspective, but is there a more native solution besides datomic?
I wouldn’t worry about ‘native’. Is it native because it is or because the API layer makes it seem to be? I’d go with whatever the best tool for the job is. If your data access layer API does the job of making it seem native, that should be good enough.
To put it another way, I’ve shifted from Mongo to RethinkDB back to Mongo (after RethinkDB folded) and then finally to Postgres.
My façade layer between my app and the data access layer held up with just adjustments to expected arguments and function names. Boom.
And likewise, I'll probably never be able to use a database besides Datomic again. Having an immutable DB is that good.
fair point. i went from mongo to couchdb and then back to mongo. but i'm also fond of postgress. i guess i view clojure data structures as documents more than tables... i'm just frustrated with mongo's query engine. perhaps i should look into postgres's document store.
how so?
I really like Datomic, mind you. I’ve just never found a use case for personal projects (or even for any professional ones) that it stood to reason to shift to it from whatever was in place. Total greenfield, I’d probably follow @tbaldridge and go with Datomic.