This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-20
Channels
- # announcements (2)
- # beginners (108)
- # cljdoc (9)
- # clojars (1)
- # clojure (33)
- # clojure-spec (20)
- # clojure-uk (9)
- # clojurescript (23)
- # datascript (1)
- # datomic (5)
- # emacs (3)
- # fulcro (15)
- # graphql (1)
- # jobs (7)
- # lumo (12)
- # off-topic (40)
- # ring-swagger (1)
- # shadow-cljs (1)
- # tools-deps (7)
- # unrepl (6)
- # vim (1)
Hi. Is there a way to work mutually recursive specs with ClojureScript? here’s the issue: https://github.com/metosin/reitit/issues/127
It is generally true, that ClojureScript will want to follow Clojure where at all possible, and if it isn't for any good reason, it would be treated a bug
@U055NJ5CC Minimal repro logged here https://dev.clojure.org/jira/browse/CLJS-2940
Can anybody help me with linking a js file into a cljs project aimed at NodeJs? What I did:
1) created a file src/aaa.js
function AAA() {
return 42;
}
2) added a compiler option
:foreign-libs [{:file "src/aaa.js"
:provides ["aaa"]}]
3) In my code:
(ns some.ns
(:require
[aaa]
...
(print (js/AAA))
but then I get goog.nodeGlobalRequire is not a function
what did I do wrong?@igrishaev On the surface, your approach looks correct. Seeing if I can repro locally...
$ clj -m cljs.main -co '{:foreign-libs [{:file "src/aaa.js" :provides ["aaa"]}]}' -r
ClojureScript 1.10.339
cljs.user=> (require 'aaa)
cljs.user=> (js/AAA)
42
(I've used foreign libs this way with in such a project, but will check for this example.)
@igrishaev I was able to repro the goog.nodeGlobalRequire
issue. Now looking at my older project to see what's up. Perhaps there is a regression in ClojureScript.
@igrishaev I was mistaken; I don't have an older project that works this way. But, it is possible to work around the issue by removing :target :nodejs
from the compiler options. I'll log a ticket in re-natal
where we can futher explore what is going on here.
Yes, so long as you don't really need that for anything else. It was introduced with re-natal
0.9.0 and may have other consequences.
@mfikes unfortunately, the project didn’t compile when I commented the target
option, got lots of errors. Perhaps I’ll figure out some other way.
@igrishaev No problem. I think the fundamental problem is that ClojureScript assumes that if :target :nodejs
, then bootstrap_nodejs.js
is being used with Node (which defines nodeGlobalRequire
) but this is not the case in for the Node environment being used with re-natal
I just released a module for scroll position management in SPAs, Clerk. Feedback welcome: https://clojureverse.org/t/say-hello-to-clerk-in-page-navigation-for-single-page-applications/3041