This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-14
Channels
- # asami (1)
- # babashka (50)
- # beginners (70)
- # bristol-clojurians (6)
- # calva (36)
- # chlorine-clover (1)
- # cider (4)
- # clj-kondo (3)
- # cljdoc (49)
- # cljsrn (5)
- # clojure (96)
- # clojure-australia (3)
- # clojure-dev (1)
- # clojure-europe (84)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (65)
- # clojurescript (31)
- # community-development (6)
- # conjure (17)
- # cursive (8)
- # datascript (5)
- # datomic (12)
- # duct (3)
- # emacs (18)
- # figwheel-main (2)
- # fulcro (7)
- # helix (1)
- # jobs (3)
- # luminus (7)
- # off-topic (77)
- # pathom (3)
- # portal (1)
- # rdf (4)
- # re-frame (1)
- # reitit (4)
- # remote-jobs (4)
- # reveal (15)
- # rum (1)
- # sci (38)
- # shadow-cljs (22)
- # spacemacs (1)
- # specter (6)
- # sql (1)
- # test-check (1)
- # tools-deps (60)
- # vim (12)
When I run clj -m namespace
it looks for .clj
and .cljc
files but not .cljs
files
According to Clojurescript doc here https://clojurescript.org/tools/testing
> Running Tests
> You can run tests by using theĀ `cljs.test/run-tests`Ā macro. This may be done in your REPL or at the end of your file. If you have many test namespaces itās idiomatic to create a test runner namespace which imports all of your test namespaces and then invokesĀ `run-tests`.
So I created the file server.cljs.tests
(ns server.cljs.tests
(:require [cljs.test :refer-macros [run-tests]]
[server.cljs.history_test]))
(enable-console-print!)
(defn runn []
(run-tests))
I have a test at server.cljs.history_test
.
But when I run function runn
in repl with
ClojureScript 1.10.238
cljs.user=> (require '[server.cljs.tests :refer [runn]])
nil
cljs.user=> (runn)
Testing server.cljs.tests
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
nil
It seems run-tests
is enable to discover the tests in server.cljs.history_test
namescpace.Good morning. Anyone knows why most ācommonā clojure.*
libraries are renamed cljs.*
in ClojurScript?
In short, has to do with macros. In long: https://clojurescript.org/guides/ns-forms#_clojure_namespace_aliasing Edit: see now that thheller was about couple of hours faster š
@pez as soon as macros are involved things would clash badly and not work. works for macro-less things like clojure/string.cljs
+ .clj
but more complex stuff like core.async
would break completely.
Hi! I had some experince with javascript (node, webpack, vuejs) and Elm. Now I'm digging into clojurescript webdev. The ecosystem looks kinda compicated for me at the first look. As far as I understood shadow-clj is like webpack. I have a freshstart project with re-frame framework. How do I use frontend css framework? For example material-components (https://www.npmjs.com/package/material-components-web) with hiccup?
The documentation of material-components-web
says:
> Simply render the necessary DOM, and attach the data-mdc-auto-init="MDCIconButtonToggle" attribute
Seems like you can just follow the documentation then and simply convert all HTML they provide into Hiccup and all JS into CLJS.
I don't understand. In this case I should use that with CDN? I want to have it in my bundle with npm install
Ah. Your initial question was about using it with Hiccup. :) Just follow the shadow-cljs user's guide: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
hey folks, can anybody help me get the cljs compiler to watch my directory for changes and auto re-compile? I'm running clj -m cljs.main -co build.edn -O advanced -c -w ./src/
and get Assert failed: No file for namespace -w exists
Ok if I add my core namespace to the -c
flag I can get a build, but it doesn't watch...
Is there a nifty way to preserve keywords with namespaces when converting to JS datastructures and back? How about object metadata?
I have a javascript library that needs the data in javascript format, but I'd like to be able to use the data it passses me again as CLJS data. This works fine for most things, but keyword values and object metadata is lost in this roundtrip.
Either that library has to support some metadata in some way, or you have to wrap all calls to that library with some code that remembers everything that that library doesn't support, destroys it, and recreates if after the library call is finished.
Yeah, thatās what I thought. No way of getting around it..
Thanks!
Hi @nickt, put the watch flag after the cljs.main like this and it'll works:
clj -m cljs.main -w src -co build.edn -O advanced -c
Does anyone have tips on incorporating https://tailwindcss.com/docs/installation into a Figwheel project?
Use the tailwindcss package and call it from a Makefile. As long as you set css-dirs
in figwheel config, it should auto-update.
Also unless you modify style.css (I only have the \@tailwind directives) you won't need to re-run it, except for prod when you wish to purge unused classes. For prod you set in Makefile export NODE_ENV := production
to have tailwindcss purge.
sorry if this question is really silly. Do you actually have a separate Makefile or are you referring to something like deps.edn
or npm's package.json
or Webpack?
Don't worry about it! I do have a Makefile for my own project. Here's a WIP project that has the tailwindcss boilerplate I ended up with: https://github.com/uosl/dataseek
You don't need a Makefile but I find it makes everything easier and more automated (like automatically running npm install if tailwindcss is missing).
Hi guys, does anybody know where to find the documentation for shadow-cljs-macros like "[:>" ? They are quite hard to google for.
:>
is not a macro, it's a regular keyword.
And it's not related to shadow-cljs - it's a Reagent thing.