This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-10
Channels
- # aleph (4)
- # beginners (32)
- # cider (12)
- # cljs-dev (56)
- # cljsrn (7)
- # clojars (3)
- # clojure (165)
- # clojure-dev (33)
- # clojure-germany (1)
- # clojure-italy (27)
- # clojure-russia (7)
- # clojure-spec (24)
- # clojure-uk (62)
- # clojurescript (37)
- # core-async (7)
- # core-matrix (1)
- # cursive (9)
- # data-science (8)
- # datomic (8)
- # duct (4)
- # events (1)
- # figwheel (7)
- # flambo (3)
- # fulcro (43)
- # hoplon (25)
- # jobs-discuss (8)
- # lein-figwheel (4)
- # luminus (2)
- # off-topic (35)
- # om (8)
- # om-next (3)
- # onyx (30)
- # pedestal (62)
- # portkey (2)
- # protorepl (2)
- # re-frame (40)
- # reagent (9)
- # shadow-cljs (123)
- # specter (30)
- # sql (22)
- # testing (1)
- # uncomplicate (40)
- # unrepl (3)
- # vim (13)
- # yada (5)
I just pushed an update to shadow-eval which adds the cljs.js example. It still fails for me.. I even tried cloning shadow-eval
fresh, yarn install
and then shadow-cljs watch bootstrap browser
. this is after a lein install
of shadow-cljs master.
can you confirm that this only happens ONCE on the initial compile and only when compiling both builds at once?
yes once the cache excists the warning disappears, which wis weird in itself since nothing is cached when warnings exist
when I compile the sample /dev project in shadow-cljs
, it appears to work. but in shadow-eval
I keep getting this error. staring at shadow-cljs.edn
and the source, just can’t see anything of difference
------ ERROR -------------------------------------------------------------------
File: jar:file:/Users/zilence/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/cljs/core.cljs:673:1
--------------------------------------------------------------------------------
669 | "Protocol for accessing the metadata of an object."
670 | (^clj-or-nil -meta [o]
671 | "Returns the metadata of object o."))
672 |
673 | (defprotocol IWithMeta
-------^------------------------------------------------------------------------
674 | "Protocol for adding metadata to an object."
675 | (^clj -with-meta [o meta]
676 | "Returns a new object with value of o and metadata meta added to it."))
677 |
678 | (defprotocol IReduce
--------------------------------------------------------------------------------
Call to cljs.core/defn did not conform to spec
In: [1] val: G__34000 fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-1 :args] predicate: vector?
In: [1] val: G__34000 fails spec: :clojure.core.specs.alpha/args+body at: [:args :bs :arity-n :bodies] predicate: (cat :args :clojure.core.specs.alpha/arg-list :body (alt :prepost+body (cat :prepost map? :body (+ any?)) :body (* any?)))
--------------------------------------------------------------------------------
there is definitely something going on with the threads, can’t quite figure it out yet
------ ERROR -------------------------------------------------------------------
File: jar:file:/Users/zilence/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/cljs/core.cljs:693:1
--------------------------------------------------------------------------------
689 | (-kv-reduce [coll f init]
690 | "Reduces an associative collection and returns the result. f should be
691 | a function that takes three arguments."))
692 |
693 | (defprotocol IEquiv
-------^------------------------------------------------------------------------
694 | "Protocol for adding value comparison functionality to a type."
695 | (^boolean -equiv [o other]
696 | "Returns true if o and other are equal, false otherwise."))
697 |
698 | (defprotocol IHash
--------------------------------------------------------------------------------
Call to cljs.core/defn did not conform to spec
In: [1] val: G__32443 fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-1 :args] predicate: vector?
In: [1] val: G__32443 fails spec: :clojure.core.specs.alpha/args+body at: [:args :bs :arity-n :bodies] predicate: (cat :args :clojure.core.specs.alpha/arg-list :body (alt :prepost+body (cat :prepost map? :body (+ any?)) :body (* any?)))
--------------------------------------------------------------------------------
I’m absolutely lost … even if I lock and allow only compiling one form at a time I get this error
@mhuebert since you just brought it up in #cljs-dev, I totally want to hear about your experience with JS deps. but not now, head is too full.
I think I really like this ability to explicitly decide, for any given build, how to resolve a name
whether or not something is in node_modules
really shouldn’t have any impact on anything
only happens when compiling cljs.core
at the same time in multiple threads. which should not be an issue since each thread has its own compiler env binding and should be totally isolated.
is there a built-in way to init a new shadow-cljs project? not that it’s super necessary, as config is so simple, but 🙂
problem also goes away if I add (Thread/sleep (rand-int 2000))
before starting the build … fun times 🙂
re init: I thought about creating a few small templates to make quickstart easier. even with the simplified config it still a bit of work to get started.
is there a way to specify in :js-options
that react
should be resolved to the node module?
"react"
{:target :npm
:require "react/cjs/react.development.js"
:require-min "react/cjs/react.production.min.js"}
that still leaves me with The required namespace "react" is not available, it was required by "re_view/util.cljc".
… would all upstream apps need to use string-require syntax for something like this to work?
does node_modules/react/cjs/react.development.js
exist? I do not yet handle installing node deps
not yet supported by who? I tried it and will move my app into production with it tomorrow
in shadow-cljs builds there was a note that the React 16 NODE_ENV require (or sth like that) is not supported
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
}
the :resolve {"react" ...}
should work, regardless of whether you do (:require [react])
or (:require ["react" :as react])
did you verify that The required namespace "react" is not available, it was required by "re_view/util.cljc".
has a node_modules/react/cjs/react.development.js
in the project dir?
I can’t decide if you mean a CLJS namespace or something that should be in node_modules
yes exactly. i would like some explicit indication of whether a thing will resolve to node_modules or classpath. a “string-name” or npm/namespaced or something else. but now I have a strange error, it seems to be loading an old version of clojurescript despite a fresh project.clj, yarn install of shadow-2.0.8
I have found using symbols for JS neat and confusing at the same time (pure personal feedback disclaimer)
RuntimeException: Unable to find static field: INFERRED_CONST_CHECKS in class com.google.javascript.jscomp.DiagnosticGroups
yes old version of something
@richiardiandrea I prefer reliability over magic syntax sugar though 😉
yeah agree
all libraries should use :scope "provided"
when using clojurescript in :dependencies
yeah, its usually not a problem since projects will have clojurescript
themselves in :dependencies
tiny feedback: if the dev server would print sth like localhost:THE_PORT when it starts, that’s a clickable link in my terminal
Oct 11, 2017 12:09:35 AM clojure.tools.logging$eval15877$fn__15880 invoke
INFO: :shadow.cljs.devtools.server.dev-http/http-serve {:http-port 8705, :http-root out/public, :build-id :browser}
found it, fixed it, reported it https://dev.clojure.org/jira/browse/CLJS-2381 😉
released [email protected]
with fix
@mhuebert btw I absolutely do not recommend using :lein true
. that bypasses all optimizations I have done to improve startup times and makes everything way slower. makes sense when using a checkout dependency of shadow-cljs
itself in a project but otherwise it should be avoided.
Its a bit annoying that Cursive requires a project.clj to work properly. maybe I take care of https://github.com/thheller/shadow-cljs/issues/70 tomorrow.