This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-10
Channels
- # announcements (1)
- # asami (44)
- # babashka (62)
- # beginners (84)
- # calva (42)
- # cider (5)
- # clj-kondo (32)
- # cljs-dev (8)
- # clojure (61)
- # clojure-australia (3)
- # clojure-berlin (1)
- # clojure-europe (12)
- # clojure-japan (3)
- # clojure-nl (4)
- # clojure-serbia (5)
- # clojure-spec (1)
- # clojure-uk (9)
- # clojurescript (31)
- # community-development (21)
- # conjure (5)
- # cursive (17)
- # datomic (14)
- # emacs (10)
- # etaoin (1)
- # figwheel-main (1)
- # fulcro (9)
- # garden (5)
- # graalvm (16)
- # helix (7)
- # honeysql (13)
- # jackdaw (25)
- # jobs (2)
- # lsp (21)
- # malli (25)
- # missionary (2)
- # mount (3)
- # off-topic (12)
- # practicalli (3)
- # re-frame (43)
- # reagent (45)
- # reitit (36)
- # releases (6)
- # remote-jobs (2)
- # reveal (28)
- # rewrite-clj (7)
- # shadow-cljs (45)
- # slack-help (4)
- # spacemacs (5)
- # sql (23)
- # startup-in-a-month (7)
- # tools-deps (59)
- # vim (26)
@thheller Is there an API to trigger heads up display so that a warning from a build hook running in flush
stage could be visible in a browser?
@roman01la no API but you can just put a warning into the build-state
oh that's nice!
Hi gals and guys,
I'm having an issue with a NPM dependency I am using: react-color
(https://www.npmjs.com/package/react-color)
I get a couple of errors and warnings when running karma on the produced code (`:karma-coverage`):
# karma start
10 03 2021 16:57:08.655:INFO [preprocessor.coverage]: coverage not included in reporters dots,progress
10 03 2021 16:57:08.881:WARN [karma]: No captured browser, open
10 03 2021 16:57:08.973:INFO [karma-server]: Karma v5.2.3 server started at
10 03 2021 16:57:08.973:INFO [launcher]: Launching browsers ChromeHeadlessNoSandbox with concurrency unlimited
10 03 2021 16:57:08.976:INFO [launcher]: Starting browser ChromeHeadless
10 03 2021 16:57:10.131:INFO [Chrome Headless 88.0.4324.182 (Linux x86_64)]: Connected on socket pvu_uV4i-0kufk6WAAAA with id 85631944
10 03 2021 16:57:10.581:WARN [web-server]: 404: /base/target/cljs-runtime/module$node_modules$icons$material$UnfoldMoreHorizontalIcon.js?80c4489cd485acfeed1e160ad69825303e4ee8e4
10 03 2021 16:57:10.595:WARN [web-server]: 404: /base/target/cljs-runtime/module$node_modules$icons$material$CheckIcon.js?3b1f8ad831751a7b84b35493627cc64278e2c8c7
10 03 2021 16:57:10.765:WARN [web-server]: 404: /base/target/cljs-runtime/module$node_modules$icons$material$UnfoldMoreHorizontalIcon.js?80c4489cd485acfeed1e160ad69825303e4ee8e4
10 03 2021 16:57:10.800:WARN [web-server]: 404: /base/target/cljs-runtime/module$node_modules$icons$material$CheckIcon.js?3b1f8ad831751a7b84b35493627cc64278e2c8c7
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$components$chrome$ChromeFields'
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$components$chrome$ChromeFields'
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$components$chrome$Chrome'
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$components$chrome$Chrome'
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$index'
Chrome Headless 88.0.4324.182 (Linux x86_64) WARN: 'shadow-cljs - failed to load', 'module$node_modules$react_color$lib$index'
Chrome Headless 88.0.4324.182 (Linux x86_64) ERROR
Uncaught Module not provided: module$node_modules$$icons$material$UnfoldMoreHorizontalIcon
at target/cljs-runtime/shadow.js.js:37:9
Chrome Headless 88.0.4324.182 (Linux x86_64) ERROR
Uncaught Module not provided: module$node_modules$$icons$material$UnfoldMoreHorizontalIcon
at target/cljs-runtime/shadow.js.js:37:9
I read some passed discussions on this channel, about adding :js-options {:ignore-asset-requires true}
, others about adding :compiler-options {:output-feature-set :es8}
but none solved my issue.There are those:
module$node_modules$$icons$material$UnfoldMoreHorizontalIcon.js
module$node_modules$$icons$material$CheckIcon.js
...with that double $
which doesn't match the ones indicated in the 404 warnings.
the extra $$
are the replacements for the /@
in actual source path (which aren't valid in JS identifiers)
Yeah, that must be it. I'm using a custom :karma-coverage
target. With :karma
it works just fine.
Thank you @thheller
I'm trying to upgrade from shadow-cljs
2.10.6 to 2.11.22, and I see a number of warnings about not being able to infer the type of things. I've gone though and manually hinted most them as ^js
, but I'm getting warnings that I don't know how to hint everytime I use a deftype
that implements reagent.ratom.IReactiveAtom
.
387 |
388 | (deftype Foo [^:mutable amdoc ^:mutable clj-value ^:mutable snapshot meta validator ^:mutable watches ^:mutable callback]
-------^------------------------------------------------------------------------
Cannot infer target type in expression (. (. Foo -prototype) -reagent$ratom$IReactiveAtom$)
--------------------------------------------------------------------------------
389 | IAtom
390 | reagent.ratom.IReactiveAtom
391 |
392 | FooClassification
Any insight as to why this is happening now, and more importantly, how to resolve it?As to "why now" I understand that at some point some defaults regarding inference changed, but I have no idea how to hint that deftype to make it leave me alone.
Thank you @thheller! I in fact turned the warnings off, but I will see if fixing my reference resolves the error ... thanks again ! 🙂
I think this particular warning will be fixed with the next CLJS release anyways. It originates from deep inside the compiler that shadow-cljs cannot easily modify.
is their a clj template for creating a shadow-cljs project targetting the browser? Just to give all the basics to get started, so I can get up and running with hot-reload, dev and test src paths, reloading css, a public folder for the html/css etc ? I'm trying to go through the docs but its so complicated and feels pretty impenetrable without an example to follow along with that I can see works and I can change and mess with.
did you go through https://github.com/thheller/shadow-cljs#quick-start?
it only handles basic project setup though. if you want more specific templates you need to select one for the libs you want to use
Its the paths and naming thats confusing me.
From the quick start you called the project acme-app, but then the namespace is
How did we end up with a frontend between acme and app ?
The dots become slashes in the expected directory structure? Then in the edn you have
:builds
{:frontend
...
What happened to acme and app here?
There just seems to be an awful lot of magic happening here based on strings and names that I'm not understanding. I think I just need to create a few examples using the npx create-cljs-project with different names and see what gets created. Thanks!the project is called acme-app
. that is literally only the directory name the files are in. it has nothing to do with what the project does. The
name I picked because naming is hard but I tried to explain why I did
in many other CLJS examples you'll see a bunch of foo.core
namespaces. I personally don't like .core
names so I used something else. its just a name, use what makes sense for you.
So I've created a project called learn-reframe in a learn-reframe
folder.
.
├── learn-reframe.iml
├── node_modules
├── package.json
├── package-lock.json
├── pom.xml
├── shadow-cljs.edn
└── src
└─ main
└─ test
For now I don't care about names so a random prefix will do, exfn
So I create
src\main\exfn\app.cljs
With namespace
(ns )
So I my edn should look like this:
{...
:builds
{:???
{:target :browser
:modules {:main {:init-fn }}}}}
I'm not sure what my :??? would be :exfn
or :app
?if i'm using :npm-module
and bundling that into a webpack frontend, is it possible to get a cljs repl connected to the webpacked build? Does shadow emit all of the necessary bridge stuff during a watch such that this is a reasonable thing to expect?
@dpsutton yes but you need to manually require the shadow.cljs.devtools.client.browser
ns from the JS side of things. so if (process.env.NODE_ENV === "development") { require("wherever/shadow.cljs.devtools.client.browser.js") }
but the REPL has some limits in what it can do since webpack post-processes the code normally but not the code loaded over the REPL
oh, where should that live? process.env.NODE_ENV
? I'm quite the beginner with webpack stuff. presumably that's in the webpack config? i'm surprised to see a require that uses that