This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-13
Channels
- # aleph (3)
- # aws (1)
- # beginners (97)
- # boot (41)
- # cider (7)
- # clara (105)
- # cljs-dev (4)
- # cljsrn (66)
- # clojure (185)
- # clojure-argentina (2)
- # clojure-colombia (15)
- # clojure-czech (1)
- # clojure-dusseldorf (8)
- # clojure-greece (2)
- # clojure-italy (5)
- # clojure-russia (33)
- # clojure-spec (14)
- # clojure-uk (9)
- # clojurescript (75)
- # cursive (6)
- # data-science (1)
- # datomic (12)
- # emacs (2)
- # fulcro (71)
- # funcool (1)
- # jobs (6)
- # jobs-discuss (62)
- # juxt (21)
- # lein-figwheel (1)
- # luminus (9)
- # lumo (41)
- # off-topic (39)
- # om (12)
- # onyx (1)
- # portkey (2)
- # protorepl (4)
- # re-frame (14)
- # reagent (50)
- # ring (3)
- # shadow-cljs (6)
- # spacemacs (38)
- # specter (8)
- # test-check (14)
- # testing (52)
- # unrepl (2)
so clj->js
does not transform #uuid
tags, is there a way to do that automatically?
@dpsutton If you mean beyond cljs.test, try fulcro-spec. It’s built on top of cljs/clojure test, but adds some handy things.
my work doesn't have cljs tests but does have clj tests and i would like to change that
So, try out the fulcro lein template. It is set up with clj and cljs test, dev mode is accomplished in a nice browser UI (hot code refresh/re-run). CI tests are part as well. The README you get describes the bits:
lein new fulcro my-project
Fulcro-spec is a standalone that can be used for testing in any project. Fulcro itself is a full-stack SPA system.
@richiardiandrea clj->js
has nothing to do with #uuid
tags really
they’re JS objects
but you can probably extend-protocol IEncodeJS
to the UUID
type
Oh that is what I was looking for yep. I figured I needed a custom writer, thanks!
Actually I would probably want to customize how the key is treated really, more than relying on uuid
tags really. So I'll probably use key->js
.
I have followed the instructions @ https://clojurescript.org/tools/repls to the letter (copy-pasted a repl.clj file and launched the REPL using it), but I still don't have CLJS-oriented file/line number info in stack traces. What things should I check for to diagnose the problem?
@cemerick are you targeting Node.js?
^ weird question. better: is the REPL evaling in Node.js?
@anmonteiro yes, sorry, using node 6.10.3, if that matters
make sure you have installed source-map-support
npm install source-map-support
(PR welcome to the website - https://github.com/clojure/clojurescript-site)
I don’t think so
I remember this being written down somewhere
perhaps didn’t make it from the wiki to the website
checking
it’s unfortunate how bad the GitHub search is
this is probably common knowledge for anyone that uses node.js as it was intended, etc
it’s not in the wiki as well
yeah, it’s not very good, but at least it’ll tell you the line number
it looks like the source-map-support is only looped in for namespaced loaded after the ((.. (node/require "source-map-support") -install))
call
source maps are much better in the browser /JavaScriptCore
the ClojureScript Node.js REPL should generate that call
@cemerick delete .cljs_node_repl
in your project dir too
I would so love to get all that guff under target so it gets flushed with everything else
@anmonteiro looking good, very nice, thank you :thumbsup:
thanks!
oh, looks like source-map-support is documented after all, in the node section of the quick start: https://clojurescript.org/guides/quick-start#running-clojurescript-on-node.js
@anmonteiro ☝️ just FYI. Thanks again 🙂
ah I thought I had seen it somewhere
What is a good tutorial for creating an web app with clojure + clojurescript?
@pvillegas12 can you be more specific, many tutorials out there that teach many different aspects of creating web app in broad sense.
i am using google reCaptcha (https://developers.google.com/recaptcha/). Its works fine in development mode. but it doesn't works in production mode. That is because of foreign-libs.
@sivakumargsk if you are asking a question, then I'd check if the externs you are providing are up to date, if you don't have externs, you probably need to make them. Also, there are more genders here than "guys", this is a habit I also had to get rid off.
@hlolli i write an externs file also it contains var grecaptcha = { "render": function () {}, "reset": function () {}, "getResponse": function () {}, "execute": function () {} }
Looks like this library isn't providing any js functions, so there isn't much reason to include it in foreign libs if you can avoid it, just add <script src='https://www.google.com/recaptcha/api.js'></script>
and give your dom elements the right class names etc. Also in case google updates their js file, then you don't need to do anything on your side.
@hlolli building a web app specifically using clojure as a backend (ring?) + cljs, I’m familiar with other backends + frontend technologies
Ok, you'd want to check out ring and compojure. And routers bidi
offers a good backend/frontend routing. Om-next has in my opinion the most beautiful data oriented GraphQL-ish endpoints via its om.next/parser. Looking at datomic tutorials you can learn also about other querying languages (pull-syntax) along with datascript
(not connected to datomic).
@hlolli ok i will try.
Does someone use https://github.com/ptaoussanis/tempura?
@kingmob that how the Node modules stuff works, via Google Closure Compiler’s support for it, worth reading the http://clojurescript.org/news blog for details
@dnolen Yeah, I’ve been poring over them nonstop since yesterday. It’s tricky because there’s important details that are scattered around and older pages that haven’t been brought up-to-date yet. E.g., the http://clojurescript.org Dependencies page still says about :foreign-libs
that “Foreign libraries are included in your final output, but are not passed through advanced compilation”, though my understanding is that setting :module-type
under :foreign-libs
means the library will go through advanced compilation, according to the Javascript Module Support page.
Been rereading latest cljs news blog and wondering which "higher level composable facilities" can be built on top of cljs.loader? > This simplification now means downstream libraries can easily build higher level composable facilities upon cljs.loader.
For example in JS you have routing library which allows you to define route-based code splits (dynamic imports which are processed by Webpack). But it seems like it's not possible in cljs, since everything should be defined statically.
@roman01la we do route-based code splits with fulcro
We have a edn file which defines all the routes and namespaces and then we generate the :modules
part for the clojurescript compiler and stuff for fulcro with a macro
Sounds interesting. How do you generate split namespaces?
@kingmob the :npm-deps
stuff is a replacement for :foreign-libs
and should not be used together. well only if you have your own js that you want to convert, but not for packages
@thheller Got it. In our case, we’re more of a plugin than in charge of the .js on the page, so we can’t feed everything through Closure :advanced
. In the short run, I’m going to push to do more of our builds outside lein, and in the long run, maybe we can produce a build where cljs is in control.
I am just getting started with a clojusrescript node project, needs to host some http services, is there a good place to start looking for docs / examples ?
@len I was looking into the same thing recently. This ended with "mmh I want to try macchiato" https://github.com/macchiato-framework. I settled for doing my http service with clojure/ring, so I can't speak much more about macchiato
Question, which options is https://cljs.github.io/api/cljs.core/pr-str-with-opts accepting and how do they modify the behavior of pr-str
?
(is it worth using?)
@richiardiandrea I think there is (pr-opts)
or something like that for the default opts. It is related to the IPrintWithWriter
protocol and which effect the opts have is dependent pretty much on each individual protocol implementation
Ok thanks, will dig into the source