This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-02
Channels
- # announcements (37)
- # babashka (9)
- # beginners (172)
- # calva (7)
- # cestmeetup (28)
- # chlorine-clover (27)
- # clj-kondo (2)
- # cljs-dev (45)
- # cljsrn (8)
- # clojure (185)
- # clojure-dev (27)
- # clojure-europe (6)
- # clojure-finland (3)
- # clojure-nl (5)
- # clojure-uk (13)
- # clojuredesign-podcast (4)
- # clojurescript (54)
- # conjure (19)
- # core-typed (1)
- # cursive (40)
- # datomic (9)
- # emacs (5)
- # figwheel-main (34)
- # fulcro (238)
- # graphql (14)
- # hugsql (3)
- # leiningen (4)
- # malli (6)
- # off-topic (12)
- # pedestal (5)
- # portkey (19)
- # protorepl (8)
- # rdf (2)
- # re-frame (23)
- # reagent (3)
- # reitit (16)
- # shadow-cljs (29)
- # spacemacs (12)
- # sql (1)
- # xtdb (15)
well I tried to use webpack conditional eliding as a way to solve the cljs-ajax problem of trying to support node and it just didn’t work. I got conditional eliding to work with a constant value, but there was no route to make this work AFAIK. And its kind-of a shame because a macro
could make quick work of this, but we have to introduce something to let the macro know the target env.
OK I found a way to do a conditional node require:
(cond
(exists? goog/global.XMLHttpRequest)
goog/global.XMLHttpRequest
(exists? goog/global.require)
(goog/global.require "xmlhttprequest")
:else nil)
this is were require
is coming from, it is different for each file. so if you capture it somewhere and bind it to global you are going to inherit the semantics of that initial file.
note that is all really just temporary. libraries are going to have to come up with a different way of doing this.
with ESM conditional requires will no longer be possible and thats definitely the direction everything is going. at least for now.
another reason I'm hesitant to do anything in ClojureScript itself about it - all this stuff seems too transient
not that the solutions they intend for this (eg. import maps) are exactly pretty either ...
webpack5 is also going to be much stricter about all of this. so thats gonna be interesting to watch too.
well ultimately I think its a good thing they are doing this. they created the problem in the first place and have to fix it some day 🙂
but there are also many other new and interesting webpack alternatives coming up so we'll see what the impact of those are
can I PR this guide to use ["npx" "[email protected]" ...
?
I think that we can push this "habit" in cljs community of use pinned versions for avoid breaking changes,
https://github.com/clojure/clojurescript-site/blob/master/content/reference/compiler-options.adoc#bundle-cmd
Not sure where to report ClojureScript bugs? Is it on http://ask.clojure.org like for Clojure ?
Any case, with 1.10.773
I get this error if I am using both :target :bundle
and :install-deps true
:
{:clojure.main/message
"Execution error (IllegalArgumentException) at cljs.closure/compute-upstream-npm-deps$fn (closure.clj:2440).\ncontains? not supported on type: java.lang.Boolean\n",
:clojure.main/triage
{:clojure.error/class java.lang.IllegalArgumentException,
:clojure.error/line 2440,
:clojure.error/cause
"contains? not supported on type: java.lang.Boolean",
:clojure.error/symbol cljs.closure/compute-upstream-npm-deps$fn,
:clojure.error/source "closure.clj",
:clojure.error/phase :execution}
[...]
[cljs.closure$compute_upstream_npm_deps invoke "closure.clj" 2430]
[cljs.closure$maybe_install_node_deps_BANG_
invokeStatic
"closure.clj"
2587]
[cljs.closure$maybe_install_node_deps_BANG_
invoke
"closure.clj"
2585]
> Is it on http://ask.clojure.org like for Clojure ? yes
@didibus that one should have been fixed for Figwheel, report it JIRA provide minimal repro inline in the ticket
@dnolen lots of people don't have jira access, they should report on http://ask.clojure.org
https://clojure.org/community/contributing#_reporting_problems_and_requesting_enhancements
we have a limited number of jira users on the cloud system (many thanks to Atlassian for providing it for free) so we are limiting jira accounts just to those doing development (ie providing patches) and trying to use http://ask.clojure.org for problem reporting and voting
Genuine question, have you ever considered switching to ClubHouse (which is Clojure product)?
apologies if I have not properly relayed all this to you in the past
feel free to steal from http://clojure.org :)